ER-Sourceviewer 2007 v2.0

Alle Dateien, die hier eingesehen werden können, sind unter der GNU GPL lizenziert. Wenn du etwas darin findest, das du gerne hättest, so schreibe mir doch bitte eine Anfrage damit ich, wenn ich es rausgeben will, alle Änderungen raussuchen könnte. Denn ich übernehme keine Verantwortung, solltest du was rausnehmen und es geht nicht. Und Support deswegen geb ich schon gar nicht.

Solltest du eine Schwachstelle im Code finden, sei es eine kritische Lücke oder eine Möglichkeit zu cheaten, dann bitte ich dich, mir das mitzuteilen. Solltest du beim cheaten erwischt werden, werde ich deinen Account eigenhändig löschen & bannen; Solltest du meinen Server angreifen, so werde ich meine Rechtsschutzversicherung kontaktieren.

Zur Source springen

Verzeichnisse:


Source anzeigen

Nach Oben


<?php



/*eigenständiger Teil eines Spielertagebuches deren Idee auf dem Original von :kelko:   
/********************************************************************
*                                                                   *
*    developed by:                                                  *
*                 :kelko:                                           *
*                 kelko < at > anakrino <.> de                      *
*                 http://kelko.anakrino.de                          *
*                                                                   *
*                                                                   *
*********************************************************************
                               
                 Vielen Dank dafür
                 
umgeschrieben als eigeneständiges Script und modifiziert und angepasst für Silienta von:

Contact:
Rikkarda@silienta-logd.de
www.silienta-logd.de
anperanick: Rikkarda
icq: 212 076 731
Entwicklerforum : http://www.dai-clan.de/SiliForum/wbb2/index.php

Download des Pakets im Forum oder unter www.anpera.net inkl Einbauanleitung möglich


*/
/*
    Angepasst von Fynn Fish für Broskova

*/

/**
 * Allow these tags in Silienta sind bestimmte html codes zum einfügen von Bildern und Absätze per Entertaste erlaubt
 */
$allowedTags='<br><b><h1><h2><h3><h4><i><hr>' .
             
'<img><li><ol><p><strong><table>' .
             
'<tr><td><th><u><ul><div><span><center><p><img>';

/**
 * Disallow these attributes/prefix within a tag (Sicherheitsfix um ausführbare Javascripte zu unterbinden)
 */
$stripAttrib 'javascript&#058;|onclick|ondblclick|onmousedown|onmouseup|onmouseover|'.
'onmousemove|onmouseout|onkeypress|onkeydown|onkeyup|onabort|'.
'onfocus|onload|onblur|onchange|onerror|onreset|onselect|obsubmit|onunload|style';

/**
 * @return string
 * @param string
 * @desc Strip forbidden tags and delegate tag-source check to removeEvilAttributes()
 */
function removeEvilTags($source,$iframe_allowed)
{
   global 
$allowedTags;
   if(
$iframe_allowed == 1$allowedTags.= "<iframe>";
   
$source strip_tags($source$allowedTags);

   return 
preg_replace('/<(.*?)>/ie'"'<'.removeEvilAttributes('\\1').'>'"$source$allowedTags);
}

/**
 * @return string
 * @param string
 * @desc Strip forbidden attributes from a tag
 */
function removeEvilAttributes($tagSource)
{
   global 
$stripAttrib;
   return 
stripslashes(preg_replace("/$stripAttrib/i"'forbidden'$tagSource));
}


require_once 
"common.php";
checkday();
$session['user']['ort']="Tagebuch";

$result db_query("SELECT * FROM accounts WHERE login='$_GET[char]'");
$row db_fetch_assoc($result);

$result1 db_query("SELECT * FROM bio WHERE acctid='$row[acctid]'");
$row1 db_fetch_assoc($result1);

    
$sqlr "SELECT name,raceid FROM race WHERE raceid='{$row['race']}'";
    
$resultr db_query($sqlr);
    
$race db_fetch_assoc($resultr);
    if (
$row['race']!=$race['raceid']) $nrace 'Unbekannt'; else $nrace $race['name'];

//some 'shortcuts' wir sind faul in Silienta ^^
$row['login'] = rawurlencode($row['login']);
$id $row['acctid'];
$owner $row['name'];
$char rawurlencode($_GET['char']);

//check whether i look at my own profile
if ($row['login']==rawurlencode($session['user']['login'])) $myProf true; else $myProf false;



if (
$_GET[ret]==""){
    
addnav("Zur Liste der Krieger","list.php");
        
}else{
    
$return preg_replace("'[&?]c=[[ igit:]-]+'","",$_GET[ret]);
    
$return substr($return,strrpos($return,"/")+1);
    
addnav("Zurück",$return);
}

page_header("Tagebuch & Biografie: ".preg_replace("'[`].'","",$row['name']));

if(
$_GET['op']==""||$_GET['op']=="long")
{
  
$specialty=array(
0=>"`7nicht spezifiziert",
"`\$Dunkle Künste",
"`%Mystische Kräfte",
"`^Diebeskunst",
"`!Blaue Magie",
"`4Rote Magie",
"`;Schwarze Magie",
"`TDunkle Stabmagie",
"`gHeilige Stabmagie",
"`@Elementare Stabmagie",
"`=Feuerkünste",
"`#Eismagie",
"`wNaturkräfte",
"`&Heilungskräfte",
"`dVerderbenszauber",
"`qChaoskünste");

$gesinnung=array(1=>"Chaotisch Gut"2=>"Rechtschaffen Gut"3=>"Neutral"4=>"Rechtschaffen Böse"5=>"Chaotisch Böse"6=>"Chaotisch Neutral"0=>"`)Unbekannt");

$jobid=array(
1=>"Schmied",
31=>"Freudenmädchen",
32=>"Totengräber",
2=>"Pfleger",
3=>"Hebamme",
4=>"Schankknecht",
5=>"Schankmaid",
6=>"Radmacher",
7=>"Florist",
8=>"Floristin",
9=>"Krämer",
10=>"Kerzenzieher",
11=>"Gaukler",
12=>"Barde",
13=>"Redner",
14=>"Wirt",
15=>"Bote",
16=>"Kunstschmied",
17=>"Heiler",
18=>"Gärtner",
19=>"Lehrer",
20=>"Zahnreisser",
21=>"Tänzer",
22=>"Geschichtenerzähler",
23=>"Schreiber",
24=>"Buchbinder",
25=>"Rechtsgelehrter",
26=>"Philosoph",
27=>"Schauspieler",
28=>"Richter",
29=>"Kartograph",
30=>"Ausbilder",
0=>"`7Arbeitslos");

output("`^Tagebuch für $row[name] ");
if (
$session[user][loggedin]) output("<a href=\"mail.php?op=write&to=$row[login]\" target=\"_blank\" onClick=\"".popup("mail.php?op=write&to=$row[login]").";return false;\"><img src='images/newscroll.GIF' width='16' height='16' alt='Mail schreiben' border='0'></a>",true);


if (
getsetting("avatare",0)==1){
    if (
$row1[avatar]){
        
$pic_size = @getimagesize($row1[avatar]);
        
$pic_width $pic_size[0];
        
$pic_height $pic_size[1];
        
output("`c<table><tr><td valign='top'>`n`n<img src=\"$row1[avatar]\" ",true);
        if (
$pic_width 300output("width=\"300\" ",true );
        if (
$pic_height 300output("height=\"300\" ",true );
        
output("alt=\"".preg_replace("'[`].'","",$row[name])."\">",true);
    } else {
        
output("`c<table><tr><td>(kein Bild)",true);
    }
}
output("`n</td></tr></table>`c`n`n",true);

output("`n`c<table>`n`n",true);
output("<tr><td>`^Titel:</td><td>`@".$row['title']."</td><td>`^Level:</td><td>`@".$row['level']."</td></tr>",true);
output("<tr><td>`^Tage seit Ankunft:</td><td>`@".$row['age']." Tage</td><td>`^Wiedererweckt:</td><td>`@".$row['resurrections']."x</td></tr>",true);
output("<tr><td>`^Rasse:</td><td>`@".$nrace."</td><td>`^Geschlecht:</td><td>`@".($row['sex']?"`tWeiblich":"`#Männlich")."</td></tr>",true);
output("<tr><td>`^Spezialgebiet:</td><td>`@".$specialty[$row['specialty']]."</td><td> `^Bester Angriff:</td><td>`@".$row[punch]."</td></tr>",true);
output("<tr><td>`^Getötete Drachen:</td><td>`@".$row['dragonkills']."</td><td>`^Arbeit:</td><td> `@".$jobid[$row[jobid]]."</td></tr>",true);
output("<tr><td>`^Ansehen:&nbsp;</td><td>`@".grafbar(100,($row['reputation']+50),100,12)."</td><td>`^Eigentümer des Hauses:</td><td>`@".$row['housekey']."</td></tr>",true);
output("<tr><td>`^Gesinnung: </td><td>`@".$gesinnung[$row[gesinnung]]."</td>",true);
$sql "SELECT mountname FROM mounts_usr WHERE acctid='{$row['acctid']}'";
$result db_query($sql);
$mount db_fetch_assoc($result);
if (
$mount['mountname']=="")
       
$mount['mountname'] = "`iKeines`i";
output("<td>`^Tier:</td><td> `@{$mount['mountname']}</td></tr>",true);
if(
$session[user][eulentrank]==1)output("<tr><td>`^Charme:</td><td>`@".$row['charm']."</td></tr>",true);
output("</table>`c`n",true);

//show the diary

output("`n`^Ausführliches Tagebuch & Biografie von $row[name]:`0");

    if (
$myProf) {
    
//i can add a chapter to my diary

        
output("<a href='biodiary.php?op=newChapter&char=$char&ret=$_GET[ret]'>`&[`^Neuen Abschnitt`&]</a>"true);

        
addnav("","biodiary.php?op=newChapter&char=".$char."&ret=".$_GET[ret]);

    }


 if (
$session['user']['superuser'] >= || $myProf ) {
    
//me and the admins can delete the whole diary

        
output("<a href='biodiary.php?op=wipe&char=$char&ret=$_GET[ret]'>`&[`4Leeren`&]`0</a>`n`n"true);

        
addnav("","biodiary.php?op=wipe&char=".$char."&ret=".$_GET[ret]);

    }



    
output("`n`n");



    
$sql "SELECT * FROM `diary` WHERE `acctid`='$id' ORDER BY `diaryID` ASC";

    
$bio_res db_query($sql);



 
//showing each chapter
    
for ($i 0$i db_num_rows($bio_res); $i++) {

        
$bio_row db_fetch_assoc($bio_res);




        
//the table is used for better centralized texts
        //no 'reorganizing' (shifting right) of the text when the paypal-icons end
        
output("<table width='100%'><tr><td width='5%'></td><td width='90%'>"true);

        



        if (
$session['user']['superuser'] >= 3  ||$myProf) {
        
//admins and me may

            //edit this particular chapter
            
output("<a href='biodiary.php?op=editChapter&no=$bio_row[diaryID]&char=".$char."&ret=".$_GET[ret]."'>`&[Bearbeiten]</a>"true);

            
addnav("","biodiary.php?op=editChapter&no=$bio_row[diaryID]&char=".$char."&ret=".$_GET[ret]);

            
//delete this particular chapter
            
output("<a href='biodiary.php?op=delChapter&no=$bio_row[diaryID]&char=".$char."&ret=".$_GET[ret]."'>`&[`4Löschen`&]`0</a>"true);

            
addnav("","biodiary.php?op=delChapter&no=$bio_row[diaryID]&char=".$char."&ret=".$_GET[ret]);

        }
        
        
output("`n`c`!$bio_row[title]`0",true);

  
//expand the macro "/me" to the actual name

                
$body str_replace("/me"$owner$bio_row['body']);

        
//$body = .CloseTags(removeEvilTags(soap(nl2br($bio_row['body'])),$row['frame'])),true);

        
output("`c`n");

        
//show this chapter
        
output (removeEvilTags(soap(nl2br($body)),"`c`b"),true);

        
output("</td><td width='5%'></td></tr></table>"true);

        
output("`n`n");





    }

 } elseif (
$_GET['op']=='editChapter') {
//edit a chapter

    
output("<form action='biodiary.php?char=$char&op=progress&act=editChapter&ID=$_GET[no]&ret=$_GET[ret]' method='POST'>"true);



    
$form=array(

        
"Neues Kapitel,title"

        
,"diaryID"=>"ID ,veryhidden"

        
,"title"=>"Titel"

        
,"body"=>"Inhalt,textarea,70,30"

    
);



    
$bio_res db_query("SELECT * FROM `diary` WHERE `diaryID`='".$_GET['no']."'");

    
$bio_row db_fetch_assoc($bio_res);



    
$prefs['title'] = $bio_row['title'];

    
$prefs['body'] = $bio_row['body'];

    
$prefs['diaryID'] =$bio_row['diaryID'];



    
showform($form,$prefs);



    
output("</form>"true);

    
addnav("""biodiary.php?char=$char&op=progress&act=editChapter&ID=$_GET[no]&ret=$_GET[ret]");



} elseif (
$_GET['op']=='delChapter') {
//delete a chapter


    
$sql "DELETE FROM `diary` WHERE `diaryID`='".$_GET['no']."'";

    
db_query($sql);



    
redirect("biodiary.php?op=long&char=$char&ret=$_GET[ret]");



} elseif (
$_GET['op']=='newChapter') {
//create a new chapter

    
output("<form action='biodiary.php?op=progress&act=newChapter&char=$char&ret=$_GET[ret]' method='POST'>"true);



    
$form=array(

        
"Neues Kapitel,title"

        
,"title"=>"Titel"

        
,"body"=>"Inhalt,textarea,70,30"

    
);



    
$prefs['title'] = "";

    
$prefs['body'] = "";



    
showform($form,$prefs);



    
output("</form>"true);

    
addnav("""biodiary.php?op=progress&act=newChapter&char=".$char."&ret=".$_GET[ret]);



} elseif (
$_GET['op']=='wipe') {
//delete all chapters


    
$sql "DELETE FROM `diary` WHERE `acctid`='$id'";

    
db_query($sql);



    
redirect("biodiary.php?op=long&char=$char&ret=$_GET[ret]");


//end of the diary


} elseif ($_GET['op']=='progress') {
//saving all the changes
//most of them and centralizing them by :kelko:

if ($_GET['act'] == 'editChapter') {
    
//editing a chapter


        /*$body = str_replace("\'","\\'", $_POST[body]);

        $body = str_replace("'","\\'", $_POST[body]);



        $title = str_replace("'","\\'", $_POST[title]);

        $title = str_replace("\'","\\'", $_POST[title]);*/
        
$body mysql_real_escape_string(stripslashes($_POST['body']));
        
$title mysql_real_escape_string(stripslashes($_POST['title']));


        
db_query("UPDATE diary SET title='$title', body='$body' WHERE diaryID='".$_GET[ID]."'");

        
output("Kapitel geändert");
        
redirect("biodiary.php?op=long&char=$char&ret=$_GET[ret]");



    } else if (
$_GET['act'] == 'newChapter') {
    
//creating a chapter


        /*$body = str_replace("\'","\\'", $_POST[body]);

        $body = str_replace("'","\\'", $_POST[body]);



        $title = str_replace("'","\\'", $_POST[title]);

        $title = str_replace("\'","\\'", $_POST[title]);*/
        
$body mysql_real_escape_string(stripslashes($_POST['body']));
        
$title mysql_real_escape_string(stripslashes($_POST['title']));



        
db_query("INSERT INTO `diary`(`acctid`,`title`,`body`,`date`) VALUES('".$session[user][acctid]."','$title','$body',now())");



        
output("Kapitel gespeichert");
        
redirect("biodiary.php?op=long&char=$char&ret=$_GET[ret]");

}

}
page_footer();

?>