vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v4.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2012, 08:58 AM
qpurser qpurser is offline
Junior Member
 
Join Date: Aug 2011
Posts: 17
Default vb block into module?

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.
  • I made a PHP file with the code and added this to the module folder.
  • Created a new PHP module calling this file but nothing shows up.
Any ideas what I am doing wrong?

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;
}
?>
Reply With Quote
  #2  
Old 06-01-2012, 10:07 AM
CareyCrew CareyCrew is offline
Gone. vB is worthless now
 
Join Date: Sep 2007
Posts: 1,676
Default

What have you set here ?

Quote:
Clean File Output

If your are trying to include a PHP file that was not written specifically for vBulletin or vBadvanced, it may be necessary to "clean" the output of this file. If you add a module and the content prints out as the first thing on the top your page, this is a good indication that it needs to be cleaned.
__________________
Seen vB5 beta? No more vbulletin for me, done , gone,finished .
Reply With Quote
  #3  
Old 06-01-2012, 10:34 AM
qpurser qpurser is offline
Junior Member
 
Join Date: Aug 2011
Posts: 17
Default

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 01:28 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.