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 14223 times)

0 Members and 1 Guest are viewing this topic.

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
question about information on the front page of albums...
« 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: question about information on the front page of albums...
« Reply #1 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.
Logged

disposition

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

I hope I can still get an answer for my question.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: question about information on the front page of albums...
« Reply #3 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
Quote
I want to replace
Code: [Select]
3 files, last one added on Nov 11, 2007with
Code: [Select]
3 files, last one added on Nov 11, 2007 - additional stuff here
Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #4 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
Logged

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 #5 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

Code: [Select]
<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 -

Code: [Select]
$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!
« Last Edit: November 13, 2007, 08:15:55 am by 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

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #6 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.
Logged

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #7 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: question about information on the front page of albums...
« Reply #8 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
Code: [Select]
?>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
Code: [Select]
// 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;
Logged

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 #9 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.

Code: [Select]
<p>{ALB_DESC}
<?php echo "$phrase"?></p>
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

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #10 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!


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


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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: question about information on the front page of albums...
« Reply #11 on: November 13, 2007, 06:47:36 pm »

Code: [Select]
<?php echo "$phrase"?>is of course nonsense and won't do anything.
Logged

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 #12 on: November 13, 2007, 06:57:27 pm »

Sorry i  mean -

Code: [Select]
echo $phrase;
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 #13 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.

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #14 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?
Logged

disposition

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

It would be cool if it just grabbed the information from "Latest additions".
Logged

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 #16 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.
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

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #17 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.
Logged

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 #18 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.
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

disposition

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 183
Re: question about information on the front page of albums...
« Reply #19 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
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.044 seconds with 19 queries.