The Arcive of vBulletin Modifications Site. |
|
Latest Album Picture v2 Details »»
|
|||||||||||||||||||||||||
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>
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Hi, searched for Widget Type: PHP Direct Execution, but couldnt find it. Maybe im in the wrong place , but im going to the widgetmanager choose new widget and then select Widget Type: PHP Direct Execution? Its not in the dropdown. (using Rc2)
|
|
#3
|
|||
|
|||
|
have you updated all the way to rc2 without uploading new php files? it may not be in old files not to sure
|
|
#4
|
||||
|
||||
|
Clear the cache
|
|
#5
|
||||
|
||||
|
thank you, works fine
|
|
#6
|
|||
|
|||
|
This will definitely be my first vB 4.0 mod. I'll add this once 4.0 is officially released.
|
|
#7
|
|||
|
|||
|
That did it, works great. Thanks!
|
|
#8
|
|||
|
|||
|
Where can I change the background of each picture? I want to decrease the height of the white box behind the picture so that it has a similar size as the picture. Is this a specific CSS file? Where can I find it?
|
|
#9
|
||||
|
||||
|
I think the album permissions are not queried. It's important to not show private albums to the user. It would be nice if I could look at a "friend only" album when I am the friend of that user, of course users that are not befriended with the album author should not be shown the image.
|
|
#10
|
|||
|
|||
|
look into that sometime today it and it uses album.css and picture.css someones the album system uses
|
![]() |
|
|