Advanced search  

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

Pages: [1]   Go Down

Author Topic: req: display_image code change (cosmetic)  (Read 2966 times)

0 Members and 1 Guest are viewing this topic.

eke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
req: display_image code change (cosmetic)
« on: November 28, 2003, 05:01:25 pm »

i tried to add album and thumb title to the title tag in the popup window view but somehow it didnt work:

file: displayimage.php
change: popup window title tag

original:
Code: [Select]
<title><?php echo $CONFIG['gallery_name'&#93;;?>: <?php echo $lang_fullsize_popup['click_to_close'&#93;;
    
?>
</title>


changed to:
Code: [Select]
<title><?php echo $CONFIG['gallery_name'&#93;;?> &raquo; <?php echo $CURRENT_PIC_DATA['album'&#93;;?> &raquo; <?php echo $CURRENT_PIC_DATA['title'&#93;;?> - <?php echo $lang_fullsize_popup['click_to_close'&#93;;
    
?>
</title>


I guess it's the $CURRENT_PIC variable being not available inside that function? any help appreciated, thanks

eke.
Logged

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
req: display_image code change (cosmetic)
« Reply #1 on: November 29, 2003, 04:59:34 am »

eke,

The array items that you try to access are not visible inside the function. In order to make them visible you have to add the array variable to the global statement at the beginning of the function (a few lines above the line you've changed). Eg.:
Code: [Select]
global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET, $CURRENT_PIC_DATA;
I didn't test but my guess is that your code will work after this change.

Eyal.
Logged

eke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
req: display_image code change (cosmetic)
« Reply #2 on: November 29, 2003, 02:25:27 pm »

yeah i tried that already but it did not work. either the [var] names are wrong or I am missing something else.

i'll have to buy myself a php book...
Logged

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
req: display_image code change (cosmetic)
« Reply #3 on: November 29, 2003, 02:44:36 pm »

Try to insert this in the code:
Code: [Select]
echo("\n<!-- \n");
print_r($CURRENT_PIC_DATA);
echo("\n -->\n");

This should dump the entire contetnts of $CURRENT_PIC_DATA array as a comment in the HTML source, so you'll know for sure what it contains.

Also verify that you spell variable/array names exactly - PHP doesn't warn when you access a variable that hasn't been assigned a value before (actually in such case PHP creates a new variable with an empty or zero value).

And finally, if you have some programming experience then you don't need to buy a book, you only need the PHP docs (available as HTML or Windows help file). If you do need an easier introduction to PHP and programming, try one of Oreilly books - their books are good and they're strong supporters of open source.

Eyal.
Logged

eke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
req: display_image code change (cosmetic)
« Reply #4 on: November 29, 2003, 03:55:47 pm »

i tried the echo on all vars in that global statement:
Code: [Select]

    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA;


and the only ones returning any value were the first three. album_set (which is originally there) current_pic_data and current_album_data where empty.

maybe the function display_fullsize_pic() has to be called differently to actually be able to process these vars or maybe an sql query needs to be placed with the "pid" from http_get_vars ?

i have downloaded the phpself docs and will delve into this. i have done some programming in delphi and java ages ago...

eke.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 18 queries.