How can i put on my site front page the Recent Added Albums? - Page 3 How can i put on my site front page the Recent Added Albums? - Page 3
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How can i put on my site front page the Recent Added Albums?

Started by ojohn, November 14, 2003, 09:50:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

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

paradox

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:

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


Joachim Müller

your question is not related to coppermine, but a general html question. I recommend you use standards-compliant code and try something like<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

ludedude

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

<? include("/home/plolps4/public_html/coppermine_dir/copper.php"); ?>

Ad this is my copper.php file

<?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
http://www.p-o-ps.com  http://www.atvans.net

loudone

Quote from: Joe Belmaati on December 18, 2003, 03:38:34 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