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 [2] 3   Go Down

Author Topic: question about information on the front page of albums...  (Read 14211 times)

0 Members and 1 Guest are viewing this topic.

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: question about information on the front page of albums...
« Reply #20 on: November 14, 2007, 08:20:59 am »

Its ok, this is using mysql statment to get the data from the database. The "aid" part is a coloumn in the database (album id). This code
Code: [Select]
$sql ="SELECT * FROM {$CONFIG['TABLE_PICTURES']}  WHERE aid = //What is this defined as\\? ORDER BY mtime DESC LIMIT 1";
is saying select (kinda means get) * means all from the pictures table where album id = the album that you want the data from (so you can get the correct username and time) order by (speaks for itself) mtime - time of upload DESC means desending and LIMIT 1 means you only want 1 name and time out of the database.

The part that is still required is the aid, im pretty sure its is $aid. So heres the that complete line of code. All you need to do is get the correct way of showing that data.

Code: [Select]
$sql ="SELECT * FROM {$CONFIG['TABLE_PICTURES']}  WHERE aid = $aid  ORDER BY mtime DESC LIMIT 1";

just_some_guy,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #21 on: November 14, 2007, 08:57:56 am »

Without knowing where you want to place this query, you can't say if a variable is defined. You're just assuming $aid will hold some album id information. This won't work. I already told you, your $phrase thingie isn't defind and the output will be NULL. Even if you get it running by placing this query somewhere in the theme.php you'll have an unnecessary query each time another page than index.php loads and includes theme.php.

Here's the way I'd do it. However this requires modifying core code.

1. copy from themes/sample/theme.php to the theme.php you're actually using:
  - function theme_display_album_list (till the closing })
  - $template_album_list (till the closing EOT;)

2. function theme_display_album_list
find
Code: [Select]
                '{ALB_LINK_PIC}' => $album['thumb_pic'],
below add
Code: [Select]
                '{ALB_PIC_OWNER}' => $album['thumb_owner'],
                '{ALB_PIC_TITLE}' => $album['thumb_title'],

3. $template_album_list
find
Code: [Select]
                        <p class="album_stat">{ALB_INFOS}</p>
replace with
Code: [Select]
                        <p class="album_stat">{ALB_INFOS}<br>Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER} </p>

4. index.php
find
Code: [Select]
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
replace with
Code: [Select]
            //alb info modification
                    $sql = "SELECT owner_name, title, filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";

find
Code: [Select]
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";
below add
Code: [Select]
              //alb info modification
$alb_list[$alb_idx]['thumb_owner'] = $picture['owner_name'];
$alb_list[$alb_idx]['thumb_title'] = $picture['title'];

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #22 on: November 14, 2007, 04:15:38 pm »

This is what I put into my theme.php (below)
Also I did what stramm said to do, but I am not getting anything to happen.  Take a look and see, am I supposed to be pointing something to something?  You seem to be explaining your self clear but I am also getting two people saying somethings will work and some will not.  Well we will see I guess.

THANKS!

I attached my index.php and theme.php since I can't copy and paste it because of length.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #23 on: November 14, 2007, 04:42:30 pm »

You decide what way to go. I already said, that imho just_some_guy's solution lacks functionality.
If you want to apply my solution, you need to start from scratch, with no modifications of this thread applied.

I know how an unmodded CPG 1.4.14 index.php looks like. No need to attach it. See above how to mod it.

Your theme is... hmm, not that good cause it includes (quote from theme) 'all CORE items that are available'. This is just silly. All stuff that hasn't been modified shouldn't go into the theme.php. If you update your gallery, then all theme functions are overwritten by the functions of your custom theme -> means you always use old ones. Therefore only add functions to the theme.php you actually need to modify.

Nevertheless, the functions that need to be copied are already in your theme.php -> you can skip point 1 of my guide.

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #24 on: November 14, 2007, 04:53:04 pm »

Gotcha, I wasn't sure which to go with since I trust everyone that is helping me.
Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #25 on: November 14, 2007, 11:41:37 pm »

OK I use this code and took out all the pointless stuff like you said and now the page does not load at all?  Any ideas

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.1
  $Source:
  $Revision: 1.10 $
  $Author:
  $Date: 2005/04/30 07:13:16 $
**********************************************/

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); 

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='::';
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['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' =>  'index.php?cat=' $cat '&amp;page=%d'));
    
$theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], array('{LINK}'  => 'index.php?cat=' $cat '&amp;page=%d'));
    
$theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], 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'],
                
'{ALB_DESC}' => $album['album_desc'],
                
'{ALB_INFOS}' => $album['album_info'],
                );

            echo 
template_eval($album_cell$params);

            if (
$count $columns == && $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;
}

// Function to display first level Albums of a category
function theme_display_album_list_cat(&$alb_list$nbAlb$cat$page$total_pages)
{
    global 
$CONFIG$STATS_IN_ALB_LIST$statistics$template_tab_display$template_album_list_cat,  $lang_album_list;
    if (!
$CONFIG['first_level']) {
        return;
    }
$template_album_list = <<<EOT

<!-- BEGIN stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span  class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END stat_row -->
<!-- BEGIN header -->
        <tr class="tableb_compact">
<!-- END header -->
<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}"><b>{ALBUM_TITLE}</b></a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image"  style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" align="left" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->
<!-- BEGIN empty_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td height="1" valign="top" class="tableh2">
                        <b>&nbsp;</b>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="top" class="tableb_compact">
                    <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1"  height="{SPACER}" border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="tableb_compact">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;
?>
Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #26 on: November 14, 2007, 11:42:39 pm »

Mind you I make the changes yet, Because I want the page to actually work before I spend my time editing it.

Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #27 on: November 14, 2007, 11:47:15 pm »

you haven't copied the entire function theme_display_album_list_cat
should be obvious cause you aren't able to do the mentioned changes

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #28 on: November 14, 2007, 11:50:42 pm »

I will check it, I thought it was correct....I will try again..thanks for your patience with me.
Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #29 on: November 15, 2007, 01:24:01 am »


O.K. what do you think, this is now my theme, also did the changes to index.php. As of now nothing is happening but I think I might be on the right track, get back to me and let me know.

Thanks!



www.BLACKDEATHMETAL.com


Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.1
  $Source:
  $Revision: 1.10 $
  $Author:
  $Date: 2005/04/30 07:13:16 $
**********************************************/

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.
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['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' $cat '&amp;page=%d'));
    
$theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' $cat '&amp;page=%d'));
    
$theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], 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'],
                
'{ALB_PIC_OWNER}' => $album['thumb_owner'],
                
'{ALB_PIC_TITLE}' => $album['thumb_title'],
                
'{ADMIN_MENU}' => $album['album_adm_menu'],
                
'{ALB_DESC}' => $album['album_desc'],
                
'{ALB_INFOS}' => $album['album_info'],
                );

            echo 
template_eval($album_cell$params);

            if (
$count $columns == && $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;
}
$template_album_list = <<<EOT

<!-- BEGIN stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END stat_row -->
<!-- BEGIN header -->
        <tr class="tableb_compact">
<!-- END header -->
<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}"><b>{ALBUM_TITLE}</b></a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image" style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" align="left" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br>Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER} </p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->
<!-- BEGIN empty_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td height="1" valign="top" class="tableh2">
                        <b>&nbsp;</b>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="top" class="tableb_compact">
                    <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="{SPACER}" border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="tableb_compact">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

?>
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #30 on: November 15, 2007, 07:56:44 am »

Probably you haven't replaced the theme.php of the theme you're using with your new one

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #31 on: November 15, 2007, 03:15:23 pm »

Well I guess you are saying I have the code correct.  THAT IS GOOD!

I did overwrite my theme.php with that one and I overwrote the index.php with the new one.  I made the changes in both and nothing happened.   Not sure why.

I attached my index.php just in case you need to see that, I am sure you will say you don't but like I said "just in case".

Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #32 on: November 15, 2007, 03:41:44 pm »

You haven't made the changes I described in my guide above for index.php (both changes -> see point 4). If you do not apply all code as mentioned the mod of course won't work.

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #33 on: November 15, 2007, 04:15:15 pm »

I did what I thought was right, as you wrote in 4.  I did both those things as you can see but still no result yet.  Of course we all know I am the issue but I really feel I did what you said.

I attached it again, man I know I am right there...
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #34 on: November 15, 2007, 04:22:03 pm »

partially... is this really that difficult??
You applied one of the two changes (the sql statement modifications) but didn't add the modification that saves the result in the array (find
Code: [Select]
below add [code])[/code]

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #35 on: November 15, 2007, 04:35:55 pm »

This is the code I added but you are saying I didn't add it, so I am confused and yes it is difficult for me not for you.


Code: [Select]
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";
//alb info modification
$alb_list[$alb_idx]['thumb_owner'] = $picture['owner_name'];
$alb_list[$alb_idx]['thumb_title'] = $picture['title'];

So what is wrong with this?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #36 on: November 15, 2007, 04:40:42 pm »

from your attached zip
Code: [Select]
                } else {
                    //alb info modification
                    $sql = "SELECT owner_name, title, filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
                    $result = cpg_db_query($sql);
                    $picture = mysql_fetch_array($result);
                    mysql_free_result($result);
                }
                $pic_url = get_pic_url($picture, 'thumb');
                if (!is_image($picture['filename'])) {
                    $image_info = getimagesize(urldecode($pic_url));
                    $picture['pwidth'] = $image_info[0];
                    $picture['pheight'] = $image_info[1];
                }
                $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";
            } else { // Inserts an empty thumbnail if the album contains 0 images
                // $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = '<img src="' . $cpg_nopic_data['thumb'] . '" ' . $cpg_nopic_data['whole'] . ' class="image" border="0" alt="" />';
            }
        } elseif ($CONFIG['show_private']) {
            // $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
            $alb_list[$alb_idx]['thumb_pic'] = '<img src="' . $cpg_privatepic_data['thumb'] . '" ' . $cpg_privatepic_data['whole'] . ' class="image" border="0" alt="" />';

show me where you added it - only moification I can see is within the sql statement

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #37 on: November 15, 2007, 04:51:03 pm »

Ah I see it is actually in there twice this is where I added it:

Code: [Select]
} else {
            $alb_stat = array();
            $count = 0;
        }
        // Inserts a thumbnail if the album contains 1 or more images
        $visibility = $alb_thumb['visibility'];

                if (!in_array($aid,$FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) {
            if ($count > 0) {
                if ($alb_thumb['filename']) {
                    $picture = &$alb_thumb;
                } else {
                    //alb info modification
                    $sql = "SELECT owner_name, title, filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
                    $result = cpg_db_query($sql);
                    $picture = mysql_fetch_array($result);
                    mysql_free_result($result);
                }
                $pic_url = get_pic_url($picture, 'thumb');
                if (!is_image($picture['filename'])) {
                    $image_info = getimagesize(urldecode($pic_url));
                    $picture['pwidth'] = $image_info[0];
                    $picture['pheight'] = $image_info[1];
                }
                $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";
//alb info modification
$alb_list[$alb_idx]['thumb_owner'] = $picture['owner_name'];
$alb_list[$alb_idx]['thumb_title'] = $picture['title'];
            } else { // Inserts an empty thumbnail if the album contains 0 images
                // $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
                $cpg_nopic_data = cpg_get_system_thumb('nopic.jpg', $alb_thumb['category']);
                $alb_list[$alb_idx]['thumb_pic'] = '<img src="' . $cpg_nopic_data['thumb'] . '" ' . $cpg_nopic_data['whole'] . ' class="image" border="0" alt="" />';
            }
       

I added it on the second one which I am assuming there should not be 2.  Still no result....yes still hard for me.


Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #38 on: November 15, 2007, 04:52:31 pm »

If you try to find the code you wanted me to find you will see it is there twice


I attached again
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: question about information on the front page of albums...
« Reply #39 on: November 15, 2007, 05:01:50 pm »

you only need it once... few lines after the sql modification
Pages: 1 [2] 3   Go Up
 

Page created in 0.03 seconds with 19 queries.