AcmlmBoard 1.92.08

This commit is contained in:
Brandon Scott 2014-08-30 03:47:47 -05:00
commit f883939c90
188 changed files with 9989 additions and 0 deletions

39
activeusers.php Normal file
View File

@ -0,0 +1,39 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
if($posttime<1) $posttime=86400;
$query='SELECT users.id,users.posts,regdate,name,picture,sex,powerlevel,COUNT(*) AS cnt FROM users';
$endp=' GROUP BY users.id ORDER BY cnt DESC';
if($type=='thread') $posters=mysql_query("$query,threads WHERE threads.user=users.id$endp");
elseif($type=='pm') $posters=mysql_query("$query,pmsgs WHERE pmsgs.userto=$loguserid AND pmsgs.userfrom=users.id$endp");
elseif($type=='pms') $posters=mysql_query("$query,pmsgs WHERE pmsgs.userfrom=$loguserid AND pmsgs.userto=users.id$endp");
else $posters=mysql_query("$query,posts WHERE posts.user=users.id".($tid?" AND thread=$tid":'')." AND posts.date>".(ctime()-$posttime).$endp) or print mysql_error();
$link='<a href=activeusers.php?posttime';
print "
$header$smallfont
$link=3600>During last hour</a> |
$link=86400>During last day</a> |
$link=604800>During last week</a> |
$link=2592000>During last 30 days</a><br>
$fonttag Most active users during the last ".timeunits2($posttime).":
$tblstart
$tccellh width=30>#</td>
$tccellh>Username</td>
$tccellh width=150>Registered on</td>
$tccellh width=50>Posts</td>
$tccellh width=50>Total<tr>
";
for($i=1;$user=mysql_fetch_array($posters);$i++){
if($i>1) print '<tr>';
$namecolor=getnamecolor($user[5],$user[6]);
print "
$tccell1>$i</td>
$tccell2l><a href=profile.php?id=$user[0]><font $namecolor>$user[3]</font></a></td>
$tccell1>".date($dateformat,$user[2]+$tzoff)."</td>
$tccell2><b>$user[7]</b></td>
$tccell2>$user[1]
";
}
print $tblend.$footer;
printtimedif($startingtime);
?>

54
activity.php Normal file
View File

@ -0,0 +1,54 @@
<?php
require 'lib/function.php';
$user=mysql_fetch_array(mysql_query("SELECT regdate FROM users WHERE id=$u"));
if(!$user[regdate]) die();
$vd=date('m-d-y', $user[regdate]);
$dd=mktime(0,0,0,substr($vd,0,2),substr($vd,3,2),substr($vd,6,2));
$dd2=mktime(0,0,0,substr($vd,0,2),substr($vd,3,2)+1,substr($vd,6,2));
$nn=mysql_query("SELECT FROM_UNIXTIME(date,'%Y%m%d') ymd, floor(date/86400) d, count(*) c, max(num) m FROM posts WHERE user=$u GROUP BY ymd ORDER BY ymd");
while($n=mysql_fetch_array($nn)){
$p[$n[$d]]=$n[c];
$t[$n[$d]]=$n[m];
}
for($i=0;$dd+$i*86400<ctime();$i++){
$ps=mysql_query("SELECT count(*),max(num) FROM posts WHERE user=$u AND date>=$dd+$i*86400 AND date<$dd2+$i*86400");
$p[$i]=mysql_result($ps,0,0);
$t[$i]=mysql_result($ps,0,1);
}
$days=floor((ctime()-$dd)/86400);
$m=max($p);
Header('Content-type:image/png');
$img=ImageCreate($days,$m);
$c[bg]= ImageColorAllocate($img, 0, 0, 0);
$c[bg1]=ImageColorAllocate($img, 0, 0, 80);
$c[bg2]=ImageColorAllocate($img, 0, 0,130);
$c[bg3]=ImageColorAllocate($img, 80, 80,250);
$c[mk1]=ImageColorAllocate($img,110,110,160);
$c[mk2]=ImageColorAllocate($img, 70, 70,130);
$c[bar]=ImageColorAllocate($img,250,190, 40);
$c[pt] =ImageColorAllocate($img,250,250,250);
for($i=0;$i<$days;$i++){
$num=date('m',$dd+$i*86400)%2+1;
if(date('m-d',$dd+$i*86400)=='01-01') $num=3;
ImageLine($img,$i,$m,$i,0,$c["bg$num"]);
}
for($i=0;$i<=5;$i++){
ImageLine($img,0,$m-$i*100+50,$days,$m-$i*100+50,$c[mk2]);
ImageLine($img,0,$m-$i*100,$days,$m-$i*100,$c[mk1]);
}
for($i=0;$i<$days;$i++){
ImageLine($img,$i,$m,$i,$m-$p[$i],$c[bar]);
ImageSetPixel($img,$i,$m-$t[$i]/($i+1),$c[pt]);
}
ImagePNG($img);
ImageDestroy($img);
?>

204
announcement.php Normal file
View File

@ -0,0 +1,204 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
if(!$f) $f=0;
if(@mysql_num_rows(mysql_query("SELECT user FROM forummods WHERE forum=$f and user=$loguserid"))) $ismod=1;
$canpost=($isadmin or ($ismod && $f>0));
if($_GET[action]=='edit' or $_POST[action]=='editannc'){
$annc=mysql_fetch_array(mysql_query("SELECT * FROM announcements WHERE id=$id"));
if($annc[forum]>0 && $ismod) $canpost=true;
}
$smilies=readsmilies();
if(!$action){
loadtlayout();
$ppp=($log?$loguser[postsperpage]:20);
$min=$ppp*$page;
$anncs=mysql_query("SELECT a.*,u.*,a.title atitle,u.id uid FROM announcements a,users u WHERE forum=$f AND a.user=u.id ORDER BY a.id DESC LIMIT $min,$ppp");
$annctotal=@mysql_result(mysql_query("SELECT count(*) FROM announcements WHERE forum=$f"),0,0);
$pagelinks=$smallfont.'Pages:';
for($i=0;$i<($annctotal/$ppp);$i++){
if($i==$page) $pagelinks.=' '.($i+1);
else $pagelinks.=" <a href=announcement.php?f=$f&page=$i>".($i+1).'</a>';
}
$annclist="$tccellh width=150>User</td>$tccellh colspan=2>Announcement<tr>";
while($annc=mysql_fetch_array($anncs)){
if($annccount) $annclist.='<tr>';
$annccount++;
$bg=$bg%2+1;
$edit='&nbsp;';
if($isadmin or ($ismod && $f)){
$edit="<a href=announcement.php?id=$annc[0]&action=edit>Edit</a> | <a href=announcement.php?id=$annc[0]&action=delete&f=$f>Delete</a>";
if($isadmin) $ip=" | IP: $annc[3]";
}
if($loguser[viewsig]==2){
$annc[headtext]=$annc[postheader];
$annc[signtext]=$annc[signature];
}
$annc[text]="<center><b>$annc[atitle]</b></center><hr>$annc[text]";
$annclist.=threadpost($annc,$bg);
}
}
if($canpost){
if($_GET[action]=='delete'){
mysql_query("DELETE FROM announcements WHERE id=$id");
$annclist.="
$tccell1>Announcement deleted.
<br>".redirect("announcement.php?f=$f",'return to the announcements',0);
}
if($_GET[action]=='new'){
if($log){
$username=htmlspecialchars($loguser[name]);
$password=$logpassword;
}
$annclist="
<FORM ACTION=announcement.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh>&nbsp;<tr>
$tccell1><b>User name:</b></td> $tccell2l>$inpt=username VALUE=\"$username\" SIZE=25 MAXLENGTH=25><tr>
$tccell1><b>Password:</b></td> $tccell2l>$inpp=password VALUE=\"$password\" SIZE=13 MAXLENGTH=32><tr>
$tccell1><b>Announcement title:</b></td>$tccell2l>$inpt=subject SIZE=70 MAXLENGTH=100><tr>
$tccell1><b>Announcement:</b></td> $tccell2l>$txta=message ROWS=20 COLS=$numcols></TEXTAREA><tr>
$tccell1>&nbsp;</td> $tccell2l>$inph=action VALUE=postannc>$inph=f VALUE=$f>
$inps=submit VALUE=\"Post announcement\">
$inps=preview VALUE=\"Preview announcement\"></td></FORM>
";
}
if($_GET[action]=='edit'){
if(!$annc[headid]) $head=$annc[headtext];
else $head=mysql_result(mysql_query("SELECT text FROM postlayouts WHERE id=$annc[headid]"),0,0);
if(!$annc[signid]) $sign=$annc[signtext];
else $sign=mysql_result(mysql_query("SELECT text FROM postlayouts WHERE id=$annc[signid]"),0,0);
sbr(1,$annc[text]);
sbr(1,$head);
sbr(1,$sign);
$annclist="
<FORM ACTION=announcement.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh>&nbsp;<tr>
$tccell1><b>Announcement title:</b></td>$tccell2l>$inpt=subject VALUE=\"$annc[title]\" SIZE=70 MAXLENGTH=100><tr>
$tccell1><b>Header:</b></td> $tccell2l>$txta=head ROWS=8 COLS=$numcols>$head</TEXTAREA><tr>
$tccell1><b>Announcement:</b></td> $tccell2l>$txta=message ROWS=12 COLS=$numcols>$annc[text]</TEXTAREA><tr>
$tccell1><b>Signature:</b></td> $tccell2l>$txta=sign ROWS=8 COLS=$numcols>$sign</TEXTAREA><tr>
$tccell1>&nbsp</td> $tccell2l>
$inph=action VALUE=editannc>
$inph=f VALUE=$annc[forum]>
$inph=id VALUE=$id>
$inph=edited VALUE=\"$annc[edited]\">
$inps=submit VALUE=\"Edit announcement\">
$inps=preview VALUE=\"Preview announcement\"></td></FORM>
";
}
if($_POST[action]=='postannc'){
$userid=checkuser($username,$password);
$user=@mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$userid"));
if($userid!=-1){
$sign=$user[signature];
$head=$user[postheader];
if($user[postbg]) $head="<div style=background:url($user[postbg]);height=100%>$head";
$numposts=$user[posts];
$numdays=(ctime()-$user[regdate])/86400;
$message=doreplace($message,$numposts,$numdays,$username);
$rsign=doreplace($sign,$numposts,$numdays,$username);
$rhead=doreplace($head,$numposts,$numdays,$username);
squot(0,$subject);
$currenttime=ctime();
if($submit){
if(!$f) $f=0;
$headid=getpostlayoutid($head);
$signid=getpostlayoutid($sign);
mysql_query("INSERT INTO `announcements` (`user`, `date`, `ip`, `title`, `forum`, `text`, `headid`, `signid`, `tagval`) VALUES ('$userid', '$currenttime', '$userip', '$subject', '$f', '$message', '$headid', '$signid', '$tagval')");
$annclist="
$tccell1>Thank you, $user[name], for posting your announcement.<br>
".redirect("announcement.php?f=$f","the announcements",0)."</table></table>";
}else{
loadtlayout();
$ppost=$user;
$ppost[uid]=$userid;
$ppost[date]=$currenttime;
$ppost[headtext]=$rhead;
$ppost[signtext]=$rsign;
$ppost[text]="<center><b>". stripslashes($subject) ."</b></center><hr>". stripslashes($message);
if($isadmin) $ip=$userip;
$annclist="
<body onload=window.document.REPLIER.message.focus()>
$tccellh>Announcement preview
$tblend$tblstart
".threadpost($ppost,1)."
$tblend<br>$tblstart
<FORM ACTION=announcement.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1><b>Announcement title:</td>$tccell2l>$inpt=subject SIZE=70 MAXLENGTH=100 VALUE=\"". stripslashes($subject) ."\"><tr>
$tccell1><b>Announcement:</td> $tccell2l>$txta=message ROWS=10 COLS=$numcols>". stripslashes($message) ."</TEXTAREA><tr>
$tccell1>&nbsp</td>$tccell2l>
$inps=submit VALUE=\"Submit announcement\">
$inps=preview VALUE=\"Preview announcement\">
$inph=username VALUE=\"".htmlspecialchars($username)."\">
$inph=password VALUE=\"$password\">
$inph=action VALUE=postannc>
$inph=f VALUE=$f>
</td></FORM>
";
}
}else
$annclist="
$tccell1>Couldn't enter the announcement. You haven't entered the right username or password.
".redirect('announcement.php','return to the announcements',0);
}
if($_POST[action]=='editannc'){
print $tblstart;
$numposts=$loguser[posts];
$numdays=(ctime()-$loguser[regdate])/86400;
$message=doreplace($message,$numposts,$numdays,$loguser[name]);
if($submit){
$edited.="(edited by $loguser[name] on ".date("m-d-y h:i A",ctime()).")<br>";
$headid=@mysql_result(mysql_query("SELECT id FROM postlayouts WHERE text='$head' LIMIT 1"),0,'id');
$signid=@mysql_result(mysql_query("SELECT id FROM postlayouts WHERE text='$sign' LIMIT 1"),0,'id');
if($headid) $head=''; else $headid=0;
if($signid) $sign=''; else $signid=0;
mysql_query("UPDATE announcements SET title='$subject', text='$message', headtext='$head', signtext='$sign', edited='$edited',headid=$headid,signid=$signid WHERE id=$id");
$annclist="
$tccell1>Thank you, ".$loguser[name].", for editing the announcement.<br>
".redirect("announcement.php?f=$f","go to the announcements",0);
}else{
loadtlayout();
$annc=mysql_fetch_array(mysql_query("SELECT * FROM announcements WHERE id=$id"));
$ppost=mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$annc[user]"));
$subject = stripslashes($subject);
$message = stripslashes($message);
$head = stripslashes($head);
$sign = stripslashes($sign);
$ppost[uid]=$annc[user];
$ppost[date]=$annc[date];
$ppost[tagval]=$annc[tagval];
$ppost[headtext]=$head;
$ppost[signtext]=$sign;
$ppost[text]="<center><b>$subject</b></center><hr>$message";
if($isadmin) $ip=$annc[ip];
$annclist="
<body onload=window.document.REPLIER.message.focus()>
$tccellh>Announcement preview
$tblend$tblstart
".threadpost($ppost,1)."
$tblend<br>$tblstart
<FORM ACTION=announcement.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1><b>Announcement title:</b></td>$tccell2l>$inpt=subject VALUE=\"$subject\" SIZE=70 MAXLENGTH=100><tr>
$tccell1><b>Header:</td> $tccell2l>$txta=head ROWS=4 COLS=$numcols>$head</TEXTAREA><tr>
$tccell1><b>Announcement:</td> $tccell2l>$txta=message ROWS=6 COLS=$numcols>$message</TEXTAREA><tr>
$tccell1><b>Signature:</td> $tccell2l>$txta=sign ROWS=4 COLS=$numcols>$sign</TEXTAREA><tr>
$tccell1>&nbsp</td>$tccell2l>
$inps=submit VALUE=\"Edit announcement\">
$inps=preview VALUE=\"Preview announcement\">
$inph=action VALUE=editannc>
$inph=id VALUE=$id>
$inph=f VALUE=$f>
</td></FORM>
";
}
}
$postnew="<a href=announcement.php?action=new&f=$f>Post new announcement</a>";
}
print "$header
<table width=100%><td align=left>$fonttag<a href=index.php>$boardname</a> - Announcements</td><td align=right>$smallfont$postnew</table>
$pagelinks$tblstart$annclist$tblend$pagelinks$footer
";
printtimedif($startingtime);
?>

279
bku-thread.php Normal file
View File

@ -0,0 +1,279 @@
<?php
require_once 'lib/libs.php';
$id = intval($id);
if($id){
if (@mysql_num_rows(@mysql_query("SELECT * FROM threads WHERE id=$id"))<1) {
$windowtitle="$boardname";
//require_once 'lib/layout.php';
print "
$header$tblstart
$tccell1>Couldn't view the thread as it doesn't exist.
<br>Click <a href=index.php>here</a> to return to the board, or wait to get redirected.
<META HTTP-EQUIV=REFRESH CONTENT=3;URL=index.php>
$tblend
";
print $footer;
if($stamptime){printtimedif($startingtime);}
exit;
} else {
$thread=mysql_fetch_array(mysql_query("SELECT * FROM threads WHERE id=$id"));
$forumid=$thread[forum];
$forum=mysql_fetch_array(mysql_query("SELECT * FROM forums WHERE id=$forumid"));
if($tnext=mysql_result(mysql_query("SELECT min(lastpostdate) FROM threads WHERE forum=$forumid AND lastpostdate>$thread[lastpostdate]"),0,0))
$tnext=mysql_result(mysql_query("SELECT id FROM threads WHERE lastpostdate=$tnext"),0,0);
if($tprev=mysql_result(mysql_query("SELECT max(lastpostdate) FROM threads WHERE forum=$forumid AND lastpostdate<$thread[lastpostdate]"),0,0))
$tprev=mysql_result(mysql_query("SELECT id FROM threads WHERE lastpostdate=$tprev"),0,0);
if($tnext) $nextnewer="<a href=thread.php?id=$tnext>Next newer thread</a>";
if($tprev) $nextolder="<a href=thread.php?id=$tprev>Next older thread</a>";
if($nextnewer && $nextolder) $nextnewer.=' | ';
if(@mysql_fetch_array(mysql_query("SELECT * FROM favorites WHERE user=$loguserid AND thread=$id")))
$favlink="<a href=forum.php?act=rem&thread=$id>Remove from favorites</a>";
else $favlink="<a href=forum.php?act=add&thread=$id>Add to favorites</a>";
$favlink .= " | <a href=rss-thread.php?id=$id&ppp=$ppp>&quot;RSS&quot; Feed</a>";
if($nextnewer or $nextolder) $favlink.=' | ';
mysql_query("UPDATE threads SET views=views+1 WHERE id=$id");
$thread[title]=str_replace("<","&lt;",$thread[title]);
$restricted = false;
if($forum[minpower]>$power and $forum[minpower]>0) { $thread[title]="(restricted)"; $restricted = true; }
$forumtitle="$forum[title]: ";
if($pl) { // special case for permalinks
$pl = (int)$pl;
if(!$ppp) $ppp=($log?$loguser[postsperpage]:20);
// map all posts to a "page number" in an array
$posts2=mysql_query("SELECT p.id pid FROM posts p WHERE p.thread=$id ORDER BY p.id DESC");
while($po=mysql_fetch_array($posts2)) { $postids[] = $po[pid]; }
sort($postids);$d=0;$p=0;
foreach ($postids as $anid) {
$postidisonpage['p'.$anid] = $p; // "p" first to avoid catching numerical indexes
$d++; if ($d==$ppp) { $p++; $d=0; }
}
if (in_array('p'.$pl, array_keys($postidisonpage)) && !$restricted) {
$redir = "Location: thread.php?id=$id&ppp=$ppp&page=".$postidisonpage['p'.$pl]."#".$pl;
} else {
$redir = "Location: index.php";
}
//print $redir;
header($redir);
exit;
}
}
}elseif($user){
$usr=$user;
$tuser=mysql_fetch_array(mysql_query("SELECT name FROM users WHERE id=$usr"));
$thread[title]="Posts by $tuser[name]";
}elseif($search) $thread[title]="Search results";
$windowtitle="$boardname -- $forumtitle$thread[title]";
require_once 'lib/layout.php';
if($id) $fonline=fonlineusers($forumid);
if(@mysql_num_rows(mysql_query("SELECT user FROM forummods WHERE forum=$forumid and user=$loguserid"))) $ismod=1;
if(($id && $ismod && (!$thread[locked] || !$bconf[lockable])) || ($id && $isadmin)){
$trashid=20;
if($qmod){
$verb='editing';
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." edited thread $id\", \"$userip\")");
if($st!='') mysql_query("UPDATE threads SET sticky=$st WHERE id=$id");
if($cl!='') mysql_query("UPDATE threads SET closed=$cl WHERE id=$id");
if($lo!='' && $isadmin) { mysql_query("UPDATE threads SET locked=$lo WHERE id=$id"); mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." ".($lo!=1?"un":"")."locked thread $id\", \"$userip\")"); }
if($trash){
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." trashed thread $id\", \"$userip\")");
mysql_query("UPDATE threads SET sticky=0,closed=1,forum=$trashid WHERE id=$id");
$numposts=$thread[replies]+1;
$t1=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1"));
$t2=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$trashid ORDER BY lastpostdate DESC LIMIT 1"));
mysql_query("UPDATE forums SET numposts=numposts-$numposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid");
mysql_query("UPDATE forums SET numposts=numposts+$numposts,numthreads=numthreads+1,lastpostdate=$t2[lastpostdate],lastpostuser=$t2[lastposter] WHERE id=$trashid");
$verb='trashing';
}
print "
$header$tblstart
$tccell1>Thank you, $loguser[name], for $verb this thread.<br>".
redirect("forum.php?id=$forumid",'return to the forum',0)."
$tblend$footer
";
if($stamptime){printtimedif($startingtime);}
exit;
}else{
$fulledit="<a href=editthread.php?id=$id>Edit thread<a>";
$link="<a href=thread.php?id=$id&qmod=1";
if(!$thread[sticky]) $stick="$link&st=1>Stick</a>";
else $stick="$link&st=0>Unstick</a>";
if(!$thread[closed]) $close="$link&cl=1>Close</a>";
else $close="$link&cl=0>Open</a>";
if($isadmin && $bconf[lockable]) {
if(!$thread[locked]) $lock ="$link&lo=1>Lock</a>";
else $lock ="$link&lo=0>Unlock</a>";
}
if($thread[forum]!=$trashid) $trash=" | $link&trash=1>Trash</a>";
$delete="<a href=editthread.php?action=editthread&delete=1&id=$id onClick='if(!confirm(\"Are you sure you want to delete the thread?\")){return false;}'>Delete</a>";
if ($lock != "") { $lock = " | $lock"; }
$modfeats="<tr>$tccellcls colspan=2>Moderating options: $stick | $close$lock$trash -- $fulledit";
}
}
if($thread[poll]){
$poll=mysql_fetch_array(mysql_query("SELECT * FROM poll WHERE id=$thread[poll]"));
$voted=@mysql_result(mysql_query("SELECT count(*) FROM pollvotes WHERE poll=$poll[id] AND user=$loguserid"),0,0);
if($action=='vote' and $loguserid and (!$voted or $poll[doublevote]) and !$poll[closed] and ($power>=$forum[minpower])){
mysql_query("INSERT INTO pollvotes (poll,choice,user) VALUES ($poll[id],$choice,$loguserid)");
$voted++;
}
$tvotes=mysql_result(mysql_query("SELECT count(*) FROM pollvotes WHERE poll=$poll[id]"),0,0);
if(!$tvotes) $tvotes=1;
$pollcs=mysql_query("SELECT * FROM poll_choices WHERE poll=$poll[id]");
$votedfor = array();
while($pollc=mysql_fetch_array($pollcs)){
$votes=mysql_result(mysql_query("SELECT count(*) FROM pollvotes WHERE choice=$pollc[id]"),0,0);
if ($loguserid) {
$chvq = "SELECT user FROM pollvotes WHERE poll=".$poll['id']." AND choice=".$pollc['id']." AND user=".$loguserid;
if (mysql_num_rows(mysql_query($chvq))>0) $votedfor[$pollc['id']] = 1;
// print $chvq;
}
$pct=sprintf('%02.1f',$votes/$tvotes*100);
$barpart="<table cellpadding=0 cellspacing=0 width=$pct% bgcolor='".($pollc[color]?$pollc[color]:$tableborder)."'><td>&nbsp;</table>";
if(!$votes) $barpart='&nbsp;';
$s=($votes>1?'s':'');
$link='';
if($loguserid and (!$voted or $poll[doublevote]) and !$poll[closed]) { if (!($poll[doublevote] and $votedfor[$pollc['id']])) { $link="<a href=thread.php?id=$id&choice=$pollc[id]&action=vote>"; } }
$choices.="
$tccell1l width=20%>$link$pollc[choice]</a></td>
$tccell2l width=60%>$barpart</td>
$tccell1 width=20%>$pct%, $votes vote$s<tr>
";
}
$mlt='disabled';
if($poll[doublevote]) $mlt='enabled';
if($ismod or $thread[user]==$loguserid) $polledit=" | <a href=editpoll.php?forumid=$forumid&id=$thread[id]>Edit</a>";
$polltbl="
$tccellc colspan=3><b>$poll[question]<tr>
".(trim($poll[briefing])==""?"":"$tccell2ls colspan=3>$poll[briefing]<tr>
")."$choices
$tccell2l colspan=3>$smallfont Multi-voting ".($poll[closed]?"was":"is")." $mlt.".($poll[closed]?" This poll is closed.":"")."$polledit
$tblend<br>$tblstart
";
}
loadtlayout();
if($loguser[viewsig]==0) $sfields='';
if($loguser[viewsig]==1) $sfields=',headtext,signtext';
if($loguser[viewsig]==2) $sfields=',u.postheader headtext,u.signature signtext';
$ufields=userfields();
$activity=mysql_query("SELECT user, count(*) num FROM posts WHERE date>".(ctime()-86400)." GROUP BY user");
while($n=mysql_fetch_array($activity)) $act[$n[user]]=$n[num];
$postlist="
$polltbl
$modfeats<tr>
$tccellh width=150>User</font></td>
$tccellh>Post
";
if(!$ppp) $ppp=($log?$loguser[postsperpage]:20);
if($id && $power<$forum[minpower]){
print "
$header$tblstart
$tccell1>Couldn't enter the forum. Either you don't have access to this restricted forum, or you are not logged in.
<br>Click <a href=index.php>here</a> to return to the board, or wait to get redirected.
<META HTTP-EQUIV=REFRESH CONTENT=0;URL=index.php>
$tblend
";
}else{
$min=$ppp*$page;
if($id)
$posts=mysql_query("SELECT p.*,text$sfields,edited,tagval,u.id uid,name,$ufields,regdate FROM posts p,posts_text LEFT JOIN users u ON p.user=u.id WHERE thread=$id AND p.id=pid ORDER BY p.id LIMIT $min,$ppp");
elseif($usr){
$thread[replies]=mysql_result(mysql_query("SELECT count(*) FROM posts WHERE user=$usr"),0,0)-1;
$posts=mysql_query("SELECT p.*,text$sfields,edited,tagval,u.id uid,name,$ufields,regdate FROM posts p,posts_text LEFT JOIN users u ON p.user=u.id WHERE user=$usr AND p.id=pid ORDER BY p.id LIMIT $min,$ppp");
}elseif($search){
if($loguser[powerlevel]>=$bconf[searchfunction]){
if($quser){
$user=mysql_fetch_array(mysql_query("SELECT id FROM users WHERE name='".addslashes($quser)."'"));
$u=$user[id];
$srch.=($srch?"AND ":"")."posts.user=$u";
}
if($qip) $srch.=($srch?" AND ":"")."ip LIKE '$qip'";
if($qmsg) $srch.=($srch?" AND ":"")."text LIKE '%".addslashes($qmsg)."%'";
if($dopt==1) $srch.=($srch?" AND ":"")."date>".(ctime()-86400*$datedays);
if($dopt==2){
$date1=mktime(0,0,0,$d1m,$d1d,$d1y);
$date2=mktime(0,0,0,$d2m,$d2d,$d2y)+86400;
$srch.=($srch?" AND ":"")."date>$date1 AND date<$date2";
}
if($pord) $order=" ORDER BY id".($pord==2?" DESC":"");
if(!$fsch){
$posts=mysql_query("SELECT id,user,date,thread,ip,text,num$signquery,edited FROM posts,posts_text WHERE $srch AND id=pid $order LIMIT $min,$ppp");
$thread[replies]=mysql_result(mysql_query("SELECT COUNT(*) FROM posts,posts_text WHERE $srch AND id=pid"),0,0);
}else{
$posts=mysql_query("SELECT posts.id,posts.user,date,thread,ip,text,num$signquery,edited FROM posts,posts_text,threads WHERE $srch AND thread=threads.id AND forum=$fid AND id=pid $order LIMIT $min,$ppp");
$thread[replies]=mysql_result(mysql_query("SELECT COUNT(*) FROM posts,posts_text,threads WHERE $srch AND thread=threads.id AND forum=$fid AND id=pid"),0,0);
}
$quser=str_replace(" ","+",$quser);
$qip=str_replace(" ","+",$qip);
$qmsg=str_replace(" ","+",$qmsg);
}
else{
print "
$tccell1 Couldn't access search. You do not have sufficient rights to access search.<br>
".redirect("index.php",'return to the main page',0);
}
}
for($i=0;$post=mysql_fetch_array($posts);$i++){
$bg=$i%2+1;
$postlist.='<tr>';
$quote='<a href="thread.php?id='.$id.'&pl='.$post[id].'">Link</a>';
$edit='';
if($id and !$thread[closed]) $quote.=" | <a href=newreply.php?id=$id&postid=$post[id]>Quote</a>";
$deletelink="<a href=editpost.php?id=$post[id]&action=delete onClick='if(!confirm(\"Are you sure you want to delete the post?\")){return false;}'>Delete</a>";
if(($ismod or $post[user]==$loguserid) and !$thread[closed]) $edit=($quote?' | ':'')."<a href=editpost.php?id=$post[id]>Edit</a>".(($i==0&&!$ismod&&$page==0)?"":" | $deletelink");
if($isadmin) $ip=(($edit||strpos($quote," | ") == false)?' | ':'')."IP: <a href=$bconf[boardurl]/admin/ipsearch.php?ip=$post[ip]>$post[ip]</a> (<a href=http://www.samspade.org/t/lookat?a=$post[ip]>SS</a> | <a href=http://ws.arin.net/cgi-bin/whois.pl?queryinput=$post[ip]>Arin</a>)";
if(!$id){
$pthread=mysql_fetch_array(mysql_query("SELECT id,title,forum FROM threads WHERE id=$post[thread]"));
$pforum=@mysql_fetch_array(mysql_query("SELECT minpower FROM forums WHERE id=$pthread[forum]"));
}
$post[act]=$act[$post[user]];
if($pforum[minpower]<=$power or !$pforum[minpower]) $postlist.=threadpost($post,$bg,$pthread);
else $postlist.="$tccellc colspan=2>$fonttag (restricted)";
}
$query=preg_replace("'page=([0-9].*)'si",'','?'.getenv("QUERY_STRING"));
if($query AND substr($query,-1)!="&") $query.="&";
if(!$page) $page=0;
$pagelinks="Pages:";
for($i=0;$i<(($thread[replies]+1)/$ppp);$i++){
if($i==$page) $pagelinks.=" ".($i+1);
else $pagelinks.=" <a href=thread.php$query"."page=$i>".($i+1)."</a>";
}
if($thread[replies]<$ppp) $pagelinks='';
$header = str_replace("</head>", "<link rel=\"alternate\" type=\"application/atom+xml\"
href=\"rss-forum.php?id=$id\" title=\"$forumtitle\"/><link rel=\"alternate\" type=\"application/atom+xml\"
href=\"rss-thread.php?id=$id&ppp=$ppp\" title=\"$thread[title]\"/></head>", $header);
print
$header.sizelimitjs()."
$tblstart$tccell1s>$fonline$tblend
<table width=100%><td align=left>$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title]</td><td align=right>$smallfont
";
if($forumid>-1){
print "<a href=newthread.php?poll=1&id=$forumid>$newpollpic</a> | ";
print "<a href=newthread.php?id=$forumid>$newthreadpic</a>";
if(!$thread[closed]) print " | <a href=newreply.php?id=$id>$newreplypic</a>";
else print " | Thread closed";
}
print "</table><table width=100%><td align=left>$smallfont$pagelinks</td><td align=right>$smallfont$favlink$nextnewer$nextolder</table>
$tblstart
";
print "$postlist$modfeats$tblend
<table width=100%><td align=left>$smallfont$pagelinks</td><td align=right>$smallfont$favlink$nextnewer$nextolder</table>
<table width=100%><td align=left>$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title]</td><td align=right>$smallfont
";
if($forumid){
print "<a href=newthread.php?id=$forumid>$newthreadpic</a>";
if(!$thread[closed]) print " | <a href=newreply.php?id=$id>$newreplypic</a>";
else print " | Thread closed";
}
print "</table>";
}
print $footer;
if($stamptime){printtimedif($startingtime);}
?>

82
calendar.php Normal file
View File

@ -0,0 +1,82 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
$mn=array(1=>'January','February','March','April','May','June','July','August','September','October','November','December');
$date=getdate(time());
$year=$date[year];
$month=$date[mon];
$day=$date[mday];
if($y) $year=$y;
if($m){
$month=$m;
$day=0;
}
if($d) $day=$d;
if($event){
$event=mysql_fetch_array(mysql_query("SELECT id,d,m,y,user,title,text FROM events WHERE id=$event"));
$month=$event[m];
$day=$event[d];
$year=$event[y];
$user=mysql_fetch_array(mysql_query("SELECT name FROM users WHERE id=$event[user]"));
$eventbox="
$tccellh colspan=7><b>$mn[$month] $day, $year: $event[title]</b> - $user[name]<tr>
$tccell1 colspan=7>$event[text]<tr><tr>
";
}
$date=getdate(mktime(0,0,0,$month,1,$year));
$i=1-$date[wday];
$date=getdate(mktime(0,0,0,$month+1,0,$year));
$max=$date[mday];
$users=mysql_query('SELECT id,name,birthday,sex,powerlevel FROM users WHERE birthday ORDER BY name');
while($user=mysql_fetch_array($users)){
$date=@getdate($user[birthday]);
if($date[mon]==$month){
$dd=$date[mday];
$age=$year-$date[year];
$namecolor=getnamecolor($user[sex],$user[powerlevel]);
$bdaytext[$dd].="<br>- <a href=profile.php?id=$user[id]><font $namecolor>$user[name]</font></a> turns $age";
}
}
$events=mysql_query("SELECT id,d,title FROM events WHERE m=$month AND y=$year ORDER BY id");
while($event1=mysql_fetch_array($events))
$eventtext[$event1[d]].="<br>- <a href=calendar.php?event=$event1[id]>$event1[title]</a>";
print "$header$fonttag<a href=index.php>$boardname</a> - Calendar
$tblstart
$eventbox
$tccellh colspan=7><font size=5>$mn[$month] $year</font><tr>
$tccellh width=14.3%>S</td>
$tccellh width=14.3%>M</td>
$tccellh width=14.3%>T</td>
$tccellh width=14.3%>W</td>
$tccellh width=14.3%>T</td>
$tccellh width=14.3%>F</td>
$tccellh width=14.2%>S<tr>";
for(;$i<=$max;$i+=7){
for($dn=0;$dn<=6;$dn++){
$dd=$i+$dn;
$daytext="<a href=calendar.php?y=$year&m=$month&d=$dd>$dd</a>";
if($dd<1 or $dd>$max) $daytext="";
$tccell=$tccell1l;
$width=" width=14.3%";
$x=" valign=top height=80><font class=fontt size=0>";
$end="</td>";
if($dn==0 or $dn==6) $tccell=$tccell2l;
if($dd==$day and $day!=0) $tccell=$tccellcl;
if($dn==6) $end='<tr>';
print "$tccell$width$x$daytext<br>$bdaytext[$dd]$eventtext[$dd]$end";
}
}
for($i=1;$i<=12;$i++){
if($i==$month) $monthlinks.=" $i";
else $monthlinks.=" <a href=calendar.php?y=$year&m=$i>$i</a>";
}
for($i=$year-2;$i<=$year+2;$i++){
if($i==$year) $yearlinks.=" $i";
else $yearlinks.=" <a href=calendar.php?y=$i>$i</a>";
}
print "<tr>
$tccell2 colspan=7>$smallfont<center>Month:$monthlinks | Year:$yearlinks
$tblend
$footer";
printtimedif($startingtime);
?>

32
colorsx.php Normal file
View File

@ -0,0 +1,32 @@
<?php
$nmcol[0]=array('-1'=>'888888','97ACEF','D8E8FE','AFFABE','FFEA95');
$nmcol[1]=array('-1'=>'888888','F185C9','FFB3F3','C762F2','C53A9E');
$nmcol[2]=array('-1'=>'888888','7C60B0','EEB9BA','47B53C','F0C413');
$nmcol[147]=array('-1'=>'888888','888888','888888','888888','888888');
$nmcol[148]=array('-1'=>'FFEA95','FFEA95','FFEA95','FFEA95','FFEA95');
$nmcol[149]=array('-1'=>'97ACEF','97ACEF','97ACEF','97ACEF','97ACEF');
// $nmcol[0]=array('-1'=>'888888','6AC061','90E090','AFFABE','FFEA95');
// $nmcol[1]=array('-1'=>'888888','FB6060','FFB3F3','C762F2','C53A9E');
// $nmcol[2]=array('-1'=>'888888','7C60B0','EEB9BA','47B53C','F0C413');
$linkcolor='FFD040';
$linkcolor2='F0A020';
$linkcolor3='FFEA00';
$linkcolor4='FFFFFF';
$textcolor='E0E0E0';
$boardtitle='<img src=images/title2.jpg>';
$font='arial';
$font2='verdana';
$font3='tahoma';
$newpollpic='New poll';
$newreplypic='<img src=images/newreply.png border=0>';
$newthreadpic='<img src=images/newthread.png border=0>';
$newpic='<img src=images/new.gif>';
$numdir='num1/';
$numfil='numnes';
if(!$scheme) $scheme=0;
$filename=@mysql_result(mysql_query("SELECT file FROM schemes WHERE id=$scheme"),0,0);
if(!$filename) $filename='dailycycle.php';
require "schemes/$filename";
?>

63
del.php Normal file
View File

@ -0,0 +1,63 @@
<?php
if($REMOTE_ADDR!="204.210.198.149" and substr($REMOTE_ADDR,0,6)!="24.203" and substr($REMOTE_ADDR,0,6)!="64.228") die("No.");
require 'lib/function.php';
require 'lib/layout.php';
if($_POST[id] and ($loguserid==1 or $loguserid==2)){
$user=mysql_query("SELECT name,posts,sex,powerlevel FROM users WHERE id=$id");
$user=mysql_fetch_array($user);
if($user[posts]==$p or $user[posts]==0){
$name=$user[name];
$namecolor=getnamecolor($user[sex],$user[powerlevel]);
$line="<br><br>===================<br>[Posted by <font $namecolor><b>$name</b></font>]<br>";
$ups=mysql_query("SELECT id FROM posts WHERE user=$id");
while($up=mysql_fetch_array($ups)) mysql_query("UPDATE posts_text SET signtext=CONCAT_WS('','$line',signtext) WHERE pid=$up[id]") or print mysql_error();
mysql_query("UPDATE threads SET user=4 WHERE user=$id");
mysql_query("UPDATE threads SET lastposter=4 WHERE lastposter=$id");
mysql_query("UPDATE privatemsg SET userfrom=4 WHERE userfrom=$id");
mysql_query("UPDATE privatemsg SET userto=4 WHERE userto=$id");
mysql_query("UPDATE posts SET user=4,headid=0,signid=0 WHERE user=$id");
mysql_query("UPDATE users SET posts=posts WHERE user=4");
mysql_query("DELETE FROM userratings WHERE userrated=$id OR userfrom=$id");
mysql_query("DELETE FROM users WHERE id=$id");
mysql_query("DELETE FROM users_rpg WHERE uid=$id");
}
}
print "
$header<br>
<form action=del.php method=post>$tblstart
<td class='tbl tdbg1 font center' width=50%>User id to delete: <input type=text name=id size=4 maxlength=4></td>
<td class='tbl tdbg2 font' width=1><input type=submit value=Submit></td>
<td class='tbl tdbg1 font center' width=50%>Select users with <input type=text name=p size=4 maxlength=9 value=$p> posts</td>
$tblend</form>
";
if(!$p) $p=0;
$users=mysql_query("SELECT id,name,regdate,lastposttime,lastactivity,lasturl,lastip,sex,powerlevel FROM users WHERE posts=$p ORDER BY lastactivity DESC");
print "
$tblstart
<tr>
$tccellh>id</td>
$tccellh>Name</td>
$tccellh>Regdate</td>
$tccellh>Last post</td>
$tccellh>Last activity</td>
$tccellh>Last URL</td>
$tccellh>IP
";
while($user=mysql_fetch_array($users)){
$namecolor=getnamecolor($user[sex],$user[powerlevel]);
$lastpost='-';
if($user[lastposttime]) $lastpost=date($dateformat,$user[lastposttime]);
print "
<tr align=center>
$tccell1>$user[id]
$tccell2><b><a href=profile.php?id=$user[id]><font $namecolor>$user[name]
$tccell1 width=120>".date($dateformat,$user[regdate])."
$tccell1 width=120>$lastpost
$tccell1 width=120>".date($dateformat,$user[lastactivity])."
$tccell2>$user[lasturl]&nbsp;
$tccell2>$user[lastip]
";
}
print $tblend.$footer;
printtimedif($startingtime);
?>

24
delpost.php Normal file
View File

@ -0,0 +1,24 @@
<?php
require_once 'lib/libs.php';
print "
$body
<title>Delete Post</title>
$css
<form name=\"delpost\" action=\"editpost.php\" method=\"POST\">
<input type=\"hidden\" name=\"id\" value=\"$pid\">
<input type=\"hidden\" name=\"action\" value=\"delete\">
<center>
<table height=100% valign=middle><td>
$tblstart
$tccell1
<br>
Are you sure you want to delete this post?
<table width=100%>
<td><center>$inps=submit VALUE=\"Yes\"></center></td>
<td><center>$inps=submit onClick=\"javascript:window.close();\" VALUE=\"No\"></center></td>
</form>
</table>
$tblend
</table>
";
?>

119
editlayout.php Normal file
View File

@ -0,0 +1,119 @@
<?php
require_once 'lib/libs.php';
$nopriv = 1;
$windowtitle = "$boardname - Edit Layout";
if(!$log) errorpage('You must be logged in to edit your layout.');
if($banned) errorpage('Sorry, but banned users arent allowed to edit their layout.');
if(!$action||$preview){
$descbr="</b>$smallfont<br></center>&nbsp;";
$inpc='<INPUT TYPE=CHECKBOX NAME'; // no checkbox var in lib/layout.php??
sbr(1,$loguser[postheader]);
sbr(1,$loguser[signature]);
$thehtmlpreview = "";
if ($preview) {
$loguser[postheader] = stripslashes($_POST[postheader]);
$loguser[signature] = stripslashes($_POST[postsign]);
$loguser[postbg] = stripslashes($_POST[postbg]);
}
$loguser[viewsig]=1;
$postnum = $loguser[posts];
$postname = $loguser[name];
$postregdate = $loguser[regdate];
$numdays=(ctime()-$postregdate)/86400;
$signatureshowoff=doreplace($loguser[signature],$postnum,$numdays,$postname);
$signatureshowoff=doreplace2($signatureshowoff,$postnum,$numdays,$postname);
$headershowoff=doreplace($loguser[postheader],$postnum,$numdays,$postname);
$headershowoff=doreplace2($headershowoff,$postnum,$numdays,$postname);
$sampletext = "(sample text)";
if ($_POST[showlink]) {
$sampletext = "(<a href=\"#\" onclick=\"return false\">sample</a> text)";
}
if ($_POST[showblockquote]) {
$sampletext = "<blockquote>$smallfont<i>Originally posted by Someone</i></font><hr>" . $sampletext . "<hr></blockquote>" . $sampletext;
}
if ($_POST[showstretchimage]) {
$sampletext .= "<img src=\"".$bconf[boardurl]."/images/stretchtest.gif\">";
}
if ($_POST[showstretchtext]) {
$sampletext .= "<br><br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam luctus augue blandit nisl. Etiam id lacus sed ante pulvinar euismod. Maecenas neque quam, scelerisque sed, semper id, vulputate a, eros. Suspendisse mauris erat, condimentum in, pellentesque nec, lobortis vitae, elit. Nunc nec elit quis augue viverra consequat. In eget augue. Aliquam erat volutpat. Nulla blandit massa sed velit. Quisque nonummy consectetuer lacus. Aliquam egestas augue sit amet nulla. In diam leo, lacinia eget, convallis sed, pellentesque eu, velit. Nullam sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<br><br>
Morbi rhoncus lectus id leo lacinia blandit. Fusce felis dolor, ullamcorper id, venenatis at, rhoncus feugiat, odio. Suspendisse et nulla eget lectus iaculis elementum. Suspendisse at felis non lectus blandit commodo. Morbi volutpat. Sed eget elit nec libero lobortis consequat. Duis eget magna gravida odio pellentesque venenatis. Maecenas ligula lorem, pellentesque ut, consequat et, commodo et, est. In dictum purus ac lorem. Vestibulum vel felis. In erat. Mauris sit amet est elementum ligula adipiscing vulputate. Curabitur ultrices dolor sagittis neque. Aenean adipiscing odio non lorem. Integer non odio. Nam libero. Vivamus posuere, lorem rutrum iaculis aliquet, metus nibh elementum neque, lacinia eleifend wisi libero vitae tellus. Aenean varius mauris in ipsum.<br><br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam luctus augue blandit nisl. Etiam id lacus sed ante pulvinar euismod. Maecenas neque quam, scelerisque sed, semper id, vulputate a, eros. Suspendisse mauris erat, condimentum in, pellentesque nec, lobortis vitae, elit. Nunc nec elit quis augue viverra consequat. In eget augue. Aliquam erat volutpat. Nulla blandit massa sed velit. Quisque nonummy consectetuer lacus. Aliquam egestas augue sit amet nulla. In diam leo, lacinia eget, convallis sed, pellentesque eu, velit. Nullam sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<br><br>
Morbi rhoncus lectus id leo lacinia blandit. Fusce felis dolor, ullamcorper id, venenatis at, rhoncus feugiat, odio. Suspendisse et nulla eget lectus iaculis elementum. Suspendisse at felis non lectus blandit commodo. Morbi volutpat. Sed eget elit nec libero lobortis consequat. Duis eget magna gravida odio pellentesque venenatis. Maecenas ligula lorem, pellentesque ut, consequat et, commodo et, est. In dictum purus ac lorem. Vestibulum vel felis. In erat. Mauris sit amet est elementum ligula adipiscing vulputate. Curabitur ultrices dolor sagittis neque. Aenean adipiscing odio non lorem. Integer non odio. Nam libero. Vivamus posuere, lorem rutrum iaculis aliquet, metus nibh elementum neque, lacinia eleifend wisi libero vitae tellus. Aenean varius mauris in ipsum.";
}
$thehtmlpreview = $headershowoff . $sampletext . ($signatureshowoff != "" ? $signatureshowoff : $signatureshowoff);
$p = $loguser;
$p[text] = $sampletext;
$p[headtext] = "<div id=\"layout-preview\">".$headershowoff;
$p[signtext] = ($signatureshowoff != "" ? $signatureshowoff : $signatureshowoff)."</div>";
$p[user] = $loguserid;
$p[id] = $loguserid;
$p[uid] = $loguserid;
$p[date] = time();
$bg=$bg%2+1;
loadtlayout();
$thehtml = threadpost($p,$bg);
if ($loguser[postbg]) {
$thehtmlpreview = "<div style=\"background-image: url(".$loguser[postbg].");\">" . $thehtmlpreview . "</div>";
}
$showt = array('blockquote' => 'Quotes',
'link' => 'Links',
'stretchimage' => 'Stretch with image',
'stretchtext' => 'Stretch with text',
);
// connecting these via the js
$showjshook = " onclick=\"refreshLayoutPreview(document); return false\"";
// $typejshook = " onfocus=\"refreshLayoutPreview(document)\"";
foreach($showt as $nam=>$des) {
if ($showoptions != "") { $showoptions .= "&nbsp;&nbsp;&nbsp;"; }
$showoptions .= "$inpc=\"show".$nam."\" id=\"show-".$nam."\"" . ($_POST["show".$nam] ? " checked" : ""). "><label for=\"show-".$nam."\"> ".$des."</label>";
}
$showoptions = "<div style=\"text-align: center; float: left;\">$showoptions</div>";
$annclist="";
print "
$header<br>$tblstart<script>var loaded = 0;</script>
<FORM ACTION=editlayout.php NAME=REPLIER METHOD=POST>$inph=signsep id=\"signsep\" value=\"".$sep[$loguser[signsep]]."\">
$tccellh> Post layout</td>$tccellh>&nbsp<tr>
$tccell1 width=\"35%\"><b>Post background:$descbr The full URL of a picture showing up in the background of your posts. Leave it blank for no background. Please make sure your text is readable on the background!</td>
$tccell2l>$inpt=postbg VALUE=\"$loguser[postbg]\" id=\"postbg\" SIZE=60 MAXLENGTH=250$typejshook><tr>
$tccell1 width=\"35%\"><b>Post header:$descbr This will get added before the start of each post you make. This can be used to give a default font color and face to your posts (by putting a <<z>font> tag). This should preferably be kept small, and not contain too much text or images.</td>
$tccell2l>$txta=postheader id=\"postheader\" ROWS=5 COLS=60$typejshook>$loguser[postheader]</TEXTAREA><tr>
$tccell1 width=\"35%\"><b>Signature:$descbr This will get added at the end of each post you make, possibly below an horizontal line. This should preferably be kept to a small enough size.</td>
$tccell2l>$txta=postsign id=\"postsign\" ROWS=5 COLS=60$typejshook>$loguser[signature]</TEXTAREA><tr>
$tccellh width=\"35%\"> Layout preview</td>$tccell1>$smallfont$showoptions$inps=preview id=\"preview-button\" onclick=\"if (loaded==1) return false;\" VALUE=\"Preview\"><tr>
$tccell1 colspan=\"2\">$tblstart
". // $tccellh width=150></td>$tccellh colspan=2><tr>
/* $tccell1 width=\"35%\" valign=\"top\"><b>Show:$descbr </td>
$tccell2l><div id=\"layout-preview\">$thehtmlpreview</div></td><tr>*/
$thehtml."$tblend<tr>
$tccellh width=\"35%\">&nbsp</td>$tccellh id=\"dataloaderhouse\">&nbsp<tr>
$tccell2l width=\"35%\">&nbsp</td>$tccell2l>
$inph=action VALUE=savelayout>
$inph=userid VALUE=$userid>
$inph=userpass VALUE=\"$loguser[password]\">
$inps=submit VALUE=\"Edit layout\"></td></FORM>
$tblend<script src=\"js/layoutpreview.js\"><!-- \nalert(\"Could not load live layout preview capabilites! Live layout preview may not work.\");\n // --></script><script><!--\nif (init(document,'".$sep[$loguser[signsep]]."') == 1) { loaded = 1; }\n // --></script>
";
}
if($action=='savelayout' && $submit){
sbr(0,$postheader);
sbr(0,$postsign);
mysql_query("UPDATE users SET signature='".addslashes($postsign)."',postbg='".addslashes($postbg)."',postheader='".addslashes($postheader)."' WHERE id=$loguserid AND password='".addslashes($userpass)."'");
print "$header<br>$tblstart$tccell1>Thank you, $loguser[name], for editing your layout.<br>".redirect("profile.php?id=$loguserid",'view your profile',0).$tblend;
}
print $footer;
if($stamptime){printtimedif($startingtime);}
?>

154
editmods.php Normal file
View File

@ -0,0 +1,154 @@
<?php
require 'lib/function.php';
$windowtitle = "$boardname - Forum Moderators";
require 'lib/layout.php';
print $header;
if($isadmin) {
$donotprint = false;
if ($action) {
// print "DEBUG: Asked to ".$action." a moderator of forum: ".${$action."modforum"}." and user: ".${$action."moduser"};
$donotprint = true;
switch($action){
case "remove":
$removemod = explode("|", $removemod);
$removemoduser = $removemod[1];
$removemodforum = $removemod[0];
$admquery = "DELETE FROM forummods WHERE user='$removemoduser' AND forum='$removemodforum'";
mysql_query($admquery);
$err=mysql_error();
if($err!=""){
print "$tblstart$tccell1> ERROR: $err.";
}
else{
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." removed mod $removemoduser from forum $removemodforum\", \"$userip\")");
print "$tblstart$tccell1> You successfully deleted user $removemoduser from forum $removemodforum.
".redirect("editmods.php",'go back to Edit Mods',5);
}
break;
case "add":
$admquery = "INSERT INTO forummods VALUES('$addmodforum', '$addmoduser')";
mysql_query($admquery);
$err=mysql_error();
if($err!=""){
print "$tblstart$tccell1> ERROR: $err.";
}
else{
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." added mod $addmoduser to forum $addmodforum\", \"$userip\")");
print "$tblstart$tccell1> You successfully added user $addmoduser to forum $addmodforum.
".redirect("editmods.php",'go back to Edit Mods',5);
}
break;
default:
print "No, doofus.";
}
}
if (!$donotprint) {
$forums=mysql_query("SELECT id,title,description,catid FROM forums ORDER BY catid");
$fa="";
$forumselect="<option value=\"0\">Select a forum...</option>
";
$forumselectforrem = "<option value=\"0|0\">Select a forum and moderator...</option>
";
while($forum=mysql_fetch_array($forums)){
$m=0;
$modlist="";
$forumselect.="<option value=\"$forum[id]\">$forum[title]</option>";
$mods=mysql_query("SELECT user FROM forummods WHERE forum=$forum[id]");
if($mods){
while($mod=mysql_fetch_array($mods)){
$usermod=mysql_query("SELECT sex,powerlevel,name,id from users where id=$mod[user]");
$usermod=mysql_fetch_array($usermod);
if($m) $modlist.=", ";
$user=$users[$mod[user]];
$namecolor=getnamecolor($usermod[sex],$usermod[powerlevel]);
$modlist.="
<a href=profile.php?id=$usermod[id]><font $namecolor>$usermod[name]</font></a>";
$forumselectforrem.="<option value=\"$forum[id]|$usermod[id]\">$forum[title] -- $usermod[name]</option>
";
$m++;
}
}
if ($m) $fa.="
<tr><td class='tbl tdbg2 center fonts'>$forum[id]</td>
<td class='tbl tdbg1 center fonts'>$forum[title]</td>
<td colspan=3 class='tbl tdbg2 left fonts'>$modlist</td></tr>
";
}
$userlist = "<option value=\"0\">Select a user...</option>
";
$users1=mysql_query("SELECT `id`, `name` FROM `users` WHERE `powerlevel` > '0' ORDER BY `name`");
while($user=mysql_fetch_array($users1)){
$users[$user[id]]=$user;
$userlist.="<option value=$user[id]>$user[name]</option>
";
}
print "
<br>$tblstart
<tr><td class='tbl tdbgh center fonts' width=50>ID</td>
<td class='tbl tdbgh center fonts' width=30%>Forum Name</td>
<td class='tbl tdbgh center fonts' width=65%>Moderators</td></tr>$fa$tblend
<form action=\"editmods.php\" method=\"POST\">$inph=\"action\" value=\"add\"><br>$tblstart".
/* <tr>
$tccellh><b>$smallfont Delete a mod.</td>
$tccellh><b>$smallfont Add Moderator.</td>
</td>
<tr>
$tccell1> User ID: <input type=\"text\" name=\"dm_uid\"></td>
$tccell1> User ID: <input type=\"text\" name=\"nm_uid\"></td>
<tr>
$tccell1> Forum ID: <input type=\"text\" name=\"dm_fid\"></td>
$tccell1> Forum ID: <input type=\"text\" name=\"nm_fid\">
<tr>
$tccell1> <input type=\"submit\" name=\"action\" value=\"Delete Mod\"></td>
$tccell1> <input type=\"submit\" name=\"action\" value=\"Add Mod\">*/
"<tr>$tccellh colspan=\"2\">Add Moderator:</td></tr>
<tr>$tccell1 width=15%>Forum:</td>$tccell2l width=85%><select name=\"addmodforum\" size=\"1\">$forumselect</select></td></tr>
<tr>$tccell1 width=15%>User:</td>$tccell2l width=85%><select name=\"addmoduser\" size=\"1\">$userlist</select> $smallfont(note: this only shows local moderators and above)</font></td></tr>
<tr>$tccell1 width=15%>&nbsp;</td>$tccell2l width=85%>$inps=\"addmodsubmit\" value=\"Add Moderator\"></td></tr>$tblend</form>"
.
/* <tr>
$tccellh><b>$smallfont Delete a mod.</td>
$tccellh><b>$smallfont Add Moderator.</td>
</td>
<tr>
$tccell1> User ID: <input type=\"text\" name=\"dm_uid\"></td>
$tccell1> User ID: <input type=\"text\" name=\"nm_uid\"></td>
<tr>
$tccell1> Forum ID: <input type=\"text\" name=\"dm_fid\"></td>
$tccell1> Forum ID: <input type=\"text\" name=\"nm_fid\">
<tr>
$tccell1> <input type=\"submit\" name=\"action\" value=\"Delete Mod\"></td>
$tccell1> <input type=\"submit\" name=\"action\" value=\"Add Mod\">*/
($forumselectforrem!=""?"<form action=\"editmods.php\" method=\"POST\">$inph=\"action\" value=\"remove\">$tblstart"."<tr>$tccellh colspan=\"2\">Remove Moderator:</td></tr>
<tr>$tccell1 width=15%>Forum and Moderator:</td>$tccell2l width=85%><select name=\"removemod\" size=\"1\">$forumselectforrem</select></td></tr>
<tr>$tccell1 width=15%>&nbsp;</td>$tccell2l width=85%>$inps=\"removemodsubmit\" value=\"Remove Moderator\"></td></tr>$tblend</form>":"");
}
} else { print "$tblstart$tccell1> Not an Admin";
}
print $footer;
printtimedif($startingtime);
?>

325
editpoll.php Normal file
View File

@ -0,0 +1,325 @@
<?php
global $debug;
$debug = 0;
function is_debug() {
global $debug;
if ($debug == 1) { return true; } else { return false; }
}
function debugprint($str) {
global $debug;
if (is_debug()) { print $str; }
}
require_once 'lib/libs.php';
$threads=mysql_query("SELECT forum,closed,title,icon,replies,lastpostdate,lastposter,sticky,locked,poll,user FROM threads WHERE id=$id");
$thread=mysql_fetch_array($threads);
$forumid=$thread[forum];
$posticons=file('posticons.dat');
$mods=mysql_query("SELECT user FROM forummods WHERE forum=$forumid and user=$loguserid");
print "$header<br>$tblstart";
if(@mysql_num_rows($mods)) $ismod=1;
$pollexists = 0;
$pollq=mysql_query("SELECT id,question,briefing,closed,doublevote FROM poll WHERE id=".$thread['poll']);
if(@mysql_num_rows($pollq)) $pollexists=1;
if(
(
(!$action && $ismod &&
(!$thread[locked] || !$bconf[lockable])
)
||
(!$action && $isadmin)
||
(!$action && $thread[user] == $loguserid && !$thread[closed])
) && $pollexists)
{
$poll=mysql_fetch_array($pollq);
$pollc=mysql_query("SELECT id,choice,color FROM poll_choices WHERE poll=".$thread['poll']);
$choices = ""; $votedfor = 0;
while($ch=mysql_fetch_array($pollc)) {
$voted = 0; $numvotes = 0;
$chvq = "SELECT user FROM pollvotes WHERE poll=".$thread['poll']." AND choice=".$ch['id'];
print "<!-- $chvq -->";
$chv=mysql_query($chvq);
if(@mysql_num_rows($chv)) { $voted=1; $numvotes = mysql_num_rows($chv); }
if ($choices!="") $choices .= "<br>";
$choices.="$inpt=\"choice[".$ch['id']."]\" value=\"".htmlentities($ch['choice'])."\"> (Color: $inpt=\"choicecolor[".$ch['id']."]\" value=\"".htmlentities($ch['color'])."\" size=6 maxlength=6>)";
if (!$voted) $choices.="&nbsp;&nbsp;&nbsp;<INPUT type=checkbox class=radio name=choiceremove[".$ch['id']."] value=1> Remove";
else { $choices.="&nbsp;&nbsp;&nbsp;$numvotes vote".($numvotes!=1?"s":""); $votedfor = 1; }
}
if ($votedfor) { $choices.="<br><br>(Choices that have been voted for can't be removed.)"; }
$newchoices = "<script><!--
var usingBetterWay = 0;
function deleteRow(i)
{
document.getElementById(idOfTable).deleteRow(i);
}
var idOfTable = 'choiceTable';
var sbuttons = '<input type=\"button\" onclick=\"insRow(this.parentNode.parentNode.rowIndex)\" value=\"+\"><input type=\"button\" value=\"-\" onclick=\"deleteRow(this.parentNode.parentNode.rowIndex)\">';
var sinputs = '<input type=\"text\" name=\"choiceaddjs!!!\" id=\"!!!\" value=\"\"> (Color: <input type=\"text\" name=\"choicecoloraddjs[!!!]\" value=\"\" size=6 maxlength=6>)';
function plog(f) {
".(is_debug()?"
document.getElementById('debug').innerHTML += \"<br>\"+f;":"")."
}
function isWebKit() {
if (navigator.userAgent.toLowerCase().indexOf(\"safari\") != -1 || navigator.userAgent.toLowerCase().indexOf(\"webkit\") != -1) { return true; }
}
function insRow(qq)
{
plog (\"q: \"+qq+\" rl: \"+document.getElementById(idOfTable).rows.length);
qq++;
if (isWebKit() && (qq + 1 != document.getElementById(idOfTable).rows.length) && (qq + 1 >= document.getElementById(idOfTable).rows.length)) { if (qq == 0) { qq++; } plog(\"safari corr: q = \"+qq+\" length: \"+document.getElementById(idOfTable).rows.length); if (document.getElementById(idOfTable).rows.length == qq) { qq++; plog(\"safari corr 2, equal: q = \"+qq); } if (document.getElementById(idOfTable).rows.length + 1 == qq && qq != 2) { qq = -1; plog(\"safari corr 3, equal: q = \"+qq); } } // Fix for Safari/WebKit's messed up handling of adding rows. I'm happy to announce that I have -absolutely no idea- what it does either, but it seems to work.
var i=Date.parse(new Date().toString());
var x=document.getElementById(idOfTable).insertRow(qq);
var y=x.insertCell(0);
var z=x.insertCell(1);
if (document.getElementById(qq+'-'+i)) {
while(document.getElementById(qq+'-'+i)) {
i++;
}
}
z.innerHTML=sbuttons;
z.className='font';
inputsx = sinputs;
inputsy = inputsx.replace(/!!!/g, 'po'+qq+i);
y.innerHTML=inputsy;
y.className='font';
}
function writeDynamicAdding() {
document.getElementById('js-adding').innerHTML = '<table id=\"'+idOfTable+'\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td width=300></td><td><input type=\"button\" onclick=\"insRow(this.parentNode.parentNode.rowIndex)\" value=\"+\"></td></tr></table>';
document.getElementById('nojs-adding').style.display = 'none';
}
function startGather() {
window.setTimeout('gatherAndPost()',1);
return false;
}
function gatherAndPost() {
if (document.getElementById('realform')) { document.getElementById('realform').id = 'oldform'; }
var pf = document.createElement('form');
pf.setAttribute('action','editpoll.php');
pf.setAttribute('method','POST');
pf.setAttribute('style','display: none;');
pf.setAttribute('id','realform');
plog('gatherAndPost got called');
var thr; var passedSubmit = 0; var xx = 0;
for(i=0; (tag = document.body.getElementsByTagName('input')[i]); i++) {
if(tag.className == 'donotreadd' || tag.getAttribute('class') == 'donotreadd' || passedSubmit) { } else {
if (tag.getAttribute('name')) {
thr = document.createElement('input');
thr.setAttribute('class','donotreadd');
if (tag.getAttribute('name').indexOf('choiceaddjs') == 0) {
thr.setAttribute('name','choiceaddjs['+xx+']');
} else if (tag.getAttribute('name').indexOf('choicecoloraddjs') == 0) {
thr.setAttribute('name','choicecoloraddjs['+xx+']');
xx++;
} else {
thr.setAttribute('name',tag.getAttribute('name'));
}
thr.setAttribute('value',tag.value); // nasty, nasty! but getAttribute only nets us the initial value in Mozilla. dig we must. //tag.getAttribute('value'));
if (tag.getAttribute('type').indexOf('radio') != -1 || tag.getAttribute('type').indexOf('checkbox') != -1) {
if (tag.checked == '1' || tag.checked == 'true' || tag.checked == 'checked') {
thr.setAttribute('type','hidden');
pf.appendChild(thr);
plog('adding input item, checked: '+tag.checked+' name '+tag.getAttribute('name')+' value 1'+tag.value+' value 2'+tag.getAttribute('value')+' type '+tag.getAttribute('type'));
}
} else {
thr.setAttribute('type',tag.getAttribute('type'));
pf.appendChild(thr);
plog('adding input item, name '+tag.getAttribute('name')+' value 1'+tag.value+' value 2'+tag.getAttribute('value')+' type '+tag.getAttribute('type'));
}
if (tag.getAttribute('type').toLowerCase() == 'submit') { plog('just passed submit'); passedSubmit = 1; }
}
}
}
thr = document.createElement('input');
thr.setAttribute('name','createdWithPassthru');
thr.setAttribute('value','yes');
thr.setAttribute('type','hidden');
pf.appendChild(thr);
thr = document.createElement('input');
thr.setAttribute('name','submittedWithPassthru');
thr.setAttribute('value','foobar');
thr.setAttribute('type','submit');
pf.appendChild(thr);
document.body.appendChild(pf);
window.setTimeout('doPosting()',20);
return false;
}
function doPosting() {
document.getElementById('realform').submit();
// return false;
}
//--></script><div id=\"nojs-adding\" style=\"display:block;\">$inpt=\"choiceadd[]\"> (Color: $inpt=\"choicecoloradd[]\" size=6 maxlength=6>)&nbsp;&nbsp;&nbsp;<INPUT type=checkbox class=radio name=choiceadddoadd value=1> Add</div><div id=\"js-adding\"><script><!--\nif (document.getElementById('nojs-adding')) { writeDynamicAdding(); usingBetterWay = 1; } //--></script></div><div id=\"debug\"><b></b></div>";
$thread[icon]=str_replace("","",$thread[icon]);
$customicon=$thread[icon];
for($i=0;$posticons[$i];){
$posticons[$i]=str_replace($br,"",$posticons[$i]);
if($thread[icon]==$posticons[$i]){
$checked='checked=1';
$customicon='';
}
$posticonlist.="<INPUT type=radio class=radio name=iconid value=$i $checked>&nbsp<IMG SRC=$posticons[$i] HEIGHT=15 WIDTH=15>&nbsp &nbsp";
$i++;
if($i%10==0) $posticonlist.='<br>';
$checked='';
}
if(!$thread[icon]) $checked='checked=1';
$posticonlist.="
<br>$radio=iconid value=-1 $checked>&nbsp None &nbsp &nbsp
Custom: $inpt=custposticon VALUE='$customicon' SIZE=40 MAXLENGTH=100>
";
$check1[$poll[closed]]='checked=1';
$check2[$poll[doublevote]]='checked=1';
$forums=mysql_query("SELECT id,title FROM forums WHERE minpower<=$power ORDER BY forder");
while($forum=mysql_fetch_array($forums)){
$checked='';
if($thread[forum]==$forum[id]) $checked='selected';
$forummovelist.="<option value=$forum[id] $checked>$forum[title]</option>";
}
$onsubmithook = '="if(usingBetterWay){startGather();return false;}else{alert(\'was going to post\');return false;}"';
print "
<FORM ACTION=editpoll.php NAME=REPLIER id=\"mainform\" METHOD=POST onsubmit$onsubmithook>
$tccellh colspan=2>Editing poll for thread <b>".($thread[icon]!=""?"<img src=\"$thread[icon]\" />&nbsp;":"").$thread['title']."</b><tr>
$tccell1><b>Poll question:</b></td> $tccell2l>$inpt=pollqu VALUE=\"$poll[question]\" SIZE=40 MAXLENGTH=100><tr>
$tccell1><b>Poll briefing:</b></td> $tccell2l>$inpt=pollbr VALUE=\"$poll[briefing]\" SIZE=40 MAXLENGTH=100><tr>
$tccell1><b>Poll status:</b></td> $tccell2l>$radio=pollclosed value=0 $check1[0]> Open&nbsp &nbsp$radio=pollclosed value=1 $check1[1]>Closed<tr>
$tccell1><b>Multiple voting:</b></td> $tccell2l>$radio=polldbl value=0 $check2[0]> Disabled&nbsp &nbsp$radio=polldbl value=1 $check2[1]>Enabled<tr>
$tccell1><b>Choices:</b></td> $tccell2l>$choices<tr>
$tccell1><b>New choices:</b></td> $tccell2l>$newchoices<tr>
"./* $tccell1><b>Forum</b></td> $tccell2l><select name=forummove>$forummovelist</select> <INPUT type=checkbox class=radio name=delete value=1>Delete thread<tr>*/"
$tccell1>&nbsp</td>$tccell2l>
$inph=action VALUE=editpoll>$inph=id VALUE=$id>
$inps=doedit onclick$onsubmithook VALUE=\"Edit poll\"></td></FORM>
$tblend
";
}
if($_POST[action]=='editpoll'){
if(($ismod && (!$thread[locked] || !$bconf[lockable])) || ($isadmin) || ($thread[user] == $loguserid && !$thread[closed])){
print "
$tccell1>Thank you, $loguser[name], for editing the poll.<br>
";
if (!is_debug()) { print redirect("thread.php?id=$id",'return to the thread',0); }
debugprint("$tblend$tblstart$tccellh>Edit poll debug data<tr>$tccell1l><pre>");
$divisor = "----------------------------------";
$ch = $co = "";
debugprint("WOULD HAVE INSERTED:<br><br>");
if($createdWithPassthru == "yes") {
if (is_array($choiceaddjs)) {
debugprint("JAVASCRIPT INSERTS:<br>------<br>");
foreach($choiceaddjs as $i=>$ch) {
$co = $choicecoloraddjs[$i]; // cleaning poll color:
$co = preg_replace("'^#(.*?)$'", "\\1", $co); // remove prefix # if given
$co = preg_replace("'[^a-zA-Z0-9]'", "", $co); // only alphanumerics, please
$co = substr($co, 0, 6); // and cut at six chars of length
debugprint("INSERT INTO poll_choices (id,poll,choice,color) VALUES (NULL,".$thread['poll'].",'".addslashes(stripslashes($ch))."','".addslashes(stripslashes($co))."')<br>");
mysql_query("INSERT INTO poll_choices (id,poll,choice,color) VALUES (NULL,".$thread['poll'].",'".addslashes(stripslashes($ch))."','".addslashes(stripslashes($co))."')");
}
}
} else {
if (is_array($choiceadd) && $choiceadddoadd) {
debugprint("NON-JAVASCRIPT INSERTS:<br>------<br>");
foreach($choiceadd as $i=>$ch) {
$co = $choicecoloradd[$i]; // cleaning poll color:
$co = preg_replace("'^#(.*?)$'", "\\1", $co); // remove prefix # if given
$co = preg_replace("'[^a-zA-Z0-9]'", "", $co); // only alphanumerics, please
$co = substr($co, 0, 6); // and cut at six chars of length
debugprint ("INSERT INTO poll_choices (id,poll,choice,color) VALUES (NULL,".$thread['poll'].",'".addslashes(stripslashes($ch))."','".addslashes(stripslashes($co))."')<br>");
mysql_query("INSERT INTO poll_choices (id,poll,choice,color) VALUES (NULL,".$thread['poll'].",'".addslashes(stripslashes($ch))."','".addslashes(stripslashes($co))."')");
}
}
}
$pollc=mysql_query("SELECT id,choice,color FROM poll_choices WHERE poll=".$thread['poll']);
while($pc = mysql_fetch_array($pollc)) { $pollchoices[$pc['id']] = $pc; }
if (is_array($choice)) {
debugprint("<br>CHANGED ITEMS:<br>------<br>");
foreach($choice as $i=>$ch) {
$i = intval($i);
$co = $choicecolor[$i]; // cleaning poll color:
$co = preg_replace("'^#(.*?)$'", "\\1", $co); // remove prefix # if given
$co = preg_replace("'[^a-zA-Z0-9]'", "", $co); // only alphanumerics, please
$co = substr($co, 0, 6); // and cut at six chars of length
if ($choiceremove[$i]) {
if (@mysql_num_rows(mysql_query("SELECT * FROM pollvotes WHERE choice=$id"))>0) {
debugprint("WON'T DELETE CHOICE \"$ch\" (COLOR \"$co\") - HAS VOTES<br>");
} else {
debugprint("DELETE FROM poll_choices WHERE id=$i<br>");
mysql_query("DELETE FROM poll_choices WHERE id=$i");
debugprint(" # CHOICE \"$ch\" (COLOR \"$co\")<br>");
}
} else if (($ch != $pollchoices[$i]['choice'] && trim($ch) != "") || ($co != $pollchoices[$i]['color'] && trim($co) != "")) {
debugprint("UPDATE poll_choices SET choice='".addslashes(stripslashes($ch))."', color='".addslashes(stripslashes($co))."' WHERE id=$i<br>");
mysql_query("UPDATE poll_choices SET choice='".addslashes(stripslashes($ch))."', color='".addslashes(stripslashes($co))."' WHERE id=$i");
debugprint(" # CHOICE \"$ch\" (COLOR \"$co\")<br>");
} else {
debugprint("WON'T CHANGE CHOICE \"$ch\" (COLOR \"$co\") - NOT CHANGED OR EMPTY COLOR/CHOICE<br>");
}
}
}
debugprint("<br>OTHER CHANGES:<br>-----<br>");
$pollclosed = intval($pollclosed); $polldbl = intval($polldbl);
debugprint("UPDATE poll SET question='".addslashes(stripslashes($pollqu))."',briefing='".addslashes(stripslashes($pollbr))."',closed=$pollclosed,doublevote=$polldbl WHERE id=".$thread['poll']."<br>");
mysql_query("UPDATE poll SET question='".addslashes(stripslashes($pollqu))."',briefing='".addslashes(stripslashes($pollbr))."',closed=$pollclosed,doublevote=$polldbl WHERE id=".$thread['poll']);
debugprint("<br>$divisor<br><br>_POST:");
if (is_debug()) { print_r($_POST); }
debugprint("</pre>");
print $tblend;
/* $posticons[$iconid]=str_replace("\n",'',$posticons[$iconid]);
if(!$delete){
$icon=$posticons[$iconid];
if($custposticon) $icon=$custposticon;
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." edited thread $id\", \"$userip\")");
mysql_query("UPDATE threads SET forum=$forummove,closed=$closed,title='".addslashes($subject)."',icon='".addslashes($icon)."',sticky=$sticky WHERE id=$id");
if($forummove!=$forumid){
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid."moved thread $id from $forumid to $forummove\", \"$userip\")");
$numposts=$thread[replies]+1;
$t1=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1"));
$t2=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forummove ORDER BY lastpostdate DESC LIMIT 1"));
mysql_query("UPDATE forums SET numposts=numposts-$numposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid");
mysql_query("UPDATE forums SET numposts=numposts+$numposts,numthreads=numthreads+1,lastpostdate=$t2[lastpostdate],lastpostuser=$t2[lastposter] WHERE id=$forummove");
}
}else{
mysql_query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." deleted thread $id - ip $REMOTE_ADDR\", \"$userip\")");
mysql_query("DELETE FROM threads WHERE id=$id");
mysql_query("DELETE FROM posts WHERE thread=$id");
$numdeletedposts=$thread[replies]+1;
$t1=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1"));
mysql_query("UPDATE forums SET numposts=numposts-$numdeletedposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid");
}*/
}else
print "
$tccell1 Couldn't edit the poll. Either you didn't enter an existing username,
or you haven't entered the right password for the username, or you are not allowed to edit this poll.<br>
".redirect("thread.php?id=$id",'return to the poll',0);
}
print $footer;
if($stamptime){printtimedif($startingtime);}
?>

190
editpolxl.php Normal file
View File

@ -0,0 +1,190 @@
<?php
require "function.php";
require "layout.php";
function aslash($text) {
$text2=str_replace("\"","&#34",$text);
$text2=stripslashes($text2);
return $text2;
}
$forums=readforums();
$users1=mysql_query("SELECT id,posts,regdate,name,password,powerlevel,signature,postheader FROM users");
while($user=mysql_fetch_array($users1)) $users[$user[id]]=$user;
$ranks=readranks();
$smilies=readsmilies();
$inumsmilies=numsmilies();
$tccellha="<td bgcolor=$tableheadbg";
$tccellhb="><center>$fonthead";
print $header;
replytoolbar(1);
print "
<table bgcolor=$tableborder width=$tablewidth cellpadding=0 cellspacing=0>
<td>
<table cellpadding=2 cellspacing=1 width=100%>
";
$userid=checkuser($username,$password);
$user=$users[$userid];
$username=$users[$loguserid][name];
/* if($user[powerlevel]<0) $userid=-1;
if($userid!=-1){ */
$caneditpoll=0;
if($ismod or $loguserid==$thread[user]) $caneditpoll=1;
$mods=mysql_query("SELECT user FROM forummods WHERE forum=$forumid and user=$loguserid");
if(@mysql_num_rows($mods)>0 and $logpwenc) $caneditpoll=1;
if ($caneditpoll) {
if($submit){
$currenttime=ctime();
$postnum=$user[posts]+1;
if ($doublevote == "yes") { $doublevote = 1; } else { $doublevote=0; }
if ($closed == "yes") { $closed = 1; } else { $closed=0; }
mysql_query("UPDATE poll SET question='".addslashes($pollquestion)."',briefing='".addslashes($pollbriefing)."',closed=$closed,doublevote=$doublevote WHERE id=$id");
mysql_query("DELETE FROM poll_choices WHERE poll=$id");
foreach ($pollchoices as $chid => $data) {
$ccolor = $data[color];
print "<!-- $chid» color: $ccolor | name: $data[choice] | poll: $id -->";
$cname = $data[choice];
mysql_query("INSERT INTO poll_choices (choice,color,poll) VALUES ('".addslashes($cname)."','".addslashes($ccolor)."',$id)");
$moo = mysql_affected_rows();
print "<!-- $chid» affected rows: $moo -->";
}
$getid = mysql_fetch_array(mysql_query("SELECT id FROM threads WHERE pollid=$id LIMIT 1"));
$getid = $getid[id];
print "
$tccell1 Thank you, $username, for editing the poll.
<br>".redirect("thread.php?id=$getid","go back to the poll",0)."</table></table>";
} else {
if (!$firsttimepassed) {
$getpolldata = mysql_query("SELECT question,briefing,closed,doublevote FROM poll WHERE id=$id");
while($data=mysql_fetch_array($getpolldata)){
$pollquestion = $data['question'];
$pollbriefing = $data['briefing'];
$pollclosed = $data['closed'];
$polldbl = $data['doublevote'];
if ($polldbl == 1) { $polldbl = "yes"; } else { $polldbl = "no"; }
if ($pollclosed == 1) { $closed = "yes"; }
}
$getchoices = mysql_query("SELECT id,poll,choice,color FROM poll_choices WHERE poll=$id");
while($data=mysql_fetch_array($getchoices)){
$choiceno = count($pollchoices)+1;
if (count($pollchoices) == 1 && !is_array($pollchoices)) { $choiceno = 1; }
$choicebyid[$data[id]] = $data[choice];
$pollchoices[$choiceno] = array('color' => $data[color],
'choice' => $data[choice],
'id' => $data[id]);
}
$getvotes = mysql_query("SELECT id,choice,user FROM poll_votes WHERE poll=$id");
while($data=mysql_fetch_array($getvotes)){
$votes[$data[$id]] = array('user' => $data[user],
'choice' => $data[choice]);
$votesname[$data[$id]] = $data[user];
print "<!-- $data[id]: user $data[user] | choice $data[choice] -->";
}
}
$getusr = mysql_query("SELECT id,name FROM users");
while($data=mysql_fetch_array($getusr)){
$voteusers[$data[id]] = $data[name];
}
if ($addchoice) {
$choiceno = count($pollchoices)+1;
if (count($pollchoices) == 1 && !is_array($pollchoices)) { $choiceno = 1; }
$pollchoices[$choiceno] = array('color' => $polladdcolor,
'choice' => $polladdchoice);
}
if ($removechoice) {
$pc2 = $pollchoices;
foreach($pc2 as $ccid=>$data) {
if ($ccid != $torem) {
$pc3[$ccid] = $data;
}
}
$pollchoices = $pc3;
/* $key_index = array_keys(array_keys($pollchoices), array_pop($removechoice));
array_splice($pollchoices, $key_index[0], 1); */
mysql_query("DELETE FROM poll_choices WHERE id=$torem");
}
/* if ($removevote) {
$torem = array_pop($removevote);
$key_index = array_keys(array_keys($votes), $torem);
array_splice($votes, $key_index[0], 1);
foreach($votes as $vid => $val) {
$newvotes[$vid] = $val;
}
$votes = $newvotes;
mysql_query("DELETE FROM poll_votes WHERE id=$torem");
if (count($votes)==0 && isset($votes)) { unset($votes); }
} */
print "<body onload=window.document.REPLIER.pollquestion.focus()>
$tccellha width=250$tccellhb&nbsp</td>$tccellh&nbsp
<FORM ACTION=editpoll.php NAME=REPLIER METHOD=POST>
$inph=firsttimepassed VALUE=1>
$inph=torem VALUE=\"\">
$inph=id VALUE=\"$id\">";
if ($polldbl == "yes") {
$doublevote = "$radio=polldbl VALUE=\"yes\" CHECKED> Allow double voting
$radio=polldbl VALUE=\"no\"> Don't allow double voting";
} else {
$doublevote = "$radio=polldbl VALUE=\"yes\"> Allow double voting
$radio=polldbl VALUE=\"no\" CHECKED> Don't allow double voting";
}
if ($pollclosed == "yes") {
$closed = "$radio=pollclosed VALUE=\"yes\" CHECKED> Voting is closed
$radio=pollclosed VALUE=\"no\"> Voting is not closed";
} else {
$closed = "$radio=pollclosed VALUE=\"yes\"> Voting is closed
$radio=pollclosed VALUE=\"no\" CHECKED> Voting is not closed";
}
$tcheader = "$tccellha colspan=2 $tccellhb";
$halfcols = $numcols/2;
print "<tr>$tcheader Poll setup<tr>
$tccell1<b>Poll question: $tccell2l$inpt=pollquestion VALUE=\"".aslash($pollquestion)."\"><tr>
$tccell1<b>Poll briefing: $tccell2l$txta=pollbriefing ROWS=10 COLS=".$halfcols.">$pollbriefing</textarea><tr>
$tccell1<b>Poll options: $tccell2l$doublevote<br>$closed<tr>
$tcheader Choices<tr>";
if (is_array($pollchoices)) {
$m=0;
foreach($pollchoices as $cid => $data) {
$m++;
$choicescode .= "$tccell1<b>Choice ".$m."$tccell2l$inpt=\"pollchoices[$cid][choice] \" VALUE=\"".aslash($data['choice'])."\"> Color: $inpt=\"pollchoices[$cid][color]\" VALUE=\"".aslash($data['color'])."\"> $inps=\"removechoice\" onClick=\"window.document.REPLIER.torem.value='$cid';\" VALUE=\"Remove\"><tr>";
}
}
print "$choicescode
$tccell1<b>Add choice$tccell2l$inpt=\"polladdchoice\" VALUE=\"\"> Color: $inpt=\"polladdcolor\" VALUE=\"\"> $inps=\"addchoice\" VALUE=\"Add choice\">";
/* if (is_array($votes) && !empty($votes)) {
$votescode .= "<tr>$tcheader Votes";
foreach($votes as $vid => $data) {
$votescode .= "<tr>$tccell1&nbsp$tccell2l".$choicebyid[$data[choice]]." -- ".$voteusers[$votesname[$vid]]."$inph=votes[$vid][choice] VALUE=\"".$data['choice']."\">$inph=votes[$cid][id] VALUE=\"".$data['id']."\"> $inps=removevote[$cid] VALUE=\"Remove\">";
}
}
print "$votescode";
print "<tr>$tccell1&nbsp$tccell2l<pre>";
print_r ($votesname);
print "<hr>";
print_r ($voteusers);
*/
print "<tr>$tccell1&nbsp$tccell2l$inps=submit VALUE=\"Edit poll\"><tr></td></form></table></table>";
}
}else{
print "
$tccell1 Couldn't enter the post. Either you didn't enter an existing username,
or you haven't entered the right password for the username, or you haven't entered a subject.
<br>".redirect("forum.php?id=$id","return to the forum",0)."</table></table>";
}
print $footer;
printtimedif($startingtime);
?>

119
editpost.php Normal file
View File

@ -0,0 +1,119 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
$post=mysql_fetch_array(mysql_query("SELECT * FROM posts,posts_text WHERE id=$id AND id=pid"));
$threadid=$post[thread];
$threads=mysql_query("SELECT forum,closed,title FROM threads WHERE id=$threadid");
$thread=mysql_fetch_array($threads);
$thread[title]=str_replace('<','&lt;',$thread[title]);
$smilies=readsmilies();
print $header;
$forum=mysql_fetch_array(mysql_query("SELECT * FROM forums WHERE id=$thread[forum]"));
$mods=mysql_query("SELECT user FROM forummods WHERE forum=$forum[id] AND user=$loguserid");
if(@mysql_num_rows($mods) and $logpwenc) $ismod=1;
print "$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forum[id]>".$forum[title]."</a> - $thread[title]
$tblstart
<FORM ACTION=editpost.php NAME=REPLIER METHOD=POST>";
if(!$action and $log and ($ismod or $loguserid==$post[user]) and (!$forum[minpower] or $power>=$forum[minpower])){
if($logpwenc and $loguser[password]==$logpwenc){
$username=$loguser[name];
$password=$logpassword;
}
$message=$post[text];
if(!$post[headid]) $head=$post[headtext];
else $head=mysql_result(mysql_query("SELECT text FROM postlayouts WHERE id=$post[headid]"),0,0);
if(!$post[signid]) $sign=$post[signtext];
else $sign=mysql_result(mysql_query("SELECT text FROM postlayouts WHERE id=$post[signid]"),0,0);
sbr(1,$message);
sbr(1,$head);
sbr(1,$sign);
$users=mysql_query("SELECT name FROM users WHERE id=$post[user]");
$user=mysql_fetch_array($users);
print "
$tccellh width=150>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1><b>Header:</td> $tccell2l>$txta=head ROWS=8 COLS=$numcols>$head</TEXTAREA><tr>
$tccell1><b>Post:</td> $tccell2l>$txta=message ROWS=12 COLS=$numcols>$message</TEXTAREA><tr>
$tccell1><b>Signature:</td> $tccell2l>$txta=sign ROWS=8 COLS=$numcols>$sign</TEXTAREA><tr>
$inph=edited VALUE=\"$post[edited]\">
$tccell1>&nbsp</td>$tccell2l>
$inph=action VALUE=editpost>
$inph=id VALUE=$id>
$inps=submit VALUE=\"Edit post\">
$inps=preview VALUE=\"Preview post\"></td></FORM>
$tblend$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forum[id]>".$forum[title]."</a> - $thread[title]
";
}
if($_POST[action]=='editpost'){
print $tblstart;
if($ismod or $loguserid==$post[user]){
$user=mysql_fetch_array(mysql_query("SELECT posts,regdate FROM users WHERE id=$loguserid"));
$numposts=$user[posts];
$numdays=(ctime()-$user[regdate])/86400;
$message=doreplace($message,$numposts,$numdays,$loguser[name]);
if($submit){
$edited.="(edited by $loguser[name] on ".date("m-d-y h:i A",ctime()).")<br>";
$headid=@mysql_result(mysql_query("SELECT `id` FROM `postlayouts` WHERE `text` = '$head' LIMIT 1"),0,0);
$signid=@mysql_result(mysql_query("SELECT `id` FROM `postlayouts` WHERE `text` = '$sign' LIMIT 1"),0,0);
if($headid) $head=''; else $headid=0;
if($signid) $sign=''; else $signid=0;
mysql_query("UPDATE `posts_text` SET `headtext` = '$head', `text` = '$message', `signtext` = '$sign', `edited` = '$edited' WHERE `pid` = '$id'");
mysql_query("UPDATE `posts` SET `headid` = '$headid', `signid` = '$signid' WHERE `id` = '$id'");
$ppp=($log?$loguser[postsperpage]:20);
$page=floor(mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `thread` = '$threadid' AND `id` < '$id'"),0,0)/$ppp);
print "
$tccell1>Post edited successfully!.<br>
".redirect("thread.php?id=$threadid&page=$page#$id",'return to the thread',0).'</table></table>';
}else{
loadtlayout();
$ppost=mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$post[user]"));
$head = stripslashes($head);
$sign = stripslashes($sign);
$message = stripslashes($message);
$ppost[uid]=$post[user];
$ppost[num]=$post[num];
$ppost[date]=$post[date];
$ppost[tagval]=$post[tagval];
$ppost[headtext]=$head;
$ppost[signtext]=$sign;
$ppost[text]=$message;
if($isadmin) $ip=$post[ip];
print "
<body onload=window.document.REPLIER.message.focus()>
$tccellh>Post preview
$tblend$tblstart
".threadpost($ppost,1)."
$tblend<br>$tblstart
$tccellh width=150>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1><b>Header:</td> $tccell2l>$txta=head ROWS=4 COLS=$numcols>$head</TEXTAREA><tr>
$tccell1><b>Post:</td> $tccell2l>$txta=message ROWS=6 COLS=$numcols>$message</TEXTAREA><tr>
$tccell1><b>Signature:</td> $tccell2l>$txta=sign ROWS=4 COLS=$numcols>$sign</TEXTAREA><tr>
$tccell1>&nbsp</td>$tccell2l>
$inps=submit VALUE=\"Edit post\">
$inps=preview VALUE=\"Preview post\">
$inph=action VALUE=editpost>
$inph=id VALUE=$id>
</td></FORM>
";
}
}else
print "
$tccell1>Couldn't edit the post. Either you didn't enter the correct username or password,
or you are not allowed to edit this post.<br>
".redirect("thread.php?id=$threadid","return to the thread",0);
print $tblend;
}
if($action=='delete'){
if($ismod or $loguserid==$post[user]){
mysql_query("DELETE FROM posts WHERE id=$id");
mysql_query("DELETE FROM posts_text WHERE pid=$id");
$p=mysql_fetch_array(mysql_query("SELECT id,user,date FROM posts WHERE thread=$threadid ORDER BY date DESC"));
mysql_query("UPDATE threads SET replies=replies-1, lastposter=$p[user], lastpostdate=$p[date] WHERE id=$threadid");
mysql_query("UPDATE forums SET numposts=numposts-1 WHERE id=$forum[id]");
$txt="Thank you, $loguser[name], for deleting the post.";
}else $txt="Couldn't delete the post. You are not allowed to delete this post.";
print "$tblstart$tccell1>$txt<br>".redirect("thread.php?id=$threadid","return to the thread",0)."$tblend";
}
print $footer;
printtimedif($startingtime);
?>

196
editprofile.php Normal file
View File

@ -0,0 +1,196 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
if(!$log) errorpage('You must be logged in to edit your profile.');
if($banned) errorpage('Sorry, but banned users arent allowed to edit their profile.');
if($loguser[posts]>=2000 or ($loguser[posts]>=1000 && (ctime()-$loguser[regdate])>=200*86400)) $postreq=1;
if($loguser[titleoption]==0 || $banned) $titleopt=0;
if($loguser[titleoption]==1 && ($postreq or $power>0 or $loguser[title])) $titleopt=1;
if($loguser[titleoption]==2) $titleopt=1;
if(!$action){
$birthday=getdate($loguser[birthday]);
if($loguser[birthday]){
$month=$birthday[mon];
$day=$birthday[mday];
$year=$birthday[year];
}
$descbr="</b>$smallfont<br></center>&nbsp;";
$checked1[$loguser[sex]]='checked=1';
$checked2[$loguser[viewsig]]='checked=1';
$checked3[$loguser[posttool]]='checked=1';
$checked4[$loguser[useranks]]='checked=1';
$sexlist="
$radio=sex value=0 $checked1[0]> Male &nbsp;&nbsp;
$radio=sex value=1 $checked1[1]> Female &nbsp;&nbsp;
$radio=sex value=2 $checked1[2]> N/A";
$vsig="
$radio=viewsig value=0 $checked2[0]> Disabled &nbsp;&nbsp;
$radio=viewsig value=1 $checked2[1]> Enabled &nbsp;&nbsp;
$radio=viewsig value=2 $checked2[2]> Auto-updating";
$vtool="
$radio=posttool value=0 $checked3[0]> Disabled &nbsp;&nbsp;
$radio=posttool value=1 $checked3[1]> Enabled";
if($titleopt){
// this went after this block, which makes it COMPLETELY USELESS
squot(0,$loguser[title]);
$titleoption="
$tccell1><b>Custom title:$descbr This title will be shown below your rank.</td>
$tccell2l>$inpt=title VALUE=\"$loguser[title]\" SIZE=60 MAXLENGTH=255><tr>
";
}
squot(1,$loguser[minipic]);
squot(1,$loguser[picture]);
squot(0,$loguser[realname]);
squot(0,$loguser[location]);
squot(1,$loguser[aim]);
squot(1,$loguser[imood]);
squot(1,$loguser[email]);
squot(1,$loguser[homepageurl]);
squot(0,$loguser[homepagename]);
sbr(1,$loguser[postheader]);
sbr(1,$loguser[signature]);
sbr(1,$loguser[bio]);
$schemes=mysql_query('SELECT id,name FROM schemes ORDER BY ord');
while($sch=mysql_fetch_array($schemes)){
$sel=($sch[id]==$loguser[scheme]?' selected':'');
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE scheme=$sch[id]"),0,0);
$schlist.="<option value=$sch[id]$sel>$sch[name] ($used)";
}
$schlist="<select name=sscheme>$schlist</select>";
$tlayouts=mysql_query('SELECT id,name FROM tlayouts ORDER BY ord');
while($lay=mysql_fetch_array($tlayouts)){
$sel=($lay[id]==$loguser[layout]?' selected':'');
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE layout=$lay[id]"),0,0);
$laylist.="<option value=$lay[id]$sel>$lay[name] ($used)";
}
$laylist="<select name=tlayout>$laylist</select>";
for($i=0;$sepn[$i];$i++){
$sel=($i==$loguser[signsep]?' selected':'');
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE signsep=$i"),0,0);
$seplist.="<option value=$i$sel>$sepn[$i] ($used)";
}
$seplist="<select name=signsep>$seplist</select>";
$rsets=mysql_query('SELECT id,name FROM ranksets ORDER BY id');
while($set=mysql_fetch_array($rsets)){
$sel=($set[id]==$loguser[useranks]?' selected':'');
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE useranks=$set[id]"),0,0);
$rsetlist.="<option value=$set[id]$sel>$set[name] ($used)";
}
$rsetlist="<select name=useranks>$rsetlist</select>";
print "
$header<br>$tblstart
<FORM ACTION=editprofile.php NAME=REPLIER METHOD=POST>
$tccellh>Login information</td>$tccellh>&nbsp<tr>
$tccell1><b>User name:</td>$tccell2l>$loguser[name]<tr>
$tccell1><b>Password:</b>$descbr You can change your password by entering a new one here.</td>
$tccell2l>$inpp=password SIZE=13 MAXLENGTH=32><tr>
$tccellh> Appearance</td>$tccellh>&nbsp<tr>
$titleoption
$tccell1><b>User rank:</b>$descbr You can hide your rank, or choose from different sets.</td>
$tccell2l>$rsetlist<tr>
$tccell1><b>User picture:$descbr The full URL of the image showing up below your username in posts. Leave it blank if you don't want to use a picture. The picture is resized to 60 in width. You can also select from a <a href=userpic.php>limited set</a> if you want.</td>
$tccell2l>$inpt=picture VALUE=\"$loguser[picture]\" SIZE=60 MAXLENGTH=100><tr>
$tccell1><b>Minipic:$descbr The full URL of a small picture showing up next to your username on some pages. Leave it blank if you don't want to use a picture. The picture is resized to 11x11.</td>
$tccell2l>$inpt=minipic VALUE=\"$loguser[minipic]\" SIZE=60 MAXLENGTH=100><tr>
$tccell1><b>Post background:$descbr The full URL of a picture showing up in the background of your posts. Leave it blank for no background. Please make sure your text is readable on the background!</td>
$tccell2l>$inpt=postbg VALUE=\"$loguser[postbg]\" SIZE=60 MAXLENGTH=250><tr>
$tccell1><b>Post header:$descbr This will get added before the start of each post you make. This can be used to give a default font color and face to your posts (by putting a <<z>font> tag). This should preferably be kept small, and not contain too much text or images.</td>
$tccell2l>$txta=postheader ROWS=5 COLS=60>$loguser[postheader]</TEXTAREA><tr>
$tccell1><b>Signature:$descbr This will get added at the end of each post you make, below an horizontal line. This should preferably be kept to a small enough size.</td>
$tccell2l>$txta=signature ROWS=5 COLS=60>$loguser[signature]</TEXTAREA><tr>
$tccellh>Personal information</td>$tccellh>&nbsp<tr>
$tccell1><b>Sex:$descbr Male or female. (or N/A if you don't want to tell it)</td>
$tccell2l>$sexlist<tr>
$tccell1><b>Real name:$descbr Your real name (you can leave this blank).</td>
$tccell2l>$inpt=realname VALUE=\"$loguser[realname]\" SIZE=40 MAXLENGTH=60><tr>
$tccell1><b>Location:$descbr Where you live (city, country, etc.).</td>
$tccell2l>$inpt=location VALUE=\"$loguser[location]\" SIZE=40 MAXLENGTH=60><tr>
$tccell1><b>Birthday:$descbr Your date of birth.</td>
$tccell2l>Month: $inpt=bmonth SIZE=2 MAXLENGTH=2 VALUE=$month> Day: $inpt=bday SIZE=2 MAXLENGTH=2 VALUE=$day> Year: $inpt=byear SIZE=4 MAXLENGTH=4 VALUE=$year><tr>
$tccell1><b>Bio:$descbr Some information about yourself, showing up in your profile.</td>
$tccell2l>$txta=bio ROWS=5 COLS=60>$loguser[bio]</TEXTAREA><tr>
$tccellh>Online services</td>$tccellh>&nbsp<tr>
$tccell1><b>Email address:$descbr This is only shown in your profile; you don't have to enter it if you don't want to.</td>
$tccell2l>$inpt=email VALUE=\"$loguser[email]\" SIZE=60 MAXLENGTH=60><tr>
$tccell1><b>AIM screen name:$descbr Your AIM screen name, if you have one.</td>
$tccell2l>$inpt=aim VALUE=\"$loguser[aim]\" SIZE=30 MAXLENGTH=30><tr>
$tccell1><b>ICQ number:$descbr Your ICQ number, if you have one.</td>
$tccell2l>$inpt=icq VALUE=$loguser[icq] SIZE=10 MAXLENGTH=10><tr>
$tccell1><b>imood:$descbr If you have a imood account, you can enter the account name (email) for it here.</td>
$tccell2l>$inpt=imood VALUE=\"$loguser[imood]\" SIZE=60 MAXLENGTH=100><tr>
$tccell1><b>Homepage URL:$descbr Your homepage URL (must start with the \"http://\"), if you have one.</td>
$tccell2l>$inpt=homepage VALUE=\"$loguser[homepageurl]\" SIZE=60 MAXLENGTH=80><tr>
$tccell1><b>Homepage name:$descbr Your homepage name, if you have a homepage.</td>
$tccell2l>$inpt=pagename VALUE=\"$loguser[homepagename]\" SIZE=60 MAXLENGTH=100><tr>
$tccellh> Options</td>$tccellh>&nbsp<tr>
$tccell1><b>Timezone offset:$descbr How many hours you're offset from the time on the board (".date($dateformat,ctime()).").</td>
$tccell2l>$inpt=timezone VALUE=$loguser[timezone] SIZE=5 MAXLENGTH=5><tr>
$tccell1><b>Posts per page:$descbr The maximum number of posts you want to be shown in a page in threads.</td>
$tccell2l>$inpt=postsperpage SIZE=4 MAXLENGTH=4 VALUE=$loguser[postsperpage]><tr>
$tccell1><b>Threads per page:$descbr The maximum number of threads you want to be shown in a page in forums.</td>
$tccell2l>$inpt=threadsperpage SIZE=4 MAXLENGTH=4 VALUE=$loguser[threadsperpage]><tr>
$tccell1><b>Use textbox toolbar when posting:$descbr You can disable it here, preventing potential slowdowns or other minor problems when posting.</td>
$tccell2l>$vtool<tr>
$tccell1><b>Signatures and post headers:$descbr You can disable them here, which can make thread pages smaller and load faster.</td>
$tccell2l>$vsig<tr>
$tccell1><b>Thread layout:$descbr You can choose from a few thread layouts here.</td>
$tccell2l>$laylist<tr>
$tccell1><b>Signature separator:$descbr You can choose from a few signature separators here.</td>
$tccell2l>$seplist<tr>
$tccell1><b>Color scheme / layout:$descbr You can select from a few color schemes here.</td>
$tccell2l>$schlist<tr>
$tccellh>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1>&nbsp</td>$tccell2l>
$inph=action VALUE=saveprofile>
$inph=userid VALUE=$userid>
$inph=userpass VALUE=\"$loguser[password]\">
$inps=submit VALUE=\"Edit profile\"></td></FORM>
$tblend
";
}
if($action=='saveprofile'){
sbr(0,$postheader);
sbr(0,$signature);
sbr(0,$bio);
if(!isset($title) or !$titleopt) $title=$loguser[title];
if($sex>2) $sex=2;
$title=preg_replace("'<(b|i|u|s|br)>'si", '[\\1]', $title);
$title=preg_replace("'</(b|i|u|s|font)>'si", '[/\\1]', $title);
$title=preg_replace("'<img ([^>].*?)>'si", '[img \\1]', $title);
$title=preg_replace("'<font ([^>].*?)>'si", '[font \\1]', $title);
$title=preg_replace("'<[\/\!]*?[^<>]*?>'si", '', $title);
$title=preg_replace("'\[font ([^>].*?)\]'si", '<font \\1>', $title);
$title=preg_replace("'\[img ([^>].*?)\]'si", '<img \\1>', $title);
$title=preg_replace("'\[(b|i|u|s|br)\]'si", '<\\1>', $title);
$title=preg_replace("'\[/(b|i|u|s|font)\]'si", '</\\1>', $title);
$title=preg_replace("'(face|style|class|size)=\"([^ ].*?)\"'si", '', $title);
$title=preg_replace("'(face|style|class|size)=\'([^ ].*?)\''si", '', $title);
$title=preg_replace("'(face|style|class|size)=([^ ].*?)'si", '', $title);
$bio=preg_replace("'<iframe'si", '&lt;iframe', $bio);
$bio=preg_replace("'<script'si", '&lt;script', $bio);
$bio=preg_replace("'onload'si", 'o<z>nload', $bio);
$bio=preg_replace("'onfail'si", 'o<z>nfail', $bio);
$bio=preg_replace("'onhover'si", 'o<z>nhover', $bio);
$bio=preg_replace("'javascript'si", 'java<z>script', $bio);
$birthday=mktime(0,0,0,$bmonth,$bday,$byear);
if(!$bmonth && !$bday && !$byear) $birthday=0;
if(!$icq) $icq=0;
if(!$password) $passwordenc=$userpass;
else{
$passwordenc=md5($password);
if($loguser[id]==$loguserid) setcookie('logpassword',shenc($password),2147483647);
}
if(!isset($useranks)) $useranks=$loguser[useranks];
mysql_query("UPDATE users SET `password` = '$passwordenc', `picture` = '$picture', `minipic` = '$minipic', `signature` = '$signature', `bio` = '$bio', `email` = '$email', `icq` = '$icq', `title` = '$title', `useranks` = '$useranks', `aim` = '$aim', `sex` = '$sex', `homepageurl` = '$homepage', `homepagename` = '$pagename', `timezone` = '$timezone', `postsperpage` = '$postsperpage', `realname` = '$realname', `location` = '$location', `postbg` = '$postbg', `postheader` = '$postheader', `birthday` = '$birthday', `scheme` = '$sscheme', `threadsperpage` = '$threadsperpage', `viewsig` = '$viewsig', `layout` = '$tlayout', `posttool` = '$posttool', `imood` = '$imood', `signsep` = '$signsep' WHERE `id` = '$loguserid' AND `password` = '$userpass'") OR print mysql_error();
print "$header<br>$tblstart$tccell1>Thank you, $loguser[name], for editing your profile.<br>".redirect("profile.php?id=$loguserid",'view your profile',0).$tblend;
}
print $footer;
printtimedif($startingtime);
?>

87
editthread.php Normal file
View File

@ -0,0 +1,87 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
$threads=mysql_query("SELECT forum,closed,title,icon,replies,lastpostdate,lastposter,sticky FROM threads WHERE id=$id");
$thread=mysql_fetch_array($threads);
$forumid=$thread[forum];
$posticons=file('posticons.dat');
$mods=mysql_query("SELECT user FROM forummods WHERE forum=$forumid and user=$loguserid");
print "$header<br>$tblstart";
if(@mysql_num_rows($mods)) $ismod=1;
if(!$action && $ismod){
$thread[icon]=str_replace("
","",$thread[icon]);
$customicon=$thread[icon];
for($i=0;$posticons[$i];){
$posticons[$i]=str_replace($br,"",$posticons[$i]);
if($thread[icon]==$posticons[$i]){
$checked='checked=1';
$customicon='';
}
$posticonlist.="<INPUT type=radio class=radio name=iconid value=$i $checked>&nbsp<IMG SRC=$posticons[$i] HEIGHT=15 WIDTH=15>&nbsp &nbsp";
$i++;
if($i%10==0) $posticonlist.='<br>';
$checked='';
}
if(!$thread[icon]) $checked='checked=1';
$posticonlist.="
<br>$radio=iconid value=-1 $checked>&nbsp None &nbsp &nbsp
Custom: $inpt=custposticon VALUE='$customicon' SIZE=40 MAXLENGTH=100>
";
$check1[$thread[closed]]='checked=1';
$check2[$thread[sticky]]='checked=1';
$forums=mysql_query("SELECT id,title FROM forums WHERE minpower<=$power ORDER BY forder");
while($forum=mysql_fetch_array($forums)){
$checked='';
if($thread[forum]==$forum[id]) $checked='selected';
$forummovelist.="<option value=$forum[id] $checked>$forum[title]</option>";
}
print "
<FORM ACTION=editthread.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh>&nbsp<tr>
$tccell1><b>Thread title:</b></td> $tccell2l>$inpt=subject VALUE=\"$thread[title]\" SIZE=40 MAXLENGTH=100><tr>
$tccell1><b>Thread icon:</b></td> $tccell2l>$posticonlist<tr>
$tccell1 rowspan=2>&nbsp</td> $tccell2l>$radio=closed value=0 $check1[0]> Open&nbsp &nbsp$radio=closed value=1 $check1[1]>Closed<tr>
$tccell2l>$radio=sticky value=0 $check2[0]> Normal&nbsp &nbsp$radio=sticky value=1 $check2[1]>Sticky<tr>
$tccell1><b>Forum</b></td> $tccell2l><select name=forummove>$forummovelist</select> <INPUT type=checkbox class=radio name=delete value=1>Delete thread<tr>
$tccell1>&nbsp</td>$tccell2l>
$inph=action VALUE=editthread>$inph=id VALUE=$id>
$inps=submit VALUE=\"Edit thread\"></td></FORM>
$tblend
";
}
if($_POST[action]=='editthread'){
if($ismod){
print "
$tccell1>Thank you, $loguser[name], for editing the thread.<br>
".redirect("forum.php?id=$forumid",'return to the forum',0).$tblend;
$posticons[$iconid]=str_replace("\n",'',$posticons[$iconid]);
if(!$delete){
$icon=$posticons[$iconid];
if($custposticon) $icon=$custposticon;
mysql_query("UPDATE `threads` SET `forum` = '$forummove', `closed` = '$closed', `title` = '$subject', `icon` = '$icon', `sticky` = '$sticky' WHERE `id` = '$id'");
if($forummove!=$forumid){
$numposts=$thread[replies]+1;
$t1=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1"));
$t2=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forummove ORDER BY lastpostdate DESC LIMIT 1"));
mysql_query("UPDATE forums SET numposts=numposts-$numposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid");
mysql_query("UPDATE forums SET numposts=numposts+$numposts,numthreads=numthreads+1,lastpostdate=$t2[lastpostdate],lastpostuser=$t2[lastposter] WHERE id=$forummove");
}
}else{
mysql_query("DELETE FROM threads WHERE id=$id");
// ******** TO DO **********
// make this only hide the posts; deleting unrecoverable information is very very bad
// mysql_query("DELETE FROM posts WHERE thread=$id");
$numdeletedposts=$thread[replies]+1;
$t1=mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1"));
mysql_query("UPDATE forums SET numposts=numposts-$numdeletedposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid");
}
}else
print "
$tccell1 Couldn't edit the thread. Either you didn't enter an existing username,
or you haven't entered the right password for the username, or you are not allowed to edit this thread.<br>
".redirect("thread.php?id=$id",'return to the thread',0);
}
print $footer;
printtimedif($startingtime);
?>

145
edituser.php Normal file
View File

@ -0,0 +1,145 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
if(!$isadmin) die();
$user=@mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$id"));
print $header;
$check1[$user[powerlevel]+1]='selected';
$check2[$user[sex]]='checked=1';
$check3[$user[useranks]]='checked=1';
$checked2[$user[viewsig]]='checked=1';
$checked3[$user[posttool]]='checked=1';
$levellist="
<select name=powerlevel>
<option value=-1 $check1[0]>Banned</option>
<option value=0 $check1[1]>Normal</option>
<option value=1 $check1[2]>Local moderator</option>
<option value=2 $check1[3]>Full moderator</option>
<option value=3 $check1[4]>Administrator</option>
<option value=4 $check1[5]>Administrator, but with random colors</option>
</select>";
$sexlist="
$radio=sex value=0 $check2[0]>Male&nbsp &nbsp
$radio=sex value=1 $check2[1]>Female&nbsp &nbsp
$radio=sex value=2 $check2[2]>N/A";
$vsig="
$radio=viewsig value=0 $checked2[0]>Disabled&nbsp &nbsp
$radio=viewsig value=1 $checked2[1]>Enabled&nbsp &nbsp
$radio=viewsig value=1 $checked2[2]>Auto-updating";
$vtool="
$radio=posttool value=0 $checked3[0]>Disabled&nbsp &nbsp
$radio=posttool value=1 $checked3[1]>Enabled";
$birthday=getdate($user[birthday]);
if($user[birthday]){
$month=$birthday[mon];
$day=$birthday[mday];
$year=$birthday[year];
}
$schemes=mysql_query('SELECT id,name FROM schemes ORDER BY ord');
while($sch=mysql_fetch_array($schemes)){
$sel='';
if($sch[id]==$user[scheme]) $sel=' selected';
$used=mysql_result(mysql_query("SELECT count(id) as cnt FROM users WHERE scheme=$sch[id]"),0,'cnt');
$schlist.="<option value=$sch[id]$sel>$sch[name] ($used)";
}
$schlist="<select name=sscheme>$schlist</select>";
$tlayouts=mysql_query('SELECT id,name FROM tlayouts ORDER BY ord');
while($lay=mysql_fetch_array($tlayouts)){
$sel="";
if($lay[id]==$user[layout]) $sel=' selected';
$used=mysql_result(mysql_query("SELECT count(id) as cnt FROM users WHERE layout=$lay[id]"),0,'cnt');
$laylist.="<option value=$lay[id]$sel>$lay[name] ($used)";
}
$laylist="<select name=tlayout>$laylist</select>";
$rsets=mysql_query('SELECT id,name FROM ranksets ORDER BY id');
while($set=mysql_fetch_array($rsets)){
$sel=($set[id]==$user[useranks]?' selected':'');
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE useranks=$set[id]"),0,0);
$rsetlist.="<option value=$set[id]$sel>$set[name] ($used)";
}
$rsetlist="<select name=useranks>$rsetlist</select>";
if(!$_POST[action] and $log){
$lft="<tr>$tccell1><b>";
$rgt=":</td>$tccell2l>";
$hlft="<tr>$tccellh>";
$hrgt="</td>$tccellh>&nbsp;</td>";
squot(0,$user[name]);
squot(0,$user[title]);
squot(1,$user[minipic]);
squot(1,$user[picture]);
squot(0,$user[realname]);
squot(0,$user[location]);
squot(1,$user[aim]);
squot(1,$user[imood]);
squot(1,$user[email]);
squot(1,$user[homepageurl]);
squot(0,$user[homepagename]);
sbr(1, $user[bio]);
sbr(1, $user[signature]);
sbr(1, $user[postheader]);
print "
<br>
$tblstart
<FORM ACTION=edituser.php NAME=REPLIER METHOD=POST>
$hlft Login information $hrgt
$lft User name $rgt$inpt=username VALUE=\"$user[name]\" SIZE=25 MAXLENGTH=25>
$lft Password $rgt$inpp=password VALUE=\"\" SIZE=13 MAXLENGTH=32>
$hlft Administrative bells and whistles $hrgt
$lft Power level $rgt$levellist
$lft Custom title $rgt$inpt=usertitle VALUE=\"$user[title]\" SIZE=60 MAXLENGTH=255>
$lft Rank set $rgt$rsetlist
$lft Number of posts $rgt$inpt=numposts SIZE=5 MAXLENGTH=10 VALUE=$user[posts]>
$lft Registration time:</b>$smallfont<br>(seconds since ".date($dateformat,$tzoff).")</td>$tccell2l>$inpt=regtime SIZE=10 MAXLENGTH=15 VALUE=$user[regdate]><tr>
$hlft Appearence $hrgt
$lft User picture $rgt$inpt=picture VALUE=\"$user[picture]\" SIZE=60 MAXLENGTH=100>
$lft Mini picture $rgt$inpt=minipic VALUE=\"$user[minipic]\" SIZE=60 MAXLENGTH=100>
$lft Post background $rgt$inpt=postbg VALUE=\"$user[postbg]\" SIZE=60 MAXLENGTH=100>
$lft Post header $rgt$txta=postheader ROWS=5 COLS=60>$user[postheader]</TEXTAREA>
$lft Signature $rgt$txta=signature ROWS=5 COLS=60>$user[signature]</TEXTAREA>
$hlft Personal information $hrgt
$lft Sex $rgt$sexlist
$lft Real name $rgt$inpt=realname VALUE=\"$user[realname]\" SIZE=40 MAXLENGTH=60>
$lft Location $rgt$inpt=location VALUE=\"$user[location]\" SIZE=40 MAXLENGTH=60>
$lft Birthday $rgt Month: $inpt=bmonth SIZE=2 MAXLENGTH=2 VALUE=$month> Day: $inpt=bday SIZE=2 MAXLENGTH=2 VALUE=$day> Year: $inpt=byear SIZE=4 MAXLENGTH=4 VALUE=$year>
$lft Bio $rgt$txta=bio ROWS=5 COLS=60>$user[bio]</TEXTAREA>
$hlft Online services $hrgt
$lft Email address $rgt$inpt=email VALUE=\"$user[email]\" SIZE=60 MAXLENGTH=60>
$lft AIM screen name $rgt$inpt=aim VALUE=\"$user[aim]\" SIZE=30 MAXLENGTH=30>
$lft ICQ number $rgt$inpt=icq SIZE=10 MAXLENGTH=10 VALUE=$user[icq]>
$lft Homepage title $rgt$inpt=pagename VALUE=\"$user[homepagename]\" SIZE=60 MAXLENGTH=80>
$lft Homepage URL $rgt$inpt=homepage VALUE=\"$user[homepageurl]\" SIZE=60 MAXLENGTH=80>
$hlft Options $hrgt
$lft Timezone offset $rgt$inpt=timezone SIZE=5 MAXLENGTH=5 VALUE=$user[timezone]>
$lft Posts per page $rgt$inpt=postsperpage SIZE=5 MAXLENGTH=5 VALUE=$user[postsperpage]>
$lft Threads per page $rgt$inpt=threadsperpage SIZE=4 MAXLENGTH=4 VALUE=$user[threadsperpage]>
$lft Use text toolbar when posting $rgt$vtool
$lft View signatures and post headers $rgt$vsig
$lft Thread layout $rgt$laylist
$lft Color scheme / layout $rgt$schlist
$lft &nbsp</td>$tccell2l>
$inph=action VALUE=saveprofile>
$inph=userid VALUE=$id>
$inps=submit VALUE=\"Edit profile\"></td></FORM>
$tblend
";
}
if($_POST[action]=='saveprofile'){
sbr(0,$signature);
sbr(0,$bio);
sbr(0,$postheader);
$minipic = htmlspecialchars($minipic);
$avatar = htmlspecialchars($avatar);
$birthday=mktime(0,0,0,$bmonth,$bday,$byear);
if(!$bmonth && !$bday && !$byear) $birthday=0;
if($password) $passedit=", `password` = '".md5($password)."'";
//mysql_query("INSERT logs SET useraction ='Edit User ".$user[nick]."(".$user[id]."'");
mysql_query("UPDATE `users` SET `posts` = '$numposts', `regdate` = '$regtime', `name` = '$username'$passedit, `picture` = '$picture', `signature` = '$signature', `bio` = '$bio', `powerlevel` = '$powerlevel', `title` = '$usertitle', `email` = '$email', `icq` = '$icq', `aim` = '$aim', `sex` = '$sex', `homepageurl` = '$homepage', `timezone` = '$timezone', `postsperpage` = '$postsperpage', `realname` = '$realname', `location` = '$location', `postbg` = '$postbg', `postheader` = '$postheader', `useranks` = '$useranks', `birthday` = '$birthday', `minipic` = '$minipic', `homepagename` = '$pagename', `scheme` = '$sscheme', `threadsperpage` = '$threadsperpage', `viewsig` = '$viewsig', `layout` = '$tlayout', `posttool` = '$posttool' WHERE `id` = '$userid'") or print mysql_error();
print "
$tblstart
$tccell1>Thank you, $loguser[name], for editing this user.<br>
".redirect("index.php","return to the board",0)."
$tblend";
}
print $footer;
printtimedif($startingtime);
?>

217
faq.php Normal file
View File

@ -0,0 +1,217 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
$smilies=readsmilies();
for($i=0;$smilies[$i][0];$i++) $smilielist.="<br><img src='".$smilies[$i][1]."'> -- ".$smilies[$i][0];
$tb='&nbsp &nbsp;';
$tab="</a></b><br><br>$tb";
$cell1="<br><br><tr>$tccell1l><br><b>- <a href=# name";
$cell2="<br><br><tr>$tccell2l><br><b>- <a href=# name";
$q01='General disclaimer';
$q02='Why should I register an account on the board?';
$q03="I'm new, where should I start?";
$q04='What is the standard of acceptable behavior at the board?';
$q05='What is considered "spam" at the board?';
$q06='What is the strike system?';
$q07='What can I do about my thread being closed/trashed/deleted?';
$q08="Help! I've been banned! What do I do now?";
$q09='Are cookies used for this board?';
$q10='Can HTML be used?';
$q11='Is there some sort of replacement code for HTML?';
$q12='Are there any rules for post layouts?';
$q13='What is Level and EXP, and how do I get more EXP?';
$q14='How do I add my stats to my posts?';
$q15='What are the "syndromes" and how do I get them?';
$q16='What is the ACS?';
$q17='What are the user rankings?';
$q18='How can I get a custom rank?';
$q19='How can I become a moderator or administrator?';
$q20='What are announcements?';
$q21='Can you add me to the Photo Album?';
$q22='How can I change my username?';
$q23='What do the username colors mean?';
$q24='What are all the smilies?';
$q25='How can I get a AcmlmBoard?';
print "$header<br>
$tblstart
$tccellh>FAQ<tr>
$tccell1ls><br>
- <a href=#01>$q01</a><br><br>
- <a href=#02>$q02</a><br>
- <a href=#03>$q03</a><br>
- <a href=#04>$q04</a><br>
- <a href=#05>$q05</a><br>
- <a href=#06>$q06</a><br>
- <a href=#07>$q07</a><br>
- <a href=#08>$q08</a><br><br>
- <a href=#09>$q09</a><br>
- <a href=#10>$q10</a><br>
- <a href=#11>$q11</a><br>
- <a href=#12>$q12</a><br><br>
- <a href=#13>$q13</a><br>
- <a href=#14>$q14</a><br>
- <a href=#15>$q15</a><br>
- <a href=#16>$q16</a><br><br>
- <a href=#17>$q17</a><br>
- <a href=#18>$q18</a><br>
- <a href=#19>$q19</a><br><br>
- <a href=#20>$q20</a><br>
- <a href=#21>$q21</a><br>
- <a href=#22>$q22</a><br>
- <a href=#23>$q23</a><br>
- <a href=#24>$q24</a><br><br>
- <a href=#25>$q25</a><br><br>
$tblend$tblstart
$tccellh>&nbsp;<tr>
$cell1=01>$q01
$tab The site does not own and cannot be held responsible for statements made by members on the forum. This site is offered as-is to the user. Any statements made on the board may be altered or removed at the discretion of the staff. Furthermore all users are expected to have read, understood, and agreed to this FAQ before posting.<br> <b>We do <u>not</u> sell or distribute member information to any third party.</b> If you have questions about any information contained in this FAQ, please send a private message with your question to a moderator or admin before posting. Questions on things not covered in this FAQ should be asked in the <a href=forum.php?id=3>Help / Suggestions Forum</a>.
$cell2=02>$q02
$tab By registering an user account, you will be able to post on the board as well as use several features only accessable through registering, such as the ability to mark forums as read and private messaging. Unregistered users have guest access to the board, meaning they can view threads but cannot reply to them.
$cell1=03>$q03
$tab The best place for newcomers to start is the <a href=forum.php?id=41>Newbie Forum</a> where you can introduce yourself to the board. If you have any questions not addressed in this FAQ, feel free to ask them in the <a href=forum.php?id=3>Help / Suggestions</a> forum.
$cell2=04>$q04
$tab First off, don't assume that our rules are the same as other boards. Just because spammy posts are OK on another board doesn't mean that they are here.<br><br>However, most of the rules aren't that hard to follow, and as long as you keep them in mind you should be all right.
<br><br><b>DO:</b><ol>
<li>Follow the rules the local mods put out for their forums.
<li>LISTEN to the admins when they warn you.
<li>Enjoy yourself, and post frequently while obeying the rules.
<li>Use proper grammar and avoid l33t speak and AOL-speak (u, ur, y, in place of words such as you, you're, why). It's a good way to gain respect.
<li>Exercise common sense when posting.
<li>Exercise caution when posting threads about controversial topics such as religion.
</ol><br><b>DON'T:</b><ol>
<li>Spam
<li>Insult/bash video game systems and games without a perfectly good reason. (i.e. \"DUD U SUCK IF U HAVE GAMCUB UR A GAY PKEMON KIDDIE\")
<li>Be a bigot. Hateful, discriminating, or homophobic remarks are not welcome on this board. (DUDE THATS GAY STFU UR GAY)
<li>Bump (post in) old or outdated threads.
<li>Create multiple accounts unless authorized to by an admin (for testing reasons, etc.). Creating a second account when banned will result in a permanent ban from the board.
<li>Ask any questions on the board that are answered in this FAQ.
<li>Post threads regarding layout testing. You can preview your layout in your user profile.
<li>Stick around if you hate this board. We don't want people going THIS BOARD SUX LOLOLOLOLOLOL DIE OF HIV.
<li>Act like the board is a chat room (post messages like \"HEY ACMLM\", \"I AGREE\", \"Whats up?\", or similar messages directed to people). This is what private messages are for.
<li>FLAME, or purposely try to be an ass to people.
<li>Expect this board to be a utopia. People won't respect you if you act stupid or act as if you're better than everyone else.
<li>Ask to be a mod, suck up, or act like a mod. It's the quickest way NOT to get what you want.
<li>Threaten to hack the board. Chances are you can't. Besides, we have a few real hackers on staff who test the board constantly for any security problems.
<li>Post porn. Permaban on the spot.
<li>Post rom/warez links on the board. You're free to exchange links with others through private messages, but do not post them out in the open.
<li>Join the board with the sole intent of advertising your site/service/etc.
<li>Respond to a spammer attack/obvious flame. If it's obvious that the post/thread in question will be deleted, don't post and make fun of the person or ask for the post/thread to be taken care of.
</ol><br>Keep in mind that you are fully responsible for your own account.
$cell1=05>$q05
$tab
Spam is making:<br>
<br>- A post that is off-topic, meaning that it has nothing to do with the original thread.
<br>- A post that is only a few words long and doesn't contribute anything meaningful to the discussion.
<br>- A thread that doesn't have any real meaning.
<br>- A thread with a poll that is pointless.
<br>- A thread that is an exact duplicate of a pre-existing, recent thread.
<br><br>If you feel that a thread is spammy, then PM or IM an admin and ask them to take a look at it. Don't ask for someone to take a look at it in the thread itself or lecture the poster on the dangers of spamming.
$cell2=06>$q06
$tab In most cases, the staff at the board follows a three-strike system when it comes to punishments. For most minor offenses, an offending user will be warned about his/her conduct through a PM. If they continue to break the rules, they will be banned for 24 hours (possibly more if it was a serious offense, up to 72 hours). If the user continues to cause trouble, they will receive a second warning, possibly followed by another ban which could last anywhere from 72 hours to a week. Finally, if the user is still causing trouble after all these warnings, they will be permanently banned from the board.<br><br>Harsher bans may be issued if a user racks up multiple warnings in a short amount of time or does something idiotic such as flooding the board or posting questionable material.<br><br>Note that if you register another account to post with during a ban, you will be permanently banned on the spot. As well, if you think it's fun to constantly harass us on the board, keep in mind that we can and will contact your ISP and lodge a formal complaint. Many ISP's take harassment very seriously and may deactivate your account.
$cell1=07>$q07
$tab First off, don't complain on the board about a thread being closed or deleted, and don't single out a certain mod or admin as being responsible. This will result in a ban. Learn from your mistakes and move on.<br><br>If you feel you need clarification on why the thread was closed or if you feel a mistake was made, contact a local mod in charge of the forum or an admin and politely explain the problem.
$cell2=08>$q08
$tab First off, DO NOT create a new account to complain about your ban, as that will just result in a permanent ban from the board. If you feel that the ban was unfair or if you wish to know exactly why you were banned, PM an admin and calmly ask about it. Aside from that, the only thing you can do is wait for the ban to expire and make sure you know why it happened.
$cell1=09>$q09
$tab Yes, it uses cookies to store your login information. You can still use this board with cookies disabled, but you'll have to enter your username and password every time it's asked, and some features may not be available.
$cell2=10>$q10
$tab Yes, it can be used in posts, private messages, nearly everywhere except in things such as thread titles, usernames, etc.
$cell1=11>$q11
$tab Yes, but it's a bit limited. Here's what can be used: (most are case sensitive)<br>
[b]<b>Bold text</b>[/b]<br>
[i]<i>Italic text</i>[/i]<br>
[u]<u>Underlined text</u>[/u]<br>
[s]<s>Stroke text</s>[/s]<br>
[img]URL of image to display[/img]<br>
[url]URL of site or page to link to[/url]<br>
And several color codes such as ".doreplace2("
[red][<z>red][/color], [green][<z>green][/color], [blue][<z>blue][/color], [orange][<z>orange][/color], [yellow][<z>yellow][/color], [pink][<z>pink][/color], [white][<z>white][/color], and [black][<z>black][/color]
",1,1,"")." (put [/color] to revert to normal color)
$cell2=12>$q12
$tab There are a few simple rules which all users should follow in their layouts:<br>
<br>- No flashy backgrounds which make text difficult to read. This doesn't mean you can't have a nice background, but at least make sure that the area where the text is doesn't make a post hard to read.
<br>- No huge pictures or excessive amounts of GIFs. Huge pictures just make threads longer to load and having too many GIFs can slow down some computers.
<br>- No broken tables. If you're working with tables and feel that you might be messing up, check your post in your user profile. If the profile seems to be messed up, then the layout is as well. Broken tables can wreck havoc with threads.
<br><br>If you have any questions about layouts in general or need help, visit the <a href=forum.php?id=22>Modern Art</a> forum.
$cell1=13>$q13
$tab EXP is calculated from your amount of posts and how long it's been since you registered. Level is calculated from EXP. You gain increasing amounts of EXP by posting, and by being registered longer.
$cell2=14>$q14
$tab In a way similar to HTML and the markup replacements (described above), just put those where you want the numbers to be:<br>
<center><table><td>$tblstart
<tr>$tccellhs>Tag</td>$tccellhs>Value
<tr>$tccell2ls>&numposts& </td>$tccell1ls>Current post count
<tr>$tccell2ls>&numdays& </td>$tccell1ls>Number of days since registration
<tr>$tccell2ls>&level& </td>$tccell1ls>Level
<tr>$tccell2ls>&exp& </td>$tccell1ls>EXP
<tr>$tccell2ls>&expdone& </td>$tccell1ls>EXP done in the current level
<tr>$tccell2ls>&expdone1k& </td>$tccell1ls>EXP done / 1000
<tr>$tccell2ls>&expdone10k& </td>$tccell1ls>EXP done / 10000
<tr>$tccell2ls>&expnext& </td>$tccell1ls>Amount of EXP left for next level
<tr>$tccell2ls>&expnext1k& </td>$tccell1ls>EXP needed / 1000
<tr>$tccell2ls>&expnext10k& </td>$tccell1ls>EXP needed / 10000
<tr>$tccell2ls>&exppct& </td>$tccell1ls>Percentage of EXP done in the level
<tr>$tccell2ls>&exppct2& </td>$tccell1ls>Percentage of EXP left in the level
<tr>$tccell2ls>&expgain& </td>$tccell1ls>EXP gain per post
<tr>$tccell2ls>&expgaintime&</td>$tccell1ls>Seconds for 1 EXP when idle
<tr>$tccell2ls>&lvlexp& </td>$tccell1ls>Total EXP amount needed for next level
<tr>$tccell2ls>&lvllen& </td>$tccell1ls>EXP needed to go through the current level
<tr>$tccell2ls>&5000& </td>$tccell1ls>Posts left until you have 5000
<tr>$tccell2ls>&20000& </td>$tccell1ls>Posts left until you have 20000
<tr>$tccell2ls>&rank& </td>$tccell1ls>Current rank, according to your amount of posts
<tr>$tccell2ls>&postrank& </td>$tccell1ls>Post ranking
<tr>$tccell2ls>&postrank10k&</td>$tccell1ls>Post ranking you'd have with 10000 less posts
<tr>$tccell2ls>&postrank20k&</td>$tccell1ls>Post ranking you'd have with 20000 less posts
<tr>$tccell2ls>&date& </td>$tccell1ls>Current date
$tblend</table></center>
$cell1=15>$q15
$tab The syndromes are based on how many posts you have made in the last 24 hours. The amount of posts required for each syndrome is as follows:<br>
<center><table><td>$tblstart
<tr>$tccellhs>Posts</td>$tccellhs>Syndrome
<tr>$tccell2s> 75</td>$tccell1ls><x".syndrome( 75)."
<tr>$tccell2s>100</td>$tccell1ls><x".syndrome(100)."
<tr>$tccell2s>150</td>$tccell1ls><x".syndrome(150)."
<tr>$tccell2s>200</td>$tccell1ls><x".syndrome(200)."
<tr>$tccell2s>250</td>$tccell1ls><x".syndrome(250)."
<tr>$tccell2s>300</td>$tccell1ls><x".syndrome(300)."
<tr>$tccell2s>350</td>$tccell1ls><x".syndrome(350)."
<tr>$tccell2s>400</td>$tccell1ls><x".syndrome(400)."
<tr>$tccell2s>450</td>$tccell1ls><x".syndrome(450)."
<tr>$tccell2s>500</td>$tccell1ls><x".syndrome(500)."
<tr>$tccell2s>600</td>$tccell1ls><x".syndrome(600)."
$tblend</table></center>
Any other \"syndromes\" you may see such as \"Cute Kitten Syndrome ++\" are not syndromes; they are simply a custom title that someone else has decided to take.<br> Don't forget that spamming in an attempt to gain these syndromes will result in a warning or a ban. The only right way to gain a syndrome is by making clear, non-spammy posts.
$cell2=16>$q16
$tab The ACS stands for Acmlm Championship Series, and is a \"competition\" run by Colin. Each day the top ten posters (and ties) on the board are given points. The top poster each day receives 10 points and the 10th placed poster receives 1. At around midnight Eastern time each day, the rankings are compiled and posted in the Craziness Domain. \"Awards\" are given out at the end of each month. Note that the ACS is just for fun and people really shouldn't be posting just to rank in it. As well, the points mean absolutely nothing in the grand scheme of things. You can't exchange them for anything. That being said, the ACS has been a success on the board and thankfully we haven't had to ban too many people for spamming to get a top spot. Let's hope it stays that way.
$cell1=17>$q17
$tab It's all listed on the <a href=ranks.php>Ranks page</a>, which also lists all moderators and administrators on this board. Ranks nobody is on and which you didn't reach aren't listed (to keep some suspense), unless you're a full moderator (moderating all the forums) or administrator on this board.
$cell2=18>$q18
$tab You can get one under one of those conditions:<br>
- Be a moderator or administrator<br>
- Have at least 2000 posts<br>
- Have at least 1000 posts, and have been registered for at least 200 days<br>
There may be a few rare exceptions, but asking for a custom title before having the requirements for it won't get you one.
$cell1=19>$q19
$tab If us administrators trust you enough for this. Don't ask us, we may ask you if we ever feel you worthy of being promoted. Being a good and regular member helps, while asking for this doesn't. It also depends whether we feel a need to promote more people, which isn't so often the case.
$cell2=20>$q20
$tab Announcements are general messages posted by administrators only. Everybody can view them, but not reply to them.
$cell1=21>$q21
$tab Yes, just send or post a picture of yourself and I may add it. Only actual photographs are accepted.
$cell2=22>$q22
$tab You can't change it yourself, only administrators can, but you can ask one of them for a name change.
$cell1=23>$q23
$tab They vary depending on the gender and power level:<table>
<td width=200>$fonttag<b><font ".getnamecolor(0,'-1').">Banned<br><font ".getnamecolor(0,0).">Regular, male<br><font ".getnamecolor(0,1).">Local moderator, male<br><font ".getnamecolor(0,2).">Full moderator, male<br><font ".getnamecolor(0,3).">Administrator, male</td>
<td width=200>$fonttag<b><font ".getnamecolor(1,'-1').">Banned<br><font ".getnamecolor(1,0).">Regular, female<br><font ".getnamecolor(1,1).">Local moderator, female<br><font ".getnamecolor(1,2).">Full moderator, female<br><font ".getnamecolor(1,3).">Administrator, female</td>
<td width=200>$fonttag<b><font ".getnamecolor(2,'-1').">Banned<br><font ".getnamecolor(2,0).">Regular, unspecified<br><font ".getnamecolor(2,1).">Local moderator, unspec.<br><font ".getnamecolor(2,2).">Full moderator, unspec.<br><font ".getnamecolor(2,3).">Administrator, unspec.</td></table>
$cell2=24>$q24
$tab Here's the smilies that can be used, and what you must type to use them: $smilielist
$cell1=25>$q25
$tab Well ... there is no released copy of it that can be downloaded, so the only way you can get one is by getting a copy from someone who has it. Also, the latest distributed version is 1.8, and the current version isn't in a distributable state (some beta versions have been given but they're exceptional cases). You may have a better chance of getting a copy if you aren't some random newcomer who comes just to ask for the board; many requests stay ignored. Also, if you ever get a copy, keep in mind you need some place to run it on, and need support for PHP and MySQL. AcmlmBoard doesn't have an admin control panel either, so you may be screwed if you don't know how to mess around with the .php files to configure a few things, and MySQL database managing software (such as PHPMyAdmin) can be very useful.<br><br>
$tblend
$footer
";
printtimedif($startingtime);
?>

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

142
forum.php Normal file
View File

@ -0,0 +1,142 @@
<?php
require 'lib/function.php';
if($id){
$forum=mysql_fetch_array(mysql_query("SELECT title,minpower,numthreads FROM forums WHERE id=$id"));
$threadcount=$forum[numthreads];
$postread=readpostread($loguserid);
}elseif($user){
$user1=mysql_fetch_array(mysql_query("SELECT name,sex,powerlevel FROM users WHERE id=$user"));
$forum[title]="Threads by $user1[name]";
}elseif($fav or ($act and $thread)){
$forum[title]='Favorites';
}
$windowtitle="$boardname -- $forum[title]";
require 'lib/layout.php';
if($act=='add'){
$t=mysql_fetch_array(mysql_query("SELECT title,forum FROM threads WHERE id=$thread"));
$f=mysql_fetch_array(mysql_query("SELECT minpower FROM forums WHERE id=$t[forum]"));
mysql_query("DELETE FROM favorites WHERE user=$loguserid AND thread=$thread");
if($f[minpower]<1 or $f[minpower]<=$power) mysql_query("INSERT INTO favorites (user,thread) VALUES ($loguserid,$thread)");
print "$header<br>$tblstart$tccell1>\"$t[title]\" has been added to your favorites.<br>".redirect("forum.php?id=$t[forum]",'return to the forum',0).$tblend.$footer;
printtimedif($startingtime);
die();
}elseif($act=='rem'){
$t=mysql_fetch_array(mysql_query("SELECT title,forum FROM threads WHERE id=$thread"));
mysql_query("DELETE FROM favorites WHERE user=$loguserid AND thread=$thread");
print "$header<br>$tblstart$tccell1>\"$t[title]\" has been removed from your favorites.<br>".redirect("forum.php?id=$t[forum]",'return to the forum',0).$tblend.$footer;
printtimedif($startingtime);
die();
}
if($id) $fonline=fonlineusers($id);
$hotcount=mysql_result(mysql_query('SELECT hotcount FROM misc'),0,0);
if($log && $id){
$headlinks.=" | <a href=index.php?action=markforumread&forumid=$id>Mark forum read</a>";
$header=makeheader($header1,$headlinks,$header2);
}
if(!$ppp) $ppp=(!$log?20:$loguser[postsperpage]);
if(!$tpp) $tpp=(!$log?50:$loguser[threadsperpage]);
if($id) $newpost="<td align=right class=fonts><a href=newthread.php?poll=1&id=$id>$newpollpic</a> | <a href=newthread.php?id=$id>$newthreadpic</a>";
print "
$header
$tblstart$tccell1s>$fonline$tblend
<table width=100%><td align=left>$fonttag<a href=index.php>$boardname</a> - $forum[title]</td>
$newpost
</table>
$tblstart
";
if($forum[minpower]>0 and ($log and $power<$forum[minpower]))
print "
$tccell1>Couldn't enter this restricted forum, as you don't have access to it.<br>
".redirect('index.php','return to the board',0);
elseif($forum[minpower]>0 and !$log)
print "
$tccell1>Couldn't enter this restricted forum, as you are not logged in.<br>
".redirect('login.php','log in (then try again)',0);
else{
if($id){
$anncs=mysql_query('SELECT user,date,announcements.title,name,sex,powerlevel FROM announcements,users WHERE forum=0 AND user=users.id ORDER BY date DESC LIMIT 1');
if($annc=mysql_fetch_array($anncs)){
$namecolor=getnamecolor($annc[sex],$annc[powerlevel]);
print "
<td colspan=7 class='tbl tdbgh center fonts'>Announcements<tr>
<td colspan=7 class='tbl tdbg1 font'><a href=announcement.php>$annc[title]</a> -- Posted by <a href=profile.php?id=$annc[user]><font $namecolor>$annc[name]</font></a> on ".date($dateformat,$annc[date]+$tzoff)."<tr>
";
}
$anncs=mysql_query("SELECT user,date,announcements.title,name,sex,powerlevel FROM announcements,users WHERE forum=$id AND user=users.id ORDER BY date DESC LIMIT 1");
if($annc=mysql_fetch_array($anncs)){
$namecolor=getnamecolor($annc[sex],$annc[powerlevel]);
print "
$tccellhs colspan=7>Forum announcements<tr>
$tccell1l colspan=7><a href=announcement.php?f=$id>$annc[title]</a> -- Posted by <a href=profile.php?id=$annc[user]><font $namecolor>$annc[name]</font></a> on ".date($dateformat,$annc[date]+$tzoff)."<tr>
";
}
}
print "
$tccellh>&nbsp</td>
$tccellh colspan=2> Thread</td>
$tccellh>Started by</td>
$tccellh width=60> Replies</td>
$tccellh width=60> Views</td>
$tccellh width=150> Last post<tr>
";
$min=$page*$tpp;
if($id) $threads=mysql_query("SELECT t.*,u1.name AS name1,u1.sex AS sex1,u1.powerlevel AS power1,u2.name AS name2,u2.sex AS sex2,u2.powerlevel AS power2 FROM threads t,users u1,users u2 WHERE forum=$id AND u1.id=t.user AND u2.id=t.lastposter ORDER BY sticky DESC,lastpostdate DESC LIMIT $min,$tpp");
elseif($user){
$threadcount=mysql_result(mysql_query("SELECT COUNT(*) FROM threads where user=$user"),0,0);
$threads=mysql_query("SELECT threads.*,'".addslashes($user1[name])."' AS name1,$user1[sex] AS sex1,$user1[powerlevel] AS power1,name AS name2,sex AS sex2,powerlevel AS power2,minpower FROM threads,users,forums WHERE user=$user AND users.id=threads.lastposter AND forums.id=forum ORDER BY sticky DESC,lastpostdate DESC LIMIT $min,$tpp");
}elseif($fav){
if(!$u or !$isadmin) $u=$loguserid;
$threadcount=mysql_result(mysql_query("SELECT COUNT(*) FROM favorites where user=$u"),0,0);
$threads=mysql_query("SELECT threads.*,u1.name AS name1,u1.sex AS sex1,u1.powerlevel AS power1,u2.name AS name2,u2.sex AS sex2,u2.powerlevel AS power2,minpower FROM threads,users AS u1,users AS u2,forums,favorites WHERE u1.id=threads.user AND u2.id=threads.lastposter AND favorites.thread=threads.id AND favorites.user=$u AND forums.id=forum ORDER BY sticky DESC,lastpostdate DESC LIMIT $min,$tpp");
}
if($threadcount>$tpp){
$query=($id?"id=$id":"user=$user");
$pagelinks2=$smallfont."Pages:";
for($k=0;$k<($threadcount/$tpp);$k++)
$pagelinks2.=($k!=$page?" <a href=forum.php?$query&page=$k>".($k+1).'</a>':' '.($k+1));
}
$sticklast=0;
for($i=1;$thread=mysql_fetch_array($threads);$i++){
if($sticklast and !$thread[sticky]) print "<tr><td colspan=7 bgcolor=$tableborder>";
$sticklast=$thread[sticky];
$hot=0;
if($thread[replies]>=$hotcount and $hotcount) $hot=1;
if(($thread[lastpostdate]>$postread[$id] and $log and $id) or ($thread[lastpostdate]>ctime()-3600 and (!$log or !$id))){
$new='<img src=images/new.gif>';
if($hot) $new='<img src=images/hotnew.gif>';
}else{
$new='&nbsp;';
if($hot) $new='<img src=images/hot.gif>';
}
if($thread[closed]) $new='<img src=images/off.gif>';
if($hot and $thread[closed]) $new='<img src=images/hotoff.gif>';
$posticon="<img height=15 src='$thread[icon]'>";
$pagelinks='';
if($thread[replies]>=$ppp){
$pagelinks=$smallfont.'(Pages:';
for($k=0;$k<(($thread[replies]+1)/$ppp);$k++) $pagelinks.=" <a href=thread.php?id=$thread[id]&page=$k>".($k+1).'</a>';
$pagelinks.=')';
}
$thread[title]=str_replace('<','&lt',$thread[title]);
$threadtitle="<a href=thread.php?id=$thread[id]>$thread[title]</a>";
$threadtitle=($thread[sticky]?'Sticky'.($thread[poll]?' poll':'').': ':($thread[poll]?'Poll: ':''))
.(($thread[sticky] or $thread[poll])?"<i>$threadtitle</i>":$threadtitle);
if(!$thread[icon]) $posticon='&nbsp;';
if($i>1) print '<tr>';
$namecolor1=getnamecolor($thread[sex1],$thread[power1]);
$namecolor2=getnamecolor($thread[sex2],$thread[power2]);
if((($user or $fav) && ($thread[minpower]<1 or $thread[minpower]<=$power)) or $id){
print "
$tccell1>$new</td>
$tccell2>$posticon</td>
$tccell2l>$threadtitle $pagelinks</td>
$tccell2><a href=profile.php?id=$thread[user]><font $namecolor1>$thread[name1]</td>
$tccell1>$thread[replies]</td>
$tccell1>$thread[views]</td>
$tccell2>".date($dateformat,$thread[lastpostdate]+$tzoff)."$smallfont<br>by <a href=profile.php?id=$thread[lastposter]><font $namecolor2>$thread[name2]</font></a></font></td>";
}else print "$tccell2s colspan=7>(restricted)";
}
}
print "$tblend$pagelinks2<br>".doforumlist($id).$footer;
printtimedif($startingtime);
?>

29
freespace.php Normal file
View File

@ -0,0 +1,29 @@
<?php
header("Content-type: text/plain; charset=US-ASCII");
$totalspace = disk_total_space("/");
$readabletotal = readable_size($totalspace);
$freespace = disk_free_space("/");
$readablefree = readable_size($freespace);
$freepct = round(($freespace/$totalspace) * 100, 2);
print "Free space: $readablefree ($freepct %)
Total space: $readabletotal";
function readable_size($size) {
if ($size < 1024) {
return $size . ' B';
}
$units = array("kB", "MB", "GB", "TB");
foreach ($units as $unit) {
$size = $size / 1024;
if ($size < 1024) {
break;
}
}
$size = round($size, 2);
return $size . ' ' . $unit;
}
?>

47
hex.php Normal file
View File

@ -0,0 +1,47 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
print "
$body
<title>Hexadecimal color chart</title>
$css
<script language=javascript>
function hex(val){
document.box.hexval.value=val;
if(document.all){
document.all('hexbg').style.background=val;
}else{
document.layers['hexbgs'].bgColor=val;
}
}
</script>
<form name=hexchart>
<map name=colmap>";
for($g=0;$g<6;$g++)
for($r=0;$r<6;$r++)
for($b=0;$b<6;$b++){
$x1=$b*8+$r*48+1;
$y1=$g*11+1;
$x2=$x1+8;
$y2=$y1+11;
$c=substr(dechex(16777216+$r*51*65536+(5-$g)*51*256+$b*51),-6);
print "<area shape=rect coords=$x1,$y1,$x2,$y2 href=javascript:hex('$c')>";
}
print "
</map>
<center>
<table height=100% valign=middle><td>
$tblstart
$tccell1
<a><img usemap=#colmap src=images/hexchart.png border=0 width=289 height=67></a><br>
Click the box of the color you want to use; the hexadecimal number will be shown below.
<br>
<table>
<td><layer name=hexbgs><table id=hexbg border bordercolor=$tableborder width=60 height=20 cellpadding=0 cellspacing=0><td>&nbsp;</table></layer></td>
</form><form name=box>
<td>$inpt=hexval size=6 value=###### readonly>
</table>
$tblend
</table>
";
?>

BIN
images/Thumbs.db Normal file

Binary file not shown.

BIN
images/back06.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

BIN
images/back07.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 B

BIN
images/back08.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
images/back09.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 B

BIN
images/back10.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
images/coin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
images/coin2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
images/hexchart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/hot.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

BIN
images/hotnew.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

BIN
images/hotoff.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

BIN
images/new.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

BIN
images/num1/-.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

BIN
images/num1/0.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
images/num1/1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
images/num1/2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

BIN
images/num1/3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
images/num1/4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
images/num1/5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
images/num1/6.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

BIN
images/num1/7.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
images/num1/8.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

BIN
images/num1/9.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
images/num1/A.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
images/num1/N.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

BIN
images/num1/Thumbs.db Normal file

Binary file not shown.

BIN
images/num1/_.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
images/num1/bar-off.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

BIN
images/num1/bar-on.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

BIN
images/num1/barleft.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
images/num1/barright.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
images/num1/exp.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

BIN
images/num1/fornext.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

BIN
images/num1/level.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
images/num1/posts.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

BIN
images/num1/slash.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
images/off.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

BIN
images/poweredbyacmlm.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/smilies/Thumbs.db Normal file

Binary file not shown.

BIN
images/smilies/annoyed.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

BIN
images/smilies/baby.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

BIN
images/smilies/bigeyes.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

BIN
images/smilies/biggrin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

BIN
images/smilies/blank.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

BIN
images/smilies/cry.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
images/smilies/cute.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

BIN
images/smilies/cute2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
images/smilies/dizzy.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
images/smilies/eek.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
images/smilies/evil.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

BIN
images/smilies/eyeshift.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

BIN
images/smilies/frown.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
images/smilies/glasses.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
images/smilies/jawdrop.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

BIN
images/smilies/lol.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

BIN
images/smilies/mad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

BIN
images/smilies/sick.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

BIN
images/smilies/smile.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
images/smilies/tongue.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
images/smilies/vamp.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

BIN
images/smilies/wink.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

BIN
images/smilies/wobbly.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
images/smilies/yuck.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

133
index.php Normal file
View File

@ -0,0 +1,133 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
$postread=readpostread($loguserid);
$users1=mysql_query("SELECT id,name,birthday,sex,powerlevel FROM users WHERE FROM_UNIXTIME(birthday,'%m-%d')='".date('m-d',ctime())."' AND birthday ORDER BY name");
for($numbd=0;$user=mysql_fetch_array($users1);$numbd++){
if(!$numbd) $blist="<tr>$tccell2s colspan=5>Birthdays for ".date('F j',ctime()).': ';
else $blist.=', ';
$users[$user[id]]=$user;
$y=date('Y',ctime())-date('Y',$user[birthday]);
$namecolor=getnamecolor($user[sex],$user[powerlevel]);
$blist.="<a href=profile.php?id=$user[id]><font $namecolor>$user[name]</font></a> ($y)";
}
$onlinetime=ctime()-300;
$onusers=mysql_query("SELECT id,name,powerlevel,lastactivity,sex,minipic FROM users WHERE lastactivity>$onlinetime OR lastposttime>$onlinetime ORDER BY name");
$numonline=mysql_num_rows($onusers);
$numguests=mysql_result(mysql_query("SELECT count(*) FROM guests WHERE date>$onlinetime"),0,0);
if($numguests) $guestcount=" | <nobr>$numguests guest".($numguests>1?"s":"");
for($numon=0;$onuser=mysql_fetch_array($onusers);$numon++){
if($numon) $onlineusers.=', ';
$namecolor=getnamecolor($onuser[sex],$onuser[powerlevel]);
$namelink="<a href=profile.php?id=$onuser[id]><font $namecolor>$onuser[name]</font></a>";
if($onuser[minipic]) $onuser[minipic]='<img width=11 height=11 src="'.str_replace('"','%22',$onuser[minipic]).'" align=absmiddle> ';
if($onuser[lastactivity]<=$onlinetime) $namelink="($namelink)";
$onlineusers.="<nobr>$onuser[minipic]$namelink</nobr>";
}
if($onlineusers) $onlineusers=': '.$onlineusers;
if($log){
$headlinks.=' | <a href=index.php?action=markallforumsread>Mark all forums read</a>';
$header=makeheader($header1,$headlinks,$header2);
}
if($action=='markforumread' and $log){
mysql_query("DELETE FROM forumread WHERE user=$loguserid AND forum=$forumid");
mysql_query("INSERT INTO forumread (user,forum,readdate) VALUES ($loguserid,$forumid,".ctime().')');
$postread=readpostread($loguserid);
}
if($action=='markallforumsread' and $log){
mysql_query("DELETE FROM forumread WHERE user=$loguserid");
mysql_query("INSERT INTO forumread (user,forum,readdate) SELECT $loguserid,id,".ctime().' FROM forums');
$postread=readpostread($loguserid);
}
if($log) $logmsg="You are logged in as $loguser[name].";
$posts[d]=mysql_result(mysql_query('SELECT COUNT(*) FROM posts WHERE date>'.(ctime()-86400)),0,0);
$posts[h]=mysql_result(mysql_query('SELECT COUNT(*) FROM posts WHERE date>'.(ctime()-3600)),0,0);
$lastuser=mysql_fetch_array(mysql_query('SELECT id,name,sex,powerlevel FROM users ORDER BY id DESC LIMIT 1'));
$misc=mysql_fetch_array(mysql_query('SELECT * FROM misc'));
if($posts[d]>$misc[maxpostsday]) mysql_query("UPDATE misc SET maxpostsday=$posts[d],maxpostsdaydate=".ctime());
if($posts[h]>$misc[maxpostshour]) mysql_query("UPDATE misc SET maxpostshour=$posts[h],maxpostshourdate=".ctime());
if($numonline>$misc[maxusers]) mysql_query("UPDATE misc SET maxusers=$numonline,maxusersdate=".ctime().",maxuserstext='".addslashes($onlineusers)."'");
$namecolor=getnamecolor($lastuser[sex],$lastuser[powerlevel]);
print "$header<br>
$tblstart
$tccell1s><table width=100%><td class=fonts>$logmsg</td><td align=right class=fonts>$count[u] registered users<br>Latest registered user: <a href=profile.php?id=$lastuser[id]><font $namecolor>$lastuser[name]</font></a></table>
$blist<tr>
$tccell2s>$count[t] threads and $count[p] posts in the board | $posts[d] posts during the last day, $posts[h] posts during the last hour.<tr>
$tccell1s>$numonline user".($numonline>1?'s':'')." currently online$onlineusers$guestcount
";
$new='&nbsp;';
if($log){
$pmsgnum=0;
$pmsgnew=0;
$maxid=mysql_result(mysql_query("SELECT max(id) FROM pmsgs WHERE userto=$loguserid"),0,0);
$pmsgs=mysql_query("SELECT userfrom,date,u.id,name,sex,powerlevel FROM pmsgs p,pmsgs_text,users AS u WHERE p.id=0$maxid AND u.id=p.userfrom AND p.id=pid") or print mysql_error();
if($pmsg=@mysql_fetch_array($pmsgs)){
$pmsgnum=mysql_result(mysql_query("SELECT COUNT(*) FROM pmsgs WHERE userto=$loguserid"),0,0);
$pmsgnew=mysql_result(mysql_query("SELECT COUNT(*) FROM pmsgs WHERE userto=$loguserid AND msgread=0"),0,0);
if($pmsgnew) $new=$newpic;
$namecolor=getnamecolor($pmsg[sex],$pmsg[powerlevel]);
$lastmsg="Last message from <a href=profile.php?id=$pmsg[id]><font $namecolor>$pmsg[name]</font></a> on ".date($dateformat,$pmsg[date]+$tzoff);
}
$privatebox="
$tblstart
$tccellhs colspan=2>Private messages<tr>
$tccell1>$new</td>
$tccell2l><a href=private.php>Private messages</a> -- You have $pmsgnum private messages ($pmsgnew new). $lastmsg
$tblend<br>
";
}
$forumlist="
$tccellh>&nbsp;</td>
$tccellh>Forum</td>
$tccellh>Threads</td>
$tccellh>Posts</td>
$tccellh>Last post
";
$categories=mysql_query("SELECT id,name FROM categories WHERE (!minpower OR minpower<=$loguser[powerlevel]) ORDER BY id");
$forums=mysql_query("SELECT f.*,u.id AS uid,name,sex,powerlevel FROM forums f LEFT JOIN users u ON f.lastpostuser=u.id WHERE (!minpower OR minpower<=$loguser[powerlevel]) ORDER BY catid,forder");
$mods=mysql_query("SELECT u.id,name,sex,powerlevel,forum FROM users u INNER JOIN forummods m ON u.id=m.user INNER JOIN forums f ON f.id=m.forum WHERE (!minpower OR minpower<=$power) ORDER BY catid,forder,name");
$forum=mysql_fetch_array($forums);
$mod=mysql_fetch_array($mods);
while($category=mysql_fetch_array($categories)){
$forumlist.="<tr><td class='tbl tdbgc center font' colspan=5><a href=index.php?cat=$category[id]>$category[name]";
for(;$forum[catid]==$category[id];$modlist=''){
for($m=0;$mod[forum]==$forum[id];$m++){
$namecolor=getnamecolor($mod[sex],$mod[powerlevel]);
$modlist.=($m?', ':'')."<a href=profile.php?id=$mod[id]><font $namecolor>$mod[name]</font></a>";
$mod=mysql_fetch_array($mods);
}
if($m) $modlist="$smallfont(moderated by: $modlist)</font>";
$namecolor=getnamecolor($forum[sex],$forum[powerlevel]);
if($forum[numposts]){
$forumlastpost=date($dateformat,$forum[lastpostdate]+$tzoff);
$threadi = mysql_fetch_array(mysql_query("SELECT `id`, `replies` FROM `threads` WHERE `forum` = '$forum[id]' AND `lastpostdate` = '$forum[lastpostdate]' LIMIT 1"));
$threadid = $threadi[id];
if(!$ppp) $ppp=($log?$loguser[postsperpage]:20);
$pg = floor($threadi[replies] / $ppp);
$by="$smallfont<br>by <a href=profile.php?id=$forum[uid]><font $namecolor>$forum[name]</font></a> <a href=thread.php?id=$threadid&page=$pg>»</a><br></font>";
}else{
$forumlastpost='-------- --:-- --';
$by='';
}
$new='&nbsp;';
if((($forum[lastpostdate]>$postread[$forum[id]] and $log) or (!$log and $forum[lastpostdate]>ctime()-3600)) and $forum[numposts]) $new=$newpic;
if($forum[lastpostdate]>$category[lastpostdate]){
$category[lastpostdate]=$forum[lastpostdate];
$category[l]=$forumlastpost.$by;
}
if($cat=='' or $cat==$category[id])
$forumlist.="
<tr>$tccell1>$new</td>
$tccell2l><a href=forum.php?id=$forum[id]>$forum[title]</a><br>
$smallfont$forum[description]<br>$modlist</td>
$tccell1>$forum[numthreads]</td>
$tccell1>$forum[numposts]</td>
$tccell2><nobr>$forumlastpost$by$forumlastuser
";
$forum=mysql_fetch_array($forums);
}
}
print "$tblend<br>$privatebox$tblstart$forumlist$tblend$footer";
printtimedif($startingtime);
?>

177
install.php Normal file
View File

@ -0,0 +1,177 @@
<?php
require "lib/config.php";
print "<html><head><title>$boardname -- Install</title></head>
<body bgcolor=#333333>
<table cellpadding=4 cellspacing=0 border=0 width=600 height=100% align=center>
<td width=0 align=center bgcolor=#222222>
<font color=#dddddd face=\"Courier New\" style=\"font-size: 13px\">
<b>Acmlmboard 1.92.08 Installer</b>
</font></td><tr><td valign=top bgcolor=#111111 height=100%>
<font color=#dddddd face=\"Courier New\" style=\"font-size: 13px\">\n";
if (!$step) {
print "Welcome to the Acmlmboard 1.92.08 beta installer. As this version is still very far from being complete, please...
<br><font color=#ff8080><b>DO NOT DISTRIBUTE !!</b></font>
<br>Please report all bugs to Xkeeper or the <a href=http://amber.stormbirds.org/acmlmbugs/><font color=#80FF80>Bug Tracker</font></a></center>
<br><br>
<pre>Acmlmboard 1.92.08 will be installed using the following information:
MySQL host: <font color=#ff8080>$sqlhost</font>
MySQL user: <font color=#ff8080>$sqluser</font>
MySQL pass: <font color=#ff8080>$sqlpass</font>
Database: <font color=#ff8080>$dbname</font>
If this is correct, please <a href=$PHP_SELF?step=1><font color=#80ff80>click here</font></a>.
If not, please edit the <font color=#ff8080>config.php</font> file in the <font color=#ff8080>lib/</font> directory.";
} elseif ($step == 1) {
$errors = 0;
$total = 0;
print "<pre>Attempting to install...\n\n";
$sql = @mysql_connect($sqlhost,$sqluser,$sqlpass) or die("<font color=#ff2020>Couldn't connect to the MySQL database!</font></body></html>");
mysql_select_db($dbname) or die("<font color=#ff2020>Couldn't select the MySQL database!</font></body></html>");
$status = doquery("CREATE TABLE `actionlog` ( `id` mediumint(9) NOT NULL auto_increment, `atime` varchar(15) NOT NULL default '', `adesc` mediumtext NOT NULL, `aip` text NOT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'actionlog'... $status\n";
$status = doquery("CREATE TABLE `announcements` ( `id` smallint(5) unsigned NOT NULL auto_increment, `user` smallint(5) unsigned NOT NULL default '0', `date` int(10) NOT NULL default '0', `ip` varchar(32) NOT NULL default '', `title` varchar(250) NOT NULL default '', `text` text, `forum` tinyint(3) NOT NULL default '0', `headtext` text, `signtext` text, `edited` text, `headid` mediumint(6) NOT NULL default '0', `signid` mediumint(6) NOT NULL default '0', `tagval` text NOT NULL, PRIMARY KEY (`id`), KEY `forum` (`forum`)) ENGINE=MyISAM");
print "Creating table 'announcements'... $status\n";
$status = doquery("CREATE TABLE `blockedlayouts` ( `user` smallint(5) unsigned NOT NULL default '0', `blockee` smallint(5) unsigned NOT NULL default '0', KEY `user` (`user`)) ENGINE=MyISAM");
print "Creating table 'blockedlayouts'... $status\n";
$status = doquery("CREATE TABLE `categories` ( `id` smallint(5) unsigned NOT NULL default '0', `name` varchar(255) NOT NULL default '', `minpower` tinyint(4) default '0', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'categories'... $status\n";
$status = doquery("CREATE TABLE `dailystats` ( `date` varchar(8) NOT NULL default '', `users` int(11) NOT NULL default '0', `threads` int(11) NOT NULL default '0', `posts` int(11) NOT NULL default '0', `views` int(11) NOT NULL default '0', PRIMARY KEY (`date`)) ENGINE=MyISAM");
print "Creating table 'dailystats'... $status\n";
$status = doquery("CREATE TABLE `events` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `d` tinyint(2) unsigned NOT NULL default '0', `m` tinyint(2) unsigned NOT NULL default '0', `y` smallint(4) unsigned NOT NULL default '0', `user` mediumint(8) unsigned NOT NULL default '0', `title` varchar(200) NOT NULL default '', `text` text NOT NULL, UNIQUE KEY `id` (`id`)) ENGINE=MyISAM");
print "Creating table 'events'... $status\n";
$status = doquery("CREATE TABLE `favorites` ( `user` bigint(6) NOT NULL default '0', `thread` bigint(9) NOT NULL default '0') ENGINE=MyISAM");
print "Creating table 'favorites'... $status\n";
$status = doquery("CREATE TABLE `forummods` ( `forum` smallint(5) NOT NULL default '0', `user` mediumint(8) NOT NULL default '0') ENGINE=MyISAM");
print "Creating table 'forummods'... $status\n";
$status = doquery("CREATE TABLE `forumread` ( `user` smallint(5) unsigned NOT NULL default '0', `forum` tinyint(3) unsigned NOT NULL default '0', `readdate` int(11) NOT NULL default '0', KEY `user` (`user`)) ENGINE=MyISAM");
print "Creating table 'forumread'... $status\n";
$status = doquery("CREATE TABLE `forums` ( `id` smallint(5) unsigned NOT NULL auto_increment, `title` varchar(250) default NULL, `description` text, `olddesc` text NOT NULL, `catid` smallint(5) unsigned NOT NULL default '0', `minpower` tinyint(2) NOT NULL default '0', `minpowerthread` tinyint(2) NOT NULL default '0', `minpowerreply` tinyint(2) NOT NULL default '0', `numthreads` mediumint(8) unsigned NOT NULL default '0', `numposts` mediumint(8) unsigned NOT NULL default '0', `lastpostdate` int(11) NOT NULL default '0', `lastpostuser` int(11) unsigned NOT NULL default '0', `forder` smallint(5) NOT NULL default '0', PRIMARY KEY (`id`), KEY `catid` (`catid`)) ENGINE=MyISAM");
print "Creating table 'forums'... $status\n";
$status = doquery("CREATE TABLE `guests` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `ip` varchar(32) NOT NULL default '', `date` int(11) NOT NULL default '0', `lasturl` varchar(100) NOT NULL default '', `lastforum` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'guests'... $status\n";
$status = doquery("CREATE TABLE `hits` ( `num` int(11) NOT NULL default '0', `user` mediumint(8) NOT NULL default '0', `ip` varchar(15) NOT NULL default '', `date` int(11) NOT NULL default '0', KEY `num` (`num`)) ENGINE=MyISAM");
print "Creating table 'hits'... $status\n";
$status = doquery("CREATE TABLE `ipbans` ( `ip` varchar(15) NOT NULL default '', `reason` varchar(100) NOT NULL default '', `perm` tinyint(2) unsigned NOT NULL default '0', `date` int(10) unsigned NOT NULL default '0', `banner` smallint(5) unsigned NOT NULL default '1', UNIQUE KEY `ip` (`ip`)) ENGINE=MyISAM");
print "Creating table 'ipbans'... $status\n";
$status = doquery("CREATE TABLE `itemcateg` ( `id` tinyint(3) unsigned NOT NULL auto_increment, `corder` tinyint(4) NOT NULL default '0', `name` varchar(20) NOT NULL default '', `description` varchar(255) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'itemcateg'... $status\n";
$status = doquery("CREATE TABLE `items` ( `id` tinyint(3) unsigned NOT NULL auto_increment, `cat` tinyint(3) unsigned NOT NULL default '0', `type` tinyint(4) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL default '', `stype` varchar(9) NOT NULL default '', `sHP` smallint(5) NOT NULL default '100', `sMP` smallint(5) NOT NULL default '100', `sAtk` smallint(5) NOT NULL default '100', `sDef` smallint(5) NOT NULL default '100', `sInt` smallint(5) NOT NULL default '100', `sMDf` smallint(5) NOT NULL default '100', `sDex` smallint(5) NOT NULL default '100', `sLck` smallint(5) NOT NULL default '100', `sSpd` smallint(5) NOT NULL default '100', `coins` mediumint(8) NOT NULL default '100', PRIMARY KEY (`id`), KEY `cat` (`cat`)) ENGINE=MyISAM");
print "Creating table 'items'... $status\n";
$status = doquery("CREATE TABLE `misc` ( `views` int(11) unsigned NOT NULL default '0', `hotcount` smallint(5) unsigned default '30', `maxpostsday` mediumint(7) unsigned NOT NULL default '0', `maxpostshour` mediumint(6) unsigned NOT NULL default '0', `maxpostsdaydate` int(10) unsigned NOT NULL default '0', `maxpostshourdate` int(10) unsigned NOT NULL default '0', `maxusers` smallint(5) unsigned NOT NULL default '0', `maxusersdate` int(10) unsigned NOT NULL default '0', `maxuserstext` text) ENGINE=MyISAM");
print "Creating table 'misc'... $status\n";
$status = doquery("CREATE TABLE `pmsgs` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `userto` smallint(5) unsigned NOT NULL default '0', `userfrom` smallint(5) unsigned NOT NULL default '0', `date` int(10) unsigned NOT NULL default '0', `ip` char(15) NOT NULL default '', `msgread` tinyint(3) unsigned NOT NULL default '0', `headid` smallint(5) unsigned NOT NULL default '0', `signid` smallint(5) unsigned NOT NULL default '0', `folderto` tinyint(3) unsigned NOT NULL default '1', `folderfrom` tinyint(3) unsigned NOT NULL default '2', PRIMARY KEY (`id`), KEY `userto` (`userto`), KEY `userfrom` (`userfrom`), KEY `msgread` (`msgread`)) ENGINE=MyISAM");
print "Creating table 'pmsgs'... $status\n";
$status = doquery("CREATE TABLE `pmsgs_text` ( `pid` mediumint(8) unsigned NOT NULL default '0', `title` varchar(255) NOT NULL default '', `headtext` text NOT NULL, `text` mediumtext NOT NULL, `signtext` text NOT NULL, `tagval` text NOT NULL, PRIMARY KEY (`pid`)) ENGINE=MyISAM");
print "Creating table 'pmsgs_text'... $status\n";
$status = doquery("CREATE TABLE `poll` ( `id` int(11) NOT NULL auto_increment, `question` varchar(255) NOT NULL default '', `briefing` text NOT NULL, `closed` tinyint(1) NOT NULL default '0', `doublevote` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'poll'... $status\n";
$status = doquery("CREATE TABLE `poll_choices` ( `id` int(11) NOT NULL auto_increment, `poll` int(11) NOT NULL default '0', `choice` varchar(255) NOT NULL default '', `color` varchar(25) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'poll_choices'... $status\n";
$status = doquery("CREATE TABLE `pollvotes` ( `poll` int(11) NOT NULL default '0', `choice` int(11) NOT NULL default '0', `user` int(11) NOT NULL default '0', UNIQUE KEY `choice` (`choice`,`user`)) ENGINE=MyISAM");
print "Creating table 'pollvotes'... $status\n";
$status = doquery("CREATE TABLE `postlayouts` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `text` text NOT NULL, UNIQUE KEY `id` (`id`)) ENGINE=MyISAM");
print "Creating table 'postlayouts'... $status\n";
$status = doquery("CREATE TABLE `postradar` ( `user` smallint(5) unsigned NOT NULL default '0', `comp` smallint(5) unsigned NOT NULL default '0', UNIQUE KEY `user` (`user`,`comp`)) ENGINE=MyISAM");
print "Creating table 'postradar'... $status\n";
$status = doquery("CREATE TABLE `posts` ( `id` mediumint(8) NOT NULL auto_increment, `thread` int(10) unsigned NOT NULL default '0', `user` smallint(5) unsigned NOT NULL default '0', `date` int(10) unsigned NOT NULL default '0', `ip` char(15) NOT NULL default '0.0.0.0', `num` mediumint(8) NOT NULL default '0', `headid` mediumint(8) unsigned NOT NULL default '0', `signid` mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `thread` (`thread`), KEY `date` (`date`), KEY `user` (`user`), KEY `ip` (`ip`)) ENGINE=MyISAM");
print "Creating table 'posts'... $status\n";
$status = doquery("CREATE TABLE `posts_text` ( `pid` mediumint(8) unsigned NOT NULL default '0', `headtext` text, `text` mediumtext, `signtext` text, `tagval` text, `options` varchar(3) NOT NULL default '0|0', `edited` text, PRIMARY KEY (`pid`)) ENGINE=MyISAM");
print "Creating table 'posts_text'... $status\n";
$status = doquery("CREATE TABLE `ranks` ( `rset` tinyint(3) unsigned NOT NULL default '1', `num` mediumint(8) NOT NULL default '0', `text` varchar(255) NOT NULL default '', KEY `count` (`num`)) ENGINE=MyISAM");
print "Creating table 'ranks'... $status\n";
$status = doquery("CREATE TABLE `ranksets` ( `id` tinyint(3) unsigned NOT NULL default '0', `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'ranksets'... $status\n";
$status = doquery("CREATE TABLE `schemes` ( `id` smallint(5) unsigned NOT NULL default '0', `ord` smallint(5) NOT NULL default '0', `name` varchar(50) default NULL, `file` varchar(200) default NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'schemes'... $status\n";
$status = doquery("CREATE TABLE `threads` ( `id` int(10) unsigned NOT NULL auto_increment, `forum` tinyint(3) unsigned NOT NULL default '0', `user` smallint(5) unsigned NOT NULL default '0', `views` smallint(5) unsigned NOT NULL default '0', `closed` tinyint(1) unsigned NOT NULL default '0', `title` varchar(100) NOT NULL default '', `icon` varchar(200) NOT NULL default '', `replies` smallint(5) unsigned NOT NULL default '0', `lastpostdate` int(10) NOT NULL default '0', `lastposter` smallint(5) unsigned NOT NULL default '0', `sticky` tinyint(1) unsigned NOT NULL default '0', `poll` smallint(5) unsigned NOT NULL default '0', `locked` tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `forum` (`forum`), KEY `user` (`user`), KEY `sticky` (`sticky`), KEY `pollid` (`poll`), KEY `lastpostdate` (`lastpostdate`)) ENGINE=MyISAM PACK_KEYS=0");
print "Creating table 'threads'... $status\n";
$status = doquery("CREATE TABLE `tlayouts` ( `id` smallint(5) unsigned NOT NULL default '0', `ord` smallint(5) NOT NULL default '0', `name` varchar(50) default NULL, `file` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'tlayouts'... $status\n";
$status = doquery("CREATE TABLE `userpic` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `categ` smallint(5) unsigned NOT NULL default '0', `url` varchar(250) NOT NULL default '', `name` varchar(100) NOT NULL default '', PRIMARY KEY (`id`), KEY `categ` (`categ`)) ENGINE=MyISAM");
print "Creating table 'userpic'... $status\n";
$status = doquery("CREATE TABLE `userpiccateg` ( `id` smallint(5) unsigned NOT NULL default '0', `page` smallint(5) unsigned NOT NULL default '0', `name` varchar(200) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM");
print "Creating table 'userpiccateg'... $status\n";
$status = doquery("CREATE TABLE `userratings` ( `userfrom` smallint(5) unsigned NOT NULL default '0', `userrated` smallint(5) unsigned NOT NULL default '0', `rating` smallint(5) NOT NULL default '0', KEY `userrated` (`userrated`)) ENGINE=MyISAM");
print "Creating table 'userratings'... $status\n";
$status = doquery("CREATE TABLE `users` ( `id` smallint(5) unsigned NOT NULL auto_increment, `posts` mediumint(9) NOT NULL default '0', `regdate` int(11) NOT NULL default '0', `name` varchar(25) NOT NULL default '', `password` varchar(32) NOT NULL default '', `minipic` varchar(100) NOT NULL default '', `picture` varchar(100) NOT NULL default '', `postbg` varchar(250) NOT NULL default '', `postheader` text, `signature` text, `bio` text, `powerlevel` tinyint(2) NOT NULL default '0', `sex` tinyint(1) unsigned NOT NULL default '2', `title` varchar(255) NOT NULL default '', `useranks` tinyint(1) unsigned NOT NULL default '1', `titleoption` tinyint(1) NOT NULL default '1', `realname` varchar(60) NOT NULL default '', `location` varchar(200) NOT NULL default '', `birthday` int(11) NOT NULL default '0', `email` varchar(60) NOT NULL default '', `aim` varchar(30) NOT NULL default '', `icq` int(10) unsigned NOT NULL default '0', `imood` varchar(60) NOT NULL default '', `homepageurl` varchar(80) NOT NULL default '', `homepagename` varchar(100) NOT NULL default '', `lastposttime` int(10) unsigned NOT NULL default '0', `lastactivity` int(10) unsigned NOT NULL default '0', `lastip` varchar(15) NOT NULL default '', `lasturl` varchar(100) NOT NULL default '', `lastforum` tinyint(3) unsigned NOT NULL default '0', `postsperpage` smallint(4) unsigned NOT NULL default '20', `threadsperpage` smallint(4) unsigned NOT NULL default '50', `timezone` float NOT NULL default '0', `scheme` tinyint(2) unsigned NOT NULL default '0', `layout` tinyint(2) unsigned NOT NULL default '1', `viewsig` tinyint(1) unsigned NOT NULL default '1', `posttool` tinyint(1) unsigned NOT NULL default '1', `signsep` tinyint(3) unsigned NOT NULL default '0', `publicemail` tinyint(1) unsigned NOT NULL default '1', `oldstylemark` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`), KEY `posts` (`posts`), KEY `name` (`name`), KEY `lastforum` (`lastforum`), KEY `lastposttime` (`lastposttime`), KEY `lastactivity` (`lastactivity`)) ENGINE=MyISAM");
print "Creating table 'users'... $status\n";
$status = doquery("CREATE TABLE `users_rpg` ( `uid` smallint(5) unsigned NOT NULL default '0', `spent` int(11) NOT NULL default '0', `eq1` smallint(5) unsigned NOT NULL default '0', `eq2` smallint(5) unsigned NOT NULL default '0', `eq3` smallint(5) unsigned NOT NULL default '0', `eq4` smallint(5) unsigned NOT NULL default '0', `eq5` smallint(5) unsigned NOT NULL default '0', `eq6` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`uid`)) ENGINE=MyISAM");
print "Creating table 'users_rpg'... $status\n";
$status = doquery("INSERT INTO `tlayouts` (`id`, `ord`, `name`, `file`) VALUES (1, 0, 'Regular', 'regular')");
print "Adding thread layout 'Regular'... $status\n";
$status = doquery("INSERT INTO `tlayouts` (`id`, `ord`, `name`, `file`) VALUES (2, 1, 'Regular without number/bar graphics', 'regular')");
print "Adding thread layout 'Regular 2'... $status\n";
$status = doquery("INSERT INTO `tlayouts` (`id`, `ord`, `name`, `file`) VALUES (3, 2, 'Compact', 'compact')");
print "Adding thread layout 'Compact'... $status\n";
$status = doquery("INSERT INTO `schemes` (`id`, `ord`, `name`, `file`) VALUES (0, 1, 'Daily Cycle', 'dailycycle.php')");
print "Adding default scheme... $status\n";
$status = doquery("INSERT INTO `misc` (`views`, `hotcount`) VALUES (0, 30)");
print "Adding misc. row... $status\n";
$status = doquery("INSERT INTO `ranksets` (`id`, `name`) VALUES (1, 'Default')");
print "Adding default rank set... $status\n";
$status = doquery("INSERT INTO `ranks` (`rset`, `num`, `text`) VALUES (1, 0, 'Non-Poster')");
print "Adding default ranks (1 of 3)... $status\n";
$status = doquery("INSERT INTO `ranks` (`rset`, `num`, `text`) VALUES (1, 1, 'Newbie')");
print "Adding default ranks (2 of 3)... $status\n";
$status = doquery("INSERT INTO `ranks` (`rset`, `num`, `text`) VALUES (1, 10, 'Member')");
print "Adding default ranks (3 of 3)... $status\n";
print "\nTotal Errors: <font color=#ff4040>$errors</font>
Total Queries: <font color=#80ff80>$total</font></pre><br><br>";
if ($errors == 0) {
print "\nYour Acmlmboard was successfully installed. You must now register and create forums, catagories, and other things, using phpMyAdmin. To verify that the installation was a success, please click <a href=index.php><font color=#80ff80>here</font></a>.
<br><br><font color=#ff4040>NOTE:</font> it is highly advised you delete this file after a successful installation!";
} else {
print "\nPlease fix the problems that have occured. This may require dropping the partially-created tables, and trying again.
<br><br><font color=#e0e080>NOTE:</font> it is possible the installation was still successful, especially if you have only recieved '<font color=#FF8080>Table already exists</font>' errors. However, it is far more likely you will need to redo the installation.
<br><br>If you would like to drop all tables and retry the installation process, <a href=$PHP_SELF?step=2><font color=#ff8080>click here</font></a>.";
}
} elseif ($step == 2) {
print "<font color=#FF4040>WARNING:</font> This will erase ALL DATA in ALL TABLES. <font color=#ff8080>ONLY CONTINUE IF YOU KNOW WHAT YOU ARE DOING.</font>
<br><br><a href=$PHP_SELF?step=3><font color=#ff4040>Continue</font></a> - <a href=$PHP_SELF?step=0><font color=#80ff80>Go Back</font></a>";
} elseif ($step == 3) {
print "<pre>";
$sql = @mysql_connect($sqlhost,$sqluser,$sqlpass) or die("<font color=#ff2020>Couldn't connect to the MySQL database!</font></body></html>");
mysql_select_db($dbname) or die("<font color=#ff2020>Couldn't select the MySQL database!</font></body></html>");
$status = doquery("DROP TABLE `actionlog`, `announcements`, `blockedlayouts`, `categories`, `dailystats`, `events`, `favorites`, `forummods`, `forumread`, `forums`, `guests`, `hits`, `ipbans`, `itemcateg`, `items`, `misc`, `pmsgs`, `pmsgs_text`, `poll`, `poll_choices`, `pollvotes`, `postlayouts`, `postradar`, `posts`, `posts_text`, `ranks`, `ranksets`, `schemes`, `threads`, `tlayouts`, `userpic`, `userpiccateg`, `userratings`, `users`, `users_rpg`");
print "Dropping all tables... $status\n";
print "\n\n<a href=$PHP_SELF?step=0><font color=#80ff80>Go Back</font></a>";
}
print "</pre></font></td><tr><td width=0 align=center bgcolor=#222222>
<font color=#dddddd face=\"Courier New\" style=\"font-size: 13px\">
Acmlmboard Installer v1.0 (12-06-05)
</font></td></table></body></html>";
function doquery($x) {
global $errors, $total;
$sql = mysql_query($x) OR $error = 1;
$total++;
if ($error) {
$retr = "<font color=#ff3030>ERROR</font> (<font color=#ff8080>". mysql_error() ."</font>)";
$errors++;
} else {
$retr = "<font color=#60ff60>OK</font>";
}
return $retr;
}
?>

153
ipsearch.php Normal file
View File

@ -0,0 +1,153 @@
<?php
require 'lib/function.php';
require 'lib/layout.php';
print "$header<br>$tblstart";
if(!$isadmin){
print "
$tccell1>Sorry, but this feature is reserved to admins.
".redirect('index.php','return to the board',0);
}else{
if(!$su) $su='n';
if(!$sp) $sp='u';
if(!$sm) $sm='n';
if(!$d) $d=1;
$ch1[$su]=' checked';
$ch2[$sp]=' checked';
$ch3[$sm]=' checked';
$ch4[$d]=' checked';
print "
<form action=ipsearch.php method=post>
$tccellh colspan=2>IP search<tr>
$tccell1 width=20%><b>IP to search:</b></td>
$tccell2l>$inpt=ip size=15 maxlength=15 value=$ip><tr>
$tccell1><b>Sort users by:</b></td>
$tccell2l>
$radio=su value=n$ch1[n]> Name &nbsp; &nbsp;
$radio=su value=p$ch1[p]> Posts &nbsp; &nbsp;
$radio=su value=r$ch1[r]> Registration &nbsp; &nbsp;
$radio=su value=s$ch1[s]> Last post &nbsp; &nbsp;
$radio=su value=a$ch1[a]> Last activity &nbsp; &nbsp;
$radio=su value=i$ch1[i]> Last IP
<tr>
$tccell1><b>Sort posts by:</b></td>
$tccell2l>
$radio=sp value=u$ch2[u]> User &nbsp; &nbsp;
$radio=sp value=d$ch2[d]> Date &nbsp; &nbsp;
$radio=sp value=i$ch2[i]> IP
<tr>
$tccell1><b>Sort private messages by:</b></td>
$tccell2l>
$radio=sm value=n$ch3[n]> Sent by &nbsp; &nbsp;
$radio=sm value=d$ch3[d]> Date &nbsp; &nbsp;
$radio=sm value=i$ch3[i]> IP
<tr>
$tccell1><b>Distinct users and IP's:</b></td>
$tccell2l>
$radio=d value=1$ch4[1]> Yes &nbsp; &nbsp;
$radio=d value=0$ch4[0]> No
<tr>
$tccell1>&nbsp</td>
$tccell1l>$inps=s value=Submit></td>
</form>
";
if($ip){
$ip=str_replace('*','%',$ip);
switch($su){
case 'n': $usort='ORDER BY name'; break;
case 'p': $usort='ORDER BY posts DESC'; break;
case 'r': $usort='ORDER BY regdate'; break;
case 's': $usort='ORDER BY lastposttime'; break;
case 'a': $usort='ORDER BY lastactivity'; break;
case 'i': $usort='ORDER BY lastip'; break;
}
switch($sp){
case 'u': $psort='ORDER BY name'; break;
case 'd': $psort='ORDER BY date'; break;
case 'i': $psort='ORDER BY ip'; break;
}
switch($sm){
case 'n': $msort='ORDER BY name1'; break;
case 'd': $msort='ORDER BY date'; break;
case 'i': $msort='ORDER BY ip'; break;
}
if($d){
$pgroup='GROUP BY p.ip,u.id';
$mgroup='GROUP BY p.ip,u1.id';
}
$users=mysql_query("SELECT * FROM users WHERE lastip LIKE '$ip' $usort");
$posts=mysql_query("SELECT p.*,u.name,u.sex,u.powerlevel,t.title FROM posts p,users u,threads t WHERE ip LIKE '$ip' AND p.user=u.id AND p.thread=t.id $pgroup $psort") or print mysql_error();
$pmsgs=mysql_query("SELECT p.*,t.title,u1.name AS name1,u2.name AS name2,u1.sex AS sex1,u2.sex AS sex2,u1.powerlevel pow1,u2.powerlevel pow2 FROM pmsgs p,pmsgs_text t,users u1,users u2 WHERE ip LIKE '$ip' AND p.userfrom=u1.id AND p.userto=u2.id AND p.id=pid $mgroup $msort");
print "
$tblend<br>$tblstart
$tccellh colspan=7><b>Users: ".mysql_num_rows($users)."</b><tr>
$tccellc>id</td>
$tccellc>Name</td>
$tccellc>Registered on</td>
$tccellc>Last post</td>
$tccellc>Last activity</td>
$tccellc>Posts</td>
$tccellc>Last IP</td>
";
for($c=0;$c<500 && $user=mysql_fetch_array($users);$c++)
print "
<tr>
$tccell2>$user[id]</td>
$tccell1><a href=profile.php?id=$user[id]><font ".getnamecolor($user[sex],$user[powerlevel]).">$user[name]</font></a></td>
$tccell1>".@date($dateformat,$user[regdate])."</td>
$tccell1>".date($dateformat,$user[lastposttime])."</td>
$tccell1>".date($dateformat,$user[lastactivity])."</td>
$tccell1>$user[posts]</td>
$tccell2>$user[lastip]</td>
";
if($post=mysql_fetch_array($users))
print "<tr>$tccell2 colspan=7>Too many results!";
print "
$tblend<br>$tblstart
$tccellh colspan=5><b>Posts: ".mysql_num_rows($posts)."</b><tr>
$tccellc>id</td>
$tccellc>Posted by</td>
$tccellc>Thread</td>
$tccellc>Date</td>
$tccellc>IP</td>
";
for($c=0;$c<500 && $post=mysql_fetch_array($posts);$c++)
print "
<tr>
$tccell2>$post[id]</td>
$tccell1><a href=profile.php?id=$post[user]><font ".getnamecolor($post[sex],$post[powerlevel]).">$post[name]</font></a></td>
$tccell1><a href=thread.php?id=$post[thread]>$post[title]</a></td>
$tccell1><nobr>".date($dateformat,$post[date])."</nobr></td>
$tccell2>$post[ip]</td>
";
if($post=mysql_fetch_array($posts))
print "<tr>$tccell2 colspan=5>Too many results!";
print "
$tblend<br>$tblstart
$tccellh colspan=6><b>Private messages: ".mysql_num_rows($pmsgs)."</b><tr>
$tccellc>id</td>
$tccellc>Sent by</td>
$tccellc>Sent to</td>
$tccellc>Title</td>
$tccellc>Date</td>
$tccellc>IP</td>
";
for($c=0;$c<500 && $pmsg=mysql_fetch_array($pmsgs);$c++)
print "
<tr>
$tccell2>$pmsg[id]</td>
$tccell1><a href=profile.php?id=$pmsg[userfrom]><font ".getnamecolor($pmsg[sex1],$pmsg[pow1]).">$pmsg[name1]</font></a></td>
$tccell1><a href=profile.php?id=$pmsg[userto]><font ".getnamecolor($pmsg[sex2],$pmsg[pow2]).">$pmsg[name2]</font></a></td>
$tccell1><a href=showprivate.php?id=$pmsg[id]>$pmsg[title]</a></td>
$tccell1><nobr>".date($dateformat,$pmsg[date])."</nobr></td>
$tccell2>$pmsg[ip]</td>
";
if($pmsg=mysql_fetch_array($pmsgs))
print "<tr>$tccell2 colspan=6>Too many results!";
}
}
print $tblend.$footer;
printtimedif($startingtime);
?>

71
js/button.js Normal file
View File

@ -0,0 +1,71 @@
var bgColor;
var ltColor;
var dkColor;
function createButton(image, name, event, backcolor, lightcolor, darkcolor)
{
var btnTable;
bgColor=backcolor;
ltColor=lightcolor;
dkColor=darkcolor;
btnTable="<table id='"+name+"' border='0' cellspacing='0' cellpadding='0' width=23 height=17 "+event+">"
btnTable+="<TR bgcolor="+backcolor+"><TD></TD><TD></TD><TD><img src=images/toolbar/invis.gif></TD><TD></TD>"
btnTable+="</TR><TR bgcolor="+backcolor+"><TD><img src=images/toolbar/invis.gif></TD>"
btnTable+="<TD colspan='2'>"
btnTable+="<table border='0' cellspacing='0' cellpadding='0' bgcolor="+backcolor+" width=100% height=100%>"
btnTable+="<tr valign=top><td align=center><img name='"+name+"imgtop' src=images/toolbar/invis.gif></td></tr>"
btnTable+="<tr valign=center><td align=center><img name='"+name+"imgleft' src=images/toolbar/invis.gif>"+image+"<img name='"+name+"imgright' src=images/toolbar/invis.gif></td></tr>"
btnTable+="<tr valign=bottom><td align=center><img name='"+name+"imgbottom' src=images/toolbar/invis.gif height=2></td></tr>"
btnTable+="</table>"
btnTable+="</TD><TD bgcolor="+backcolor+"><img src=images/toolbar/invis.gif></TD></TR>"
btnTable+="<TR bgcolor="+backcolor+"><TD></TD><TD></TD><TD></TD><TD></TD></TR>"
btnTable+="</TABLE>"
return btnTable;
}
function createSeperation(backcolor, lightcolor, darkcolor)
{
var btnTable;
btnTable="<table border='0' bgcolor='"+backcolor+"' cellspacing='0' cellpadding='0' width=2 height=17>"
btnTable+="<TR valign=top><TD><img src=images/toolbar/invis.gif height=1></TD><TD><img src=images/toolbar/invis.gif></TD></TR>"
btnTable+="<TR><TD bgcolor='"+darkcolor+"' width=1 height=7></TD><TD bgcolor='"+lightcolor+"' width=1></TD></TR>"
btnTable+="<TR><TD bgcolor='"+darkcolor+"' width=1 height=7></TD><TD bgcolor='"+lightcolor+"' width=1></TD></TR>"
btnTable+="<TR valign=bottom><TD><img src=images/toolbar/invis.gif height=1></TD><TD><img src=images/toolbar/invis.gif></TD></TR>"
btnTable+="</TABLE>"
return btnTable;
}
function buttonOut(name)
{
eval(name+'.rows[0].style.backgroundColor=bgColor');
eval(name+'.rows[1].style.backgroundColor=bgColor');
eval(name+'.rows[1].cells[2].style.backgroundColor=bgColor');
eval(name+'.rows[2].style.backgroundColor=bgColor');
}
function buttonDown(name)
{
eval(name+'.rows[0].style.backgroundColor=dkColor');
eval(name+'.rows[1].style.backgroundColor=dkColor');
eval(name+'.rows[1].cells[2].style.backgroundColor=ltColor');
eval(name+'.rows[2].style.backgroundColor=ltColor');
eval('document.all.'+name+'imgtop.height=2');
eval('document.all.'+name+'imgleft.width=2');
eval('document.all.'+name+'imgright.width=0');
}
function buttonUp(name)
{
eval(name+'.rows[0].style.backgroundColor=ltColor');
eval(name+'.rows[1].style.backgroundColor=ltColor');
eval(name+'.rows[1].cells[2].style.backgroundColor=dkColor');
eval(name+'.rows[2].style.backgroundColor=dkColor');
eval('document.all.'+name+'imgtop.height=1');
eval('document.all.'+name+'imgleft.width=1');
eval('document.all.'+name+'imgright.width=1');
}

5
js/hex.js Normal file
View File

@ -0,0 +1,5 @@
<script>
function hexidecimalchart() {
newwin=window.open('hex.php','hexidecimalchart','toolbar=no,scrollbars=no,status=no,width=350,height=195');
}
</script>

219
js/layoutpreview.js Normal file
View File

@ -0,0 +1,219 @@
// Live layout preview 0.1
// by Jesper, for AcmlmBoard.
isIE = false;
var sep = "";
var fooElement = document.createElement('style');
fooElement.type = 'text/css';
tn = document.createTextNode("foo");
if ((document.all)&&(navigator.appVersion.indexOf("Mac")!=-1)&&(navigator.userAgent.indexOf("Gecko")==-1)&&(navigator.userAgent.indexOf("KHTML")==-1)) { isIE = true; }
try {
fooElement.appendChild(tn);
} catch(e) {
if (e == "[object Error]") { // we have IE
isIE = true;
}
}
function init(d,s) {
if (!isIE) {
thedoc = d;
sep = s;
// d.getElementById("noscript").style.display = "none";
/* d.getElementById("show-blockquote").onclick = refreshLayoutPreview;
d.getElementById("show-link").onclick = refreshLayoutPreview;
d.getElementById("show-stretchimage").onclick = refreshLayoutPreview;
d.getElementById("show-stretchtext").onclick = refreshLayoutPreview;
d.getElementById("postbg").onfocus = refreshLayoutPreview;
d.getElementById("postsign").onfocus = refreshLayoutPreview;
d.getElementById("postheader").onfocus = refreshLayoutPreview; */
d.getElementById("preview-button").onclick = refreshLayoutPreview;
d.getElementById("dataloaderhouse").innerHTML += "<iframe name=\"dataloader\" id=\"dataloader\" src=\"about:blank\" style=\"width: 0px; height: 0px; background: white; border: 0; -moz-opacity: 0; filter:alpha(opacity=0); opacity: 0; \"></iframe>";
return 1;
} else { return 0; }
}
var thedoc;
var foo;
var theStyle;
function refreshLayoutPreview() {
if (!isIE) {
var sampleText = "(sample text)";
d = thedoc;
var cnv = d.getElementById("layout-preview");
var pbg = d.getElementById("postbg");
var phd = d.getElementById("postheader");
var psg = d.getElementById("postsign");
var sbq = d.getElementById("show-blockquote");
var sln = d.getElementById("show-link");
var str = d.getElementById("show-stretchimage");
var stt = d.getElementById("show-stretchtext");
var ssp = d.getElementById("signsep");
var text = cnv.innerHTML+"";
// thedoc = d;
foo = "doodad";
// alert("foo");
var formm = d.createElement("form");
formm.setAttribute("method","POST");
formm.setAttribute("action","/layoutpreviewfilter.php");
formm.setAttribute("target","dataloader");
formm.setAttribute("id","theform");
formm.setAttribute("name","theform");
// formm.setAttribute("onsubmit","alert('submitting')");
var i1 = d.createElement("input");
var i2 = d.createElement("input");
var i3 = d.createElement("input");
var i4 = d.createElement("input");
i1.setAttribute("type","hidden");
i2.setAttribute("type","hidden");
i3.setAttribute("type","hidden");
i4.setAttribute("type","submit");
i1.setAttribute("name","headtext");
i2.setAttribute("name","text");
i3.setAttribute("name","signtext");
i4.setAttribute("name","dosubmit");
i4.setAttribute("id","submitbutton");
i4.style.display = "none";
i4.setAttribute("onclick","alert(document.body.innerHTML);");
if (sln.checked) {
sampleText = "(<a href=\"#\" onclick=\"return false\">sample</a> text)";
}
text = sampleText;
if (sbq.checked) {
text = "<blockquote><font class=fonts><i>Originally posted by Someone</i></font><hr>" + sampleText + "<hr></blockquote>" + sampleText;
}
if (str.checked) {
text = text + "<img src=\"images/stretchtest.gif\">";
}
if (stt.checked) {
text = text + "<br><br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam luctus augue blandit nisl. Etiam id lacus sed ante pulvinar euismod. Maecenas neque quam, scelerisque sed, semper id, vulputate a, eros. Suspendisse mauris erat, condimentum in, pellentesque nec, lobortis vitae, elit. Nunc nec elit quis augue viverra consequat. In eget augue. Aliquam erat volutpat. Nulla blandit massa sed velit. Quisque nonummy consectetuer lacus. Aliquam egestas augue sit amet nulla. In diam leo, lacinia eget, convallis sed, pellentesque eu, velit. Nullam sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<br><br>" + "Morbi rhoncus lectus id leo lacinia blandit. Fusce felis dolor, ullamcorper id, venenatis at, rhoncus feugiat, odio. Suspendisse et nulla eget lectus iaculis elementum. Suspendisse at felis non lectus blandit commodo. Morbi volutpat. Sed eget elit nec libero lobortis consequat. Duis eget magna gravida odio pellentesque venenatis. Maecenas ligula lorem, pellentesque ut, consequat et, commodo et, est. In dictum purus ac lorem. Vestibulum vel felis. In erat. Mauris sit amet est elementum ligula adipiscing vulputate. Curabitur ultrices dolor sagittis neque. Aenean adipiscing odio non lorem. Integer non odio. Nam libero. Vivamus posuere, lorem rutrum iaculis aliquet, metus nibh elementum neque, lacinia eleifend wisi libero vitae tellus. Aenean varius mauris in ipsum.<br><br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam luctus augue blandit nisl. Etiam id lacus sed ante pulvinar euismod. Maecenas neque quam, scelerisque sed, semper id, vulputate a, eros. Suspendisse mauris erat, condimentum in, pellentesque nec, lobortis vitae, elit. Nunc nec elit quis augue viverra consequat. In eget augue. Aliquam erat volutpat. Nulla blandit massa sed velit. Quisque nonummy consectetuer lacus. Aliquam egestas augue sit amet nulla. In diam leo, lacinia eget, convallis sed, pellentesque eu, velit. Nullam sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<br><br>" + "Morbi rhoncus lectus id leo lacinia blandit. Fusce felis dolor, ullamcorper id, venenatis at, rhoncus feugiat, odio. Suspendisse et nulla eget lectus iaculis elementum. Suspendisse at felis non lectus blandit commodo. Morbi volutpat. Sed eget elit nec libero lobortis consequat. Duis eget magna gravida odio pellentesque venenatis. Maecenas ligula lorem, pellentesque ut, consequat et, commodo et, est. In dictum purus ac lorem. Vestibulum vel felis. In erat. Mauris sit amet est elementum ligula adipiscing vulputate. Curabitur ultrices dolor sagittis neque. Aenean adipiscing odio non lorem. Integer non odio. Nam libero. Vivamus posuere, lorem rutrum iaculis aliquet, metus nibh elementum neque, lacinia eleifend wisi libero vitae tellus. Aenean varius mauris in ipsum.";
}
i2.setAttribute("value",text);
if (pbg.value != "") {
i1.setAttribute("value","<div style=\"background-image: url(" + pbg.value + ")\">" + phd.value);
if (psg.value != "") {
i3.setAttribute("value",sep + psg.value + "</div>");
} else {
i3.setAttribute("value",psg.value + "</div>");
}
} else {
i1.setAttribute("value",phd.value);
if (psg.value != "") {
i3.setAttribute("value",sep + psg.value);
} else {
i3.setAttribute("value",psg.value);
}
}
formm.appendChild(i1);
formm.appendChild(i2);
formm.appendChild(i3);
formm.appendChild(i4);
// alert("bar: " + i3.getAttribute('value'));
var IFrameDoc;
if (d.getElementById("dataloader").contentDocument) {
// For NS6
IFrameDoc = d.getElementById("dataloader").contentDocument;
} else if (d.getElementById("dataloader").contentWindow) {
// For IE5.5 and IE6
IFrameDoc = d.getElementById("dataloader").contentWindow.document;
} else if (d.getElementById("dataloader").document) {
// For IE5
IFrameDoc = d.getElementById("dataloader").document;
}
/* while(IFrameDoc.body.hasChildNodes() == true)
{
IFrameDoc.body.removeChild(IFrameDoc.body.childNodes[0]);
}*/
if (d.getElementById("theform")) {
d.body.removeChild(d.getElementById("theform"));
}
d.body.appendChild(formm);
// alert("b: " + IFrameDoc.body.innerHTML);
//IFrameDoc.theform.submit();
setTimeout('submitFormStuff()',10);
// formm.submit();
/* cnvs = doFilter(phd.value) + cnvs + ssp.value + doFilter(psg.value);
if (pbg.value != "") {
cnvs = "<div style=\"background-image: url(" + pbg.value + ")\">" + cnvs + "</div>";
}
// alert(cnvs);
d.getElementById("layout-preview").innerHTML = cnvs;*/
return false;
} else { return true; }
}
function submitFormStuff() {
var IFrameDoc;
// alert("submitformstuff");
if (thedoc.getElementById("dataloader").contentDocument) {
// For NS6
IFrameDoc = thedoc.getElementById("dataloader").contentDocument;
} else if (thedoc.getElementById("dataloader").contentWindow) {
// For IE5.5 and IE6
IFrameDoc = thedoc.getElementById("dataloader").contentWindow.document;
} else if (thedoc.getElementById("dataloader").document) {
// For IE5
IFrameDoc = thedoc.getElementById("dataloader").document;
}
// alert("before submit: " + IFrameDoc.body.innerHTML);
// alert(IFrameDoc.getElementById("theform").innerHTML+"");
// IFrameDoc.getElementById("theform").submit();
// IFrameDoc.getElementById("submitbutton").click();
// alert("after: " + IFrameDoc.body.innerHTML);
// alert(foo);
thedoc.getElementById("theform").submit();
}
function setPreview(n,s) {
// alert("howdy");
// n = "<style>" + s + "</style>" + n;
thedoc.getElementById("layout-preview").innerHTML = n;
var styleElement = document.createElement('style');
styleElement.type = 'text/css';
tn = document.createTextNode(s);
try {
styleElement.appendChild(tn);
} catch(e) {
if (e == "[object Error]") { // we have IE
styleElement.innerHTML = s;
}
}
if (!theStyle) {
theStyle = document.getElementsByTagName('head')[0].appendChild(styleElement);
} else {
theStyle = document.getElementsByTagName('head')[0].replaceChild(styleElement,theStyle);
}
/* try {
// IE can't handle inline stylesheets, so let's add them 'the right way' - replacing if we're reloading
if (csscreated) { css = document.styleSheets[document.styleSheets.length-1]; }
else { css = document.createStyleSheet(); csscreated = "1"; }
css.cssText = s;
thedoc.getElementById("layout-preview").innerHTML = n;
} catch(e) {
return;
}*/
// alert(thedoc.getElementById("layout-preview").innerHTML);
}

219
js/menu.js Normal file
View File

@ -0,0 +1,219 @@
//Netscape Resize fix
if (document.layers)
{
widthCheck = window.innerWidth
heightCheck = window.innerHeight
}
function resizeFix()
{
if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
{
document.location.href = document.location.href
}
}
window.onerror = null;
var DOM;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4 && bVer <5);
var NS5 = (bName == "Netscape" && bVer >=5);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
if (document.getElementById)
{
DOM = true;
NS4 = false
}
else
{
DOM= false;
}
var MTOP = 57
var menuActive = 0
var MenuOn = 0
var onLayer
var timeOn = null
var loaded = 0
var openmenu = "";
var closemenu = "";
var activeLayer = "";
var menu1 = new Image();
menu1.src = "images/toolbar/invis.gif"; //Invisibol Placeholder
var menu2 = new Image();
menu2.src = menu1.src;
// MENU COLOR VARIABLE
var menuColor = "#000000"
// LAYER SWITCHING CODE
if (NS4 || IE4)
{
if (navigator.appName == "Netscape")
{
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
else
{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
}
// SHOW MENU
function showLayer(layerName, e)
{
MenuOn=1
if (NS4 || IE4 || DOM)
{
if (timeOn != null)
{
clearTimeout(timeOn)
hideLayer(onLayer)
}
if (NS4 || IE4)
{
eval(layerName+'.style.left=e.clientX-e.offsetX');
eval(layerName+'.style.top=e.clientY');
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
activeLayer=layerName;
}
if (DOM)
{
document.getElementById(layerName).style.visibility='visible'
}
}
onLayer = layerName
}
// HIDE MENU
function hideLayer(layerName)
{
MenuOn=0
if (menuActive == 0)
{
if (NS4 || IE4)
{
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}
if (DOM)
{
document.getElementById(layerName).style.visibility='hidden'
}
}
}
// TIMER FOR BUTTON MOUSE OUT
function btnTimer()
{
if(MenuOn==1)
{
timeOn = setTimeout("btnOut()",1000)
}
}
// BUTTON MOUSE OUT
function btnOut()
{
hideLayer(onLayer)
}
// MENU MOUSE OVER
function menuOver(layerName)
{
if(layerName==activeLayer)
{
clearTimeout(timeOn)
menuActive = 1
return true;
}
else
{
return false;
}
}
// MENU MOUSE OUT
function menuOut()
{
menuActive = 0
timeOn = setTimeout("hideLayer(onLayer)", 400)
}
// Creates menu object
function menuLink(title, url)
{
this.title = title
this.url = url
}
// Builds menu table
function menuMaker(menuArray, fontcolor, backcolor, lightcolor, darkcolor)
{
topTable = ""
btmTable = ""
n = ""
j = eval(menuArray + ".length")-1;
topTable = "<div ID='" + eval(menuArray + ".id") + "' STYLE='POSITION: absolute; LEFT: 0; TOP: 0; VISIBILITY: hidden; Z-INDEX: 1'>"
topTable+="<table border='0' cellspacing='0' cellpadding='0'>"
topTable+="<TR><TD bgcolor='"+lightcolor+"'></TD><TD bgcolor='"+lightcolor+"' ALT='Top Border'></TD><TD bgcolor='"+lightcolor+"' ALT='Top Right Small Background'><img src=images/toolbar/invis.gif height=1 width=1></TD><TD bgcolor='"+lightcolor+"'></TD>"
topTable+="</TR><TR><TD bgcolor='"+lightcolor+"'><img src=images/toolbar/invis.gif></TD>"
topTable+="<TD colspan='2'>"
topTable+="<table border='0' cellspacing='0' cellpadding='0'>"
btmTable = "</table>"
btmTable+="</TD><TD bgcolor='"+darkcolor+"'><img src=images/toolbar/invis.gif></TD></TR>"
//btmTable+="</TR><TR><TD bgcolor='"+darkcolor+"'></TD><TD bgcolor='"+darkcolor+"' ALT='Lower Right Side Border'><img src=images/toolbar/invis.gif></TD></TR>"
btmTable+="<TR><TD bgcolor='"+darkcolor+"' ALT='Lower Right Corner Border'></TD><TD bgcolor='"+darkcolor+"'></TD><TD bgcolor='"+darkcolor+"'></TD><TD bgcolor='"+darkcolor+"'></TD></TR></TABLE>"
btmTable+="</div>"
bgnrow = ""
for( var i = 0; i <=j; i++)
{
test=eval(menuArray + "[" + i + "].title")
bgnrow += "<tr valign=Center><td bgcolor='"+backcolor+"' align=Center width=100%><a onMouseOut='menuOut()' onMouseOver='menuOver(activeLayer)' class='menus' target='_top'><img src='images/toolbar/invis.gif' width=15 height=15 border='0'></a>"
bgnrow += "<a onClick='" + eval(menuArray + "[" + i + "].url") + "' onMouseOut='menuOut()' onMouseOver='menuOver(activeLayer)' class='menus' target='_top'><font face='MS Sans Serif, Western' size=1 color='"+fontcolor+"'>" + test + "</font></td></tr>"
}
n= topTable+bgnrow+btmTable
return n;
}
function getScale()
{
var scale;
var newwidth
if (bName == "Netscape")
{
newwidth = window.innerWidth
}
else
{
newwidth= document.body.clientWidth
}
center = ((newwidth-371)/2)+251;
minWidth = 539
if (center <minWidth)
{
return minWidth;
}
else
{
return center;
}
}

77
js/password.js Normal file
View File

@ -0,0 +1,77 @@
function checkName()
{
if (window.document.REPLIER.username.value == '')
{
alert('Please Enter Your Username');
return true;
}
else
{
return false;
}
}
function checkPass()
{
if (window.document.REPLIER.password.value == '')
{
alert('Please Enter Your Password');
return true;
}
else
{
return false;
}
}
function checkTitle()
{
if (window.document.REPLIER.subject.value == '')
{
alert('Please Enter Your Thread Title');
return true;
}
else
{
return false;
}
}
function checkPost()
{
if (window.document.REPLIER.message.value == '')
{
alert('Please Enter Your Message');
return true;
}
else
{
return false;
}
}
function checkReciever()
{
if (window.document.REPLIER.username.value == '')
{
alert('Please Enter The Recieving User');
return true;
}
else
{
return false;
}
}
function checkSubject()
{
if (window.document.REPLIER.subject.value == '')
{
alert('Please Enter The Subject');
return true;
}
else
{
return false;
}
}

20
js/png.js Normal file
View File

@ -0,0 +1,20 @@
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
document.writeln('<style type="text/css">img { visibility:hidden; } </style>');
window.attachEvent("onload", fnLoadPngs);
}
function fnLoadPngs() {
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
if (itsAllGood && img.src.match(/\.png$/i) != null) {
var src = img.src;
img.style.width = img.width + "px";
img.style.height = img.height + "px";
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
img.src = "images/_.gif";
}
img.style.visibility = "visible";
}
}

86
js/toolbar.js Normal file
View File

@ -0,0 +1,86 @@
imgFColor = new Image();
imgFColor.src = "images/toolbar/fcolor.gif";
imgBGColor = new Image();
imgBGColor.src = "images/toolbar/bgcolor.gif";
imgBold = new Image();
imgBold.src = "images/toolbar/bold.gif";
imgItalic = new Image();
imgItalic.src = "images/toolbar/italic.gif";
imgUnderline = new Image();
imgUnderline.src = "images/toolbar/underline.gif";
imgStrike = new Image();
imgStrike.src = "images/toolbar/strike.gif";
imgLink = new Image();
imgLink.src = "images/toolbar/link.gif";
imgImage = new Image();
imgImage.src = "images/toolbar/image.gif"
imgSmiley = new Image();
imgSmiley.src = "images/toolbar/smiley.gif";
var mnuFGround = "Menu1";
var mnuBGround = "Menu2";
var mnuSmiley = "Menu3";
var btnfcolorname = "FColor";
var btnbgcolorname = "BGColor";
var btnboldname = "bold";
var btnitalname = "italic";
var btnundname = "underline";
var btnstrikename = "strike";
var btnlinkname = "link";
var btnimagename = "image";
var btnsmileyname = "smiley";
var boldOpen = "[b]";
var boldClose = "[/b]";
var boldDown = 0;
var italOpen = "[i]";
var italClose = "[/i]";
var italDown = 0;
var undOpen = "[u]";
var undClose = "[/u]";
var undDown = 0;
var strkOpen = "[s]";
var strkClose = "[/s]";
var strkDown = 0;
var linkOpen = "[url]";
var linkClose = "[/url]";
var linkDown = 0;
var imageOpen = "[img]";
var imageClose = "[/img]";
var imageDown = 0;
function checkBrowser()
{
return (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4); //checks to see if IE is running
}
function checkKey(btnNumber, e)
{
if(e.keyCode==btnNumber)
{
return true;
}
else
{
return false;
}
}
function doCode(code)
{
window.document.REPLIER.message.value+=code;
}

62
layoutpreviewfilter.php Normal file
View File

@ -0,0 +1,62 @@
<?php
require_once 'lib/libs.php';
//require_once 'lib/layout.php';
header("Pragma: no-cache");
$loguser[viewsig]=1;
$post['signtext'] = stripslashes($_POST['signtext']);
$post['headtext'] = stripslashes($_POST['headtext']);
$post['text'] = stripslashes($_POST['text']);
$user=@mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$loguserid"));
$user[viewsig]=1;
$post['num'] = $user['posts'];
$post['name'] = $user['name'];
$post['regdate'] = $user['regdate'];
$post['date'] = ctime();
$numdays=(ctime()-$user[regdate])/86400;
$post['signtext']=doreplace($post['signtext'],$user[posts],$numdays,$user[name]);
$post['signtext']=doreplace2($post['signtext'],$user[posts],$numdays,$user[name]);
$post['headtext']=doreplace($post['headtext'],$user[posts],$numdays,$user[name]);
$post['headtext']=doreplace2($post['headtext'],$user[posts],$numdays,$user[name]);
function myaddslashes($s) {
return preg_replace("(\r\n|\n|\r)", "", str_replace("'", "\'", $s));
}
$post['styles'] = "";
$post['signtext'] = implode(explode("\n", $post['signtext']));
$post['headtext'] = implode(explode("\n", $post['headtext']));
$post['text'] = implode(explode("\n", $post['text']));
while (preg_match("'<style(.*?)</style>'si", $post['headtext'],$m)) {
preg_match("'^(?:.*?)>(.*?)</style>$'si", $m[0], $m1);
/* if (preg_match_all("'@import\s+(\()?([\"'])(.*?)\2(\))?'si", $m1[1], $m2, PREG_SET_ORDER)) {
foreach ($m2 as $list) {
$post['styleimports'][] = $list[3];
}
}*/
$post['styles'] .= $m1[1];
$post['headtext'] = str_replace($m[0]."", "", $post['headtext']);
// $post['text'] .= "<br>replaced ".htmlentities($m[0])."<br>";
$m = array();
$m1 = array();
}
print "<body><script>\n\n";
// $post = setlayout($post, true);
print "var headt, textt, signt, stylest; \n\n headt = '" . myaddslashes( $post['headtext']) . "';\n stylest = '" . myaddslashes( $post['styles']) . "';\n textt = '" . myaddslashes( $post['text']) . "';\n signt = '" . myaddslashes( $post['signtext']) . "';\n\n";
/* print "var importst = new Array();\n";
if (count($post['styleimports']) > 0) {
$i = 0;
foreach ($post['styleimports'] as $f) {
print "importst[".$i."] = \"". myaddslashes($f) . "\";\n";
$i++;
}
}*/
print "parent.setPreview(headt+textt+signt,stylest);\n\n";
print "</script></body>";
?>

24
lib/colors.php Normal file
View File

@ -0,0 +1,24 @@
<?php
$nmcol[0]=array('-1'=>'888888','97ACEF','D8E8FE','AFFABE','FFEA95');
$nmcol[1]=array('-1'=>'888888','F185C9','FFB3F3','C762F2','C53A9E');
$nmcol[2]=array('-1'=>'888888','7C60B0','EEB9BA','47B53C','F0C413');
$linkcolor='FFD040';
$linkcolor2='F0A020';
$linkcolor3='FFEA00';
$linkcolor4='FFFFFF';
$textcolor='E0E0E0';
$boardtitle='<font size=6>Title Goes Here</font>';
$font='arial';
$font2='verdana';
$font3='tahoma';
$newpollpic='New poll';
$newreplypic='New reply';
$newthreadpic='New Thread';
$newpic='<img src=images/new.gif>';
$numdir='num1/';
$numfil='numnes';
if(!$scheme) $scheme=0;
$filename=@mysql_result(mysql_query("SELECT file FROM schemes WHERE id=$scheme"),0,0);
if(!$filename) $filename='dailycycle.php';
require "schemes/$filename";
?>

20
lib/config.php Normal file
View File

@ -0,0 +1,20 @@
<?php
//MySQL setup
$sqlhost="localhost";
$sqluser="root";
$sqlpass="";
$dbname="test";
//Board and site info
$boardname="board title here";
$siteurl="http://yoursite.com";
$sitename="Your Site Name Here";
//Dropdown links at the bottom
/*
$affiliatelinks="<form><select onchange=window.open(this.options[this.selectedIndex].value)>
<OPTION selected>Forum affiliates:
<option value=about:blank>Blank Page
</select></form>";
*/
?>

Some files were not shown because too many files have changed in this diff Show More