How to show a small picture on the server?

Discover FAST, a records keeping server control script with a public records system called Dedimania, which will show records from the server on tm-exchange.com

Moderators: Slig, TM-Patrol

Post Reply
xis101
happy cruiser
happy cruiser
Posts: 154
Joined: 14 Aug 2006 01:22
Owned TM-games: TMUF
Manialink(s): gn
Contact:

How to show a small picture on the server?

Post by xis101 » 26 Jul 2009 20:51

Hi all,

can someone tell me how to show a small logo/picture with FAST on the server?
I had a look in plugin.98.ml_howto, but couldn´t get it to work. TM always crashed at mouseover. :(

Thanks in advance

xis101
happy cruiser
happy cruiser
Posts: 154
Joined: 14 Aug 2006 01:22
Owned TM-games: TMUF
Manialink(s): gn
Contact:

Re: How to show a small picture on the server?

Post by xis101 » 29 Jul 2009 10:52

I found the plugin.99.podiumlogo on the fast homepage and modified it. all worked fine. But if I add a link to a website something strange happens.
On the first map, it works. If I click on the image the website opens, but on the second map TM crashes instantly everytime I move the mouse over the image.

Here is what I changed.

Code: Select all

<?php
global $_podiumlogo_url;
///////////////////////////////////////////////////////////////
// File:      FAST 3.2 plugin
// Date:      31.03.2009
// Author:    Gilles Masson
////////////////////////////////////////////////////////////////
//
// show a logo/image (.png !) during the podium
//
// configure $_podiumlogo_url below

// set the png url
$_podiumlogo_url = 'http://www.fileden.com/files/2008/6/15/1960784/gsnlogo.png';



if($_podiumlogo_url!=''){ // activate only if image url is provided
	registerPlugin('podiumlogo',99,1.0);
}

//--------------------------------------------------------------
// Init :
//--------------------------------------------------------------
function podiumlogoInit($event){
	global $_debug,$_podiumlogo_url,$_podiumlogo_xml;

	// get logo size (pixels), if failed then suppose it as square
	$img = getimagesize($_podiumlogo_url);
	if(isset($img['mime']) && $img['mime']=='image/png'){
		$_podiumlogo_pxwidth = $img[0];
		$_podiumlogo_pxheight = $img[1];
	}else{
		$_podiumlogo_pxwidth = 100;
		$_podiumlogo_pxheight = 100;
	}

	// Build logo manialink
	// To change size and position, modify $height and posn="0 37 2" values
	$height = '18';
	$width = $height * $_podiumlogo_pxwidth / $_podiumlogo_pxheight;
	$_podiumlogo_xml = sprintf('<quad sizen="%0.2F %0.2F" posn="0 37 2" halign="center" valign="center" url="http://www.gamesnirvana.com/index.php" image="%s"/>',
														 $width,$height,$_podiumlogo_url);
}


//--------------------------------------------------------------
// if player connect while race : show logo
function podiumlogoPlayerConnect($event,$login,$pinfo,$pdetailedinfo,$pranking){
	global $_podiumlogo_xml,$_StatusCode;
	if($_StatusCode = 4)
		manialinksShow($login,'podiumlogo.logo',$_podiumlogo_xml);
}


//--------------------------------------------------------------
// if player activate manialinks while race : show logo
function podiumlogoPlayerShowML($event,$login,$ShowML){
	global $_podiumlogo_xml,$_StatusCode;
	if($ShowML && $_StatusCode = 4)
		manialinksShow($login,'podiumlogo.logo',$_podiumlogo_xml);
}

//--------------------------------------------------------------
// at begin of challenge : show logo
function podiumlogoBeginChallenge($event,$Ranking,$ChallengeInfo,$GameInfos,$continuecup){
	global $_podiumlogo_xml;
	manialinksShow(true,'podiumlogo.logo',$_podiumlogo_xml);
}

?>

Post Reply