Back to vBulletin 4.x Add-ons

Latest Album Picture v2
Mod Version: 0.3, by Massamo

vB Version: 4.0.3 Rating: (2 votes - 4.50 average) Installs: 63
Released: 14 Dec 2009 Last Update: Never Downloads: 1
Not Supported Template Edits Re-usable Code Translations Is in Beta Stage  

Create a new widget
Widget Type: PHP Direct Execution
Title: Latest Picture

Then save find it again and click the configure change top box to
Code:
global $db;
// set how many to display
$hm = '1';
// replace dateline below with rand(NOW()) if you want it random
$orderby = "dateline";
$lpictures = $db->query_read("
  SELECT *  FROM " . TABLE_PREFIX . "attachment AS attach
    WHERE attach.state = 'visible' and attach.contenttypeid = '1'
ORDER BY $orderby DESC LIMIT 0, $hm
  ");
    $cols = $db->num_rows($lpictures);
    while ($lpicture = $db->fetch_array($lpictures))
    {
$templater = vB_Template::create('cms_albums_albumsbits');
$templater->register('lpicture' , $lpicture);
$albumpics .= $templater->render();
$templater = vB_Template::create('cms_albums');
$templater->register('lpicture' , $lpicture);
$templater->register('albumpics' , $albumpics);
$cms_albums = $templater->render();
    }
$output = $cms_albums;
Then save

add 2 new templates below

Title: cms_albums
Code:
    <link rel="stylesheet" type="text/css" href="css.php?styleid=1&amp;langid=1&amp;d=1260794007&amp;td=ltr&amp;sheet=album.css" />
    <link rel="stylesheet" type="text/css" href="css.php?styleid=1&amp;langid=1&amp;d=1260794007&amp;td=ltr&amp;sheet=picture.css" />
<div class="block" id="album">
    <ol id="thumbnails" class="blockbody floatcontainer">
        $albumpics
</ol>    
</div>
Title: cms_albums_albumsbits
Code:
<li>
    <center><a class="picture" href="$vboptions[bburl]/attachment.php?attachmentid=$lpicture[attachmentid]"><img src="$vboptions[bburl]/attachment.php?attachmentid=$lpicture[attachmentid]" alt="$lpicture[caption]" border="0" height="100" width="200"  /></a></center>
</li>
all you need to do now is go into layout manager and add the widget where you want it

Download

No files for download.

Similar Mods

Social Group and Album Enhancements Album Picture Clicks to Next Picture in Album vBulletin 3.7 Template Modifications

vblts.ru supports vBulletin®, 2022-2024