Ok here is what I did to try and get random pictures to show for my CMPS homepage:
Copied out the following code from vbimghost_last5forumhome-plugins.xml:
Code:
$rec = $vbulletin->db->query_read("
SELECT imgid,imgfile,thumbname,imgwidth,imgheight,imgdate
FROM ".TABLE_PREFIX."vbimghost
WHERE imgprivate='0'
order by imgdate DESC
LIMIT 5
");
$vbimghost['count'] = $db->num_rows($rec);
if ($vbimghost['count']){
while ($row = $vbulletin->db->fetch_array($rec)) {
$vbimghost['id']=$row['imgid'];
$vbimghost['path']=$vbulletin->options['bburl']."/".$vbulletin->options['imgdir']."/".$row['imgfile'];
$vbimghost['dispath']=$vbulletin->options['bburl']."/vbimghost.php?do=displayimg&imgid=".$row['imgid'];
$vbimghost['width']=$row['imgwidth'];
$vbimghost['height']=$row['imgheight'];
$vbimghost['date']=date('Y-m-d', $row['imgdate']);
if (file_exists($vbulletin->options['imgdir']."/".$row['thumbname'])){
$vbimghost['thumbpath']=$vbulletin->options['bburl']."/".$vbulletin->options['imgdir']."/".$row['thumbname'];
$vbimghost['thumbsize']=0;
}else{
$vbimghost['thumbpath']=$vbimghost['path'];
if ($row['imgwidth'] <= $vbulletin->options['imgthumw'])
$vbimghost['thumbsize']=$row['imgwidth'];
else
$vbimghost['thumbsize']=$vbimghost['imgthumw'];
}
eval('$mimghost .= "'.fetch_template('vbimghost_memberbit') . '";');
}
}else{
$vbimghost['more'] = "";
eval('$mimghost ="'.fetch_template('vbimghost_memberbit_noimg') . '";');
}
$vbimghost['last5'] = $mimghost;
I then added pphp tags to enclose it:
I then saved it as vbimagehostpics.php and placed it in my modules folder.
Then I made a template and called it vbimage
Code:
<tr>
<td>
<table class="tborder" align="center" border="0" cellpadding="6" cellspacing="1" width="100%">
<thead>
<tr>
<td class="tcat" colspan='$vbimghost[count]' align="center">$vbphrase[vbimghost_last5img] </td>
</tr>
</thead>
<tbody>
<tr align="center">
$vbimghost[last5]
</tr>
</tbody>
</table>
</td>
</tr>
I then went back and added a modulee as a php file
Module Title: Random Pix
Column: Center
Display Order: 2
Active: Yes
Update All Pages: Yes
File to Include: vbimagehostpics.php
Identifier: blank
Template used: adv_portal_vbimage
Use Module Shell Template: No
everything saved ok but nothing shows on the main page. What am I doing wrong?!?