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: [Solved]: Changing the link on the pictures  (Read 5341 times)

0 Members and 1 Guest are viewing this topic.

Paladin_Brewer

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
[Solved]: Changing the link on the pictures
« on: June 13, 2008, 02:22:12 pm »

Hello,

I have cpm set up on my main page at the top here:

http://www.3dbrewer.com/

My problem is with the link on the pictures, it will open up the the coppermine gallery full page.  But, my gallery is actually within an iframe on the site:

http://www.3dbrewer.com/index.php?option=com_wrapper&view=wrapper&Itemid=84

So my question is, how do I force it to go to the above link so it is within the iframe?
« Last Edit: June 16, 2008, 05:01:15 pm by Nibbler »
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Changing the link on the pictures
« Reply #1 on: June 14, 2008, 03:05:05 am »

I not a good idea to wrap coppermine in an iframe page, imho. When someone is in your page and open the album link in new tab, then it will come to the real coppermine page without header.

I suggest of using a custom header and footer instead of wrapping it in iframe imho.

I think that it is really hard coded to open the fetch images in iframe cause the target iframe page is not there.
Maybe someone know how to code it.  ???
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Paladin_Brewer

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Changing the link on the pictures
« Reply #2 on: June 16, 2008, 03:51:37 pm »

I know I cannot link straight to the images through an iframe, and that is fine.  What I want to do is either:

1.) Make all the links go to "http://www.3dbrewer.com/index.php?option=com_wrapper&view=wrapper&Itemid=84", regardless of which image it is showing.

OR

2.) Remove the links all together and just have linkless images.

If someone can help me manipulate the code I would appreciate it.  I have tried editting the cpmfetch.php and cpmfetch_dao.php myself, but nothing I do seems to work well.
Logged

Nibbler

  • Guest
Re: Changing the link on the pictures
« Reply #3 on: June 16, 2008, 04:26:32 pm »

Links are generated in cpmfetch.php

Code: [Select]
function htmlTagAHREF($target, $contents, $extraAttributes="") {

$htmlOut = '<a';

if ( ( (array_key_exists('imagelink',$this->optionHash))
&& $this->optionHash['imagelink'] == 'large')
&& array_key_exists('windowtarget',$this->optionHash ) )
{

if ($this->optionHash['windowtarget'] == '_blank-js' ) {
$htmlOut .= " href=\"javascript:cmfshowpic('$target','')\" ";

} elseif ($this->optionHash['windowtarget'] == '_blank-cfshow') {

$htmlOut .= " href=\"javascript:void(window.open('cfshow.php?pic=$target','cpmFetch','width=825,height=625,toolbars=0,scrollbars=1,resizable=1'));\"";


} elseif ($this->optionHash['windowtarget'] == '_blank') {
$htmlOut .= " href=\"$target\" target=\"_blank\" ";

} else {
$htmlOut .= " href=\"$target\" target=\"{$this->optionHash['windowtarget']}\"  ";
}

} // handling less than full size photos
else {

if (array_key_exists('windowtarget',$this->optionHash)) $htmlOut .= ' target="' . $this->optionHash['windowtarget'] . '"';
$htmlOut .= " href=\"$target\" ";

}

if (array_key_exists('linkstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['linkstyle']}";
if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;
$htmlOut .= $this->getOptionAttributes("linkattributes");

$htmlOut .= " >$contents</a>" ;

return $htmlOut;
}

You should be able to simply hardcode:

Code: [Select]
function htmlTagAHREF($target, $contents, $extraAttributes="") {
return '<a href="http://www.3dbrewer.com/index.php?option=com_wrapper&view=wrapper&Itemid=84">' . $contents . '</a>';
}

or remove:

Code: [Select]
function htmlTagAHREF($target, $contents, $extraAttributes="") {
return $contents;
}
Logged

Paladin_Brewer

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Changing the link on the pictures
« Reply #4 on: June 16, 2008, 04:55:08 pm »

That worked great, much appreciated  ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.