Send email to admin 1.01

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
jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Send email to admin 1.01

Post by jouko100 » 20 Mar 2010 06:55

version 1.01 fixed minor bugs works with userpanel
U need webserver for that plugin
Those are webservers who works with email.I have tested

http://maniaworld.eu/

http://www.bplaced.net/

2 buttons send help and send email
http://yfrog.com/jlnppyltp

send help brings this dislplay
http://yfrog.com/03ohjeep

U can use /write + ur message + enter to write ur message.Login is added automatic.
Use enter only in the end of message.
max 142 characters.Only one line.Push send email button after this.

upload this to ur webserver and name it alarm2.php.Edit ur email address.

Code: Select all

<?php

$to="ur email@email.com";// put ur email here*****************************


$myFile = "message.txt";
$fh = fopen($myFile, 'r');
$message = fread($fh, filesize($myFile));
fclose($fh);


$subject ="";
utf8_encode($subject);
utf8_encode($message);

$from = $_GET['playerlogin']."  wrote from server:";



if (mail($to, $subject, $message, $from)) {
  echo("<p>Email is sended</p>");
echo"Back to server:Click trackmania in the  bottom";


 } else {
  echo("<p>Message delivery failed...</p>");

 }




?>
put this to plugins directory and name it message.php
add line in plugins .xml
<plugin>message.php</plugin>
edit urls
//urls**********************************************************
global $url;
$url="http://www.ur webserver address/alarm2.php";
global $ftp;
$ftp="ftp.ur webserver address without http://www. must be ftp.xxx
global $ftplogin;
$ftplogin="ur ftp login";
global $ftppass;
$ftppass="ur ftp password";
//end urls************************************************************


Code: Select all

<?php
Aseco::registerEvent('onEndRace', 'send');
Aseco::registerEvent('onPlayerConnect', 'send');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick50');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick51');
Aseco::registerEvent('onEndRace', 'sendoff');
Aseco::registerEvent('onEndRace', 'helpoff');


Aseco::addChatCommand('write', 'write');

//urls**********************************************************
global $url;
$url="http://www.ur webserver address/alarm2.php";
global $ftp;
$ftp="ftp.ur webserver address without www.";// must be ftp.xxx
global $ftplogin;
$ftplogin="ur ftp login";
global $ftppass;
$ftppass="ur ftp password";
//end urls************************************************************
global $aseco;

global $buttonmainposition;
$buttonmainposition = '-60 -30 1';
//manialink*************************************************
function send($aseco) {
global $buttonmainposition;
global $url;


 $xml = '<manialink id="0815470000125">

      <format style="TextCardInfoSmall" textsize="1" />

      <frame posn="'.$buttonmainposition.'">

         
//alarm****************************************************************

<quad posn="100 -10.6 0" sizen="9 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />

      <label posn="100 -10.5 1" sizen="9 2" halign="center" valign="center" text="$i$s$f00Send email"url="'.$url.'" addplayerid="1"/>
<quad posn="100 -12.8 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />

      <label posn="100 -12.6 1" sizen="8 2" halign="center" valign="center" text="$i$s$f00Send help" action="27008545"/>


      </frame>

   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));

}
//end manialink************************************   
function chat_write($aseco, $command) {
global $ftplogin;
   global $ftppass;
   global $ftp;  

	$command['params'] = explode(' ', $command['params'], 1);
                		$msg = $command['params'][0];		$msg = $aseco->formatColors($msg);
$txt=$msg;
$log = 'message.txt';
if (!file_exists($log)) {
$avaa = fopen($log, "w");
fwrite($avaa, "");
fclose($avaa);
}
// Write new data into file-
$fp=fopen('message.txt','w+');
fwrite($fp,$txt);
fclose($fp);
//upload message***************************************************
$conn = ftp_connect($ftp) or die("Could not connect");ftp_login($conn,$ftplogin,$ftppass);

ftp_nb_put($conn,"message.txt","message.txt",FTP_ASCII);
ftp_close($conn);                            										}
// help text*************************************************
function nouseButtonHandleClick50($aseco, $command) {       $playerid = $command[0];   $login = $command[1];   $action = $command[2].'';     if ($action == '27008545'){

 $xml = '<manialink id="0815470000160">      <format style="TextCardInfoSmall" textsize="1" />      <frame posn="'.$buttonmainposition.'">         

<label posn="30 -12.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00Use /write ur message+enter" action="270085201"/>
<label posn="30 -14.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00Push Send email after it.Email is sended to admin." action="270085201"/>
<label posn="30 -16.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00Ur login is added automatic." action="270085201"/>
<label posn="30 -18.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00Max 142 characters. Only one line." action="270085201"/>
<label posn="30 -20.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00Use enter only in the end of message." action="270085201"/>
<label posn="30 -22.8 1" sizen="20 2" halign="center" valign="center" text="$i$s$f00" action="270085201"/>



<quad posn="28 -10.8 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />

<label posn="28 -10.6 1" sizen="8 2" halign="center" valign="center" text="$i$s$f00Hide help" action="27008543"/>

      </frame>   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPageToLogin', array($login, $aseco->formatColors($xml), 0, false));

}
}
//end help text*******************************************************
//send off**************************************************************	
function sendoff($aseco) {   $xml = '<manialink id="0815470000125">
<format style="TextCardInfoSmall" textsize="1" />      <frame posn="'.$buttonmainposition.'">


   <frame posn="0 0 0">      <quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008545" />               </frame>   </manialink>';   $aseco->client->query('SendDisplayManialinkPage', array($xml, 0, false));}

//help off**************************************************************	
function helpoff($aseco) {
$playerid = $command[0];   $login = $command[1];   $action = $command[2].'';

   $xml = '<manialink id="0815470000160">
<format style="TextCardInfoSmall" textsize="1" />      <frame posn="'.$buttonmainposition.'">

   <frame posn="0 0 0">      <quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008545" /><quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008543" />               </frame>   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
$xml = '<manialink id="0815470000160">

      <format style="TextCardInfoSmall" textsize="1" />

      <frame posn="'.$buttonmainposition.'">

         
//alarm****************************************************************

<quad posn="100 -12.8 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />

      <label posn="100 -12.6 1" sizen="8 2" halign="center" valign="center" text="$i$s$f00Send help" action="27008545"/>


      </frame>

   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

//help off**************************************************************
function nouseButtonHandleClick51($aseco, $command) {
       $playerid = $command[0];   $login = $command[1];   $action = $command[2].'';     if ($action == '27008543'){

 	
   $xml = '<manialink id="0815470000160">
<format style="TextCardInfoSmall" textsize="1" />      <frame posn="'.$buttonmainposition.'">

   <frame posn="0 0 0"><quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008545" />
<quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008543" />
         </frame>   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPageToLogin', array($login, $aseco->formatColors($xml), 0, false));
$xml = '<manialink id="0815470000160">

      <format style="TextCardInfoSmall" textsize="1" />

      <frame posn="'.$buttonmainposition.'">

         
//alarm****************************************************************

<quad posn="110 -12.8 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />

      <label posn="110 -12.6 1" sizen="8 2" halign="center" valign="center" text="$i$s$f00Send help" action="27008545"/>


      </frame>

   </manialink>';
$aseco->client->addCall('SendDisplayManialinkPageToLogin', array($login, $aseco->formatColors($xml), 0, false));
}}
	?>
Last edited by jouko100 on 15 Jul 2010 03:55, edited 4 times in total.

User avatar
Knutselmaaster
swift roadking
swift roadking
Posts: 692
Joined: 16 Feb 2007 01:40
Owned TM-games: TMO/TMN/TMNF/TMU
Manialink(s): intr
Location: Between DisneyLand and Paris
Contact:

Re: Send email to admin 1.0

Post by Knutselmaaster » 20 Mar 2010 09:07

Very cool plugin!
I'm gonna check if i can get this working on my servers.

Amisxp
road tourist
road tourist
Posts: 81
Joined: 26 Dec 2008 10:28
Owned TM-games: TMUF
Location: Slovenia, Maribor

Re: Send email to admin 1.0

Post by Amisxp » 21 Mar 2010 15:07

plugin works great on my server :d

great job +1 :3
Last edited by Amisxp on 22 Mar 2010 20:52, edited 1 time in total.

Greco
happy cruiser
happy cruiser
Posts: 144
Joined: 13 May 2009 18:40
Owned TM-games: TMN

Re: Send email to admin 1.0

Post by Greco » 22 Mar 2010 08:40

cool plugin :pil

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Re: Send email to admin 1.01

Post by jouko100 » 15 Jul 2010 03:56

version 1.01 fixed minor bugs works with userpanel

Post Reply