Who can tell me in Phpbb index.php Show random image (Crosswise) ? Who can tell me in Phpbb index.php Show random image (Crosswise) ?
 

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

Who can tell me in Phpbb index.php Show random image (Crosswise) ?

Started by ken8yan, June 28, 2004, 08:12:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ken8yan

i have See this Post

http://forum.coppermine-gallery.net/index.php?topic=1196.0

Who can tell me in Phpbb index.php Show random image Horizontal display ?
Now only show vertically display ... i want use Horizontal display i need edit where ? ???

Quote<?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,4"); 
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=80 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>' ); 


?>

DaMysterious

DaMysterious.

ken8yan


DaMysterious

Quote from: ken8yan on June 29, 2004, 04:59:47 PM
Quote from: DaMysterious on June 28, 2004, 09:48:22 PM
Quote from: ken8yan on June 28, 2004, 08:12:11 AM
i have See this Post

http://forum.coppermine-gallery.net/index.php?topic=1196.0


Scroll a little down in the tread and you may find some answers  ;).

Sorry Sir ... Can you tell me edit where code ?

Follow this link and scroll down til '2) gallery_center_random_block.php' the solution you'r looking for though.
DaMysterious.