Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
echo get_random_picture();
function get_random_picture() {
$connessione_db=mysql_connect("localhost","your_user","your_password");
mysql_select_db("your_database_name",$connessione_db);
$tabella = 'plogger_pictures';
$offset_result = mysql_query( " SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM ".$tabella,$connessione_db);
$offset_row = mysql_fetch_array( $offset_result );
$offset = $offset_row['offset'];
$result = mysql_query( " SELECT id,description,caption,path FROM $tabella LIMIT $offset, 1 ",$connessione_db);
$row = mysql_fetch_array($result);
$descrizione = $row['description'];
$path = $row['path'];
$nome = $row['caption'];
$id = $row['id'];
$thumb = generate_thumb($path, $id);
$pic_url = generate_url("picture",$id);
$output = '<a class="random-image-link" href="'.$pic_url.'" title="'.$nome.'"><img id="thumb-'.$id.'" class="photos" src="'.$thumb.'" title="'.$nome.'" alt="'.$descrizione.'" width="105" height="105" /></a>';
$output .= '<div style="text-align:center; padding:0 10px; margin-bottom:10px;"><a href="'.$pic_url.'" title="Visualizza Sfondo: '.$nome.'">'.ucfirst($nome).'</a></div>';
return $output;
}
//this will output 3 random images:
echo get_random_picture().get_random_picture().get_random_picture();
// or you can use
echo get_random_picture();
echo get_random_picture();
echo get_random_picture();
$pic_url = generate_url("picture",$id);
$pic_url = generate_url("picture",$id);
$pic = get_picture_by_id($id);
$album = get_album_by_id($pic["parent_album"]);
$collection = get_collection_by_id($pic["parent_collection"]);
$pic_url = $config['baseurl'].$collection['path'].'/'.$album['path'].'/'.sanitize_filename(strtolower(get_caption_filename($pic, false)))."/";
/***Funktion für Zufallsbilder auf der Startseite***/
function get_random_picture() {
$connessione_db=mysql_connect("localhost","your_user","your_password");
mysql_select_db("your_database_name",$connessione_db);
$tabella = 'plogger_pictures';
$offset_result = mysql_query( " SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM ".$tabella,$connessione_db);
$offset_row = mysql_fetch_array( $offset_result );
$offset = $offset_row['offset'];
$result = mysql_query( " SELECT id,description,caption,path FROM $tabella LIMIT $offset, 1 ",$connessione_db);
$row = mysql_fetch_array($result);
global $config;
$descrizione = $row['description'];
$path = $row['path'];
$nome = $row['caption'];
$id = $row['id'];
$thumb = generate_thumb($path, $id);
$pic = get_picture_by_id($id);
$album = get_album_by_id($pic["parent_album"]);
$collection = get_collection_by_id($pic["parent_collection"]);
$filename = basename($row["path"]);
$picture_name = substr($filename, 0, -4);
$pic_url = $config['baseurl']."bilder/".$collection['path'].'/'.$album['path'].'/'.$picture_name."/";
$output = '<a class="random-image-link" href="'.$pic_url.'" title="'.$nome.'"> <img id="thumb-'.$id.'" class="photos" src="'.$thumb.'" title="'.$nome.'" alt="'.$descrizione.'" width="158" height="158" /> </a>';
return $output;
}
function get_random_picture() {
$offset_result = mysql_query( " SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM `".PLOGGER_TABLE_PREFIX."pictures`");
$offset_row = mysql_fetch_array( $offset_result );
$offset = $offset_row['offset'];
$result = mysql_query( " SELECT id,description,caption,path FROM `".PLOGGER_TABLE_PREFIX."pictures` LIMIT $offset, 1 ");
$row = mysql_fetch_array($result);
global $config;
$descrizione = $row['description'];
$path = $row['path'];
$nome = $row['caption'];
$id = $row['id'];
$thumb = generate_thumb($path, $id);
$pic = get_picture_by_id($id);
$album = get_album_by_id($pic["parent_album"]);
$collection = get_collection_by_id($pic["parent_collection"]);
$filename = basename($row["path"]);
$picture_name = substr($filename, 0, -4);
$pic_url = $config['baseurl'].$collection['path'].'/'.$album['path'].'/'.$picture_name."/";
$fullsize = $config['baseurl']. 'plog-content/images/'.$collection['path'].'/'.$album['path'].'/'.$picture_name.".jpg";
$output = '<a class="random-image-link" href="'.$pic_url.'" title="'.$nome.'"> <img id="thumb-'.$id.'" class="photos" src="'.$thumb.'" title="'.$nome.'" alt="'.$descrizione.'" /> </a>';
return $output;
}
1 to 17 of 17