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: 697
Joined: 26 May 2012, 20:16
Location: Hamburg, Germany
Contact:

Maniaflash as frame like tsviewer

Post by NJin » 16 Feb 2014, 22:03

Are there any possibilities to include the maniaflash news into your own manialink?
German Moderator || TM Turbo Moderator
Web: https://n-jin.eu/ || Facebook: http://fb.com/NJinTM || Discord: N-Jin#2809

PC: i7-8700k @4,7GHz ; GTX 1080 ; 16GB DDR4-3000

Image

User avatar
magnetik
Nadeo
Nadeo
Posts: 1645
Joined: 01 Feb 2012, 19:13
Location: Paris
Contact:

Re: Maniaflash as frame like tsviewer

Post by magnetik » 17 Feb 2014, 13:56

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: 697
Joined: 26 May 2012, 20:16
Location: Hamburg, Germany
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin » 17 Feb 2014, 20:04

And how i can add this? xD
German Moderator || TM Turbo Moderator
Web: https://n-jin.eu/ || Facebook: http://fb.com/NJinTM || Discord: N-Jin#2809

PC: i7-8700k @4,7GHz ; GTX 1080 ; 16GB DDR4-3000

Image

User avatar
NJin
Posts: 697
Joined: 26 May 2012, 20:16
Location: Hamburg, Germany
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin » 18 Feb 2014, 16:49

Is there s specific code for maniaflash?
Because my php knowledge is not so good
German Moderator || TM Turbo Moderator
Web: https://n-jin.eu/ || Facebook: http://fb.com/NJinTM || Discord: N-Jin#2809

PC: i7-8700k @4,7GHz ; GTX 1080 ; 16GB DDR4-3000

Image

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

Re: Maniaflash as frame like tsviewer

Post by w1lla » 18 Feb 2014, 17:24

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: 697
Joined: 26 May 2012, 20:16
Location: Hamburg, Germany
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin » 18 Feb 2014, 21:28

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?
German Moderator || TM Turbo Moderator
Web: https://n-jin.eu/ || Facebook: http://fb.com/NJinTM || Discord: N-Jin#2809

PC: i7-8700k @4,7GHz ; GTX 1080 ; 16GB DDR4-3000

Image

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

Re: Maniaflash as frame like tsviewer

Post by w1lla » 18 Feb 2014, 21:53

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: 697
Joined: 26 May 2012, 20:16
Location: Hamburg, Germany
Contact:

Re: Maniaflash as frame like tsviewer

Post by NJin » 18 Feb 2014, 22:22

hm damnit
German Moderator || TM Turbo Moderator
Web: https://n-jin.eu/ || Facebook: http://fb.com/NJinTM || Discord: N-Jin#2809

PC: i7-8700k @4,7GHz ; GTX 1080 ; 16GB DDR4-3000

Image

User avatar
magnetik
Nadeo
Nadeo
Posts: 1645
Joined: 01 Feb 2012, 19:13
Location: Paris
Contact:

Re: Maniaflash as frame like tsviewer

Post by magnetik » 20 Feb 2014, 13:58

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