anpera.net
https://anpera.dyndns.org/phpbb3/

Standardfarben?
https://anpera.dyndns.org/phpbb3/viewtopic.php?f=34&t=2470
Seite 1 von 1

Autor:  Setsna [ Mo 17 Apr, 2006 14:11 ]
Betreff des Beitrags:  Standardfarben?

Guten Morgen,
Ich arbeite an einer kleinen Idee ...
Ich habe in den Prefs ein zusätzliches Feld eingefügt, dass mir in der Accounts.db das feld "farbe" belegt, und zwar mit einem Wert bestehend aus zwei zeichen (eben `6 oder sonstiges)
Nun möchte ich allerdings einfügen, dass diese eben auch berücksichtigt werden, allerdings schaffe ich es nicht dieses wirklich zu implementieren >_<

Hier ist noch meine "Addcommentary" - für hilfe wäre ich sehr dankbar

$this->bbcode_second_pass_code('', '


function addcommentary() {
global $HTTP_POST_VARS,$session,$REQUEST_URI,$HTTP_GET_VARS,$doublepost;
$doublepost=0;

$section=$HTTP_POST_VARS['section'];
$talkline=$HTTP_POST_VARS['talkline'];
if ($HTTP_POST_VARS[insertcommentary][$section]!==NULL &&
trim($HTTP_POST_VARS[insertcommentary][$section])!="") {
$commentary = str_replace("`n","",soap($HTTP_POST_VARS[insertcommentary][$section]));
$y = strlen($commentary);
for ($x=0;$x<$y;$x++){
if (substr($commentary,$x,1)=="`"){
$colorcount++;
if ($colorcount>=getsetting("maxcolors",10)){
$commentary = substr($commentary,0,$x).preg_replace("'[`].'","",substr($commentary,$x));
$x=$y;
}
$x++;
}
}
if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
$session['user']['drunkenness']>0) {
//drunk people shouldn't talk very straight.
$straight = $commentary;
$replacements=0;
while ($replacements/strlen($straight) < ($session['user']['drunkenness'])/500 ){
$slurs = array("a"=>"aa","e"=>"ee","f"=>"ff","h"=>"hh","i"=>"ij","l"=>"ll","m"=>"mm","n"=>"nn","o"=>"oo","r"=>"rr","s"=>"sh","u"=>"uu","v"=>"vv","w"=>"ww","y"=>"yy","z"=>"zz");
if (e_rand(0,9)) {
srand(e_rand());
$letter = array_rand($slurs);
$x = strpos(strtolower($commentary),$letter);
if ($x!==false &&
substr($comentary,$x,5)!="*hic*" &&
substr($commentary,max($x-1,0),5)!="*hic*" &&
substr($commentary,max($x-2,0),5)!="*hic*" &&
substr($commentary,max($x-3,0),5)!="*hic*" &&
substr($commentary,max($x-4,0),5)!="*hic*"
){
if (substr($commentary,$x,1)<>strtolower($letter)) $slurs[$letter] = strtoupper($slurs[$letter]); else $slurs[$letter] = strtolower($slurs[$letter]);
$commentary = substr($commentary,0,$x).$slurs[$letter].substr($commentary,$x+1);
$replacements++;
}
}else{
$x = e_rand(0,strlen($commentary));
if (substr($commentary,$x,5)=="*hic*") {$x+=5; } //output("moved 5 to $x ");
if (substr($commentary,max($x-1,0),5)=="*hic*") {$x+=4; } //output("moved 4 to $x ");
if (substr($commentary,max($x-2,0),5)=="*hic*") {$x+=3; } //output("moved 3 to $x ");
if (substr($commentary,max($x-3,0),5)=="*hic*") {$x+=2; } //output("moved 2 to $x ");
if (substr($commentary,max($x-4,0),5)=="*hic*") {$x+=1; } //output("moved 1 to $x ");
$commentary = substr($commentary,0,$x)."*hic*".substr($commentary,$x);
//output($commentary."`n");
$replacements++;
}//end if
}//end while
//output("$replacements replacements (".($replacements/strlen($straight)).")`n");
while (strpos($commentary,"*hic**hic*"))
$commentary = str_replace("*hic**hic*","*hic*hic*",$commentary);
}//end if
$commentary = preg_replace("'([^[:space:]]{45,45})([^[:space:]])'","\\1 \\2",$commentary);
if ($session['user']['drunkenness']>50) $talkline = "lallt";
$talkline = translate($talkline);

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)!="/me")

$commentary = $farbe + ":`3$talkline: \\\"`#$commentary`3\\\"";
$sql = "SELECT commentary.comment,commentary.author FROM commentary WHERE section='$section' ORDER BY commentid DESC LIMIT 1";
$result = db_query($sql) or die(db_error(LINK));
$row = db_fetch_assoc($result);
db_free_result($result);
if ($row[comment]!=stripslashes($commentary) || $row[author]!=$session[user][acctid]){
// if ($row[comment]!=$commentary || $row[author]!=$session[user][acctid]){
$sql = "INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'$section',".$session[user][acctid].",\"$commentary\")";
db_query($sql) or die(db_error(LINK));
return true;
} else {
$doublepost = 1;
}
}
return false;
}

')

Autor:  Harthas [ Mo 17 Apr, 2006 14:16 ]
Betreff des Beitrags: 

meinst du soetwas hier

http://anpera.homeip.net/forum/viewtopic.php?highlight=standartfarben&t=802

Wenn ich es richtig verstanden habe gibt es das nähmlöich schon^^

Autor:  Setsna [ Mo 17 Apr, 2006 14:44 ]
Betreff des Beitrags: 

Ja genau ^^

Ich bin nur kein Fan von abschreiben *nuschel*
Aber das hat mir geholfen eine funktionierende lösung zu finden,

Domo Arigato

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/