Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: BBCode for URLs not calling _blank ever - I did read the JS solution threads  (Read 6282 times)

0 Members and 1 Guest are viewing this topic.

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...

I've searched on the board for this and read the solution for the gallery credit addressed with that nifty javascript solution, but I did not find an answer as to why bbcode for url calls in file descriptions are calling links as "self" (in effect) instead of "_blank" style (in effect).

I'm building a gallery with 1.4 at this url:

http://www.aeronauticpictures.com/royalty-free-stock-footage/index.php

It uses QuickTime files with matching thumbs. I've got it playing a short QT file as a brief preview but want to link to a full length QT file that I'd like to open in a stand alone player from the description text linked with the url code as shown on that page.

Using the code below, it simply links to an embedded player in whatever browser the user operates.

I've also got a call to a stand alone purchase page (html) until I test the paypal mod. That too I'd like to open in a new window - leaving my customer on the product page.

Here is the exact code from the description field:

Code: [Select]
[b]Exploring the history of aviation from 1900 to the 1930s[/b]
[color=red][b][u]Please Allow Time[/u] For The Preview To Load Above
You Will See A QuickTime Preview Of [u]One Clip[/u] From This Disc[/b][/color]
[color=red][b]
( BUY NOW ) [url=http://www.aeronauticpictures.com/royalty-free-stock-footage/royalty-free-stock-footage.purchase.aviation.early-flight.htm]Click Here To Buy This Early Flight Royalty Free Stock Footage Disc[/url][/b][/color]
[color=#FF9900][b]
To View The Entire Preview Video Of All Clips On The Early Flight Royalty Free Stock Footage Disc - [u]27 Megs - Expect To Wait For The Download[/u] [url=http://www.aeronauticpictures.com/movs/royalty-free-stock-footage.early-flight.preview.full.mov]Click Here[/url][/b][/color]

The issue I've got with (I think) with the javascript solution is that it would change all domain based links to external calls if this portion were set thus:

Code: [Select]
if (anchor.getAttribute("href") == "http://www.aeronauticpictures.com/")
     anchor.target = "_blank";

Or could I set this to both, say, a /mov/ url for the long form previews and another path for purchase pages like /buy/ ?

Many thanks!
« Last Edit: May 25, 2006, 08:15:07 am by GauGau »
Logged

Nibbler

  • Guest

Use the same javascript solution for the bbcode urls as for the gallery footer.
Logged

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...

Use the same javascript solution for the bbcode urls as for the gallery footer.

Nibbler,

Thanks for the reply - I take it you are saying use the code which includes this snippet (but use the whole thing, of course):

Code: [Select]
if (anchor.getAttribute("href") == "http://www.aeronauticpictures.com/")
     anchor.target = "_blank";

???

I'm no javascript guru, so since we don't want all calls of urls on the aeronauticpictures.com domain to open new windows, just those that call the long QT movies and purchase pages, do I need to implement two calls to the anchor.getAttribute ?

The movies are living in the /movs path from the site root (not gallery) and the purchase pages in the /royaltyfree-stock-footage path (close but not identical to the gallery) from the site root (also not gallery)

Since normal gallery navigation is not via BBCode, can I assume that implementing this solution will not open all normal CPG navigation links in new windows?

Sorry for being such a coding newb - I just don't know the syntax for pulling this off in javascript.

Thank you again!
Logged

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...

Solved I think - Dev Team - is there a reason I should not be doing this?

line 586 in include/functions.inc.php

this:

Code: [Select]
$bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external">
to this:
Code: [Select]
$bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external" target="_blank">
???

Seems to be working as wished in my royalty free stock footage store:

http://www.aeronauticpictures.com/royalty-free-stock-footage/index.php
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

There is no security issue, but the target attribute is being considered to be obsolete. The recommended method is to do as suggested in http://www.sitepoint.com/article/standards-compliant-world
Logged

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...

Thanks for the reply and advice GauGau.

I hope to install the paypal hack mod to replace one of these _blank calls (the purchase page), and I'll address the long form .mov previews with the standards compliant approach after that's operational.

Thanks again.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.