News - Features - Downloads - Forum - Team - Support - Switch View: Screen
Login - Registrierung - Passwort vergessen
Codepaste - Details
Weitere Infos zum Codepaste

Name TMX BB Code
Autor fam sakrified
CMS-Version ClanSphere 2008
Datei system/cor/abcode.php
Datum 23.04.2009 um 02:52 Uhr
Beschreibung Get a link and all information about a trackmania track by using the new BB-Code
[tmn]205939[/tmn]
[tmnf]1071051[/tmnf]
[tmu]1212811[/tmu]

You can change all information from $linkalias. Standard: Trackname by Author (ID)
$tmxinfo[1] = trackname
$tmxinfo[3] = author
$tmxinfo[4] = type (Race...)
$tmxinfo[5] = enviroment
$tmxinfo[6] = mood (Sunset...)
$tmxinfo[7] = style (Offroad...)
$tmxinfo[8] = routes (Single...)
$tmxinfo[9] = lenght
$tmxinfo[10] = difficulty
$tmxinfo[11] = LB-Rating
$tmxinfo[12] = awards
$tmxinfo[13] = comments
Alter Code Alter Code +-
 
1.
1. / 2. / ... 
 ---
Neuer Code Neuer Code +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
1. / 2. / ... 
 add to abcode.php:

Dropdown Menu (optional)
add into function cs_abcode_features...

$trackmania "javascript:abc_insert('[' + this.form.tm";
$trackmania .= $name ".options[this.form.tm" $name ".selectedIndex].value + ']";
$trackmania .= "','[/' + this.form.tm";
$trackmania .= $name ".options[this.form.tm" $name ".selectedIndex].value + ']','" $name "');this.selectedIndex=0";
$var .= cs_html_select(1,'tm' $name,"onchange=\"" $trackmania "\"");
$var .= cs_html_option('TMX','');
$var .= cs_html_option('Nations Forever','tmnf');
$var .= cs_html_option('United','tmu');
$var .= cs_html_option('Nations','tmn');
$var .= cs_html_select(0);

----------------------------------------------------------------------
add three new functions to abcode.php

function cs_abcode_tmnf($matches) {
    
        
$check file_get_contents("http://tmnforever.tm-exchange.com/apiget.aspx?action=apisearch&trackid=".$matches[1]);
        if (
$check != "") {
        
$tmxinfo explode("\t"$check);
        
$linkalias $tmxinfo[1].' by '.$tmxinfo[3].' (Nations Forever '.$matches[1].')';
        
$blub 'http://tmnforever.tm-exchange.com/main.aspx?action=trackshow&id='.$matches[1].'#auto';
        return 
cs_html_link($blub,$linkalias);
        }
        else {
        
$fail 'No track found with ID '.$matches[1].' @ tmnforever.tm-exchange.com';
        return 
$fail;        
        }
    
}

function 
cs_abcode_tmu($matches) {
    
        
$check file_get_contents("http://united.tm-exchange.com/apiget.aspx?action=apisearch&trackid=".$matches[1]);
        if (
$check != "") {
        
$tmxinfo explode("\t"$check);
        
$linkalias $tmxinfo[1].' by '.$tmxinfo[3].' (United '.$matches[1].')';
        
$blub 'http://united.tm-exchange.com/main.aspx?action=trackshow&id='.$matches[1].'#auto';
        return 
cs_html_link($blub,$linkalias);
        }
        else {
            
$fail 'No track found with ID '.$matches[1].' @ united.tm-exchange.com';
            return 
$fail;
        }
    
}

function 
cs_abcode_tmn($matches) {
    
        
$check file_get_contents("http://nations.tm-exchange.com/apiget.aspx?action=apisearch&trackid=".$matches[1]);
        if (
$check != "") {
        
$tmxinfo explode("\t"$check);
        
$linkalias $tmxinfo[1].' by '.$tmxinfo[3].' (Nations '.$matches[1].')';
        
$blub 'http://nations.tm-exchange.com/main.aspx?action=trackshow&id='.$matches[1].'#auto';
        return 
cs_html_link($blub,$linkalias);
        }
        else {
            
$fail 'No track found with ID '.$matches[1].' @ nations.tm-exchange.com';
            return 
$fail;
        }
    
}

----------------------------------------------------------------------
add into function cs_secure after "if (!empty($phpeval))"

$replace preg_replace_callback("=\[tmnf\](.*?)\[/tmnf\]=si","cs_abcode_tmnf",$replace);
$replace preg_replace_callback("=\[tmu\](.*?)\[/tmu\]=si","cs_abcode_tmu",$replace);
$replace preg_replace_callback("=\[tmn\](.*?)\[/tmn\]=si","cs_abcode_tmn",$replace);
Zurück - Übersicht


Bitte Login benutzen, um Kommentare zu schreiben.


ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo