coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Michael-CGC on January 27, 2005, 09:13:56 PM

Title: Thumbs o index (latest images)
Post by: Michael-CGC on January 27, 2005, 09:13:56 PM
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
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on January 28, 2005, 03:22:06 PM
Anyone please? Is it possible?  :(
Title: Re: Thumbs o index (latest images)
Post by: 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.
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on January 28, 2005, 03:28:46 PM
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?
Title: Re: Thumbs o index (latest images)
Post by: Joachim Müller on January 28, 2005, 04:31:09 PM
By clicking here (http://forum.coppermine-gallery.net/index.php?action=search)
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on January 28, 2005, 05:01:15 PM
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?
Title: Re: Thumbs o index (latest images)
Post by: Joachim Müller 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.
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on January 30, 2005, 12:23:30 PM
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?
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on February 01, 2005, 01:23:14 PM
Please help a stupid noob  :-[
Title: Re: Thumbs o index (latest images)
Post by: Nibbler on February 01, 2005, 01:36:29 PM
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;
                }
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on February 01, 2005, 05:00:56 PM
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  :)
Title: Re: Thumbs o index (latest images)
Post by: Michael-CGC on February 07, 2005, 02:36:41 PM
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