R@ge Skrevet 10. september 2004 Del Skrevet 10. september 2004 Original topic from Sourceforge.net ********************* My CPG is an standalone version on the same server, using the same database.... ********************* Ok my problem is actually best shown with an screenshot. For some strange reason my cpg pictures are outside the block.. Do my nuke 7.1, cause this error? Please help, I LOVE this hack Dette er koden jeg har benyttet: <?php //***Enter Path information here*** //***absolute path to main coppermine directory*** $copperminepath = '/gallery'; //***YOU MUST CHANGE THIS*** //This connects to the mysql DB //***change username and password below*** $MZrandompic = @mysql_connect('localhost', 'root', ''); //***YOU MUST CHANGE THIS*** if (!$MZrandompic) { echo( '<p>Unable to connect to the ' . 'database server at this time.</p>' ); exit(); } //select photo DB //***YOU MUST CHANGE THIS*** if (! @mysql_select_db('coppermine') ) { 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,6"); 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'] . '" alt=' . $MZrow['filename'] . ' '. 'border=0 width=60 height=50>' . '</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=1>'); echo('<P ALIGN=center>'); echo('<a href="' . $copperminepath . '/thumbnails.php?album=' . $albumid . '">' . $MZalbumname['title'] . '</a>' . '</p>'); } if (! @mysql_select_db('coppermine') ) { die( '<p>Unable to reload the main website ' . 'database at this time.</p>' ); } ?> Hele PHP koden m.m. er hentet fra dette innlegget: http://coppermine.sourceforge.net/board/in...hp?topic=1196.0 Lenke til kommentar
Anbefalte innlegg
Opprett en konto eller logg inn for å kommentere
Du må være et medlem for å kunne skrive en kommentar
Opprett konto
Det er enkelt å melde seg inn for å starte en ny konto!
Start en kontoLogg inn
Har du allerede en konto? Logg inn her.
Logg inn nå