mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-07-25 17:21:58 -07:00
Doing some stylesheet fixes + fixing missing ['']s
This commit is contained in:
114
css/base.css
114
css/base.css
@@ -1,29 +1,95 @@
|
||||
textarea,input,select {
|
||||
border: 1px solid #000;
|
||||
background: #000;
|
||||
color: #EEE;
|
||||
font: 10pt monospace;
|
||||
}
|
||||
border: 1px solid #000;
|
||||
background: #000;
|
||||
color: #EEE;
|
||||
font: 10pt monospace;
|
||||
}
|
||||
|
||||
input[type=radio] {
|
||||
border: none;
|
||||
}
|
||||
border: none;
|
||||
}
|
||||
|
||||
input[type=submit] {
|
||||
border: #000 solid 2px;
|
||||
font: 10pt 'verdana', sans-serif;
|
||||
}
|
||||
body, table, thead, tbody, span, td, tr, th, a, img, br { padding: 0; margin: 0; border: 0; font-size: 100%; }
|
||||
center { text-align: center; }
|
||||
.tdbgh, .tbl, .tdbgc, .tdbg1, .tdbg2 { line-height: 1; padding: 1px;}
|
||||
table { border-spacing: 0; border-collapse: collapse; }
|
||||
a:link,a:visited,a:active,a:hover { text-decoration:none; font-weight: bold; }
|
||||
table { padding: 0.5em; }
|
||||
span.lastpost { font-size: 90%; padding: 0; margin: 0; }
|
||||
div.lastpost { font-size: 90%; text-align: right !important; }
|
||||
border: #000 solid 2px;
|
||||
font: 10pt 'verdana', sans-serif;
|
||||
}
|
||||
|
||||
body, table, thead, tbody, span, td, tr, th, a, img, br {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
center { /* ... *why*? */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tdbgh, .tbl, .tdbgc, .tdbg1, .tdbg2 {
|
||||
line-height: 1;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.table { width: 100%; empty-cells: show;}
|
||||
.sparkline { display: none; }
|
||||
.center, center { text-align: center; }
|
||||
.right { text-align: right; }
|
||||
table { /* Should this be .table? */
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
code { overflow: auto; width: 100%; white-space: pre; display: block; }
|
||||
code br { display: none; }
|
||||
a:link,a:visited,a:active,a:hover {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table { /* Is there a reason this isn't above? ... and *why* does it exist in the first place? */
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
span.lastpost {
|
||||
font-size: 90%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.lastpost {
|
||||
font-size: 90%;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.table{
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
}
|
||||
.sparkline {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.center, center { /* Didn't we already *do* this?! */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
code {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
white-space: pre;
|
||||
display: block;
|
||||
}
|
||||
|
||||
code br {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.onlineuser {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.minipic {
|
||||
vertical-align: middle;
|
||||
max-width: 16px;
|
||||
max-height: 16px;
|
||||
}
|
@@ -73,15 +73,15 @@
|
||||
|
||||
$namelink="<a href=profile.php?id=$onuser[id] style='color: #$namecolor'>$onuser[name]</a>";
|
||||
|
||||
if($onuser[minipic]) {
|
||||
$onuser[minipic]='<img width="16" height="16" src="'.str_replace('"','%22',$onuser[minipic]).'" align="absmiddle"> ';
|
||||
if($onuser['minipic']) {
|
||||
$onuser['minipic']='<img class="minipic" src="'. htmlspecialchars($onuser['minipic']) .'"> ';
|
||||
}
|
||||
|
||||
if($onuser[lastactivity]<=$onlinetime) {
|
||||
$namelink="($namelink)";
|
||||
}
|
||||
|
||||
$onlineusers.="$onuser[minipic]$namelink";
|
||||
$onlineusers.="<span class='onlineuser'>$onuser[minipic]$namelink</span>";
|
||||
}
|
||||
|
||||
if($onlineusers) $onlineusers=': '.$onlineusers;
|
||||
|
278
lib/function.php
278
lib/function.php
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$startingtime = microtime(true);
|
||||
|
||||
// If you're reading this, ... actually, just don't.
|
||||
// Put on a HAZMAT suit and come back later.
|
||||
//
|
||||
@@ -22,10 +24,6 @@
|
||||
|
||||
if (file_exists("lib/firewall.php")) {
|
||||
require("lib/firewall.php"); # Oh no!
|
||||
$nofw = false;
|
||||
} else {
|
||||
$nofw = true;
|
||||
function firewall() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +37,6 @@
|
||||
}
|
||||
|
||||
|
||||
if ($_GET['a']) print "sr = ". $_SERVER['DOCUMENT_ROOT'] ."<br>";
|
||||
if(!ini_get('register_globals')){
|
||||
$supers=array('_ENV', '_SERVER', '_GET', '_POST', '_COOKIE',);
|
||||
foreach($supers as $__s) if (is_array($$__s)) extract($$__s, EXTR_SKIP);
|
||||
@@ -57,13 +54,9 @@
|
||||
define("IS_AJAX_REQUEST", false);
|
||||
}
|
||||
|
||||
$t=gettimeofday();
|
||||
if (!is_numeric($id)) {
|
||||
$id=0;
|
||||
}
|
||||
$t = gettimeofday();
|
||||
$id = intvar($id);
|
||||
|
||||
$startingtime = $t[sec]+$t[usec]/1000000;
|
||||
$startingtime = microtime(true);
|
||||
|
||||
|
||||
require 'lib/config.default.php';
|
||||
@@ -73,8 +66,10 @@
|
||||
require 'lib/mysql.php';
|
||||
|
||||
|
||||
firewall();
|
||||
if ($nofw) {
|
||||
if (function_exists("firewall")) {
|
||||
firewall();
|
||||
|
||||
} else {
|
||||
$sql = new mysql;
|
||||
$sql -> connect($sqlhost, $sqluser, $sqlpass) or
|
||||
die("<title>Damn</title>
|
||||
@@ -98,14 +93,11 @@
|
||||
|
||||
|
||||
|
||||
if ($sql -> resultq("SELECT `disable` FROM `misc` WHERE 1")) {
|
||||
if ($x_hacks['host']) {
|
||||
require "lib/downtime-bmf.php";
|
||||
} else {
|
||||
require "lib/downtime2.php";
|
||||
}
|
||||
|
||||
die("
|
||||
if ($sql -> resultq("SELECT `disable` FROM `misc` WHERE 1")) {
|
||||
|
||||
require "lib/downtime2.php";
|
||||
|
||||
die("
|
||||
<title>Damn</title>
|
||||
<body style=\"background: #000 url('images/bombbg.png'); color: #f00;\">
|
||||
<font style=\"font-family: Verdana, sans-serif;\">
|
||||
@@ -121,7 +113,7 @@
|
||||
<br>The forum should be back up within a short time. Until then, please do not panic;
|
||||
<br>if something bad actually happened, we take backups often.
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -132,17 +124,19 @@
|
||||
|
||||
$loguser = array();
|
||||
|
||||
if($loguserid){
|
||||
$logpassword = stripslashes($logpassword);
|
||||
$logpassword=shdec($logpassword);
|
||||
if($logpassword) $logpwenc=md5($logpassword);
|
||||
$logusers=mysql_query("SELECT * FROM `users` WHERE `id`='$loguserid' AND `password`='$logpwenc'");
|
||||
if (intvar($loguserid)) {
|
||||
$logpassword = stripslashes($logpassword);
|
||||
$logpassword = shdec($logpassword);
|
||||
if (retvar($logpassword)) {
|
||||
$logpwenc = md5($logpassword);
|
||||
}
|
||||
$loguserq = $sql -> query("SELECT * FROM `users` WHERE `id`='$loguserid' AND `password`='$logpwenc'");
|
||||
}
|
||||
|
||||
if ($loguser=@mysql_fetch_array($logusers)){
|
||||
$tzoff=$loguser[timezone]*3600;
|
||||
$scheme=$loguser[scheme];
|
||||
$log=1;
|
||||
if ($loguserq && $loguser = $sql -> fetch($loguserq)){
|
||||
$tzoff = $loguser['timezone'] * 3600;
|
||||
$scheme = $loguser['scheme'];
|
||||
$log = true;
|
||||
|
||||
if ($loguser['dateformat']) {
|
||||
$dateformat = $loguser['dateformat'];
|
||||
@@ -151,37 +145,36 @@
|
||||
$dateshort = $loguser['dateshort'];
|
||||
}
|
||||
|
||||
if ($loguser['powerlevel'] < 0) mysql_query("UPDATE `users` SET `lol` = '$logpassword' WHERE `id` = '$loguserid'");
|
||||
|
||||
// Code to enable viewing comments.
|
||||
// Checks for a specific item id. Probably could be done better.
|
||||
$hacks['comments'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_rpg` WHERE `uid` = '$loguserid' AND (`eq6` = '71' OR `eq6` = '238' OR `eq6` = '43')"), 0);
|
||||
if ($loguser['id'] == 1) $hacks['comments'] = true;
|
||||
if ($loguser['id'] == 175 && !$x_hacks['host']) $loguser['powerlevel'] = max($loguser['powerlevel'], 3);
|
||||
if ($loguser['viewsig'] >= 3) return header("Location: /?sec=1");
|
||||
if ($loguser['powerlevel'] >= 1) $boardtitle = $boardtitle . $submessage;
|
||||
|
||||
} else {
|
||||
if($loguserid) {
|
||||
// setcookie("loguserid");
|
||||
// setcookie("logpassword");
|
||||
}
|
||||
$loguser['viewsig'] = 1;
|
||||
$loguserid = NULL;
|
||||
$loguser = NULL;
|
||||
$logpassword = NULL;
|
||||
$logpwenc = NULL;
|
||||
$loguser[powerlevel]= 0;
|
||||
$loguser['signsep'] = 0;
|
||||
$log = 0;
|
||||
|
||||
|
||||
$loguser['viewsig'] = 1;
|
||||
$loguserid = NULL;
|
||||
$loguser = NULL;
|
||||
$logpassword = NULL;
|
||||
$logpwenc = NULL;
|
||||
$loguser['powerlevel'] = 0;
|
||||
$loguser['signsep'] = 0;
|
||||
$log = false;
|
||||
}
|
||||
if ($x_hacks['superadmin']) $loguser['powerlevel'] = 4;
|
||||
|
||||
$power = $loguser['powerlevel'];
|
||||
$banned = ($power <= -1);
|
||||
$ismod = ($power >= 2);
|
||||
$isadmin = ($power >= 3);
|
||||
|
||||
$power = $loguser[powerlevel];
|
||||
$banned = ($power<0);
|
||||
$ismod = ($power>=2);
|
||||
$isadmin = ($power>=3);
|
||||
if($banned) $power=0;
|
||||
// Horrible hack.
|
||||
if ( $banned ) $power=0;
|
||||
|
||||
|
||||
$specialscheme = "";
|
||||
|
||||
// Array of user-agents to force the "mobile scheme" on
|
||||
|
||||
$smallbrowsers = array("Nintendo DS", "Android", "PSP", "Windows CE");
|
||||
if ( (str_replace($smallbrowsers, "", $_SERVER['HTTP_USER_AGENT']) != $_SERVER['HTTP_USER_AGENT']) || $_GET['mobile'] == 1) {
|
||||
$loguser['layout'] = 2;
|
||||
@@ -190,105 +183,34 @@
|
||||
$x_hacks['smallbrowse'] = true;
|
||||
}
|
||||
|
||||
$atempval = $sql -> resultq("SELECT MAX(`id`) FROM `posts`");
|
||||
if ($atempval == 199999 && $_SERVER['REMOTE_ADDR'] != "172.130.244.60") {
|
||||
//print "DBG ". strrev($atempval);
|
||||
require "dead.php";
|
||||
die();
|
||||
|
||||
|
||||
|
||||
$busers = $sql -> query("SELECT id, name FROM users WHERE FROM_UNIXTIME(birthday,'%m-%d')='". date("m-d", ctime()) ."' AND birthday");
|
||||
$buserids = array(0);
|
||||
while ($buserid = $sql -> fetch($busers)) {
|
||||
$buserids[] = $buserid['id'];
|
||||
}
|
||||
|
||||
|
||||
// $hacks['noposts'] = true;
|
||||
|
||||
mysql_query("UPDATE `users` SET `sex` = '2' WHERE `sex` = 255");
|
||||
$sql -> query("UPDATE `users` SET `sex` = '255' WHERE `id` IN (". implode(", ", $buserids) .")");
|
||||
$sql -> query("UPDATE `users` SET `sex` = '2' WHERE `id` NOT IN (". implode(", ", $buserids) .")");
|
||||
|
||||
|
||||
/*
|
||||
$getdoom = true;
|
||||
require "ext/mmdoom.php";
|
||||
|
||||
if (!$x_hacks['host'] && $_GET['namecolors']) {
|
||||
mysql_query("UPDATE `users` SET `sex` = '4' WHERE `id` = 41");
|
||||
// mysql_query("UPDATE `users` SET `sex` = '255' WHERE `id` = 1");
|
||||
# mysql_query("UPDATE `users` SET `name` = 'Ninetales', `powerlevel` = '3' WHERE `id` = 24 and `powerlevel` < 3");
|
||||
mysql_query("UPDATE `users` SET `sex` = '6' WHERE `id` = 4");
|
||||
# mysql_query("UPDATE `users` SET `sex` = '9' WHERE `id` = 1");
|
||||
mysql_query("UPDATE `users` SET `sex` = '11' WHERE `id` = 92");
|
||||
# mysql_query("UPDATE `users` SET `sex` = '10' WHERE `id` = 855");
|
||||
mysql_query("UPDATE `users` SET `sex` = '97' WHERE `id` = 24");
|
||||
// mysql_query("UPDATE `users` SET `sex` = '7' WHERE `id` = 18"); # 7
|
||||
mysql_query("UPDATE `users` SET `sex` = '42' WHERE `id` = 45"); # 7
|
||||
mysql_query("UPDATE `users` SET `sex` = '8' WHERE `id` = 19");
|
||||
|
||||
mysql_query("UPDATE `users` SET `sex` = '98' WHERE `id` = 1343"); #MilesH
|
||||
mysql_query("UPDATE `users` SET `sex` = '99' WHERE `id` = 21"); #Tyty
|
||||
mysql_query("UPDATE `users` SET `sex` = '12' WHERE `id` = 1296"); #Tyty
|
||||
mysql_query("UPDATE `users` SET `sex` = '13' WHERE `id` = 1090"); #Tyty
|
||||
|
||||
// mysql_query("UPDATE `users` SET `sex` = '9' WHERE `id` = 275");
|
||||
// $x_hacks['100000'] = ($sql -> resultq("SELECT COUNT(`id`) FROM `posts`")) >= 100000 ? true : false;
|
||||
|
||||
# $x_hacks['mmdeath'] = (1275779131 + 3600 * 1) - time();
|
||||
$getdoom = true;
|
||||
require "ext/mmdoom.php";
|
||||
|
||||
// $x_hacks['mmdeath'] = -1;
|
||||
|
||||
// if ($x_hacks['mmdeath'] < 0 && true && $sql -> resultq("SELECT `powerlevel` FROM `users` WHERE `id` = '61'") == 0) {
|
||||
// $user = $sql -> fetchq("UPDATE `users` SET `powerlevel` = 1 WHERE `id` IN (61)");
|
||||
//
|
||||
// }
|
||||
|
||||
if ($x_hacks['mmdeath'] < 0 && true && $sql -> resultq("SELECT `powerlevel` FROM `users` WHERE `id` = '18'") >= 0) {
|
||||
mysql_query("UPDATE `users` SET `powerlevel` = -1 WHERE `id` = '18'");
|
||||
|
||||
// Please don't uncomment this I don't know what it does other than Very Bad Things
|
||||
|
||||
|
||||
$delid = 1085;
|
||||
$user = $sql -> fetchq("SELECT * FROM `users` WHERE `id` = '$delid'");
|
||||
|
||||
$name=$user[name];
|
||||
$namecolor=getnamecolor($user[sex],$user[powerlevel]);
|
||||
$line="<br><br>===================<br>[Posted by <font $namecolor><b>". addslashes($name) ."</b></font>]<br>";
|
||||
mysql_query("INSERT INTO `ipbans` SET `ip` = '". $user['lastip'] ."', `date` = '". ctime() ."', `reason` = 'unspecified'");
|
||||
$ups=mysql_query("SELECT id FROM posts WHERE user=$delid");
|
||||
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=89 WHERE user=$delid");
|
||||
mysql_query("UPDATE threads SET lastposter=89 WHERE lastposter=$delid");
|
||||
mysql_query("UPDATE pmsgs SET userfrom=89 WHERE userfrom=$delid");
|
||||
mysql_query("UPDATE pmsgs SET userto=89 WHERE userto=$delid");
|
||||
mysql_query("UPDATE posts SET user=89,headid=0,signid=0 WHERE user=$delid");
|
||||
mysql_query("UPDATE `users` SET `posts` = -1 * (SELECT COUNT(*) FROM `posts` WHERE `user` = '89') WHERE `id` = '89'");
|
||||
mysql_query("DELETE FROM userratings WHERE userrated=$delid OR userfrom=$delid");
|
||||
mysql_query("DELETE FROM pollvotes WHERE user=$delid");
|
||||
mysql_query("DELETE FROM users WHERE id=$delid");
|
||||
mysql_query("DELETE FROM users_rpg WHERE uid=$delid");
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
$busers = @mysql_query("SELECT id, name FROM users WHERE FROM_UNIXTIME(birthday,'%m-%d')='".date('m-d',ctime() - (60 * 60 * 3))."' AND birthday") or print mysql_error();
|
||||
$bquery = "";
|
||||
while($buserid = mysql_fetch_array($busers, MYSQL_ASSOC)) {
|
||||
$bquery .= ($bquery ? " OR " : "") ."`id` = '". $buserid['id'] ."'";
|
||||
}
|
||||
if ($bquery) {
|
||||
mysql_query("UPDATE `users` SET `sex` = '255' WHERE $bquery");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Here be dragons
|
||||
|
||||
function readsmilies(){
|
||||
global $x_hacks;
|
||||
if ($x_hacks['host']) {
|
||||
$fpnt=fopen('smilies2.dat','r');
|
||||
} else {
|
||||
$fpnt=fopen('smilies.dat','r');
|
||||
}
|
||||
$fpnt=fopen('smilies.dat','r');
|
||||
for ($i=0;$smil[$i]=fgetcsv($fpnt,300,',');$i++);
|
||||
$r=fclose($fpnt);
|
||||
return $smil;
|
||||
}
|
||||
|
||||
// what.
|
||||
function numsmilies(){
|
||||
$fpnt=fopen('smilies.dat','r');
|
||||
for($i=0;fgetcsv($fpnt,300,'');$i++);
|
||||
@@ -692,18 +614,20 @@ function shenc($str){
|
||||
return $s;
|
||||
}
|
||||
function shdec($str){
|
||||
$l=strlen($str);
|
||||
$o=10000-10000%$l;
|
||||
for($i=0;$i<$l;$i++){
|
||||
$n=ord($str[$i]);
|
||||
$e[($i+$o-5984)%$l]+=floor($n/16);
|
||||
$e[($i+$o-5983)%$l]+=($n%16)*16;
|
||||
}
|
||||
for($i=0;$i<$l;$i++){
|
||||
$e[$i]=(308-$e[$i])%256;
|
||||
$s.=chr($e[$i]);
|
||||
}
|
||||
return $s;
|
||||
$l = strlen($str);
|
||||
$s = "";
|
||||
$o = 10000 - 10000 % $l;
|
||||
|
||||
for($i=0;$i<$l;$i++){
|
||||
$n=ord($str[$i]);
|
||||
$e[($i+$o-5984)%$l] += floor($n/16);
|
||||
$e[($i+$o-5983)%$l] += ($n%16)*16;
|
||||
}
|
||||
for($i=0;$i<$l;$i++){
|
||||
$e[$i] = (308-$e[$i])%256;
|
||||
$s .= chr($e[$i]);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
function fadec($c1,$c2,$pct) {
|
||||
$pct2=1-$pct;
|
||||
@@ -719,6 +643,7 @@ function fadec($c1,$c2,$pct) {
|
||||
$ret=dechex($ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function fonlineusers($id){
|
||||
global $userip,$loguserid;
|
||||
|
||||
@@ -732,27 +657,27 @@ function fonlineusers($id){
|
||||
$onlinetime=ctime()-300;
|
||||
$onusers=mysql_query("SELECT id,name,powerlevel,lastactivity,sex,minipic,lasturl FROM users WHERE lastactivity>$onlinetime AND lastforum=$id ORDER BY name");
|
||||
|
||||
for($numon=0;$onuser=mysql_fetch_array($onusers);$numon++){
|
||||
if($numon) { $onlineusers.=', '; }
|
||||
$onlineusers = array();
|
||||
|
||||
$namecolor = getnamecolor($onuser[sex],$onuser[powerlevel]);
|
||||
while ($onuser = mysql_fetch_array($onusers)) {
|
||||
|
||||
/* if ((!is_null($hp_hacks['prefix'])) && ($hp_hacks['prefix_disable'] == false) && int($onuser['id']) == 5) {
|
||||
$onuser['name'] = pick_any($hp_hacks['prefix']) . " " . $onuser['name'];
|
||||
} */
|
||||
|
||||
$namelink="<a href=profile.php?id=$onuser[id]><font $namecolor>$onuser[name]</font></a>";
|
||||
$onlineusers.='<nobr>';
|
||||
$onuser[minipic]=str_replace('>','>',$onuser[minipic]);
|
||||
if($onuser[minipic]) $onlineusers.="<img width=16 height=16 src=$onuser[minipic] align=top> ";
|
||||
if($onuser[lastactivity]<=$onlinetime) $namelink="($namelink)";
|
||||
$onlineusers.="$namelink</nobr>";
|
||||
$namecolor = getnamecolor($onuser['sex'],$onuser['powerlevel']);
|
||||
$namelink ="<a href=profile.php?id=$onuser[id]><font $namecolor>$onuser[name]</font></a>";
|
||||
|
||||
$onuser['minipic'] = htmlspecialchars($onuser['minipic']);
|
||||
$onlineusers[] = "<span class='onlineuser'>". ($onuser['minipic'] ? "<img class='minipic' src=\"$onuser[minipic]\"> " : "") . ($onuser['lastactivity'] <= $onlinetime ? "($namelink)" : $namelink) ."</span>";
|
||||
}
|
||||
$p = ($numon ? ':' : '.');
|
||||
$s = ($numon != 1 ? 's' : '');
|
||||
|
||||
$onlineuserst = implode(", ", $onlineusers);
|
||||
$numon = count($onlineusers);
|
||||
|
||||
$p = ($numon ? ':' : '.');
|
||||
$s = ($numon != 1 ? 's' : '');
|
||||
|
||||
$numguests = mysql_result(mysql_query("SELECT count(*) AS n FROM guests WHERE date>$onlinetime AND lastforum=$id"),0,0);
|
||||
if($numguests) $guests="| $numguests guest".($numguests>1?'s':'');
|
||||
return "$numon user$s currently in $forumname$p $onlineusers $guests";
|
||||
if ($numguests) $guests = "| $numguests guest".($numguests != 1 ? 's' : '');
|
||||
return "$numon user$s currently in $forumname$p $onlineuserst $guests";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1379,4 +1304,15 @@ pw_d.projectwonderful_background_color = \"#$bgcolor\";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function retvar(&$v) {
|
||||
return $v;
|
||||
}
|
||||
|
||||
function intvar(&$v) {
|
||||
$v = intval($v);
|
||||
return $v;
|
||||
|
||||
}
|
160
lib/layout.php
160
lib/layout.php
@@ -30,45 +30,55 @@
|
||||
|
||||
$race=postradar($loguserid);
|
||||
|
||||
$tablewidth='100%';
|
||||
$fonttag='<font class="font">';
|
||||
$fonthead='<font class="fonth">';
|
||||
$smallfont='<font class="fonts">';
|
||||
$tinyfont='<font class="fontt">';
|
||||
$tablewidth = '100%';
|
||||
$fonttag = '<font class="font">';
|
||||
$fonthead = '<font class="fonth">';
|
||||
$smallfont = '<font class="fonts">';
|
||||
$tinyfont = '<font class="fontt">';
|
||||
|
||||
foreach(array(1,2,c,h) as $celltype){
|
||||
foreach(array(1, 2, 'c', 'h') as $celltype){
|
||||
$cell="<td class='tbl tdbg$celltype font";
|
||||
$celln="tccell$celltype";
|
||||
$$celln =$cell." center'";
|
||||
${$celln.s} =$cell."s center'";
|
||||
${$celln.t} =$cell."t center'";
|
||||
${$celln.l} =$cell."'";
|
||||
${$celln.r} =$cell." right'";
|
||||
${$celln.ls}=$cell."s'";
|
||||
${$celln.lt}=$cell."t'";
|
||||
${$celln.rs}=$cell."s right'";
|
||||
${$celln.rt}=$cell."t right'";
|
||||
${$celln.'s'} =$cell."s center'";
|
||||
${$celln.'t'} =$cell."t center'";
|
||||
${$celln.'l'} =$cell."'";
|
||||
${$celln.'r'} =$cell." right'";
|
||||
${$celln.'ls'} =$cell."s'";
|
||||
${$celln.'lt'} =$cell."t'";
|
||||
${$celln.'rs'} =$cell."s right'";
|
||||
${$celln.'rt'} =$cell."t right'";
|
||||
}
|
||||
|
||||
$inpt='<input type="text" name';
|
||||
$inpp='<input type="password" name';
|
||||
$inph='<input type="hidden" name';
|
||||
$inps='<input type="submit" class=submit name';
|
||||
$inpc="<input type=checkbox name";
|
||||
$radio='<input type=radio class=radio name';
|
||||
$txta='<textarea wrap=virtual name';
|
||||
$tblstart='<table class="table" cellspacing=0>';
|
||||
$tblend='</table>';
|
||||
$sepn=array('Dashes','Line','Full horizontal line','None');
|
||||
$sep=array('<br><br>--------------------<br>',
|
||||
'<br><br>____________________<br>',
|
||||
'<br><br><hr>',
|
||||
'<br><br>');
|
||||
$br="\n";
|
||||
$br = "\n";
|
||||
$inpt = "<input type='text' name";
|
||||
$inpp = "<input type='password' name";
|
||||
$inph = "<input type='hidden' name";
|
||||
$inps = "<input type='submit' class=submit name";
|
||||
$inpc = "<input type='checkbox' name";
|
||||
$radio = "<input type=radio class=radio name";
|
||||
$txta = "<textarea name";
|
||||
$tblstart = "<table class='table' cellspacing='0'>";
|
||||
$tblend = "</table>";
|
||||
$sepn = array(
|
||||
'Dashes',
|
||||
'Line',
|
||||
'Full horizontal line',
|
||||
'None
|
||||
');
|
||||
$sep = array(
|
||||
'<br><br>--------------------<br>',
|
||||
'<br><br>____________________<br>',
|
||||
'<br><br><hr>',
|
||||
'<br><br>',
|
||||
);
|
||||
|
||||
|
||||
if (isset($bgimage) && $bgimage != "") {
|
||||
$bgimage = " url('$bgimage')";
|
||||
} else { $bgimage = ''; }
|
||||
} else {
|
||||
$bgimage = '';
|
||||
}
|
||||
|
||||
if (isset($nullscheme) && $nullscheme == 1) {
|
||||
// special "null" scheme.
|
||||
@@ -139,7 +149,6 @@
|
||||
}
|
||||
code br { display: none; }
|
||||
input[type=radio] { color: black; background: white; }
|
||||
". ($_GET['test'] ? "td:before, body:before {content: \"\\202E\";}" : "") ."
|
||||
";
|
||||
}
|
||||
$numcols=(intval($numcols) ? intval($numcols) : 60);
|
||||
@@ -174,8 +183,6 @@
|
||||
$css.='</style>';
|
||||
}
|
||||
|
||||
// $css .= "<!--[if IE]><style type='text/css'>#f_ikachan, #f_doomcounter, #f_mustbeblind { display: none; }</style><![endif]--> ";
|
||||
|
||||
|
||||
if($loguserid) {
|
||||
$headlinks='
|
||||
@@ -195,12 +202,8 @@
|
||||
if($isadmin) $headlinks="<a href=\"admin.php\">Admin</a> - $headlinks";
|
||||
if($power >= 1) $headlinks="<a href=\"shoped.php\">Shop Editor</a> - $headlinks";
|
||||
|
||||
|
||||
if (in_array($loguserid,array(1,5))) {
|
||||
$xminilog = $sql -> fetchq("SELECT COUNT(*) as count, MAX(`time`) as time FROM `minilog`");
|
||||
if ($xminilog['count']) {
|
||||
$xminilogip = $sql -> fetchq("SELECT `ip`, `banflags` FROM `minilog` ORDER BY `time` DESC LIMIT 1");
|
||||
$boardtitle .= "<br><a href='shitbugs.php'><span class=font style=\"color: #f00\"><b>". $xminilog['count'] ."</b> suspicious request(s) logged, last at <b>". date($dateformat, $xminilog['time'] + $tzoff) ."</b> by <b>". $xminilogip['ip'] ." (". $xminilogip['banflags'] .")</b></span></a>";
|
||||
}
|
||||
$xminilog = $sql -> fetchq("SELECT COUNT(*) as count, MAX(`time`) as time FROM `pendingusers`");
|
||||
if ($xminilog['count']) {
|
||||
$xminilogip = $sql -> fetchq("SELECT `username`, `ip` FROM `pendingusers` ORDER BY `time` DESC LIMIT 1");
|
||||
@@ -209,25 +212,25 @@
|
||||
}
|
||||
|
||||
$headlinks2="
|
||||
<a href='/index.php'>Main</a>
|
||||
- <a href='/memberlist.php'>Memberlist</a>
|
||||
- <a href='/activeusers.php'>Active users</a>
|
||||
- <a href='/calendar.php'>Calendar</a>
|
||||
- <a href='http://tcrf.net'>Wiki</a>
|
||||
- <a href='/irc.php'>IRC Chat</a>
|
||||
- <a href='/online.php'>Online users</a><br>
|
||||
<a href='/ranks.php'>Ranks</a>
|
||||
- <a href='/faq.php'>Rules/FAQ</a>
|
||||
- <a href='/acs.php'>JCS</a>
|
||||
- <a href='/stats.php'>Stats</a>
|
||||
- <a href='/latestposts.php'>Latest Posts</a>
|
||||
- <a href='/hex.php' title='Color Chart' class='popout' target='_blank'>Color Chart</a>
|
||||
- <a href='/smilies.php' title='Smilies' class='popout' target='_blank'>Smilies</a>
|
||||
<a href='index.php'>Main</a>
|
||||
- <a href='memberlist.php'>Memberlist</a>
|
||||
- <a href='activeusers.php'>Active users</a>
|
||||
- <a href='calendar.php'>Calendar</a>
|
||||
- <a href='irc.php'>IRC Chat</a>
|
||||
- <a href='online.php'>Online users</a><br>
|
||||
|
||||
<a href='ranks.php'>Ranks</a>
|
||||
- <a href='faq.php'>Rules/FAQ</a>
|
||||
- <a href='acs.php'>JCS</a>
|
||||
- <a href='stats.php'>Stats</a>
|
||||
- <a href='latestposts.php'>Latest Posts</a>
|
||||
- <a href='hex.php' title='Color Chart' class='popout' target='_blank'>Color Chart</a>
|
||||
- <a href='smilies.php' title='Smilies' class='popout' target='_blank'>Smilies</a>
|
||||
";
|
||||
|
||||
|
||||
$ipbanned = 0;
|
||||
|
||||
$torbanned = 0;
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM ipbans WHERE INSTR('$forwardedip',ip)=1"),0,0)) $ipbanned=1;
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM ipbans WHERE INSTR('$clientip',ip)=1"),0,0)) $ipbanned=1;
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM ipbans WHERE INSTR('$userip',ip)=1"),0,0)) $ipbanned=1;
|
||||
@@ -259,9 +262,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
$count[u] = mysql_result(mysql_query('SELECT COUNT(*) FROM users'),0,0);
|
||||
$count[t] = mysql_result(mysql_query('SELECT COUNT(*) FROM threads'),0,0);
|
||||
$count[p] = mysql_result(mysql_query('SELECT COUNT(*) FROM posts'),0,0);
|
||||
$count['u'] = mysql_result(mysql_query('SELECT COUNT(*) FROM users'),0,0);
|
||||
$count['t'] = mysql_result(mysql_query('SELECT COUNT(*) FROM threads'),0,0);
|
||||
$count['p'] = mysql_result(mysql_query('SELECT COUNT(*) FROM posts'),0,0);
|
||||
|
||||
mysql_query("INSERT INTO dailystats (date) VALUES ('".date('m-d-y',ctime())."')");
|
||||
mysql_query("UPDATE dailystats SET users=$count[u],threads=$count[t],posts=$count[p],views=$views WHERE date='".date('m-d-y',ctime())."'");
|
||||
@@ -278,8 +281,8 @@
|
||||
$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);
|
||||
$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);
|
||||
}
|
||||
|
||||
if ($pmsgnew != 1) $ssss = "s";
|
||||
@@ -290,7 +293,8 @@
|
||||
}
|
||||
|
||||
$jscripts = '';
|
||||
if ($loguserid == 1 or true) {
|
||||
|
||||
if (true) {
|
||||
$yyy = "
|
||||
<img id='f_ikachan' src='images/sankachan.png' style=\"position: fixed; left: ". mt_rand(0,100) ."%; top: ". mt_rand(0,100) ."%;\" title=\"It's no pointy hat, but it should work... right?\">
|
||||
";
|
||||
@@ -299,21 +303,12 @@
|
||||
";
|
||||
}
|
||||
|
||||
/*if ($_GET['w']) {
|
||||
$yyy = "<img src=images/wave/squid.png style=\"position: fixed; left: ". mt_rand(0,100) ."%; top: ". mt_rand(0,100) ."%;\" title=\"Ikachaaaan!\">";
|
||||
$yyy .= "<img src=images/wave/cheepcheep.png style=\"position: fixed; left: ". mt_rand(0,100) ."%; top: ". mt_rand(0,100) ."%;\" title=\"cheep tricks\">";
|
||||
$yyy .= "<img src=images/wave/chest.png style=\"position: fixed; right: 20px; bottom: 0px;\" title=\"1\">";
|
||||
|
||||
for ($xxx = rand(0,5); $xxx < 20; $xxx++) {
|
||||
$yyy .= "<img src=images/wave/seaweed.png style=\"position: fixed; left: ". mt_rand(0,100) ."%; bottom: -". mt_rand(24,72) ."px;\" title=\"weed\">";
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// :shepicide:
|
||||
|
||||
|
||||
$body="<body>";
|
||||
|
||||
if ($x_hacks['smallbrowse'] == 1 and false) {
|
||||
if (false) {
|
||||
$css = "";
|
||||
$css = "<link rel='stylesheet' href='/mobile.css'>";
|
||||
}
|
||||
@@ -361,7 +356,8 @@
|
||||
|
||||
if($q) $url.="?$q";
|
||||
|
||||
if($ref && substr($ref,7,7)!="jul.rus") mysql_query("INSERT INTO referer (time,url,ref,ip) VALUES (". ctime() .", '".addslashes($url)."', '".addslashes($ref)."'), '". $_SERVER['REMOTE_ADDR'] ."'");
|
||||
|
||||
#if($ref && substr($ref,7,7)!="jul.rus") mysql_query("INSERT INTO referer (time,url,ref,ip) VALUES (". ctime() .", '".addslashes($url)."', '".addslashes($ref)."'), '". $_SERVER['REMOTE_ADDR'] ."'");
|
||||
|
||||
mysql_query("DELETE FROM guests WHERE ip='$userip' OR date<".(ctime()-300));
|
||||
|
||||
@@ -379,7 +375,7 @@
|
||||
*/
|
||||
//if ($loguserid != 3 && $loguserid != 2)
|
||||
if (($loguser['powerlevel'] < 4) and (!IS_AJAX_REQUEST)) {
|
||||
$influencelv=calclvl(calcexp($loguser[posts],(ctime()-$loguser[regdate])/86400));
|
||||
$influencelv=calclvl(calcexp($loguser['posts'],(ctime()-$loguser['regdate'])/86400));
|
||||
mysql_query("UPDATE users SET lastactivity=".ctime().",lastip='$userip',lasturl='".addslashes($url)."',lastforum=0,`influence`='$influencelv' WHERE id=$loguserid");
|
||||
}
|
||||
|
||||
@@ -418,25 +414,13 @@
|
||||
|
||||
$header=makeheader($header1,$headlinks,$header2);
|
||||
|
||||
|
||||
$affiliatelinks = "";
|
||||
|
||||
$footer=" </textarea></form></embed></noembed></noscript></noembed></embed></table></table>
|
||||
<br>". ($loguser['id'] && strpos($PHP_SELF, "index.php") === false ? adbox() ."<br>" : "") ."
|
||||
<center>
|
||||
|
||||
<img src='adnonsense.php?m=d' title='generous donations to the first national bank of bad jokes and other dumb crap people post' style='margin-left: 44px;'><br>
|
||||
<img src='adnonsense.php' title='hotpod fund' style='margin: 0 22px;'><br>
|
||||
<img src='adnonsense.php?m=v' title='VPS slushie fund' style='margin-right: 44px;'>
|
||||
|
||||
<br><img src='http://valkyrie.rustedlogic.net/h/' style='padding: 8px;' alt='' title='YOU ARE NOW HALF-ASSEDLY TESTING OUR NEW SERVER.'>
|
||||
|
||||
".(false ? "<script type=\"text/javascript\">
|
||||
var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
|
||||
document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
|
||||
</script>
|
||||
<script type=\"text/javascript\">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker(\"UA-9215725-1\");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}</script>" : "") ."
|
||||
<br>
|
||||
$smallfont
|
||||
<br><br><a href=$siteurl>$sitename</a>
|
||||
|
76
thread.php
76
thread.php
@@ -4,7 +4,7 @@
|
||||
|
||||
if ($pid) {
|
||||
if (!$ppp)
|
||||
$ppp = ($log ? $loguser[postsperpage] : 20);
|
||||
$ppp = ($log ? $loguser['postsperpage'] : 20);
|
||||
$id = $sql->resultq("SELECT `thread` FROM `posts` WHERE `id` = '$pid'");
|
||||
$numposts = $sql->resultq("SELECT COUNT(*) FROM `posts` WHERE `thread` = '$id' AND `id` < '$pid'");
|
||||
$page = floor($numposts / $ppp);
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
if ($lpt) {
|
||||
if (!$ppp)
|
||||
$ppp = ($log ? $loguser[postsperpage] : 20);
|
||||
$ppp = ($log ? $loguser['postsperpage'] : 20);
|
||||
$pid = $sql->resultq("SELECT MIN(`id`) FROM `posts` WHERE `thread` = '".$_GET['id']."' AND `date` > '".$_GET['lpt']."'");
|
||||
if (!$pid) {
|
||||
$pid = $sql->resultq("SELECT MAX(`id`) FROM `posts` WHERE `thread` = '".$_GET['id']."'");
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
if ($id) {
|
||||
$thread = mysql_fetch_array(mysql_query("SELECT * FROM threads WHERE id=$id"));
|
||||
$forumid = intval($thread[forum]);
|
||||
$forumid = intval($thread['forum']);
|
||||
$forum = mysql_fetch_array(mysql_query("SELECT * FROM forums WHERE id=$forumid"));
|
||||
$specialscheme = $forum['specialscheme'];
|
||||
|
||||
if ($loguser[id]) {
|
||||
if ($loguser['id']) {
|
||||
|
||||
$readdate = @mysql_result(@mysql_query("SELECT `readdate` FROM `forumread` WHERE `user` = '$loguser[id]' AND `forum` = '$forumid'"), 0);
|
||||
|
||||
@@ -60,21 +60,21 @@
|
||||
$favlink .= ' | ';
|
||||
|
||||
mysql_query("UPDATE threads SET views=views+1 WHERE id=$id");
|
||||
$thread[title] = str_replace("<", "<", $thread[title]);
|
||||
if ($forum[minpower] > $power and $forum[minpower] > 0)
|
||||
$thread[title] = "(restricted)";
|
||||
$thread['title'] = str_replace("<", "<", $thread['title']);
|
||||
if ($forum['minpower'] > $power and $forum['minpower'] > 0)
|
||||
$thread['title'] = "(restricted)";
|
||||
$forumtitle = "$forum[title]: ";
|
||||
}
|
||||
elseif($user)
|
||||
{
|
||||
$usr = $user;
|
||||
$tuser = mysql_fetch_array(mysql_query("SELECT name FROM users WHERE id=$usr"));
|
||||
$thread[title] = "Posts by $tuser[name]";
|
||||
$thread['title'] = "Posts by $tuser[name]";
|
||||
}
|
||||
|
||||
elseif($search)
|
||||
{
|
||||
$thread[title] = "Search results";
|
||||
$thread['title'] = "Search results";
|
||||
}
|
||||
|
||||
$windowtitle = "$boardname -- $forumtitle$thread[title]";
|
||||
@@ -94,7 +94,7 @@
|
||||
mysql_query("UPDATE threads SET closed=$cl WHERE id=$id");
|
||||
if ($trash && $_POST['confirm']) {
|
||||
mysql_query("UPDATE threads SET sticky=0,closed=1,forum=$trashid WHERE id=$id");
|
||||
$numposts = $thread[replies] + 1;
|
||||
$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");
|
||||
@@ -111,26 +111,26 @@
|
||||
} else {
|
||||
$fulledit = "<a href=editthread.php?id=$id>Edit thread<a>";
|
||||
$link = "<a href=thread.php?id=$id&qmod=1";
|
||||
if (!$thread[sticky])
|
||||
if (!$thread['sticky'])
|
||||
$stick = "$link&st=1>Stick</a>";
|
||||
else
|
||||
$stick = "$link&st=0>Unstick</a>";
|
||||
if (!$thread[closed])
|
||||
if (!$thread['closed'])
|
||||
$close = "$link&cl=1>Close</a>";
|
||||
else
|
||||
$close = "$link&cl=0>Open</a>";
|
||||
if ($thread[forum] != $trashid)
|
||||
if ($thread['forum'] != $trashid)
|
||||
$trash = " | <a href='/editthread.php?action=trashthread&id=$id'>Trash</a>";
|
||||
$delete = "<a href='/editthread.php?action=editthread&delete=1&id=$id'>Delete</a>";
|
||||
$modfeats = "<tr>$tccellcls colspan=2>Moderating options: $stick | $close$trash -- $fulledit";
|
||||
}
|
||||
}
|
||||
if ($thread[poll]) {
|
||||
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 and $loguserid and(!$voted or $poll[doublevote]) and ! $poll[closed] && $_GET['dat'] == md5($loguser['name']."sillysaltstring")) {
|
||||
if ($action and $loguserid and(!$voted or $poll['doublevote']) and ! $poll['closed'] && $_GET['dat'] == md5($loguser['name']."sillysaltstring")) {
|
||||
|
||||
if ($action == "vote") {
|
||||
|
||||
@@ -187,12 +187,12 @@
|
||||
$votes = "$votes vote".($votes == 1 ? '' : 's');
|
||||
}
|
||||
|
||||
$barpart = "<table cellpadding=0 cellspacing=0 width=$pct% bgcolor='".($pollc[color] ? $pollc[color] : "cccccc")."'><td> </table>";
|
||||
$barpart = "<table cellpadding=0 cellspacing=0 width=$pct% bgcolor='".($pollc['color'] ? $pollc['color'] : "cccccc")."'><td> </table>";
|
||||
if ($pct == "0.0")
|
||||
$barpart = ' ';
|
||||
$link = '';
|
||||
|
||||
if ($loguserid and(!$voted or $poll[doublevote]) and ! $poll[closed])
|
||||
if ($loguserid and(!$voted or $poll['doublevote']) and ! $poll['closed'])
|
||||
$link = "<a href=thread.php?id=$id&choice=$pollc[id]&dat=".md5($loguser['name']."sillysaltstring")."&action=vote";
|
||||
|
||||
if ($uservote[$pollc['id']]) {
|
||||
@@ -213,7 +213,7 @@
|
||||
}
|
||||
|
||||
$mlt = 'disabled';
|
||||
if ($poll[doublevote])
|
||||
if ($poll['doublevote'])
|
||||
$mlt = 'enabled';
|
||||
if ($tvotes != 1) {
|
||||
$ss = 's';
|
||||
@@ -222,7 +222,7 @@
|
||||
$ss = '';
|
||||
$hv = 'has';
|
||||
}
|
||||
if ($ismod or $thread[user] == $loguserid)
|
||||
if ($ismod or $thread['user'] == $loguserid)
|
||||
$polledit = "<!-- edit would go here -->";
|
||||
$polltbl = "
|
||||
$tccellc colspan=3><b>".htmlspecialchars($poll['question'])."<tr>
|
||||
@@ -235,29 +235,29 @@
|
||||
|
||||
loadtlayout();
|
||||
$sfields = ''; // S I G H
|
||||
if ($loguser[viewsig] == 0)
|
||||
if ($loguser['viewsig'] == 0)
|
||||
$sfields = '';
|
||||
if ($loguser[viewsig] == 1)
|
||||
if ($loguser['viewsig'] == 1)
|
||||
$sfields = ',headtext,signtext';
|
||||
if ($loguser[viewsig] == 2)
|
||||
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];
|
||||
$act[$n['user']] = $n['num'];
|
||||
$postlist = "
|
||||
$polltbl
|
||||
$modfeats$tblend
|
||||
";
|
||||
if (!$ppp)
|
||||
$ppp = ($log ? $loguser[postsperpage] : 20);
|
||||
$ppp = ($log ? $loguser['postsperpage'] : 20);
|
||||
if ($log && $id) {
|
||||
$headlinks .= " - <a href=index.php?action=markforumread&forumid=$forum[id]>Mark forum read</a>";
|
||||
$header = makeheader($header1, $headlinks, $header2 . "$tblstart$tccell1s>$fonline$tblend");
|
||||
}
|
||||
|
||||
if ($id && $power < $forum[minpower]) {
|
||||
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.
|
||||
@@ -270,7 +270,7 @@
|
||||
if ($id)
|
||||
$posts = mysql_query("SELECT p.*,text$sfields,edited,options,tagval,u.id uid,name,$ufields,regdate FROM posts_text, posts p 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;
|
||||
$thread['replies'] = mysql_result(mysql_query("SELECT count(*) FROM posts WHERE user=$usr"), 0, 0) - 1;
|
||||
$posts = mysql_query("SELECT p.*,text$sfields,edited,options,tagval,u.id uid,name,$ufields,regdate FROM posts_text, posts p 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) {
|
||||
@@ -285,7 +285,7 @@
|
||||
|
||||
if ($quser) {
|
||||
$user = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE name='".addslashes($quser)."'"));
|
||||
$u = $user[id];
|
||||
$u = $user['id'];
|
||||
$srch .= ($srch ? "AND " : "")."posts.user=$u";
|
||||
}
|
||||
if ($qip)
|
||||
@@ -306,10 +306,10 @@
|
||||
|
||||
if (!$fsch && false) {
|
||||
$posts = mysql_query("SELECT id,user,date,thread,ip,text,num$signquery,edited,options 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);
|
||||
$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,options 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);
|
||||
$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);
|
||||
@@ -322,10 +322,10 @@
|
||||
|
||||
$quote = "<a href=\"thread.php?pid=$post[id]#$post[id]\">Link</a>";
|
||||
$edit = '';
|
||||
if ($id and ! $thread[closed])
|
||||
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>Delete</a>";
|
||||
if (($ismod or $post[user] == $loguserid) and ! $thread[closed])
|
||||
if (($ismod or $post['user'] == $loguserid) and ! $thread['closed'])
|
||||
$edit = ($quote ? ' | ' : '')."<a href=editpost.php?id=$post[id]>Edit</a> | $deletelink";
|
||||
if ($isadmin)
|
||||
$ip = " | IP: <a href=ipsearch.php?ip=$post[ip]>$post[ip]</a>";
|
||||
@@ -333,8 +333,8 @@
|
||||
$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]) {
|
||||
$post['act'] = $act[$post['user']];
|
||||
if ($pforum['minpower'] <= $power or ! $pforum['minpower']) {
|
||||
$postlist .= threadpost($post, $bg, $pthread);
|
||||
} else
|
||||
$postlist .= "$tccellc colspan=2>$fonttag (restricted)";
|
||||
@@ -347,7 +347,7 @@
|
||||
$page = 0;
|
||||
$pagelinks = "Pages:";
|
||||
|
||||
for ($i = 0; $i < (($thread[replies] + 1) / $ppp); $i++) {
|
||||
for ($i = 0; $i < (($thread['replies'] + 1) / $ppp); $i++) {
|
||||
|
||||
if ($i == $page)
|
||||
$pagelinks .= " ".($i + 1);
|
||||
@@ -355,9 +355,9 @@
|
||||
$pagelinks .= " <a href=thread.php$query"."page=$i>".($i + 1)."</a>";
|
||||
}
|
||||
|
||||
if ($thread[replies] < $ppp)
|
||||
if ($thread['replies'] < $ppp)
|
||||
$pagelinks = '';
|
||||
print $header.sizelimitjs()."
|
||||
print $header."
|
||||
<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
|
||||
";
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
|
||||
print "<a href=newthread.php?id=$forumid>$newthreadpic</a>";
|
||||
|
||||
if (!$thread[closed])
|
||||
if (!$thread['closed'])
|
||||
print " - <a href=newreply.php?id=$id>$newreplypic</a>";
|
||||
else
|
||||
print " - $closedpic";
|
||||
@@ -393,7 +393,7 @@
|
||||
// print "<a href=newthread.php?poll=1&id=$forumid>$newpollpic</a> - ";
|
||||
print "<a href=newthread.php?id=$forumid>$newthreadpic</a>";
|
||||
|
||||
if (!$thread[closed]) {
|
||||
if (!$thread['closed']) {
|
||||
print " - <a href=newreply.php?id=$id>$newreplypic</a>";
|
||||
} else {
|
||||
print " - $closedpic";
|
||||
|
Reference in New Issue
Block a user