The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#6
|
||||
|
||||
![]()
I have a forum side block that will pull a single image from any gallery you want ....
Replace the id which is highlighted in red with the id of the album which you want to use ... You can also change the width of the sideblock as well, the width for this one is highlighted in red and its 225 px ... Code:
// -- Widget Configuration -- $use_vB_thumbnail_size = false; $use_custom_css = true; $twidth = 225; $limit = 1; $albums_list = "17"; // -- Nothing to configure below this line -- if ($use_custom_css){ $pthumb = 'class="pthumb"'; $pcaption = 'class="pcaption"'; $pmore = 'class="pmore"'; $pstyle = ''; }else{ $pthumb = 'style="text-align:center;"'; $pcaption = 'style="text-align:center;font-style:italic;font-family: Times, serif;margin-bottom:10px;"'; $pmore = 'style="text-align:right;display:block;"'; $pstyle = 'style="border: 1px solid black;padding:4px;background: white;"'; } if ($albums_list!="") $sup_cond = "AND alb.albumid IN ($albums_list)"; else $sup_cond =""; ob_start(); require_once(DIR . '/includes/functions_album.php'); require_once(DIR . '/includes/functions_user.php'); $pic_get = vB::$db->query_read(" SELECT alb.albumid, att.attachmentid, att.userid, att.caption, att.dateline, att.state, fdt.filesize, IF(fdt.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, fdt.thumbnail_dateline, fdt.thumbnail_width, fdt.thumbnail_height, u.username FROM ".TABLE_PREFIX."album AS alb LEFT JOIN ".TABLE_PREFIX."attachment AS att ON alb.albumid = att.contentid LEFT JOIN ".TABLE_PREFIX."filedata AS fdt ON att.filedataid = fdt.filedataid LEFT JOIN ".TABLE_PREFIX."user AS u ON att.userid = u.userid WHERE alb.state = 'public' AND att.contenttypeid = '8' $sup_cond ORDER BY rand(" . microtime()*1000000 . ") LIMIT $limit"); $output_bits = ""; while($pic = vB::$db->fetch_array($pic_get)) { $albuminfo = fetch_albuminfo($pic[albumid]); $picture = prepare_pictureinfo_thumb($pic, $albuminfo); if ($use_vB_thumbnail_size) $size = $picture[dimensions]; else $size = "width=$twidth"; $output_bits .= "<div $pthumb><a href=\"album.php?{$vbulletin->session->vars['sessionurl']}albumid={$pic[albumid]}&attachmentid={$picture[attachmentid]}\"><img $pstyle src=\"attachment.php?{$vbulletin->session->vars['sessionurl']}attachmentid={$picture[attachmentid]}&thumb=0&d={$picture[thumbnail_dateline]}\" alt=\"{$picture[caption_preview]}\" $size /></a>"; $output_bits .= "</div><div $pcaption>{$picture[caption_preview]} by {$pic[username]}</div>"; } $output_bits .= '<span '.$pmore.'><a href="album.php" alt="To the albums">More...</a></span>'; $output = $output_bits; ob_end_clean(); return $output; |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|