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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | | PHP-Quelltext
<?php
unset($event);
if (isset($_REQUEST['comcat'])) $comcat=$_REQUEST['comcat'];
if (isset($_REQUEST['subid'])) $subid=$_REQUEST['subid'];
if (isset($_POST['action'])) $ACTION=$_POST['action'];
else $ACTION='view';
// Kit-NoSpam v1.0 fuer PHPKit 1.6.1
// Idee: Onkel Hotte
// www.kit-security.de (c)2006
// Version v1.0 - 27.07.2006
// Schlussel einbinden
$cryptkey = $config['captcha_cryptkey'];
//Zufallszahlen erzeugen und an Variable uebergeben
mt_srand ((double) microtime() * 1000000);
$chars = "123456789";
for ($i = 0; $i < 4; $i += 1) {
$num = mt_rand(0, strlen($chars)-1);
$readychar .= $chars[$num]; }
$setcode=trim($readychar);
$cryptcode=base64_encode($setcode+$cryptkey);
/**** EOS ****/
if (adminaccess('comment')) {
$DB->query("DELETE FROM ".$db_tab['comment']." WHERE comment_id='".$_REQUEST['delcomment']."' LIMIT 1");
}
if ($ACTION==$_POST['save']) {
if ($config['comment_register']==1 && !$USER['id']>0) {header("location: include.php?event=1session_id()); exit();}
else {
$floodcontrol=time()-($config['comment_floodctrl']*60);
$infocount=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['comment']." WHERE comment_ip='".$thisUSER['ipaddr']."' && comment_subid='".addslashes($_POST['subid'])."' && comment_userid='".$USER['id']."' && comment_time>'".$floodcontrol."' LIMIT 1"));
// Kit-NoSpam v1.0 fuer PHPKit 1.6.1
// Idee: Onkel Hotte
// www.kit-security.de (c)2006
// Version v1.0 - 27.07.2006
$cryptvar=base64_decode($_REQUEST['crashcode']);
$cryptvar=$cryptvar-$cryptkey;
/*** EOS ***/
if (trim($_POST['content'])=='' || trim($_POST['comment_autor'])=='') $event=12;
elseif (strlen(trim($_POST['content']))>$config['comment_maxchars']) $event=46;
elseif ($infocount[0]>0) $event=45;
elseif (!checkusername($_POST['comment_autor'],1)) $event=42;
// Kit-NoSpam v1.0 fuer PHPKit 1.6.1
// Idee: Onkel Hotte
// www.kit-security.de (c)2006
// Version v1.0 - 27.07.2006
elseif ($cryptvar != strtolower($_REQUEST['inputchars'])) $event=48;
/*** EOS ***/
// *** Punktesystem Pro *** Start ***
$psp_info = $DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['psp_config'].""));
$userinfo=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['user']." WHERE user_id='".$USER['id']."'"));
if ($userinfo['psp_aktiv']==1) {
if ($psp_info['psp_aktiv']==1) {
if ($psp_info['psp_kommentare_aktiv']==1) {
$DB->query("UPDATE ".$db_tab['user']." SET psp_punkte=psp_punkte+'".$psp_info['psp_kommentare']."' WHERE user_id ='".$USER['id']."'");
$DB->query("UPDATE ".$db_tab['user']." SET psp_kommentare=psp_kommentare+1 WHERE user_id ='".$USER['id']."'");
}
}
}
// *** Punktesystem Pro *** Ende ***
else {
$DB->query("INSERT INTO ".$db_tab['comment']." (comment_cat,comment_subid,comment_time,comment_autor,comment_ip,comment_text, comment_userid) VALUES ('".$_POST['comcat']."','".$_POST['subid']."','".time()."','".$_POST['comment_autor']."','".$thisUSER['ipaddr']."','".addslashes($_POST['content'])."','".$USER['id']."')");
$autor=$_POST['comment_autor'];
$mail_title=$config['site_name'].' - '.$lang['new_comment'];
eval ("\$mail_text= \"".getTemplate("comment_mail_notify")."\";");
notifymail('comment',$mail_title,$mail_text);
$im_title=$lang['new_gbentry'];
eval ("\$im_text= \"".getTemplate("comment_im_notify")."\";");
notifyim('comment',$im_title,$im_text);
if ($_POST['comcat']=='gb') {
$email=$DB->fetch_array($DB->query("SELECT gbook_notify,gbook_email,gbook_autor FROM ".$db_tab['gbook']." WHERE gbook_id='".$_POST['subid']."' LIMIT 1"));
if ($email['gbook_notify']==1) {
$comment_text=$_POST['content'];
eval ("\$email_title= \"".getTemplate("guestbook/email_title")."\";");
eval ("\$email_text= \"".getTemplate("guestbook/email_text")."\";");
mailsender($email['gbook_email'],$email_title,$email_text);
}
}
header("location: include.php?event=13&moveto=".urlencode($current_path)."session_id()); exit();
}
}
}
if ($comcat=="gb") {
$getinfo=$DB->query("SELECT * FROM ".$db_tab['gbook']." WHERE gbook_id='".$subid."'");
while ($gbookinfo=$DB->fetch_array($getinfo)) {
$row=rowcolor($row);
if ($gbookinfo['gbook_userid']>0 && $userinfo=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['user']." WHERE user_id='".$gbookinfo['gbook_userid']."' LIMIT 1"))) {
eval ("\$gbook_autor= \"".getTemplate("member_showprofil_textlink")."\";");
if ($userinfo['expire']==0) eval ("\$info_os= \"".getTemplate("member_os_offline")."\";");
else eval ("\$info_os= \"".getTemplate("member_os_online")."\";");
if ($userinfo['user_emailshow']==1) eval ("\$gbook_email= \"".getTemplate("member_email_iconlink")."\";");
if ($userinfo['user_icqid']>0) eval ("\$gbook_icq= \"".getTemplate("member_icq_iconlink")."\";");
if (trim($userinfo['user_hpage'])!='') {
if (ereg("http://",$userinfo['user_hpage'])) $info_link=$userinfo['user_hpage'];
else $info_link='http://'.$userinfo['user_hpage'];
eval ("\$gbook_hpage= \"".getTemplate("member_hpage_iconlink")."\";");
}
if ($USER['sigoption']==1 && $userinfo['user_sig']!='') {
$info_sig=$PARSE->parse($userinfo['user_sig'],0,$config['text_ubb'], $config['text_smilies'], $config['text_images'],1);
eval ("\$info_sig= \"".getTemplate("member_signatur")."\";");
}
}
else {
$userinfo['user_nick']=$gbookinfo['gbook_autor'];
$gbook_autor=$gbookinfo['gbook_autor'];
if ($gbookinfo['gbook_check']==1 && $gbookinfo['gbook_email']!='') {
$userinfo['user_email']=$gbookinfo['gbook_email'];
eval ("\$gbook_email= \"".getTemplate("member_email_iconlink")."\";");
}
if ($gbookinfo[gbook_hpage]!='') {
if (ereg('http://',$gbookinfo['gbook_hpage'])) $info_link=$gbookinfo['gbook_hpage'];
else $info_link='http://'.$gbookinfo['gbook_hpage'];
eval ("\$gbook_hpage= \"".getTemplate("member_hpage_iconlink")."\";");
}
if ($gbookinfo['gbook_icqnr']>0) {
$userinfo['user_icqid']=$gbookinfo['gbook_icqnr'];
eval ("\$gbook_icq= \"".getTemplate("member_icq_iconlink")."\";");
}
eval ("\$info_os= \"".getTemplate("guest_os_icon")."\";");
}
$gbook_title=htmlentities($gbookinfo['gbook_title']);
$gbook_text=$PARSE->parse($gbookinfo['gbook_text'],0,$config['gbook_ubb'],$config['gbook_smilies'],$config['gbook_images'],1);
$gbook_time=formattime($gbookinfo['gbook_time']);
if ($USER['status']=='admin') {
if ($gbookinfo['gbook_ip']==0) eval ("\$gbook_ip= \"".getTemplate("guestbook/gbook_ipno_iconlink")."\";");
else eval ("\$gbook_ip= \"".getTemplate("guestbook/gbook_ip_iconlink")."\";");
eval ("\$gbook_admin= \"".getTemplate("guestbook/gbook_admin_iconlink")."\";");
}
if ($config['gbook_commenteod']==1) {
$ccounter=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['comment']." WHERE comment_cat='gb' and comment_subid='".$gbookinfo['gbook_id']."'"));
if ($ccounter[0]>1) $gbook_comment=$ccounter[0].' '.$lang['comments'];
elseif ($ccounter[0]==1) $gbook_comment='1 '.$lang['comment'];
else $gbook_comment=$lang['no_comments'];
eval ("\$gbook_comment= \"".getTemplate("guestbook/viewgb_comment_textlink")."\";");
}
eval ("\$gbook_row= \"".getTemplate("guestbook/viewgb_row")."\";");
unset($gbook_email); unset($gbook_hpage); unset($gbook_icq); unset($gbook_admin); unset($gbook_ip); unset($gbook_comment); unset($info_sig);
}
eval ("\$site_body.= \"".getTemplate("comment_gbook_body")."\";");
}
elseif ($comcat=="cont") {
$info=$DB->fetch_array($DB->query("SELECT content_option, content_status FROM ".$db_tab['content']." WHERE content_id='".$subid."' LIMIT 1"));
if ($info['content_status']!=1) {$event=23; include("admin/config/event.php");}
else {
if ($info['content_option']==1) {$contentid=$subid; include("content/articles.php");}
elseif ($info['content_option']==2) {$contentid=$subid; include("content/news.php");}
elseif ($info['content_option']==3) {$type=3; $contentid=$subid; include("content/overview.php");}
elseif ($info['content_option']==4) {
$contentid=$subid; include("content/download.php");
}
}
}
$comment_order="DESC";
if ($comcat=="user") {
$comment_title=$lang['sign'];
$comment_type=$lang['previous_entries'];
}
else {
$comment_title=$lang['write_comment'];
$comment_type=$lang['comments'];
if ($config['comment_order']=="ASC") $comment_order=$config['comment_order'];
}
unset($sqlcommand);
$getcomment=$DB->query("SELECT * FROM ".$db_tab['comment']." where comment_subid='".$subid."' and comment_cat='".$comcat."' ORDER BY comment_time ".$comment_order);
while ($comment=$DB->fetch_array($getcomment)) {
$comment_hash[$comment['comment_id']]=$comment;
if ($comment['comment_userid']!=0) {
if ($sqlcommand) $sqlcommand.=" OR user_id='".$comment['comment_userid']."'";
else $sqlcommand="SELECT user_id, user_nick FROM ".$db_tab['user']." WHERE user_id='".$comment['comment_userid']."'";
}
}
if ($sqlcommand) {
$getuserinfo=$DB->query($sqlcommand);
while ($userinfo=$DB->fetch_array($getuserinfo)) {$userinfo_hash[$userinfo['user_id']]=$userinfo;}
}
if (is_array($comment_hash)) {
unset($comment_row);
if ($comment_order=="DESC") $comment_counter=count($comment_hash);
else $comment_counter=1;
foreach ($comment_hash as $comment) {
$row=rowcolor($row);
if (adminaccess('comment')) {
if ($comcat=="user") {$comment_path="login/pguestbook.php";}
else {$comment_path="comment/comment.php&subid=$subid&comcat=$comcat";}
eval ("\$comment_option= \"".getTemplate("comment_delete_iconlink")."\";");
if ($comment[comment_ip]!="") {eval ("\$comment_option.= \"".getTemplate("comment_ip_iconlink","")."\";");}
else {eval ("\$comment_option.= \"".getTemplate("comment_ipno_iconlink","")."\";");}
}
if (($userinfo=$userinfo_hash[$comment['comment_userid']])!='') {
if (isonline($userinfo['user_id'])) eval ("\$comment_option.= \"".getTemplate("member_os_online")."\";");
else eval ("\$comment_option.= \"".getTemplate("member_os_offline")."\";");
eval ("\$info_nick= \"".getTemplate("member_showprofil_textlink","small")."\";");
}
else {
eval ("\$comment_option.= \"".getTemplate("guest_os_icon","")."\";");
$info_nick=htmlentities(stripslashes($comment['comment_autor']));
}
if ($comcat=='user') $comment_text=$PARSE->parse($comment['comment_text'],0,$config['text_ubb'],$config['text_smilies'],$config['text_images'],1);
else $comment_text=$PARSE->parse($comment['comment_text'], 0, $config['comment_bb'], $config['comment_smilies'],$config['comment_images'],1);
$comment_time=formattime($comment['comment_time']);
eval ("\$comment_row.= \"".getTemplate("comment_comments_row","")."\";");
if ($comment_order=="DESC") $comment_counter--;
else $comment_counter++;
unset($comment_option); unset($comment_text);
}
eval ("\$site_body.= \"".getTemplate("comment_comments_body")."\";");
}
if ($comcat=='user') {
$comment_title="Ins Gätebuch eintragen";
$comment_path="login/pguestbook.php&id=$subid";
if ($config['text_ubb']==1) {eval ("\$sign_format.= \"".getTemplate("format_text")."\";");}
if ($config['text_smilies']==1) {$smilies=new smilies(); $sign_format.=$smilies->getSmilies("1");}
if ($sign_format!="") eval ("\$sign_format= \"".getTemplate("format_table")."\";");
if (getrights("user")) eval ("\$comment_autorinfo= \"".getTemplate("comment_writeform_autorinfo")."\";");
else eval ("\$comment_autorinfo= \"".getTemplate("comment_writeform_autorform")."\";");
if (isset($event)) {
if ($event==46) $commentlength=strlen($_POST['content']);
$site_body.='<br />';
include("admin/config/event.php");
}
$comment_text=$_POST['content'];
eval ("\$site_body.= \"".getTemplate("comment_writeform")."\";");
}
else {
if ($config['comment_register']!=1 || ($config['comment_register']==1 && ($USER['status']=='user' || $USER['status']=='member'|| $USER['status']=='mod' || $USER['status']=='admin'))) {
if ($config['comment_bb']==1) eval ("\$sign_format.= \"".getTemplate("format_text")."\";");
if ($config['comment_smilies']==1) {
$smilies=new smilies();
$sign_format.=$smilies->getSmilies(1);
}
$comment_path='comment/comment.php&subid='.$subid.'&comcat='.$comcat;
if ($sign_format!="") eval ("\$sign_format= \"".getTemplate("format_table")."\";");
if (getrights("user")) eval ("\$comment_autorinfo= \"".getTemplate("comment_writeform_autorinfo")."\";");
else eval ("\$comment_autorinfo= \"".getTemplate("comment_writeform_autorform")."\";");
if (isset($event)) {
if ($event==46) $commentlength=strlen($_POST['content']);
$site_body.='<br />';
include("admin/config/event.php");
}
$comment_text=$_POST['content'];
eval ("\$site_body.= \"".getTemplate("comment_writeform")."\";");
}
else eval ("\$site_body.= \"".getTemplate("comment_autorlogin")."\";");
}
?>
|