forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: ojohn on November 14, 2003, 09:50:31 pm

Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on November 14, 2003, 09:50:31 pm
How can i put on my site front page the Recent Added Albums?
Title: How can i put on my site front page the Recent Added Albums?
Post by: moorey on November 14, 2003, 11:22:03 pm
It's an idea, but at the moment you can't, only with recently added pictures. Not sure how recently added albums can be useful though, since albums are almost "permanent", much like categories. What are your thoughts?
Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on November 14, 2003, 11:51:31 pm
Well when i do uploads i put each one in batch of pictures in a Album?

I use it mostly for high school sport pictures.
Title: How can i put on my site front page the Recent Added Albums?
Post by: paularms on November 15, 2003, 09:05:39 am
I would like to be able to put the 'last uploads' on a different page outside of the gallery directory. I think it would be a great little mod if anyone who knows php, mysql, and coppermine well...
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on November 15, 2003, 10:30:59 am
actually there are three hacks around for this purpose, one made by zarsky, one by gtroll, one by me. All of them are not recommended, as they don't take into account the permission settings of coppermine, but if you don't have private albums at all you're encouraged to use one of them. You'll find my mod in the download section, look for cpg1.1mod_ssi.zip (http://prdownloads.sourceforge.net/coppermine/cpg1.1mod_ssi.zip?download). Zarsky's mod is available here (http://forum.coppermine-gallery.net/index.php?topic=1196) and gtroll's hack here (http://forum.coppermine-gallery.net/index.php?topic=625)

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on November 16, 2003, 11:26:20 pm
Ok, I did try your SSI.php but i need it to just show the Todays added albums only.
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on November 17, 2003, 12:04:45 am
if you just need to show todays pics and you know some php/mySQL: the basic query is this one:
Code: [Select]
SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ORDER BY ctime DESC LIMIT 0,5;Check if they were uploaded today and you're ready to roll.

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Oasis on November 17, 2003, 12:10:51 am
Last updated albums works pretty much like Last added albums....
Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on November 17, 2003, 03:09:10 am
How would i do that oasis?
Title: How can i put on my site front page the Recent Added Albums?
Post by: Oasis on November 17, 2003, 10:36:16 am
in the configuration, you know, where you add the "catlist" "alblist" "toprated" etc,
add "lastalb"

Of course, it's not going to appear as normal albums do. It will appear much like the recently added pictures and random pictures. Only one picture will be shown, with the album name and description under it. But that's good enough for me...

However, if by front page, you mean a front page OUTSIDE coppermine, then I misunderstood you, and this is probably not going to work (OK not probably... definitely :lol:  )
Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on November 17, 2003, 05:53:35 pm
Yes that what i need it work great but i need it like you said to show out of coppermine. The way it lists it is great i just need it to display out side of coppermine.
Title: How can i put on my site front page the Recent Added Albums?
Post by: hilophilo on November 20, 2003, 07:35:08 am
is there anyway to edit the size of the thumbnail when appearing on your front page for example. I try editing the config file in the gallery itself but that doest work.
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on November 20, 2003, 07:43:15 am
the config settings (as the foot note says) only applies to the size of newly created thumbs (after submitting the config changes), they won't affect your existing thumbs. You can either resize the thumbs (using "resize pictures" in admin menu) or reduce the width and height parameters of the <img>-tag in html (so the browsers reduces the size for you).

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: DefenceTalk.com on December 03, 2003, 07:11:38 pm
gaugau's ssi mod has been doing great for me as i don't have any private albums.

www.defencetalk.com < go there and scroll down you should see random images from the gallery along with stats, etc.

If that doesn't work for you... why not use anycontent.php file and include it on your main page? Of course, your main page extension must be .php for you to include any .php files, etc.

Hope that helps.
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 04, 2003, 10:49:46 am
Gaugau, your ssi script is exactly what I need for my main welcome page (http://www.belmaati.com).

Right now I have manually created links and thumbnails, but I am very eager to get the whole thing to work dynamically.

I have followed all the install instructions, but I am getting a couple of errors when I run the example (http://www.belmaati.com/gallery/example.php)

Can anyone tell me what I am doing wrong? I checked in phpinfo.php, and my absolute path seems to be correct.....
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 04, 2003, 01:51:06 pm
hm, hard to say what went wrong. What is the absolute path for you?

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 04, 2003, 03:28:02 pm
If I am understanding the absolute path terminology correctly, the absolute path to ssi is:

/hotel/belmaati/WWW/gallery/ssi.php

Do I need something before the /hotel part..?

When I run phpinfo.php and look at DOCUMENT_ROOT I get this info:
/hotel/belmaati/WWW
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 04, 2003, 07:13:53 pm
are you really self-hosted (as the path indicates)? If yes, you should know the absolute path (or ask the person who runs your server).

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 04, 2003, 07:30:42 pm
No,
I am hosted by a hosting company. I talked to their support, and they believed that the absolute path is indeed hotel/belmaati/WWW. Maybe you could give me some kind of clue as to what the path might be....?

I can PM you the path to my phpinfo.php file, to show you - if you've got the time...

Thank you very much in advance!
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 05, 2003, 09:14:08 am
go ahead, pm me the phpinfo url and the top 50 lines of youre ssi.php and example.php

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 09, 2003, 11:09:16 am
Gaugau,
did you have a chance to look at the files I sent you...?

Thank you very much for your kind help!

Best,
Joe Belmaati
Copenhagen, Denmark
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 09, 2003, 05:37:53 pm
Joe,

sorry, I didn't have the time yet, but it's on my agenda, promise!

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 09, 2003, 05:44:27 pm
Thanks,
I really do appreciate it..!

Best,
Joe Belmaati
Copenhagen Denmark
Title: How can i put on my site front page the Recent Added Albums?
Post by: BigKing on December 15, 2003, 10:36:20 am
I try to built the ssi mod into the index page but i get this error message:

Code: [Select]

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67

Notice: Undefined variable: function in c:\webroot\coppermine\ssi.php on line 67


What i did wrong?
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 15, 2003, 11:56:32 am
nothing, it's just a notice - change your error level in php.

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 18, 2003, 09:44:44 am
Gaugau,
I changed my root path, and I no longer get the "failed to include" error in example.php, however when I execute the file I get the following error:

Quote
Parse error: parse error, unexpected T_STRING in /hotel/belmaati/WWW/gallery/ssi.php on line 124

This is an example of the usage of ssi.php
This is how to ouput a table containing the thumbnails linking to the most recent pics:

Fatal error: Call to undefined function: cpg_thumb() in /hotel/belmaati/WWW/gallery/example.php on line 41


Could this still be related to my root path or is something else wrong..?

Thanks in advance,
Joe
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 18, 2003, 01:04:13 pm
you'll have to get rid of the parse error first, this shoould be easy to track (it's php saying "your syntax is incorrect") - look for some missing semi-colons or quotes.

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 18, 2003, 01:52:16 pm
This is the code in line 124 in ssi.php. I can't tell what's missing there.

Code: [Select]
if ($cpg_link_target=="popup")

code from line 120-130
Code: [Select]
{
  $return_value.= "<a href=%22%22;
    if ($cpg_link_singlepic==1)
      {
       if ($cpg_link_target=="popup")
          {
          $return_value.="javascript:;\" onClick=\"MM_openBrWindow('".$url_of_cpg_dir."displayimage.php?pid=".$row['pid']."&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,resizable=yes,width=".($row['pwidth']+16).",height=".($row['pheight']+16)."')\"";
          }
          else
          {
          $return_value.=$url_of_cpg_dir."displayimage.php?&pos=-".$row['pid'];


Any help is much appreciated.
Thank you very much,
Joe Belmaati
Copenhagen Denmark
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 18, 2003, 01:54:39 pm
should line 121 be

Code: [Select]
$return_value.= "<a href=%22%22>";




....?

[edit: tried that and got a whole bunch of errors. I'm a php novice, so any help is MUCH appreciated!]
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 18, 2003, 02:11:47 pm
somehow your ssi.php file has been corrupted, the line should be
Code: [Select]
$return_value.= "<a href=\"";instead of $return_value.= "<a href=%22%22>";
Code: [Select]
Do you happen to edit ssi.php (and example.php) with a wysiwyg editor like MS Frontpage? If your answer is yes: get a fresh copy of ssi.php (re-download or look for the zip, if it's still on your hard drive) and only edit it with a text editor (notepad.exe will do fine).
Never edit a file containing other things than plain html with a wysiwyg editor (in fact, never use frontpage at all :wink: )!

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 18, 2003, 03:38:34 pm
MADE IT WORK!!! Thanks, Gaugau!!

'!@[%&$$! MS Frontpage...! I trashing all my doings in FP and moving everything over to Dreamweaver.

Once again, thanks for your help!!

Best,
Joe Belmaati
Copenhagen Denmark
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joe Belmaati on December 18, 2003, 04:04:20 pm
The script is totally cool!

Is there any way to make the fetched thumbnails appear on a vertical string instead of a horizontal one?

Thank you so much for the help.
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 19, 2003, 09:34:49 am
Quote from: "Joe Belmaati"
Is there any way to make the fetched thumbnails appear on a vertical string instead of a horizontal one?
try this: in ssi.php, look for
Code: [Select]
$return_value="<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" class=\"maintable\" border=\"0\">";
$td_start="<td valign=\"middle\" class=\"thumbnails\" align=\"center\">\n";
$td_end="</td>";
$cpg_table_end="</table>";
$tr_start="<tr>\n";
$tr_end="</tr>\n";
and change it to
Code: [Select]
$return_value="<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" class=\"maintable\" border=\"0\">";
$td_start="<tr>\n<td valign=\"middle\" class=\"thumbnails\" align=\"center\">\n";
$td_end="</td></tr>\n";
$cpg_table_end="</table>";
$tr_start="";
$tr_end="";
GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: ojohn on December 22, 2003, 06:59:46 pm
How do i make it show the pictures name under the picture?
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on December 22, 2003, 11:13:52 pm
at the moment: not at all...

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: pilot on March 19, 2004, 12:18:45 pm
Gaugau.. I've testet your add-on for a while. It works good, but it doesn't support long filenames. The link works, but not the thumb......

example

albums/userpics/thumb_Wingover%20en%20la%20Portada.jpg (the path from the first page)

albums/userpics/thumb_Wingover%2520en%2520la%2520Portada.jpg (the path from coppermine album)



Do you have a new version or patch out?
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on March 19, 2004, 03:50:37 pm
no, sorry. Like I said earlier: ssi.php is not recommended anymore...

GauGau
Title: How can i put on my site front page the Recent Added Albums?
Post by: nordew on March 22, 2004, 07:21:43 am
Gaugau. Your mod works fine for me.

How will only pictures from a certain category shown on the frontpage?
Title: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on March 22, 2004, 07:20:22 am
you can only have it display pics from a certain album, but not a certain category. This will hopefully be in a future version of this mod (which I still haven't started coding yet :wink: ).

GauGau
Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: aem on April 24, 2004, 05:02:26 am
Is there a html script for this mod?

I have a portal with boxes which allows for htmls and would like to link the recent added pics to it.
Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on April 24, 2004, 11:55:07 am
HTML is static, you can't have dynamic content on static pages (surprise, surprise). That's the reason why PHP and other server-sided scripting languages were invented in the first place.
Take a look at http://forum.coppermine-gallery.net/index.php?topic=4150.0 instead - you can insert an image...

GauGau
Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: paradox on May 28, 2004, 10:41:03 pm
Hi,

I use the GauGau hack to and it works very good but  I have a smal problem, I can´t center the "cpg_single" picture in my table.

I use this code:

Code: [Select]
<TABLE>
   <TR>
        <TD height="10" valign=top  bgcolor="#0A300A" >
        <font face="Verdana, Arial, Helvetica, sans-serif" size="1">
   
    <CENTER> <? print cpg_single();?> </CENTER>
   
        </TD>
   </TR>
</TABLE>

what is wrong ???

Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: Joachim Müller on May 30, 2004, 04:42:49 pm
your question is not related to coppermine, but a general html question. I recommend you use standards-compliant code and try something like
Code: [Select]
<table width="100%">
   <tr>
        <td align="center" valign="top"  bgcolor="#0A300A">
                  <? print cpg_single();?>
        </td>
   </tr>
</table>
Better still, try to avoid additional tables and use a <div> tag and some css formatting.

GauGau
Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: ludedude on June 01, 2004, 09:10:03 pm
I'm trying to use Zarsky's hack..in my Smartor EZ portal...but no luck yet.

I installed the Extreme Mod and have files i the cache folder, so that is working...yes?

Here is the line inseted in my portal tpl file

Code: [Select]
<? include("/home/plolps4/public_html/coppermine_dir/copper.php"); ?>
Ad this is my copper.php file

Code: [Select]
<?php 

// 
//***Enter Path information here*** 
//***absolute path to main coppermine directory*** 
// 

$copperminepath '/home/plolps4/public_html/coppermine_dir/';  //***YOU MUST CHANGE THIS*** 

// 
//This connects to the mysql DB 
//***change username and password below*** 
// 

$MZrandompic = @mysql_connect('localhost''mydbusername''mydbpassword'); //***YOU MUST CHANGE THIS*** 

if (!$MZrandompic) { 
echo( 
'<p>Unable to connect to the ' 
'database server at this time.</p>' ); 
exit(); 


// 
//select photo DB 
// 

if (! @mysql_select_db('coppermine_1_1') ) { 
die( 
'<p>Unable to locate the picture ' 
'database at this time.</p>' ); 


// 
//This gets a random picture record from the database and 
//the picture's location and displays it 
// 

$MZresult = @mysql_query("SELECT * FROM cpg11d_pictures ORDER BY RAND() LIMIT 0,1"); 
if (!
$MZresult) { 
die(
'<p>Error performing query: ' mysql_error() . 
'</p>'); 


while ( 
$MZrow mysql_fetch_array($MZresult) ) { 

$albumid $MZrow['aid'];  //This gets the picture's associated album name 
$pos $MZrow['pid'];      //This finds the picture's coppermine location 

echo('<P ALIGN=center>'); 

echo(
'<a target = "_new" href="' $copperminepath '/displayimage.php?album=' $albumid 
'&pos=-' $pos '">'); //make thumbnail clickable 

echo('<IMG SRC="' $copperminepath '/albums/');           //append base dir structure 
echo($MZrow['filepath'].thumb_.$MZrow['filename'] . '">' '</a>'); //outputs path from /userspics 



// 
//This displays the picture's album name and 
//links it to the coppermine album 
// 

$MZalbumresult = @mysql_query("SELECT * FROM cpg11d_albums WHERE aid = '$albumid'"); 
if (!
$MZalbumresult) { 
die(
'<p>Error performing query: ' mysql_error() . 
'</p>'); 


while ( 
$MZalbumname mysql_fetch_array($MZalbumresult) ) { 
echo(
'<FONT SIZE=2>'); 
echo(
'<P ALIGN=center>'); 

echo(
'<a target = "_new" href="' $copperminepath 
'/thumbnails.php?album=' $albumid '">' 
$MZalbumname['title'] . '</a>' '</p>'); 



?>

Nothing happens
Title: Re: How can i put on my site front page the Recent Added Albums?
Post by: loudone on June 02, 2004, 04:18:15 pm
'!@[%&$$! MS Frontpage...! I trashing all my doings in FP and moving everything over to Dreamweaver.

Dreamweaver is the choice of champs! Been using it for 3 years now, never "tried" anything else, just heard horror stories.... ;D