Thread: Major Additions - ibProArcade - professional Arcade System
View Single Post
  #6645  
Old 03-18-2012, 02:15 PM
Hippy's Avatar
Hippy Hippy is offline
 
Join Date: Dec 2001
Location: USA, New Jersey
Posts: 2,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if your using postbit
admincp> plugin manager

look for ibProArcade: Crowns in Postbit

and replace the code with this

Code:
global $crowncache;
if (!$crowncache)
{
	$this->cache['champs'] = array();
	$this->cache['tourneys'] = array();
	$this->cache['crowns'] = array();
	$this->cache['crown'] = $this->registry->db->query_first("SELECT crown_type AS type, show_crowns, show_t_won FROM " . TABLE_PREFIX . "games_settings");
	if ($this->cache['crown']['show_crowns'])
	{
		$thecrowns = $this->registry->db->query_read("
			SELECT c.*, g.gname, cat.password FROM " . TABLE_PREFIX . "games_champs AS c, " . TABLE_PREFIX . "games_list AS g, " . TABLE_PREFIX . "games_cats AS cat
			WHERE (c.champ_gid=g.gid) AND (g.gcat=cat.c_id) AND trim(password)='' AND g.active=1
		");
    		while ($this_champ = $this->registry->db->fetch_array($thecrowns))
    		{
			if (!isset($this->cache['champs']["$this_champ[champ_mid]"]))
        		{
				$this->cache['champs']["$this_champ[champ_mid]"] = array();
        		}
        		$this->cache['champs']["$this_champ[champ_mid]"][] = array(
				'gid' => $this_champ['champ_gid'],
				'gtitle' => $this_champ['champ_gtitle'],
				'gname' => $this_champ['gname']
			);
    		}
	}
	if ($this->cache['crown']['show_t_won'])
	{
		$tourneyquery = $this->registry->db->query_read("
			SELECT t.champion, u.userid FROM " . TABLE_PREFIX . "tournaments AS t
			LEFT JOIN " . TABLE_PREFIX . "user AS u ON (t.champion = u.username)
			WHERE champion<>''
		");
		while ($this_tourney = $this->registry->db->fetch_array($tourneyquery))
		{
			if (!isset($this->cache['tourneys']["$this_tourney[userid]"]))
			{
				$this->cache['tourneys']["$this_tourney[userid]"] = 0;
			}
			$this->cache['tourneys']["$this_tourney[userid]"]++;
		}
	}
	$crowncache = true;
}
$champs =& $this->cache['champs'];
$tourneys =& $this->cache['tourneys'];
$crown =& $this->cache['crown'];

$crowns = '';
if ($crown['show_crowns'])
{
	if (!isset($this->cache['crowns']["$post[userid]"]))
	{
		$crowns = '';
		if (isset($champs["$post[userid]"]))
		{
			if ((count($champs["$post[userid]"]) > 1) && ($crowns[type]!=4))
			{
				switch ($crown['type'])
				{
					case 0:
						$crowns = '';
						break;
					case 1:
						$crowns = '<marquee width="150" scrollamount="3">';
						break;
					case 2:
						$crowns = '<marquee width="175" name="crownscroll" scrollamount="1" direction="up" height="20">';
						break;
					case 3:
						$crowns = '';
						break;
				}
				$crown_end = ($crown['type'] == 1) ? '' : '<br />';
				$counter=0;
				foreach ($champs["$post[userid]"] AS $this_game)
				{
					if ($crown['type'] == 3)
					{
						if ($counter == 5)
						{ 
							$counter = 0; $crowns.= "<br />";
						}
					}
					$imgtext="";
					if ($crown['type'] == 3) { $imgtext = "$this_game[gtitle] Champion"; }
					$crowns .= "<a href=\"arcade.php?" . $this->registry->session->vars['sessionurl'] . "do=stats&amp;gameid=$this_game[gid]\"> <img src=\"arcade/images/$this_game[gname]2.gif\" border=\"0\" alt=\"$imgtext\" width=\"20\" height=\"20\" />";
					if ($crown['type']!=3)
					{
						$crowns .= $this_game[gtitle]." Champion!</a> " . $crown_end; 
					}
					else
					{
						$crowns .= "</a> ";
					}
					$counter++;
				}
				if ($crown['type'] != 0)
				{
					$crowns .= '</marquee>';
					if ( ($crown['show_t_won']) && (isset($tourneys["$post[userid]"])) )
					{
						$crowns .= '<br />';
					}
				}
			}
			else
			{
				foreach ($champs["$post[userid]"] AS $this_game )
				{
					$imgtext = "";
					if ($crown['type'] == 3) { $imgtext = "$this_game[gtitle] Champion"; }
					$crowns = "<a href=\"arcade.php?" . $this->registry->session->vars['sessionurl'] . "do=stats&amp;gameid=$this_game[gid]\"><img src=\"arcade/images/$this_game[gname]2.gif\" border=\"0\" alt=\"$imgtext\" width=\"20\" height=\"20\" /> ";
					if ($crown['type'] != 3)
					{
						$crowns .= "$this_game[gtitle] Champion!";
					}
					$crowns .= "</a>";
				}
			}
		}

		if ($crown[type]==4)
		{
			$extra="";
			if (count($champs["$post[userid]"])>1)
			{
				$extra="s";
			}
			$crowns = "";
			if (count($champs["$post[userid]"]) > 0)
			{
				$crowns = "<img src='arcade/images/trophy.gif' alt='".(count($champs["$post[userid]"]))." Highscore".$extra."'><br />";
			}
		}

		$this->cache['crowns']["$post[userid]"] = $crowns;
	}
	else
	{
		$crowns = $this->cache['crowns']["$post[userid]"];
	}
}
$champtext = '';
if ($crown['show_t_won'])
{
	if (isset($tourneys["$post[userid]"]) )
	{
		$champtext = "<dt><a href='arcade.php?do=viewtourneyend' target='_blank' alt='123456'>" .$vbphrase[ibpa_tourney] . " </dt></a><b>" . $tourneys[$post[userid]] . "</b>";
	}
}
$post['crowns'] = $crowns;
$post['champtext'] = $champtext;
if your using postbit_legacy change the marquee width= to suite
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01209 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete