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: More info next to thumb on Index Page  (Read 5607 times)

0 Members and 1 Guest are viewing this topic.

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
More info next to thumb on Index Page
« on: April 29, 2014, 09:06:21 am »

I have recently upgraded from 1.4.xx to 1.5.8

I used to have a field called "Event Date" and "Event Location" next the the album thumb as seen on the index page.

With 1.4.xx I knew where and how to add the fields ( e.g. in the table "ALBUMS" I had fields "event_date" and "event_location", I modified albmgr.php, theme.inc.php, etc. and it worked fine with 1.4.xx calling the info to display.

Now with my new version, I looked and tried everything, but simply cannot find the correct place to add or do the the placement.

Searches on the board reveiled nothing in this matter.

Someone be able to help me please ?

Screenshot of HERE-TO-PUT included where I want the info ... the field with data already in my table "ALBUMS"

Thanx
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: More info next to thumb on Index Page
« Reply #1 on: April 29, 2014, 11:23:08 am »

Posting your old mod will avoid to re-create it from scratch. However, searching for
Code: [Select]
{ALB_DESC}in themes/sample/theme.php should give you an idea where to put your custom code (don't forget to copy the corresponding code parts/blocks/functions to your theme's theme.php file).
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #2 on: April 29, 2014, 02:29:36 pm »

Hi André

Thanx for your quick responce.

I checked my old version's scripts .... and I knew exactly where and how to add those fields, een in the database side ...

Currently (and in the previous versions), I added those changes to my theme.inc.php

Here are the cude: ( I // the fields temporary )

if (!function_exists('theme_display_album_list'))  {  //{THEMES}
/******************************************************************************
** Section <<<theme_display_album_list>>> - START
******************************************************************************/
function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages)
{


    global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list, $lang_album_list;

    $theme_alb_list_tab_tmpl = $template_tab_display;

    $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page']));
    $theme_alb_list_tab_tmpl['page_link'] = strtr($theme_alb_list_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));

    $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);

    $album_cell = template_extract_block($template_album_list, 'album_cell');
    $empty_cell = template_extract_block($template_album_list, 'empty_cell');
    $tabs_row = template_extract_block($template_album_list, 'tabs');
    $stat_row = template_extract_block($template_album_list, 'stat_row');
    $spacer = template_extract_block($template_album_list, 'spacer');
    $header = template_extract_block($template_album_list, 'header');
    $footer = template_extract_block($template_album_list, 'footer');
    $rows_separator = template_extract_block($template_album_list, 'row_separator');

    $count = 0;

    $columns = $CONFIG['album_list_cols'];
    $column_width = ceil(100 / $columns);
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;

    starttable('100%');

    if ($STATS_IN_ALB_LIST) {
        $params = array('{STATISTICS}' => $statistics,
            '{COLUMNS}' => $columns,
            );
        echo template_eval($stat_row, $params);
    }

    echo $header;

    if (is_array($alb_list)) {
        foreach($alb_list as $album) {
            $count ++;

            $params = array('{COL_WIDTH}' => $column_width,
                '{ALBUM_TITLE}' => $album['album_title'],
                '{THUMB_CELL_WIDTH}' => $thumb_cell_width,
                '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
                '{ALB_LINK_PIC}' => $album['thumb_pic'],
                '{ADMIN_MENU}' => $album['album_adm_menu'],
                //'{EVENT_LOCATION}' => $album['event_location'],
                //'{EVENT_DATE}' => $album['event_date'],
                //'{JOBNUMBER}' => $album['jobnumber'],
                '{ALB_DESC}' => $album['album_desc'],
                '{ALB_INFOS}' => $album['album_info'],
                '{ALB_HITS}' => $album['alb_hits'],
                );
            $params = CPGPluginAPI::filter('theme_album_params', $params);

            echo template_eval($album_cell, $params);

            if ($count % $columns == 0 && $count < count($alb_list)) {
                echo $rows_separator;
            }
        }
    }

    $params = array('{COL_WIDTH}' => $column_width,
          '{SPACER}' => $thumb_cell_width
          );
    $empty_cell = template_eval($empty_cell, $params);

    while ($count++ % $columns != 0) {
        echo $empty_cell;
    }

    echo $footer;
    // Tab display
    $params = array('{COLUMNS}' => $columns,
        '{TABS}' => $tabs,
        );
    echo template_eval($tabs_row, $params);

    endtable();

    echo $spacer;
}
/******************************************************************************
** Section <<<theme_display_album_list>>> - END
******************************************************************************/
}  //{THEMES}



Also on my index pgae round line (approx) 688 i added the params:

    if (USER_ADMIN_MODE && $cat == (USER_ID + FIRST_USER_CAT)) {
        $sql = 'SELECT a.aid, a.jobnumber, a.event_location, a.event_date, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner FROM ' . $CONFIG['TABLE_ALBUMS'] . ' AS a LEFT JOIN ' . $CONFIG['TABLE_PICTURES'] . ' AS p ON a.thumb=p.pid WHERE a.owner=' . $USER_DATA['user_id'] . $album_filter . ' ORDER BY a.jobnumber DESC , a.pos ' . $limit;


This worked on my old version, but now it seems not to get the info from the database ...

Thanx for your quick responce



Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: More info next to thumb on Index Page
« Reply #3 on: April 29, 2014, 02:40:21 pm »

Code: [Select]
if (USER_ADMIN_MODE && $cat == (USER_ID + FIRST_USER_CAT)) {means this just works for your personal gallery (category ID > 10000). I assume this is not intended, thus you extended the wrong SQL query.
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #4 on: April 29, 2014, 02:50:46 pm »

So where do you think i must add these fields in a query, or what should I do now ?

Thanx again for your help ...

http://www.youth-sport-fotos.com/index.php

Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #5 on: April 29, 2014, 03:08:33 pm »

Also, I am the only one that can add photos to the albums ... and even in ADMIN mode, I can not see those fields ..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: More info next to thumb on Index Page
« Reply #6 on: April 29, 2014, 03:27:55 pm »

Have you added the custom tokens {EVENT_LOCATION}, {EVENT_DATE} and {JOBNUMBER} to your theme ($template_album_list and $template_album_list_cat)?
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #7 on: April 29, 2014, 03:58:22 pm »

André

I am realy sorry to be so stupid ... for the past 8 years I used coppermine on all my photo websites, but with this new version im am just too stupid to figure it out ... and I have 6 sites running on the old version, all down now because of the new versions of PHP, Appach and Sql ...

Hope you dont mind, but I am going to paste my complete theme.inc.php and index.php here ...

PS: Is there another easy way to call the date from the database like eg.  $CURRENT_ALBUM_DATA['event_lacation'];  or something ?

I appreciate your help ... Im sure there will be other users that might find this helpfull ...

you may also have a look at : http://www.boy-idols.com/index.php?cat=4

You will note I have fields there ( Age, Hair, Etc ) ... that is still old coppermine version, so if I enable plugins, the whole website is screwed up, thats why I decided to upgrade all of the sites ...

I just need to know where and how to add or change my custom tokens ...

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: More info next to thumb on Index Page
« Reply #8 on: April 29, 2014, 07:04:58 pm »

I just need to know where and how to add or change my custom tokens ...

I already told you:
$template_album_list and $template_album_list_cat

If those blocks don't exist in your theme's theme.php file, copy them from themes/sample/theme.php and add your tokens to the desired locations, probably somewhere near {ALB_DESC}.
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #9 on: April 29, 2014, 09:13:03 pm »

I already did

If you read the files I attached, you will see it is in there.

Im just not sure if the arguments or the way to call the info is correct ...

If you have paypal or a way for me to send you money, I will be glad to pay for your help.


 :D
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: More info next to thumb on Index Page
« Reply #10 on: April 30, 2014, 08:46:17 am »

In index.php, find
Code: [Select]
$sql = "SELECT a.aid, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner "and replace with
Code: [Select]
$sql = "SELECT a.aid, a.jobnumber, a.event_location, a.event_date, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner "
find
Code: [Select]
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) {
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;
            $last_upload_date = ($count || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? localised_date($alb_stat['last_upload'], $lang_date['lastup']) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['link_pic_count'] = $link_pic_count;
            $alb_list[$alb_idx]['alb_hits'] = sprintf($lang_list_albums['alb_hits'], $alb_hits);
            $alb_list[$alb_idx]['album_info'] = theme_album_info($count, $link_pic_count, $last_upload_date);
            $alb_list[$alb_idx]['album_adm_menu'] = album_adm_menu($alb_thumb['aid'], $cat, $alb_thumb['owner']);
        } elseif ($CONFIG['show_private']) { // uncomment this else block to show private album description
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;
            $last_upload_date = ($count || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? localised_date($alb_stat['last_upload'], $lang_date['lastup']) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['link_pic_count'] = $link_pic_count;
            $alb_list[$alb_idx]['alb_hits'] = sprintf($lang_list_albums['alb_hits'], $alb_hits);
            $alb_list[$alb_idx]['album_info'] = theme_album_info($count, $link_pic_count, $last_upload_date);
            $alb_list[$alb_idx]['album_adm_menu'] = album_adm_menu($alb_thumb['aid'], $cat, $alb_thumb['owner']);
        }
and replace with
Code: [Select]
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) {
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;
            $last_upload_date = ($count || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? localised_date($alb_stat['last_upload'], $lang_date['lastup']) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['link_pic_count'] = $link_pic_count;
            $alb_list[$alb_idx]['alb_hits'] = sprintf($lang_list_albums['alb_hits'], $alb_hits);
            $alb_list[$alb_idx]['album_info'] = theme_album_info($count, $link_pic_count, $last_upload_date);
            $alb_list[$alb_idx]['album_adm_menu'] = album_adm_menu($alb_thumb['aid'], $cat, $alb_thumb['owner']);
            $alb_list[$alb_idx]['event_location'] = $alb_thumb['event_location'];
            $alb_list[$alb_idx]['event_date'] = $alb_thumb['event_date'];
            $alb_list[$alb_idx]['jobnumber'] = $alb_thumb['jobnumber'];
        } elseif ($CONFIG['show_private']) { // uncomment this else block to show private album description
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;
            $last_upload_date = ($count || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? localised_date($alb_stat['last_upload'], $lang_date['lastup']) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['link_pic_count'] = $link_pic_count;
            $alb_list[$alb_idx]['alb_hits'] = sprintf($lang_list_albums['alb_hits'], $alb_hits);
            $alb_list[$alb_idx]['album_info'] = theme_album_info($count, $link_pic_count, $last_upload_date);
            $alb_list[$alb_idx]['album_adm_menu'] = album_adm_menu($alb_thumb['aid'], $cat, $alb_thumb['owner']);
            $alb_list[$alb_idx]['event_location'] = $alb_thumb['event_location'];
            $alb_list[$alb_idx]['event_date'] = $alb_thumb['event_date'];
            $alb_list[$alb_idx]['jobnumber'] = $alb_thumb['jobnumber'];
        }

I haven't checked that in detail, but I think a lot of your other modifications aren't needed.
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #11 on: May 06, 2014, 11:48:41 am »

Andrč

You are a star !!! AN absolute star ... its working now, Im uploading all the new files to my server now. What do I owe you ?

Just one more question, in each Category I have albums, bit the albums need to be sorted by "jobnumber" Desending, you will notice I have in some instances more than 20 albums in one category, so basicly ( with the previous version ) I want the latest one to bo on top ... hop you understand what I mean ...

I think it is to do with one of the sql quiries on the index page, just not sore which one ...

Can you halp please ?
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: More info next to thumb on Index Page
« Reply #12 on: May 06, 2014, 01:34:02 pm »

Thanx, figured it out !!!
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.