![]() |
|
#1
|
|||
|
|||
|
I am using a vBulletin add-on called Raffles.
This add-on puts also a forum side block on the forum to display the active Raffles. I would like to use this forum block into a module and therefore I tried to put the PHP code I found in this forum block into a new PHP module.
Here is the code I had from the forum block which I added into my PHP file: Code:
<?php
global $vbulletin;
if ($vbulletin->options['raffle_mode'] && $vbulletin->options['raffle_showsidebar'] && !is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['raffle_perms'])))
{
$timenow = TIMENOW;
$allow_view = true;
$raffle_getactive = $vbulletin->db->query_read_slave("SELECT * FROM " . TABLE_PREFIX . "raffle
WHERE enddate > $timenow AND startdate <= $timenow AND winner = ''
ORDER BY id DESC
");
if ($vbulletin->db->num_rows($raffle_getactive))
{
while($raffle = $vbulletin->db->fetch_array($raffle_getactive))
{
($hook = vBulletinHook::fetch_hook('raffle_active')) ? eval($hook) : false;
if($allow_view == true)
{
if($raffle_list) $raffle_list .= '<br />';
$raffle_list .= '<a href="raffles.php?' . $session[sessionurl] . 'do=raffle&id=' . $raffle[id] . '" title="' . $raffle[name] . '" />' . $raffle[name];
if($raffle['showimage'])
{
if(empty($raffle['prizeimg'])) $raffle['prizeimg'] = 'images/raffles/default.gif';
$target = $vbulletin->options['raffle_sidebar_maxpicture'];
$picturesize = getimagesize($raffle['prizeimg']);
$percentage = ($target / $picturesize[0]);
$picture_width = round($picturesize[0] * $percentage);
$picture_height = round($picturesize[1] * $percentage);
$raffle_list .= '<br /><center><img class="display" src="' . $raffle['prizeimg'] . '" width="' . $picture_width . '" height="' . $picture_height . '" alt="' . $raffle['name'] . '" border="0" /></center>';
}
$raffle_list .= '</a><br />';
}
}
}
unset($raffle_getactive);
$statsarray = array('currentraffles' => $raffle_list,);
return $statsarray;
}
?>
|
|
#2
|
|||
|
|||
|
What have you set here ?
Quote:
__________________
Seen vB5 beta? ![]() No more vbulletin for me, done , gone,finished .
|
|
#3
|
|||
|
|||
|
The add-on was written for vBulletin and works fine in the sidebar block without vBadvanced.
Here is a link to the add-on on vBulletin.org: http://www.vbulletin.org/forum/showt...light=advanced Tried everything. With and without clean output. Just won't show up |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Welcome Block into Module | Mondi | Module & Modification Discussion & Requests | 3 | 04-30-2008 12:00 PM |
| How can I add this to a module block? | wobbly | Module & Modification Discussion & Requests | 8 | 04-24-2007 04:36 AM |
| re: Welcome Block Module | CJA | Chit Chat | 2 | 02-16-2006 05:09 PM |
| Welcome Block Module | MikeM79 | "How Do I..." Questions | 6 | 02-16-2006 01:00 PM |
| Welcome Block Module | jrcart | Troubleshooting & Problems | 5 | 06-29-2005 09:09 PM |