Thumbs o index (latest images) Thumbs o index (latest images)
 

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

Thumbs o index (latest images)

Started by Michael-CGC, January 27, 2005, 09:13:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Michael-CGC

Hi there

I've tried serching but couldn't find what I'm looking for  :-[

I have 2 rows showing 'Latest additions' (6 images) on my index. Under every thumb there's 2 lines: Image uploader (username) and date added.

Here's my quastion. Is it possible to add 2 extra line that shows which album and category the thumb belong?

In advance thank you
Michael

Michael-CGC


Nibbler

It's possible yes, and I'm 90% sure it has been posted before, or something very similar.

Michael-CGC

Quote from: Nibbler on January 28, 2005, 03:25:30 PM
It's possible yes, and I'm 90% sure it has been posted before, or something very similar.

Hi Nibbler

Thank you for your reply  :) Do you know I can get the code?

Joachim Müller


Michael-CGC

Hi GAUGAU

I've tried searching I don't know how many time. I just can't find what I'm searching for  :-[ Please help me?

Joachim Müller

haven't tested, but should be in include/functions.inc.php:
Find $rowset[$key]['caption_text'] = $caption; after the case 'lastup': // Last uploads-section (around line 620) and add the album name there.

Michael-CGC

Quote from: GauGau on January 29, 2005, 06:35:06 PM
haven't tested, but should be in include/functions.inc.php:
Find $rowset[$key]['caption_text'] = $caption; after the case 'lastup': // Last uploads-section (around line 620) and add the album name there.

Hi Gau Gau

I'm not goog at coding  :-[ What should I add (code) after where you mentioned?

Michael-CGC


Nibbler

Change

                if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid';

                $result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY pid DESC $limit");

                $rowset = db_fetch_rowset($result);
                mysql_free_result($result);

                if ($set_caption) foreach ($rowset as $key => $row){
                        $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : '';
                        $caption = $user_link.'<span class="thumb_caption">'.localised_date($row['ctime'], $lastup_date_fmt).'</span>';
                        $rowset[$key]['caption_text'] = $caption;
                }


to


               $select_columns = '*';

                $result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} as a, {$CONFIG['TABLE_CATEGORIES']} AS c WHERE p.aid =a.aid AND a.category = c.cid AND approved = 'YES' $ALBUM_SET ORDER BY pid DESC $limit");

                $rowset = db_fetch_rowset($result);
                mysql_free_result($result);

                if ($set_caption) foreach ($rowset as $key => $row){
                        $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : '';
                        $caption = $user_link.'<span class="thumb_caption">'.localised_date($row['ctime'], $lastup_date_fmt).'</span>';
$caption .= '<span class="thumb_caption">'.$row['title'].'</span>';
$caption .= '<span class="thumb_caption">'.$row['name'].'</span>';
                        $rowset[$key]['caption_text'] = $caption;
                }

Michael-CGC

#10
Hi Nibbler

I did what you suggested, but I'm getting database errror in the categories  :( Beside that category and album is now showing under new images on index  :)

Michael-CGC

The error seems to be the categories  :-\\ How to I remove the category part from the code, so it only show album name ? One other thing. I like to have the album name under random pictures. Where can I add the code and what's the code for it ? Is it the same as above ?

Thx
Michael