coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: disposition on November 12, 2007, 04:11:52 AM

Title: question about information on the front page of albums...
Post by: disposition on November 12, 2007, 04:11:52 AM
Under each category I have albums for specific things like music an dvideo and what not, I would like everytime someone uploads something for the name of the file to show where it reads "1 files, last one added on Nov 10, 2007" (on the front page.

Hope you can help!
THANKS!


www.blackdeathmetal.com
Title: Re: question about information on the front page of albums...
Post by: Joachim Müller on November 12, 2007, 08:18:38 AM
Unrelated to your request, but more important: you're using cpg1.4.8, while the most recent stable release currently is cpg1.4.14. It's absolutely mandatory to upgrade asap.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 12, 2007, 04:09:21 PM
I hope I can still get an answer for my question.
Title: Re: question about information on the front page of albums...
Post by: Joachim Müller on November 12, 2007, 05:29:03 PM
I can see that you heeded the advice and upgraded to cpg1.4.14 - that's fine. Now we can go ahead.
Not sure what your actual request is; I understand that you want to change the look of the album stats, but I have no idea what you're actually trying to accomplish. Please re-phrase your question, using more words and maybe a made-up example string. Something like
QuoteI want to replace3 files, last one added on Nov 11, 2007with3 files, last one added on Nov 11, 2007 - additional stuff here
Title: Re: question about information on the front page of albums...
Post by: disposition on November 12, 2007, 09:16:09 PM
I took your advice and had a smooth update.  Thanks!


Well I uploaded two photos for you to check out, the first photo link is what it looks like now.

http://www.blackdeathmetal.com/aaa/1.jpg

Second is what I want it to look like. Check under VIDEO and album MUSIC VIDEO (on the picture), I added a line in the picture that reads "Latest Update - Death Spiritual Healing Video - Posted by your momma".  That is what I would like it to do, or at least something like.

http://www.blackdeathmetal.com/aaa/2.jpg

Hope this helps and thanks for helping.


www.BLACKDEATHMETAL.com
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 12, 2007, 09:46:24 PM
I can help you with this one. The location where you want the text to be is in theme.php look for

<p>{ALB_DESC}</p>

to get text there you can type around that.

For the specific query you want you need to call up the information from the database. This bit of code will probebly get you on your way, im not sure what the album id is defined by. I would think it would be $aid like the categories are defined as $cid but you might want to look into this -

$sql ="SELECT * FROM {$CONFIG['TABLE_PICTURES']}  WHERE aid = //What is this defined as\\? ORDER BY mtime DESC LIMIT 1";
$result = cpg_db_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$user_mod = $row['owner_name'];
$name_mod = $row['title'];
}

//Form a sentence, define as a variable

$phrase =  "Lastest upload -  ".$name_mod." Posted by ".$user_mod."";

//Then you can echo this out where you want.


Happy Coding!
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 03:43:55 AM
Hey thanks for the reply, although my theme.php does not have that information I am confused on where to put the code.  And I  need you to clarify where to actually put this code, you said anywhere around it, so I am assuming before it or after.

Anyway hope you can still help me out.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 04:21:23 AM
Oh yeah I used the BLACKBIRCH theme and the theme.php doesn't really have anything in it.
Title: Re: question about information on the front page of albums...
Post by: Joachim Müller on November 13, 2007, 06:35:31 AM
If a particular section doesn't exist in your theme.php, copy the corresponding section that needs changing (and only that section) from themes/sample/theme.php into a new line before?>of themes/yourtheme/theme.php, then modify as you see fit / as suggested here. The stuff you need to copy from the sample theme in your case is// HTML template for the album list
$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;
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 13, 2007, 08:18:44 AM
Juding by your screen shots your albums dont have any description so adding the code like this shouldnt do any harm. If it does then you will need to move the code to a different place.

<p>{ALB_DESC}
<?php echo "$phrase"?></p>
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 04:39:24 PM
I am rather new at this but I put that bit of code before ?> and it did not seem to give me errors, but I am stumped at what to do now and even if I am doing this correct!  I saw no difference on the site so I am assuming I am very slow at getting this for some reason. Please advise on my mistake. 

I also replaced

<p>{ALB_DESC}</p> <p class="album_stat">{ALB_INFOS}</p>

with

< p>{ALB_DESC} <?php echo "$phrase"; ?></p>

Not sure if that was the right thing to do or not.

Thanks!


<?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 $
**********************************************/


// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='::';

// HTML template for the album list
$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}
<?php echo "
$phrase"; ?>
</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;?>
Title: Re: question about information on the front page of albums...
Post by: Joachim Müller on November 13, 2007, 06:47:36 PM
<?php echo "$phrase"?>is of course nonsense and won't do anything.
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 13, 2007, 06:57:27 PM
Sorry i  mean -


echo $phrase;
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 13, 2007, 07:09:01 PM
won't do any useful either...
1. we're in a heredoc here, echo would just print as echo and won't be parsed as function
2. $phrase isn't defined. Output of nothing is nothing. In addition to that you should set vars in heredocs in curly brackets

@disposition: if you get errors, then post them. Otherwise it's not possible to give you advice.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 07:37:04 PM
I apopreciate all your help, but I am so new to PHP and I feel a bit overwhelmed here.  Am I supposed to put this code into theme or not and what is necessary to put in, It seems that some code is not necessary and some is, I am so confused, I put the code into my theme and it does nothing.  Am I supposed to edit something in this code?
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 10:24:26 PM
It would be cool if it just grabbed the information from "Latest additions".
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 13, 2007, 10:31:29 PM
The code i gave you should work fine to actually "grab" the data. It just matter of printing it out.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 13, 2007, 10:35:26 PM
What does that mean?

I added that to my theme.php so should I expect that it should be working now?  I am just trying to re out what I should do now.
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 13, 2007, 10:55:13 PM
Well basically in non coding terms. Think of it this way your solving a maths sum -  you have thought of the answer - its just a case of writing down the answer. Hope it makes makes more sense.

NB you still need to find out what the aid is in the file.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 14, 2007, 12:52:13 AM
O.K. I get that.

I still need to know what the aid is int he first place, remember I am not very familiar in PHP and as you can see I am trying to learn here, and so far I am doing O.K.

What is aid?
What file is that code grabbing from? If that even makes sense.
As I said I have the code down on my theme.php but I just don't get it.

Obviously I am just not getting this, maybe it is just way over my head for a beginner and of course I appreciate your help alot.  If there is a way to get this done that would be great if you can give me more help, if you are just fed up woth me I will try again when I learn more.

thanks
Title: Re: question about information on the front page of albums...
Post by: just_some_guy 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
$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.

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


just_some_guy,
Title: Re: question about information on the front page of albums...
Post by: Stramm 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
                '{ALB_LINK_PIC}' => $album['thumb_pic'],

below add
                '{ALB_PIC_OWNER}' => $album['thumb_owner'],
                '{ALB_PIC_TITLE}' => $album['thumb_title'],


3. $template_album_list
find
                        <p class="album_stat">{ALB_INFOS}</p>

replace with
                        <p class="album_stat">{ALB_INFOS}<br>Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER} </p>


4. index.php
find
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";

replace with
            //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
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";

below add
              //alb info modification
$alb_list[$alb_idx]['thumb_owner'] = $picture['owner_name'];
$alb_list[$alb_idx]['thumb_title'] = $picture['title'];
Title: Re: question about information on the front page of albums...
Post by: disposition 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.
Title: Re: question about information on the front page of albums...
Post by: Stramm 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.
Title: Re: question about information on the front page of albums...
Post by: disposition 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.
Title: Re: question about information on the front page of albums...
Post by: disposition 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

<?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;
?>
Title: Re: question about information on the front page of albums...
Post by: disposition 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.

Title: Re: question about information on the front page of albums...
Post by: Stramm 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
Title: Re: question about information on the front page of albums...
Post by: disposition 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.
Title: Re: question about information on the front page of albums...
Post by: disposition 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


<?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;

?>
Title: Re: question about information on the front page of albums...
Post by: Stramm 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
Title: Re: question about information on the front page of albums...
Post by: disposition 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".

Title: Re: question about information on the front page of albums...
Post by: Stramm 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.
Title: Re: question about information on the front page of albums...
Post by: disposition 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...
Title: Re: question about information on the front page of albums...
Post by: Stramm 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 below add [code])[/code]
Title: Re: question about information on the front page of albums...
Post by: disposition 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.



                $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?
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 04:40:42 PM
from your attached zip
                } 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
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 04:51:03 PM
Ah I see it is actually in there twice this is where I added it:

} 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.


Title: Re: question about information on the front page of albums...
Post by: disposition 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
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 05:01:50 PM
you only need it once... few lines after the sql modification
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 05:08:32 PM
This is what I have and uploaded it but no change.



                } 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'];
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 05:18:08 PM
if you made the theme changes, then you'd at least will see
Last upload: from
below your album stats. Even without the index.php changes and the mod in the functions... this is plain text in plain html. Therfore I can say you haven't  added it or you have added it at the wrong place, not uploaded, uploaded into the wrong place etc.

                        <p class="album_stat">{ALB_INFOS}<br>Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER} </p>

You see what the code does... displaying the alb stats and the text... if the text doesn't show, then it's not there.

Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 05:19:12 PM
So you are saying the code is correct?
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 05:25:51 PM
index.php??... as far as I can see, yes
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 05:27:06 PM
Well I will keep trying, i know you are all irritated because it is easy for you...it is kind of like music for me.

Anyway I will keep up at it, thanks for your help.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 05:34:11 PM
OK it is seeming to pick up some information:

Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER}

Ok now how does it pick up the uploaders info?
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 05:37:16 PM
that's point 2 of the guide
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 05:39:00 PM
OK I get that.... I added that to my theme and if you check my site it is showing up as that, now I want it to change to the actual user name.

www.BLACKDEATHMETAL.com

Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 06:41:01 PM
as said, follow point 2 of my guide
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 07:28:32 PM
Why do you have to be all vague, I said " I added your point 2 to my theme and uploaded it and it is not grabbing any of the info....as you can see on my site Last upload: {ALB_PIC_TITLE} from {ALB_PIC_OWNER} shows up but not the uploader info.....
Title: Re: question about information on the front page of albums...
Post by: just_some_guy on November 15, 2007, 07:33:41 PM
I dont think you have done this -

Quote2. function theme_display_album_list
find

Code:
                '{ALB_LINK_PIC}' => $album['thumb_pic'],
below add

Code:
                '{ALB_PIC_OWNER}' => $album['thumb_owner'],
                '{ALB_PIC_TITLE}' => $album['thumb_title'],
Title: Re: question about information on the front page of albums...
Post by: Stramm on November 15, 2007, 07:36:23 PM
Either 2 or 4 is missing. Cause you've obviously added 4 it needs to be 2. What's vague with that statement.

This is with every change. You say you've made it but you haven't. So what do you want me to say... hey, I'll mod that for you... I'll send you the files and you just have to upload it. Yah, I could have done that. Would have saved me a lot of typing. The files I already had before posting in here and writing the guide. But you probably want to upgrade your gallery in the future. Then you need to be able to redo these changes. Therefore it's even commented in the code. And honestly, I can not understand what's that difficult to do these lil changes and to make sure you really did them. Posting unmodified code and asking if you did all right doesn't make me feel willing to help more. Then the same with the theme changes (3) and to be continued with point 2. Come on, this is ridiculous.
Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 07:38:32 PM
Ok I got it, The problem is there were 2 on each theme and index, for some reason there are double the code. So I would add it and then it didn't work and then you get irritated.  Now I find that there was a double code ont he theme and the changes were correct but I had to do it on the second one.

Either way this would have worked fine if there was not a double version of the same code.

Thanks I got it working now you can relax. I appreciate your help alot.  You were patient and I think that rocks!

Title: Re: question about information on the front page of albums...
Post by: disposition on November 15, 2007, 07:40:47 PM
Wow you are all angry< i never asked you to do it for me... you told me to change a specific file and I did that, Obviously the problem was that there were 2 of the same thing in each file.