Die Funktionen in der Einbauanleitung /ms können abweichen, falls ihr nicht die Landschaftsemotes von Eliwood (normal /X bei mir /em) eingebaut habt, oder auch die Vordefinierten Farben von Chaosmaker (Profileinstellung) nutzt.
Die Funktion /ms ist eigentlich hauptsächlich "geeignet" für Rollenspielserver, und entstanden aus einem Userwunsch. Das beginnen eines Kommentars mit /ms text fügt am Ende des Nicks ein s (in Nickfarbe natürlich) an, ist ein s der letzte Buchstabe des Namens, ein ' . Ausserdem setzt es den Kommentar anschliessend in der im Profil eingestellten Emotefarbe fort.
Beispiel: /ms Umhang weht
Anzeige: Göttin Rikkardas Umhang weht
Beispiel2: /ms Umhang weht
Anzeige: Feuerspucker Sandros' Umhang weht
so nun mal zum Einbau
common.php
beachtet bitte, /em mit dem Kürzel zu ersetzen, welches IHR für die Landschaftsemotes von Eliwood nutzt
suche: $this->bbcode_second_pass_code('', 'if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
substr($commentary,0,3)!="/em" &&
$session['user']['drunkenness']>0) {')
ersetze mit:
$this->bbcode_second_pass_code('', 'if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
substr($commentary,0,3)!="/ms" &&
substr($commentary,0,3)!="/em" &&
$session['user']['drunkenness']>0) {')
suche:
$this->bbcode_second_pass_code('', '//begin colorhack by chaosmaker 1 of 1//
if (substr($commentary,0,1)==':' || substr($commentary,0,3)=='/me') {
if (substr($commentary,0,3)=='/me') $strpos = 3;
elseif (substr($commentary,0,2)=='::') $strpos = 2;
else $strpos = 1;
if ($session['user']['prefs']['commentemotecolor']) $commentary = substr($commentary,0,$strpos).$session['user']['prefs']['commentemotecolor'].substr($commentary,$strpos);
}
else {
if ($session['user']['prefs']['commenttalkcolor']) $commentary = $session['user']['prefs']['commenttalkcolor'].$commentary;
}
//end colorhack by chaosmaker 1 of 1//')
ersetze mit:
$this->bbcode_second_pass_code('', '//begin colorhack by chaosmaker 1 of 1//
if (substr($commentary,0,1)==':' || substr($commentary,0,3)=='/me'||substr($commentary,0,3)=='/ms') {
if (substr($commentary,0,3)=='/me') $strpos = 3;
elseif (substr($commentary,0,3)=='/ms') $strpos = 3;
elseif (substr($commentary,0,2)=='::') $strpos = 2;
else $strpos = 1;
if ($session['user']['prefs']['commentemotecolor']) $commentary = substr($commentary,0,$strpos).$session['user']['prefs']['commentemotecolor'].substr($commentary,$strpos);
}
else {
if ($session['user']['prefs']['commenttalkcolor']) $commentary = $session['user']['prefs']['commenttalkcolor'].$commentary;
}
//end colorhack by chaosmaker 1 of 1//')
suche:
$this->bbcode_second_pass_code('', 'if ($talkline!="sagt" // do an emote if the area has a custom talkline and the user isn't trying to emote already.
&& substr($commentary,0,1)!=":"
&& substr($commentary,0,2)!="::"
&& substr($commentary,0,3)!="/em"
&& substr($commentary,0,3)!="/me")
$commentary = ":`3$talkline: \\\"`#$commentary`3\\\"";')
ersetze mit:
$this->bbcode_second_pass_code('', 'if ($talkline!="sagt" // do an emote if the area has a custom talkline and the user isn't trying to emote already.
&& substr($commentary,0,1)!=":"
&& substr($commentary,0,2)!="::"
&& substr($commentary,0,3)!="/em"
&& substr($commentary,0,3)!="/ms"
&& substr($commentary,0,3)!="/me")
$commentary = ":`3$talkline: \\\"`#$commentary`3\\\"";')
suche:
$this->bbcode_second_pass_code('', 'Landschafts-Emote by Eliwood
*/
if ($ft=="/em")
{
$x = strpos($row[comment],$ft);
if ($x!==false)
{
if ($linkbios)
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
else
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
}
}
/*Landschaft-Emote Ende*/')
füge danach ein:
dieser Part muss angepasst werden, mit Euren Bedürfnissen. Das ist eigentlich relativ einfach. Kopiert aus eurer viewcommentary, den Teil ab:
$this->bbcode_second_pass_code('', ' if ($x!==false){
if ($linkbios)
.
.
.
}
}
')
unter der /me funktion raus, welche so beginnt:
$this->bbcode_second_pass_code('', 'elseif ($ft=="::" || $ft=="/me" || $ft==":"){
$x = strpos($row[comment],$ft);')
und ersetzt meinen Teil damit, da ich es auch inkl. Gilden etc habe
$this->bbcode_second_pass_code('', '*beginn ms-rp Emote by Rikkarda@silienta-logd.de for www.silienta-logd.de*/
elseif ($ft=="/ms"){
$name = str_replace("`0","",$row['name']);
$namestrlen = strlen($name);
$lastchar = $name{$namestrlen-1};
$name = $name.($lastchar == "s" || $lastchar == "x"?"'`0":"s`0");
$x = strpos($row[comment],$ft);
if ($x!==false){
if ($linkbios)
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
.$guildpre
."`0<a href='$link' style='text-decoration: none' >\n<span onMouseOver=\"return escape('".HTMLEntities($string)."')\">`&$name`0</span></a>\n`& "
.$guildsuf
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
else
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
.$guildpre
."`0\n<span onMouseOver=\"return escape('".HTMLEntities($string)."')\">`&$name`0</span>\n`& "
.$guildsuf
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
}
}
/*rp-ms Emote-End*/')
so das wars
2. ist eine Funktion, damit sich die Charaktere beim Anmelden, selbst wenn sie mit a beginnen gleich als A darstellen *schmunzel* es ist einfach schöner, wenn ein Char zb. Abraham und nicht abraham heisst
der login funktioniert aber natürlich weiterhin auch mit abraham. Nur wird der Charakter eben automatisch zu Abraham
so dann mal los:
common.php
füge an beliebiger Stelle zwischen den Functionen ein:
$this->bbcode_second_pass_code('', '
//Rikkarda@silienta-logd.de für Silienta, damit der erste Buchstabe immer gross wird
//gefunden im php handbuch *fg* umgeschrieben auf die create.php
function FormatName($shortname=NULL) {
/* Formats a first or last name, and returns the formatted
version */
if (empty($shortname))
return false;
// Initially set the string to lower, to work on it
$shortname = strtolower($shortname);
// Run through and uppercase any multi-barrelled names
$names_array = explode('-',$shortname);
for ($i = 0; $i < count($names_array); $i++) {
// "McDonald", "O'Conner"..
if (strncmp($names_array[$i],'mc',2) == 0 || ereg('^[oO]\'[a-zA-Z]',$names_array[$i])) {
$names_array[$i][2] = strtoupper($names_array[$i][2]);
}
// Always set the first letter to uppercase, no matter what
$names_array[$i] = ucfirst($names_array[$i]);
}
// Piece the names back together
$shortname = implode('-',$names_array);
// Return upper-casing on all missed (but required) elements of the $name var
return ucwords($shortname);
}
//end by Rikkarda for www.silienta-logd.de')
öffne create.php
suche:
$this->bbcode_second_pass_code('', '$sql = "INSERT INTO accounts
(name,
title,
password,
sex,
login,
laston,
uniqueid,
lastip,
superuser,
gold,
emailaddress,
emailvalidation,
referer
) VALUES (
'$title $shortname',
'$title',
'$HTTP_POST_VARS[pass1]',
'$HTTP_POST_VARS[sex]',
'$shortname',
'".date("Y-m-d H:i:s",strtotime("-1 day"))."',
'$_COOKIE[lgi]',
'".$_SERVER['REMOTE_ADDR']."',
".getsetting("superuser",0).",
".getsetting("newplayerstartgold",50).",
'$_POST[email]',
'$emailverification',
'$referer'
)";
db_query($sql) or die(db_error(LINK));
if (db_affected_rows(LINK)<=0){
output("`\$Fehler`^: Dein Account konnte aus unbekannten Gründen nicht erstellt werden. Versuchs bitte einfach nochmal. ");')
füge DAVOR ein:
$this->bbcode_second_pass_code('', '$shortname=FormatName($shortname);')
also in silienta läuft beides Einwandfrei und ich hoffe auch hier gibt es welche, die das nutzen können
lg Rikka