|
Latest Album Picture v2
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;
add 2 new templates below Title: cms_albums Code:
<link rel="stylesheet" type="text/css" href="css.php?styleid=1&langid=1&d=1260794007&td=ltr&sheet=album.css" />
<link rel="stylesheet" type="text/css" href="css.php?styleid=1&langid=1&d=1260794007&td=ltr&sheet=picture.css" />
<div class="block" id="album">
<ol id="thumbnails" class="blockbody floatcontainer">
$albumpics
</ol>
</div>
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>
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 |