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: Getting Data but not outputting it  (Read 3185 times)

0 Members and 1 Guest are viewing this topic.

Weezel

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Getting Data but not outputting it
« on: May 06, 2007, 06:31:47 am »

Greetings. I'm hoping for assistance. I've been all over the documentation and this forum, and I don't see any way to do what I want to.
I understand that if I use the $options array, I can have it return a title underneath the image. I'm trying to get the values of the $options array, but not actually display them. The documentation talks about returning image data, not just images, but all the functions seem just to return images.

The reason I'm trying to do this is to take the resulting information and use it in PHP to create the output string to pass along to another application (in this case the highslide thumbnail viewer). This might be possible using the options array, as I see I can pass the class name, but how would I pass the onclick portion?

For example, I want the following HTML:
<a href="http://localhost/pictures/albums/batch/Misc4and5/normal_IMG_7289.jpg" class="highslide"  onclick="return hs.expand(this)">
                <img src="http://localhost/pictures/albums/batch/Misc4and5/thumb_IMG_7289.jpg" alt="Alia is Cute" border="0" id="P1710" title="Alia is Cute" /></a>

Could I cheat the options array and try to overload it would not only the class name, but the additional onclick text? like this.

$options = array("subtitle" => "Details", "subtitlelink" => "", "imagelink" => "album", "linkstyle"=>"highslide\" onclick="return hs.expand(this)", "alttag" => "%c" );

That sort of works and I can get the onclick added to the img, but it also adds it to the Details link which I don't want. I want that to link straight to the picture (displayed in the album).

<a href="http://localhost/pictures//thumbnails.php?album=1"  class="highslide" onclick="return hs.expand(this)" ><img  src="http://localhost/pictures//albums/batch/Misc4and5/thumb_IMG_7323.jpg" alt="Jean and Alia" title="Jean and Alia"  /></a><br /><br /><a href="http://localhost/pictures//thumbnails.php?album=1"  class="highslide" onclick="return hs.expand(this)" >Details</a></td>

So I guess I need to turn off the subtitlelink and instead compose the subtitle to actually be HTML text that is a link.

Here's what I'm trying to format through the options:
-The <a href> needs to point to the full url+filename of the NORMAL file. This way that's the image which is passed into the Highslide JS viewer. I see there is imagelink which can either go to album or large, but not a way to go to the thumbail or normal.
-I got the class string to overload to add the onclick text, but I only want it to apply to the image, not to the text underneath.
-If I wanted the subtitle to link to the picture in the album, the only image data I see as a format string is %i for PID, so I'd need to compose the 'subtitle' => "<a href=\"http://localhost/pictures/displayimage.php?pid=%i\">Details</a>". I just can't get the proper URL and settings for displayimage.php and the pid, it seems like the PID it's returning is not the one for the image, or it's formatted wrong because it's not linking to the image.

Thanks for the help.

.W.

                                                                                       
« Last Edit: May 07, 2007, 08:49:46 am by GauGau »
Logged

Weezel

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Getting Data but not outputting it
« Reply #1 on: May 07, 2007, 04:32:57 am »

Just in case anyone else reads this later, I solved the problem myself. It was definately doable by overloading the class and subtitle options with the additional HTML I wanted to use. Here's the final array that I used:
Code: [Select]
    $options = array( "subtitle" => "<a class='chaospiclink' href=\"http://localhost/pictures/displayimage.php?pos=-%i\">View Picture in Album</a><br/><span class='chaospicalbum'>Album: %a</span><br/><span class='chaospictitle'>%t</span><br/><div class='highslide-caption' id='chaospic'>%c<a href='#' onclick='hs.close(this)' class='highslide-close'>Close</a></div>", "imagelink" => "large", "alttag" => "%t", "linkstyle" => "highslide\" onclick=\"return hs.expand(this, {captionId: 'chaospic'})\" onmouseover=\"self.status='Click to enlarge thumbnail'; return true;");
And the css to center it in my sidebar div and format the sections appropriately:
Code: [Select]
#chaospics
    .chaospictitle  { font-size: 0.9em; margin: 0 0 0 0px; font-style: italic; text-align: center; }
#chaospics
    .chaospicalbum  { font-size: 0.9em; margin: 0 0 0 0px; text-align: center; }
#chaospics
    .chaospiclink   { font-size: 0.75em; margin: 0 0 0 0px; text-align: center; }
#chaospics
    table           { width: 100%; text-align: center; }
« Last Edit: May 07, 2007, 08:49:04 am by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.