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: How do i change what you see on a thumbnail mouseover?  (Read 8493 times)

0 Members and 1 Guest are viewing this topic.

GWP

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How do i change what you see on a thumbnail mouseover?
« on: September 30, 2003, 01:12:31 pm »

Hello All
Firstly, great product :)

I would like to be able to add to the mouseover text when someone puts their mouse over a thumbnail, I am not sure if this applies to all thumbnails, that would be better. But at least the ones displayed in the random section.

I have installed the username mod, it adds the username info to the Mysql db and to the info panel.

Does anyone know where to look for the mouseover text and what would i need to add or change?

Thanks
GWP
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How do i change what you see on a thumbnail mouseover?
« Reply #1 on: September 30, 2003, 06:24:53 pm »

as there are several kinds of thumbs, there are several places to look: edit /include/funtions.inc.php and search for the term "<img" - you'll notice what to edit...

GauGau
Logged

GWP

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How do i change what you see on a thumbnail mouseover?
« Reply #2 on: September 30, 2003, 07:36:10 pm »

Quote
                       $pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
                                $lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
                                $lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
                                $lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);


Ok Thank you, i have found it.
Now, would anyone know what to add to include the posters name.

This was the Mysql query that is added when you add the username mod.
Quote
ALTER TABLE `cpg11d_pictures` ADD INDEX ( `owner_id` );
Logged

GWP

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How do i change what you see on a thumbnail mouseover?
« Reply #3 on: September 30, 2003, 07:51:01 pm »

Quote
                       $pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
                                $lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
                                $lang_display_thumbnails['added_by'].$row['user_name']."\n".
                                $lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);

I have added the line (underlined) which displays "Added By" to the mouseover, but cannot get the actual name to appear. I have tried Username, username, user_name, owner_id.

But still nothing.
anyone any clues please :)
Logged

GWP

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How do i change what you see on a thumbnail mouseover?
« Reply #4 on: October 01, 2003, 12:00:37 am »

Bummer!
6 hours and still i can't work it out.
Back to the coffee and "PHP for idiots" :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How do i change what you see on a thumbnail mouseover?
« Reply #5 on: October 01, 2003, 08:20:48 am »

try owner_name:
Code: [Select]
$pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
$lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
$lang_display_thumbnails['added_by'].$row['owner_name']."\n".
$lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);
GauGau
Logged

GWP

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How do i change what you see on a thumbnail mouseover?
« Reply #6 on: October 02, 2003, 09:39:56 am »

I tried that, but still no joy.

I am assuming it has something to do with this small mod i got from the FAQ section
Quote
Warning: this is quite a complicated hack for a newbie to perform!
Edit displayimage.php and search for:
$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
add after it:
$info[$lang_picinfo['Username']] = htmlspecialchars($CURRENT_PIC_DATA['user_name']);.
Then open /include/functions.inc.php and search for following in function get_pic_data():
if($select_columns != '*') $select_columns .= ', title, caption';
and replace it with:
if($select_columns != '*') $select_columns .= ', title, caption, user_name';.
After that search for:
      $result = db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE aid='$album' $approved $ALBUM_SET ORDER BY $sort_order $limit");
and replace it with:
      $result = db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} AS p LEFT JOIN {$CONFIG['TABLE_USERS']} AS u ON u.user_id = p.owner_id WHERE p.aid='$album' $approved $ALBUM_SET ORDER BY $sort_order $limit");
Then you have to add the language string for the username. Open /lang/yourlang.php and search for:
$lang_picinfo = array(
and add after that:
'Username' => 'Username',
Also you need to execute this query in MySQL (with a tool like phpMyAdmin):
ALTER TABLE `cpg11d_pictures` ADD INDEX ( `owner_id` );
(If your table_prefix is not cpg11d_ then you need to change it in the query)

Maybe there is another username db that i should be using.
BTW, this mod works fine and shows the username.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 18 queries.