Recent Topics

Turn sponsored_links into a Credits plugin.

Started by on Aug 28, 2006 – Contents updated: Aug 28, 2006

Aug 28, 2006 01:18    

Yeh as the title says.

Also to kick it off, here are some functions from lightality:

		//	Adds Someone to the Credits array
			//	Used for Components to add their credits.
		function AddCredit($Name, $Reason, $WebSite){
			//Check is Subject to be Credited already Exists
			$Exists = -1;
			for ( $i = 0; $i < sizeof($this->Credits); $i++ ) {				
				if( $Name == $this->Credits[$i]['Name'] ){
					$Exists = $i;
					break;
				}				
			}
			
			if($Exists != -1){
				//If they do, Append the Reason.
				$this->Credits[$Exists]['Reason'] .= ', '.$Reason;
			}else{
				//If they don't then Append the Subject
				$this->Credits[] = 
					array(
						'Name' 		=>	$Name,
						'Reason' 	=>	$Reason,
						'WebSite'	=>	$WebSite
					);
			}
		}
		
		function DisplayCredits(){
			?>
			<a href="http://www.lightality.com" title="Visit Lightality's WebSite">Lightality</a> (v<?=$GLOBALS['Lightality']->Version?>) is a Skinning System Developed by 
			<strong><a href="http://www.balupton.com" title="Visit Balupton's WebSite">balupton</a></strong><br />
			<?php
			if(sizeof($this->Credits) != 0){
				echo 'With credits to&nbsp;';
				$tot = sizeof($this->Credits)-1;
				for($i = 0; $i < $tot; $i++){
?>
<a title="<?=$this->Credits[$i]['Reason']?>" href="<?=$this->Credits[$i]['WebSite']?>"><?=$this->Credits[$i]['Name']?></a>, <?php
				}
?>
and 
<a title="<?=$this->Credits[$tot]['Reason']?>" href="<?=$this->Credits[$tot]['WebSite']?>"><?=$this->Credits[$tot]['Name']?></a>.<br /><?php
				unset($tot);
			}
			?>
			Currently running <a href="http://b2evolution.net" title="Visit B2evo's WebSite">b2evolution</a> (v<?=$GLOBALS['app_version']?>)
			<?php
		}


Form is loading...

Social CMS software – This forum is powered by b2evolution CMS, a complete engine for your website.