vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > Module & Modification Discussion & Requests

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2012, 11:38 PM
MediaSoldierX MediaSoldierX is offline
Junior Member
 
Join Date: Jul 2008
Posts: 15
Exclamation vB Clan Wars Module

I'm looking to make or get some help here on how to make a module with the widget code provided with vB Clan Wars.

Here is the code:
Code:
global $db;
$wconf = $db->fetch_array($db->query_read("SELECT colorbox, formatblock FROM ".TABLE_PREFIX."clan_wars_config"));

$lastwars = "<center><table cellpadding='0' cellspacing'0' border='0' class='lastwarstable' width='90%'>";
			$result5 = $db->query_read("SELECT opp_tag, wid, wardate FROM ".TABLE_PREFIX."clan_wars WHERE status='0' AND active='1' ORDER BY wardate ASC LIMIT 5");
			if($db->num_rows($result5) > 0){
				$lastwars .= "<tr>
								<td align='left' colspan='2'><b>Upcoming Wars</b></td>
							</tr>";
			
			while($row5 = $db->fetch_array($result5)){
				$wid = $row5['wid'];
				$opp_tag = $row5['opp_tag'];
				$wardate = $row5['wardate'];

				$lastwars .= "<tr>
								<td align='left'><a href='clanwars.php?do=Details&wid=$wid'>$opp_tag</a></td>
								<td width='20%' align='center'><b>".date($wconf['formatblock'], $wardate)."</b></td>
							</tr>";
			}
		}
			//Last Wars
			$result6 = $db->query_read("SELECT opp_tag, wid, opp_score, our_score FROM ".TABLE_PREFIX."clan_wars WHERE status='1' AND active='1' ORDER BY wardate DESC LIMIT 5");
			if($db->num_rows($result6) > 0){
				$lastwars .= "<tr>
								<td align='left' colspan='2'><b>Last Wars</b></td>
							</tr>";
			
			while($row5 = $db->fetch_array($result6)){
				$wid = $row5['wid'];
				$opp_tag = $row5['opp_tag'];
				$our_score = $row5['our_score'];
				$opp_score = $row5['opp_score'];
				$wconf = $db->fetch_array($db->query_read("SELECT colorbox FROM ".TABLE_PREFIX."clan_wars_config"));
				if($wconf['colorbox']){
					//Colored boxes
					if ($our_score > $opp_score) {
						$tdcolor ='#009900';
					}else if ($our_score < $opp_score) {
						$tdcolor ='#990000';
					}else {
						$tdcolor ='#3333FF';
					}
					$tdcolor = 'style="background:'.$tdcolor.' url();"';
					$fontcolor ='#FFFFFF';
				}else{
					//Colored Text
					if ($our_score > $opp_score){
						$fontcolor = "#009900";
					}elseif($our_score < $opp_score){
						$fontcolor = "990000";
					}else{
						$fontcolor = "#3333FF";
					}
					$tdcolor ='';
				}
				
				$lastwars .= "<tr>
								<td align='left'><a href='clanwars.php?do=Details&wid=$wid'>$opp_tag</a></td>
								<td width='20%' $tdcolor align='center'><font color='$fontcolor'><b>$our_score/$opp_score</b></font></td>
							</tr>";
			}
		}
		$lastwars .= "</table></center>";
		
$output = $lastwars;
I haven't a clue how to get it working I've tried a .php module but no luck it just throws up errors on my site. Can someone possibly help ? I'm stuck here.

Thanks
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
Star Wars MMO community Swuk Show off your vBadvanced! 1 04-23-2012 06:30 PM
Clan Match Module Dark Fury Module & Modification Discussion & Requests 3 06-16-2009 01:12 PM
My Clan Site christ0pher Show off your vBadvanced! 4 05-11-2009 05:23 PM
XzX Clan! The Fathom Show off your vBadvanced! 0 01-23-2008 08:05 AM
Clan Server Spy Module yinyang Troubleshooting / "How do I..." Questions 3 06-04-2004 08:28 PM


All times are GMT -4. The time now is 05:17 AM.

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.