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: what in this code do i need to edit to make fav 1 column?  (Read 3572 times)

0 Members and 1 Guest are viewing this topic.

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
what in this code do i need to edit to make fav 1 column?
« on: March 22, 2004, 04:17:03 am »

case 'favpics': // Favourite Pictures

                $album_name = $lang_meta_album_names['favpics'];
                if (count($FAVPICS)>0){
                        $favs = implode(",",$FAVPICS);
                        $result = db_query("SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND pid IN ($favs)");
                        $nbEnr = mysql_fetch_array($result);
                        $count = $nbEnr[0];
                        mysql_free_result($result);

                        $select_columns = '*';

                        $result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ($favs) $limit");
                        $rowset = db_fetch_rowset($result);

                        mysql_free_result($result);

                        if ($set_caption) foreach ($rowset as $key => $row){
                                $caption = $rowset[$key]['title'] ? "<span class=\"thumb_caption\">".($rowset[$key]['title'])."</span>" : '';
                                $caption .= $rowset[$key]['caption'] ? "<span class=\"thumb_caption\">".bb_decode(($rowset[$key]['caption']))."</span>" : '';
                                $rowset[$key]['caption_text'] = $caption.$rowset[$key]['pid'];
                        }
                }
                return $rowset;
                break;

ok~> all of my other album/thumbnail views have been set to four columns in config.php

but i want to make my fav page only one column/thumbnail per row.

how would i change this? without changing all of the other views to 1 column?
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
what in this code do i need to edit to make fav 1 column?
« Reply #1 on: March 22, 2004, 05:22:08 am »

As you can see the retruned $rowset is an array - none of the rendering is happening here...

Look at functions display_thumbnails and theme_display_thumbnails
Logged
SANIsoft PHP applications for E Biz

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
what in this code do i need to edit to make fav 1 column?
« Reply #2 on: March 22, 2004, 05:28:31 am »

:?  im really confused by what you said-there isn't anything there that i could change to affect only the favorites
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
what in this code do i need to edit to make fav 1 column?
« Reply #3 on: March 22, 2004, 06:59:54 am »

The snippet you have posted is from the function get_pic_data -

If you want to change the display you will have to look into function display_thumbnails and theme_display_thumbnails
Logged
SANIsoft PHP applications for E Biz

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
what in this code do i need to edit to make fav 1 column?
« Reply #4 on: March 23, 2004, 02:03:13 am »

:oops: i'm not a coder-just a confused person :oops:

here are the snippets from what you said to edit-i don't know what code i need to put in there to make the favorites page only have one column of thumbnails.

here is theme_display_thumbnails
Code: [Select]
               theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);


i don't see how to modify this to change only the favorites thumbnails

and the same for this

here is display_thumbnails
Code: [Select]
function display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)
{
        global $CONFIG, $AUTHORIZED, $HTTP_GET_VARS;
        global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;

        $thumb_per_page = $thumbcols * $thumbrows;
        $lower_limit = ($page-1) * $thumb_per_page;

        $pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
        $total_pages = ceil($thumb_count / $thumb_per_page);

        $i = 0;
        if (count($pic_data) > 0) {
                foreach ($pic_data as $key => $row) {
                        $i++;

                        $image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);

                        $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);

                        $thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
                        $thumb_list[$i]['image'] = "<img src=\"" . get_pic_url($row, 'thumb') . "\" class=\"image\" {$image_size['geom']} border=\"0\"></a>";
                        $thumb_list[$i]['caption'] = $row['caption_text'];
                        $thumb_list[$i]['admin_menu'] = '';
                        $thumb_list[$i]['aid'] = $row['aid'];
                }
                theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
        } else {
                theme_no_img_to_display($album_name);
        }
}



i am sooo confused-can you please code or help me code this section?
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
what in this code do i need to edit to make fav 1 column?
« Reply #5 on: March 23, 2004, 06:44:50 am »

Am sorry - your request is too specific to your case, I can't help you any more than what has already been done

May be someone else will pick up the thread and help you further....
Logged
SANIsoft PHP applications for E Biz

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
what in this code do i need to edit to make fav 1 column?
« Reply #6 on: March 24, 2004, 05:02:54 am »

*bump*
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
what in this code do i need to edit to make fav 1 column?
« Reply #7 on: March 24, 2004, 07:49:22 am »

stop bumping, you fool :x

GauGau
Logged

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
what in this code do i need to edit to make fav 1 column?
« Reply #8 on: March 24, 2004, 11:44:04 pm »

i followed the rules, gaugau-you said not to bump the same day as the last post-so i didn't i did it a day later
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
what in this code do i need to edit to make fav 1 column?
« Reply #9 on: March 25, 2004, 03:42:38 am »

:evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:  :evil:
One more of your smart alecky post and I will ban you.
Logged
SANIsoft PHP applications for E Biz
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.