External link on album thumbs page External link on album thumbs page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

External link on album thumbs page

Started by pytheas, October 07, 2004, 12:18:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pytheas

I have checked the docs and the forums for a solution to my request.

I would like to add an external link after the album title in the thumb view.

On the following page(s) I would like to have the following displayed on the row with the coloured balls.

Australia Zoo - Click here to visit the official Australia Zoo site
(where 'Click here to visit the official Australia Zoo site' is a hyperlink to the external website opening in a new window (_blank)

Here is the link
http://www.pytheas.org.uk/coppermine/thumbnails.php?album=9

This isn't the only album I want to do this for but it is a good example of the principle.

Any assistance would be appreciated as always.

Regards

Stu

kegobeer

Have you tried adding this after your description text in the album's properties?

[url=http://yoursite.com/]Url Text[/url]
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

pytheas

I tried that and tried various modifications of the answer but unfortunately none worked.

It just gave extra text  :(

Stu

kegobeer

I see you have 1.3.1 - perhaps upgrading to 1.3.2 will solve your problem.  Also try switching to the default theme.  Shouldn't make any difference, but you never know.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

pytheas

Thanks for the response.

Unfortunately upgrading is not convenient at the present time and the theme has been used throughout the site.  So it will have to wait until some time in the future.

Regards

Stu

kegobeer

#5
Could you switch to the default theme just to test it out, then switch back to your current theme?  I'd like to know if it's the theme that's behind the problem or if it's something else entirely, as I can't replicate the problem.

Forget what I posted - I see what you want now.  The album title isn't designed to have a link in it.  I was talking about the description text that displays when you look at the album list.  I'm sure it's possible to do what you want - it's a matter of telling Coppermine to look for BB code in the album title as well as the description.  I'll look into it for you.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

pytheas

Was just about to respond when i saw your amendment.  Yep that's what i need. Thanks for looking into it.

Regards

Stu

kegobeer

I think I have what you want.  There's a lot to change, mostly in your theme.php file.

Open functions.inc.php.

Find:

$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";

Replace With:

$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".bb_decode($CURRENT_ALBUM_DATA['title'])."</a>";


Open up your theme.php file, and replace all $album_name with bb_decode($album_name) and all $album['album_title'] with bb_decode($album['album_title'])
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

Forgot to add this:  use the bb code format for the url - [url=http://yourlink.com]Your text[/url]
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

pytheas

Hi Keg

Im sorry but I think I didn't explain myself correctly.

On the thumb page only. After the album title (just plain text) I want to add a link just after that

For example OOO Australia Zoo www.australiazoo.com

where OOO is the three coloured dots in my theme.
Australia Zoo is the plain text
and www.australiazoo.com is the link.

in the theme.php i have found where that section is displayed and i think this is what i need to modify.  I'm just a little confused about syntax.

From your indication about functions.inc.php I thought the syntax below in the 2nd <td> is going to call the bb_decode function but as you see from the following link it doesnt seem to do so.

http://www.pytheas.org.uk/coppermine/thumbnails.php?album=9

<td width="50%" class="statlink">{ALBUM_NAME}</td>
<td width="50%" class="extlink">bb_decode({ALBUM_NAME})</td>
<td>......the sorting data.............</td>

Album name as you can see has been set to [url]http://yourlink.com[/url] to keep it as simple as possible.
When I can get the link showing I think I know how to go on from there.  Its just that first step that a prob.

Assistance as always appreciated.

Regards

Stu

kegobeer

Quote<td width="50%" class="statlink">{ALBUM_NAME}</td>
<td width="50%" class="extlink">bb_decode({ALBUM_NAME})</td>
<td>......the sorting data.............</td>

You can't call php functions inside regular HTML.  You can tell there's no coding there by looking up a few lines for <<<EOT.  The template parser will replace the placeholder {ALBUM_NAME} with whatever value is in there.  That's why I made all those changes in the theme.php file.

Unfortunately, this is kind of an all-or-none situation.  If you don't use bb_decode for all the $album_name and $album['album_title'] links, you'll get output like this:

Austrailia Zoo - [url=http://www.yoursite.com]Link[/url]
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MstrMitch

I just found this thread and wanted to ask a followup. If I make a category called "camz" and then multiple albums "a", "b", "c" etc, will this hack make those thumbnails for the albums linkable to external websites. Or will it at the very least make the album titles linkable to an external site. Is there anyway to make an album thumb not linkable at all (even to an internal album) and just have the title linkable to an external site?

Mitch
Phoenix, AZ