Maniaflash as frame like tsviewer

Discuss all the publishing tools, including ManiaHome, ManiaPub, ManiaFlash and ManiaPress in this forum

Moderator: NADEO

Post Reply
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Maniaflash as frame like tsviewer

Post by NJin »

Are there any possibilities to include the maniaflash news into your own manialink?
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Maniaflash as frame like tsviewer

Post by magnetik »

That's something we want do to :thumbsup:

For now, you can use our WebServices to retreive the messages from a specific channel.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin »

And how i can add this? xD
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin »

Is there s specific code for maniaflash?
Because my php knowledge is not so good
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
w1lla
Posts: 2396
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: Maniaflash as frame like tsviewer

Post by w1lla »

ManiaFlash GetChannel:

done with webservices:

Code: Select all

<?php
/**
 * Maniaplanet Web Services SDK for PHP
 *
 * @copyright   Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @author      $Author: maximeraoust $:
 * @version     $Revision: 2 $:
 * @date        $Date: 2011-09-08 18:03:11 +0200 (Thu, 08 Sep 2011) $:
 */
require_once __DIR__.'/libraries/autoload.php';

try
{
$mf = new Maniaplanet\WebServices\ManiaFlash('loginMPWS','passwordMPWS');
$id = 'thedoge'; // ManiaFlash Channel ID:
$list = $mf->getChannel($id);
	/**
	 * Return informations about a ManiaFlash
	 * @param string $id
	 * @return Object
	 *			- name
	 *			- description
	 *			- id
	 * @throws Exception
	 */
var_dump($list->id);
}
catch(\Maniaplanet\WebServices\Exception $e)
{
	echo "Error!\n";
	printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
		$e->getHTTPStatusMessage());
	echo "\n";
	printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
	echo "\n";
}
echo "\n";
?>
You can also do GetMessages to get some messages:

Code: Select all

<?php
/**
 * Maniaplanet Web Services SDK for PHP
 *
 * @copyright   Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @author      $Author: maximeraoust $:
 * @version     $Revision: 2 $:
 * @date        $Date: 2011-09-08 18:03:11 +0200 (Thu, 08 Sep 2011) $:
 */
require_once __DIR__.'/libraries/autoload.php';

try
{
$mf = new Maniaplanet\WebServices\ManiaFlash('loginMPWS','passwordMPWS');
$id = 'thedoge'; // ManiaFlash Channel ID:
$list = $mf->getMessages($id, $offset = 0, $length = 10);
	/**
	 * Return latest messages of a channel
	 * @param string $id
	 * @return Object[]
	 *				- id
	 *				- author
	 *				- dateCreated
	 *				- message
	 *				- link
	 * @throws Exception
	 */
var_dump($list);
}
catch(\Maniaplanet\WebServices\Exception $e)
{
	echo "Error!\n";
	printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
		$e->getHTTPStatusMessage());
	echo "\n";
	printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
	echo "\n";
}
echo "\n";
?>
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin »

Ok now i get this in the browser:

Code: Select all

array(1) { [0]=> object(stdClass)#3 (8) { ["id"]=> string(4) "2194" ["author"]=> string(8) "tm-jinzo" ["dateCreated"]=> string(19) "2014-02-16 22:16:37" ["message"]=> string(44) "Maniaflash for $i$0f0gτx$000. $fffCommunity" ["link"]=> NULL ["iconStyle"]=> NULL ["iconSubStyle"]=> NULL ["mediaURL"]=> string(0) "" } } 
Now i want to print out only the message, but how?
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
w1lla
Posts: 2396
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: Maniaflash as frame like tsviewer

Post by w1lla »

Message in this case will only report a Title message.

There is no way to show the details of the message only a way to link it.

for instance by getting:

Code: Select all

var_dump($list[0]->id);
Will get the id of the message or replace id with message
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin »

hm damnit
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Maniaflash as frame like tsviewer

Post by magnetik »

It's just that we haven't updated the API.

We will add the full message soon.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
Post Reply

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 2 guests