Display Mod name in widget

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
Olymptor
sunday driver
sunday driver
Posts: 59
Joined: 16 May 2009 00:15
Owned TM-games: TMUF, TMO, TMS

Display Mod name in widget

Post by Olymptor » 02 Dec 2010 04:38

I would display mod name in fufi.widgets

I manage to add new value (i add a line in fufi_ChallengeWidget.xml) No pb for me it works (label...%mod%...)

I try to add code in plugin.fufi.widgets.php.
Display is good because on my serv there is a text "No mod"

But i don't understand how Xymph call mod ( i read and use chat.songmod.php ) I know xymph and f**kfish don't use same methods so my "copy/paste" is stupid :/

Code in plugin.fufi.widgets.php

Code: Select all

//replace the placeholders in the xml blocks with content
        if ($aseco->server->challenge->gbx->modname) {
							$mod = strval(
		                      $aseco->server->challenge->gbx->modname,
		                      $aseco->server->challenge->gbx->modfile);
							  }
		else {	$mod = 'NO MOD' ;
		}
							  					  
		$page = str_replace(array("%manialinksid%", "%widgetid%", "%widgetpos%", "%trackname%", "%mod%", "%bronzetime%", "%silvertime%", "%goldtime%", "%authortime%", "%author%"),
		array($this->manialinksID,	$this->challengeWidgetID, $this->settings["challengewidget"]["states"][$state]["pos"], htmlspecialchars($this->getValidUTF8String($challenge->name)), htmlspecialchars($mod), formatTime($challenge->bronzetime), formatTime($challenge->silvertime), formatTime($challenge->goldtime), formatTime($challenge->authortime), htmlspecialchars($this->getValidUTF8String($challenge->author))), $page);
		
It always go on ELSE and always display "No mod" in challenge widget on my server. What can i do for main code works when there is a mod on the track, and add it in $mod

Thanks.
(Sorry for my english :? , hard to explain easy with another language)

Lambda
happy cruiser
happy cruiser
Posts: 131
Joined: 22 Feb 2009 22:03
Owned TM-games: TMU+F, TM²C

Re: Display Mod name in widget

Post by Lambda » 02 Dec 2010 07:40

I made this plugin some time ago for my RPG server.

Image

How it works you can check on server World of RPG; just click on the widget.

Plugin download here.
Last edited by Lambda on 13 Dec 2010 19:39, edited 1 time in total.

Olymptor
sunday driver
sunday driver
Posts: 59
Joined: 16 May 2009 00:15
Owned TM-games: TMUF, TMO, TMS

Re: Display Mod name in widget

Post by Olymptor » 03 Dec 2010 00:45

Nice ! i'm going to study your code to display what i want and permanently.
I would have a link to download top 1 tmx replay (if exist) (like in fufi widget) and also TMX name author. I'll try myself, i think i can do it alone.
Thanks to authors and their open-source plugins especially to lambda for upgrade RPG servers :1
TM community forever ! :lovetm

Post Reply