Anleitung genau gelesen ? Noe.
Du musst function addcommentary und viecommentary auskommen tieren oder aber auch loeschen
[php]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" &&
substr($commentary,0,2)!="/X" &&
$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,2)!="/X"
&& substr($commentary,0,3)!="/me")
$commentary = ":`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));
if ($session[user][beta]==1) $session[user][donation]+=1; //RPG-Chars Addon (c) 2006 by Meralou & Alexiel
return true;
} else {
$doublepost = 1;
}
}
return false;
}
function viewcommentary($section,$message="Kommentar hinzufügen?",$limit=10,$talkline="sagt") {
global $HTTP_POST_VARS,$session,$REQUEST_URI,$HTTP_GET_VARS, $doublepost,$appoencode_str;
if($section!="' or '1'='1") $session['user']['chatpos'] = $section; //Extended chatposition, Hadriel [BErpL]
$nobios = array("motd.php"=>true);
if ($nobios[basename($_SERVER['SCRIPT_NAME'])]) $linkbios=false; else $linkbios=true;
//output("`b".basename($_SERVER['SCRIPT_NAME'])."`b`n");
if ($doublepost) output("`\$`bDoppelpost?`b`0`n");
//Extended chatposition, Hadriel [BErpL]
if($section!="' or '1'='1") {
$selq = "SELECT name,login FROM accounts WHERE chatpos = '".$section."' AND acctid!='".$session[user][acctid]."' AND loggedin='1' AND invisible=0 AND laston>'".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds"))."';";
$resq = mysql_query($selq);
if(mysql_num_rows($resq)>0){
$comma = '';
$oup = 'Hier '.(mysql_num_rows($resq)==1?'ist':'sind').':`n';
while($rokon = mysql_fetch_assoc($resq)){
$link = "bio.php?char=".rawurlencode($rokon[login]) . "&ret=".URLEncode($_SERVER['REQUEST_URI']);
$oup .= $comma.'`0<a href="mail.php?op=write&to='.$rokon[login].'" target="_blank" onclick="window.open(\'mail.php?op=write&to='.$rokon[login].'\',\'mailphpopwriteto'.$rokon[login].'\',\'scrollbars=yes,resizable=yes,width=550,height=320\');return false;">`0<img src="images/newscroll.GIF" alt="Mail schreiben" border="0" height="16" width="16"></a>`0<a href="'.$link.'">`#'.$rokon['name'].'`0</a>`0' ;
$comma = ', ';
addnav("",$link);
}
}else{
$oup = "Schreibe Niemanden an, der nicht wirklich hier ist!";
}
output("`n".$oup."`n",true);
}
//Extended chatposition, Hadriel [BErpL]
$message = translate($message);
$com=(int)$HTTP_GET_VARS[comscroll];
$sql = "SELECT commentary.*,
accounts.name,
accounts.login,
accounts.prefs,
accounts.loggedin,
accounts.location,
accounts.laston,
accounts.memberid,
accounts.acctid,
gilden.gildenprefix,
gilden.gildenid,
gilden.leaderid
FROM commentary
INNER JOIN accounts
ON accounts.acctid = commentary.author
LEFT JOIN gilden
ON gilden.leaderid = accounts.acctid OR gilden.gildenid = accounts.memberid
WHERE section = '$section'
AND accounts.locked=0
ORDER BY commentid DESC
LIMIT ".($com*$limit).",$limit";
$result = db_query($sql) or die(db_error(LINK));
$counttoday=0;
for ($i=0;$i < db_num_rows($result);$i++){
$row = db_fetch_assoc($result);
$row[comment]=preg_replace("'[`][^".$appoencode_str."`]'","",$row[comment]);
$commentids[$i] = $row[commentid];
/* limit posts
if (date("Y-m-d",strtotime($row[postdate]))==date("Y-m-d")){
// if ($row[name]==$session[user][name] && substr($section,0,5)!="house") $counttoday++;
}
*/
$x=0;
$ft="";
$timest="";
if ($session['user']['prefs']['timestamps']) $timest="`0[".date("H:i",strtotime($row['postdate']))."] ";
for ($x=0;strlen($ft)<3 && $x<strlen($row[comment]);$x++){
if (substr($row[comment],$x,1)=="`" && strlen($ft)==0) {
$x++;
}else{
$ft.=substr($row[comment],$x,1);
}
}
$link = "bio.php?char=".rawurlencode($row[login]) . "&ret=".URLEncode($_SERVER['REQUEST_URI']);
$link2 = "`2[`0<a href='showdetail.php?id=".$row['gildenid']."' target='window_popup' onClick=\"".popup("showdetail.php?id=".$row['gildenid'])."; return false;\">`&".stripslashes($row[gildenprefix])."`&</a>`2]";
if (substr($ft,0,2)=="::") $ft = substr($ft,0,2);
else
if (substr($ft,0,2)=="/X") $ft = substr($ft,0,2);
else
if (substr($ft,0,1)==":") $ft = substr($ft,0,1);
/*
Landschafts-Emote by Eliwood
*/
if ($ft=="/X")
{
$x = strpos($row[comment],$ft);
if ($x!==false)
{
if ($linkbios)
$op[$i] = $timest.str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
else
$op[$i] = $timest.str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
}
}
/*Landschaft-Emote Ende*/ elseif ($ft=="::" || $ft=="/me" || $ft==":") {
$x = strpos($row[comment],$ft);
if ($x!==false){
if ($linkbios)
$op[$i] = $timest.str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0".$link2."`0<a href='$link' style='text-decoration: none'>\n`&$row[name]`0</a>\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`&$row[name]`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
}
}
if ($op[$i]=="")
if ($linkbios)
$op[$i] = "$timest.`0".$link2."`0<a href='$link' style='text-decoration: none'>`&$row[name]`0</a>`3 sagt: \"`#"
.str_replace("&","&",HTMLEntities($row[comment]))."`3\"`0`n";
else
$op[$i] = $timest."`0`&$row[name]`0`3 sagt: \"`#"
.str_replace("&","&",HTMLEntities($row[comment]))."`3\"`0`n";
if ($message=="X") $op[$i]="`0($row[section]) ".$op[$i];
$loggedin=(date("U") - strtotime($row[laston]) < getsetting("LOGINTIMEOUT",900) && $row[loggedin] && $row[location]==0);
if ($row['postdate']>=$session['user']['recentcomments']) $op[$i]=($loggedin?"<img src='images/new-online.gif' alt='>' width='3' height='5' align='absmiddle'> ":"<img src='images/new.gif' alt='>' width='3' height='5' align='absmiddle'> ").$op[$i];
addnav("",$link);
}
$i--;
$outputcomments=array();
$sect="x";
for (;$i>=0;$i--){
$out="";
if ($session['user']['superuser']>=2 || ($session['user']['superuser']>=2 && $message=="X")){
$out.="`0[ <a href='superuser.php?op=commentdelete&commentid=$commentids[$i]&return=".URLEncode($_SERVER['REQUEST_URI'])."'>`4X`0</a> ] ";
addnav("","superuser.php?op=commentdelete&commentid=$commentids[$i]&return=".URLEncode($_SERVER['REQUEST_URI']));
if($message=="X")
{
$matches=array();
preg_match("/[(][^)]*[)]/",$op[$i],$matches);
$sect=$matches[0];
}
}
//output($op[$i],true);
$out.=$op[$i];
if (!is_array($outputcomments[$sect])) $outputcomments[$sect]=array();
array_push($outputcomments[$sect],$out);
}
ksort($outputcomments);
reset($outputcomments);
while (list($sec,$v)=each($outputcomments)){
if ($sec!="x") output("`n`b$sec`b`n");
output(implode('',$v),true);
}
if ($session[user][loggedin]) {
//if ($counttoday<($limit/2) || $session['user']['superuser']>=2){
if ($message!="X"){
if ($talkline!="says") $tll = strlen($talkline)+11; else $tll=0;
output("<form action=\"$REQUEST_URI\" method='POST'>`@$message`n<input name='insertcommentary[$section]' size='60' maxlength='".(5000-$tll)."' onkeyup=\"document.getElementById('chatpreview').innerHTML = appoencode(this.value);\"><input type='hidden' name='talkline' value='$talkline'><input type='hidden' name='section' value='$section'><input type='submit' class='button' value='Hinzufügen'><span id='chatpreview'></span>`n".(round($limit/2,0)-$counttoday<3?"`)(Du hast noch ".(round($limit/2,0)-$counttoday)." Beiträge für heute übrig)":"")."`0`n</form>",true);
addnav("",$REQUEST_URI);
}
// }else{
// output("`@$message`nSorry, du hast deine Beiträge in dieser Region für heute aufgebraucht.`0`n");
// }
}
if (db_num_rows($result)>=$limit){
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]-])*'","",$REQUEST_URI)."&comscroll=".($com+1);
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com+1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output("<a href=\"$req\"><< Vorherige</a>",true);
addnav("",$req);
}
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]]|-)*'","",$REQUEST_URI)."&comscroll=0";
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com-1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output(" <a href=\"$req\">Aktualisieren</a> ",true);
addnav("",$req);
if ($com>0){
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]]|-)*'","",$REQUEST_URI)."&comscroll=".($com-1);
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com-1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output(" <a href=\"$req\">Nächste >></a>",true);
addnav("",$req);
}
$dellink="chat_delete.php?return=".$REQUEST_URI."§ion=".$section;
output(" <a href=\"$dellink\" style=\"color: red;\">Letzten Post löschen</a>",true);
addnav("",$dellink);
db_free_result($result);
}
[/php]
WEG!
Und ganz unten in der common ueber dem
[php]?>[/php]
musst du noch folgendes einbauen :
[php]Include 'lib/commentary.php';[/php]
Mfg
_________________ Never change a running system. Bullshit!
|