Ejemplo n.º 1
0
                }
            }
            if ($diff == 0) {
                $color = xk(4);
            } else {
                $color = xk(8);
            }
            $diff = "/" . ($diff + 1) * 8;
            xk_ircsend("102|" . xk(7) . "User {$loguser['name']} (id {$loguserid}) changed from IP " . xk(8) . $loguser['lastip'] . xk(7) . " to " . xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) . " ({$color}{$diff}" . xk(7) . ")");
        }
        $sql->query("UPDATE users SET lastactivity=" . ctime() . ",lastip='{$userip}',lasturl='" . addslashes($url) . "',lastforum=0,`influence`='{$influencelv}' WHERE id={$loguserid}");
    }
} else {
    $sql->query("INSERT INTO guests (ip,date,useragent,lasturl) VALUES ('{$userip}'," . ctime() . ",'" . addslashes($_SERVER['HTTP_USER_AGENT']) . "','" . addslashes($url) . "')");
}
$header = makeheader($header1, $headlinks, $header2);
$footer = "\t</textarea></form></embed></noembed></noscript></noembed></embed></table></table>\n<br>" . ($loguser['id'] && strpos($PHP_SELF, "index.php") === false ? adbox() . "<br>" : "") . "\n<center>\n\n<!--\n<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>\n<img src='adnonsense.php' title='hotpod fund' style='margin: 0 22px;'><br>\n<img src='adnonsense.php?m=v' title='VPS slushie fund' style='margin-right: 44px;'>\n-->\n<br>\n\t{$smallfont}\n\t<br><br><a href={$siteurl}>{$sitename}</a>\n\t<br>" . filter_string($affiliatelinks) . "\n\t<br>\n\t<table cellpadding=0 border=0 cellspacing=2><tr>\n\t\t<td>\n\t\t\t<img src=images/poweredbyacmlm.gif>\n\t\t</td>\n\t\t<td>\n\t\t\t{$smallfont}\n\t\t\tAcmlmboard - <a href='https://github.com/Xkeeper0/jul'>" . (file_exists('version.txt') ? file_get_contents("version.txt") : shell_exec("git log --format='commit %h [%ad]' --date='short' -n 1")) . "</a>\n\t\t\t<br>&copy;2000-" . date("Y") . " Acmlm, Xkeeper, Inuyasha, et al. \n\t\t\t</font>\n\t\t</td>\n\t</tr></table>\n\t" . ($x_hacks['mmdeath'] >= 0 ? "<div style='position: absolute; top: -100px; left: -100px;'>Hidden preloader for doom numbers:\n\t\t<img src='numgfx/death/0.png'> <img src='numgfx/death/1.png'> <img src='numgfx/death/2.png'> <img src='numgfx/death/3.png'> <img src='numgfx/death/4.png'> <img src='numgfx/death/5.png'> <img src='numgfx/death/6.png'> <img src='numgfx/death/7.png'> <img src='numgfx/death/8.png'> <img src='numgfx/death/9.png'>" : "") . "\n<!-- Piwik -->\n<script type=\"text/javascript\">\nvar pkBaseURL = ((\"https:\" == document.location.protocol) ? \"https://stats.tcrf.net/\" : \"http://stats.tcrf.net/\");\ndocument.write(unescape(\"%3Cscript src='\" + pkBaseURL + \"piwik.js' type='text/javascript'%3E%3C/script%3E\"));\n</script><script type=\"text/javascript\">\ntry {\nvar piwikTracker = Piwik.getTracker(pkBaseURL + \"piwik.php\", 4);\npiwikTracker.trackPageView();\npiwikTracker.enableLinkTracking();\n} catch( err ) {}\n</script><noscript><p><img src=\"http://stats.tcrf.net/piwik.php?idsite=4\" style=\"border:0\" alt=\"\" /></p></noscript>\n<!-- End Piwik Tag -->\n<!--<script type=\"text/javascript\" src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js\"></script>\n<script type=\"text/javascript\" src=\"js/useful.js\"></script> -->\n\n</body></html>\n  ";
if ($ipbanned) {
    if ($loguser['title'] == "Banned; account hijacked. Contact admin via PM to change it.") {
        $reason = "Your account was hijacked; please contact Xkeeper to reset your password and unban your account.";
    } elseif ($loguser['title']) {
        $reason = "Ban reason: " . $loguser['title'] . "<br>If you think have been banned in error, please contact Xkeeper.";
    } else {
        $reason = $sql->resultq("SELECT `reason` FROM ipbans WHERE {$checkips}", 0, 0);
        $reason = $reason ? "Reason: {$reason}" : "<i>(No reason given)</i>";
    }
    die("{$header}<br>{$tblstart}{$tccell1}>\n\t\tYou are banned from this board.\n\t\t<br>" . $reason . "\n\t\t<br>\n\t\t<br>If you think you have been banned in error, please contact the administrator:\n\t\t<br>E-mail: xkeeper@gmail.com\n\t\t{$tblend}{$footer}");
}
if ($torbanned) {
    die("{$header}<br>{$tblstart}{$tccell1}>\n\tYou appear to be using a Tor proxy. Due to abuse, Tor usage is forbidden.\n\t<br>If you have been banned in error, please contact Xkeeper.\n\t<br>\n\t<br>E-mail: xkeeper@gmail.com\n\t{$tblend}{$footer}");
}
Ejemplo n.º 2
0
		// Some lame botnet that keeps refreshing this page every second or so.
		xk_ircsend("102|". date("Y-m-d h:i:s") ." - ".xk(7)."IP address ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." is being weird. ". xk(5) ."(UA: ". $_SERVER['HTTP_USER_AGENT'] .")");
		header("Location: http://". $_SERVER['REMOTE_ADDR'] ."/");
		die("F**k off, forever.");
	}
	if (empty($_COOKIE)) {
		// Some lame botnet that keeps refreshing this page every second or so.
		xk_ircsend("102|". date("Y-m-d h:i:s") ." - ".xk(7)."IP address ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." is being slightly less weird, but still weird. ". xk(5) ."(UA: ". $_SERVER['HTTP_USER_AGENT'] .")");
		header("Location: http://". $_SERVER['REMOTE_ADDR'] ."/");
		die("Don't be weird.");
	}
*/
$time = filter_int($_GET['time']) ? $_GET['time'] : 300;
// FOR THE LOVE OF GOD XKEEPER JUST GIVE ME ~NUKE ACCESS
$banorama = $_SERVER['REMOTE_ADDR'] == $x_hacks['adminip'] || $loguser['id'] == 1 || $loguser['id'] == 5 || $loguser['id'] == 2100;
if ($banorama && filter_string($_GET['banip']) && filter_string($_GET['valid']) == md5($_GET['banip'] . "aglkdgslhkadgshlkgds")) {
    $sql->query("INSERT INTO `ipbans` SET `ip` = '" . $_GET['banip'] . "', `reason`='online.php ban', `date` = '" . ctime() . "', `banner` = '{$loguserid}'") or print mysql_error();
    //		if ($_GET['uid']) mysql_query("UPDATE `users` SET `powerlevel` = -1, `title` = 'Banned; account hijacked. Contact admin via PM to change it.' WHERE `id` = '". $_GET['uid'] ."'") or print mysql_error();
    xk_ircsend("1|" . xk(8) . $loguser['name'] . xk(7) . " added IP ban for " . xk(8) . $_GET['banip'] . xk(7) . ".");
    return header("Location: online.php?m=1");
}
$sort = filter_bool($_GET['sort']);
$lnk = '<a href=online.php' . ($sort ? "?sort=1&" : '?') . 'time';
print "\n\t\t{$header}{$smallfont}\n\t\tShow online users during the last:\n\t\t{$lnk}=60>minute</a> |\n\t\t{$lnk}=300>5 minutes</a> |\n\t\t{$lnk}=900>15 minutes</a> |\n\t\t{$lnk}=3600>hour</a> |\n\t\t{$lnk}=86400>day</a>\n\t";
if ($isadmin) {
    print '<br>Admin cruft: <a href=online.php' . ($sort ? '?sort=1&' : '?') . "time={$time}>Sort by " . ($sort == 'IP' ? 'date' : 'IP') . "</a>";
}
// Logged in users
$posters = $sql->query("SELECT id,posts,name,sex,powerlevel,aka,lastactivity,lastip,lastposttime,lasturl,birthday FROM users WHERE lastactivity>" . (ctime() - $time) . ' ORDER BY ' . ($sort == 'IP' && $isadmin ? 'lastip' : 'lastactivity DESC'));
print "<br>\n\t{$fonttag} Online users during the last " . timeunits2($time) . ":\n\t{$tblstart}\n\t\t{$tccellh} width=20>&nbsp</td>\n\t\t{$tccellh} width=200>Username</td>\n\t\t{$tccellh} width=120> Last activity</td>\n\t\t{$tccellh} width=180> Last post</td>\n\t\t{$tccellh} width=*>URL</td>\n\t";
if ($isadmin) {
Ejemplo n.º 3
0
Archivo: add.php Proyecto: eokyere/elgg
// Make sure we're logged in (send us to the front page if not)
if (!isloggedin()) {
    forward();
}
// Get input data
$body = get_input('note');
$tags = get_input('thewiretags');
$access_id = get_default_access();
$location = get_input('location');
$method = get_input('method');
$parent = (int) get_input('parent', 0);
if (!$parent) {
    $parent = 0;
}
// convert the shout body into tags
$tagarray = filter_string($body);
// Make sure the title / description aren't blank
if (empty($body)) {
    register_error(elgg_echo("thewire:blank"));
    forward("mod/thewire/add.php");
    // Otherwise, save the thewire post
} else {
    if (!thewire_save_post($body, $access_id, $parent, $method)) {
        register_error(elgg_echo("thewire:error"));
        if ($location == "activity") {
            forward("mod/riverdashboard/");
        } else {
            forward("mod/thewire/add.php");
        }
    }
    // Now let's add tags. We can pass an array directly to the object property! Easy.
Ejemplo n.º 4
0
/** Given a simple string, this function returns the string
 *  processed by enabled string filters if $CFG->filterall is enabled
 *
 *  This function should be used to print short strings (non html) that
 *  need filter processing e.g. activity titles, post subjects,
 *  glossary concepts.
 *
 *  @param string  $string     The string to be filtered.
 *  @param boolean $striplinks To strip any link in the result text (Moodle 1.8 default changed from false to true! MDL-8713)
 *  @param int     $courseid   Current course as filters can, potentially, use it
 *  @return string
 */
function format_string($string, $striplinks = true, $courseid = NULL)
{
    global $CFG, $COURSE;
    //We'll use a in-memory cache here to speed up repeated strings
    static $strcache = false;
    if ($strcache === false or count($strcache) > 2000) {
        // this number might need some tuning to limit memory usage in cron
        $strcache = array();
    }
    //init course id
    if (empty($courseid)) {
        $courseid = $COURSE->id;
    }
    //Calculate md5
    $md5 = md5($string . '<+>' . $striplinks . '<+>' . $courseid . '<+>' . current_language());
    //Fetch from cache if possible
    if (isset($strcache[$md5])) {
        return $strcache[$md5];
    }
    // First replace all ampersands not followed by html entity code
    $string = preg_replace("/\\&(?![a-zA-Z0-9#]{1,8};)/", "&amp;", $string);
    if (!empty($CFG->filterall)) {
        $string = filter_string($string, $courseid);
    }
    // If the site requires it, strip ALL tags from this string
    if (!empty($CFG->formatstringstriptags)) {
        $string = strip_tags($string);
    } else {
        // Otherwise strip just links if that is required (default)
        if ($striplinks) {
            //strip links in string
            $string = preg_replace('/(<a\\s[^>]+?>)(.+?)(<\\/a>)/is', '$2', $string);
        }
        $string = clean_text($string);
    }
    //Store to cache
    $strcache[$md5] = $string;
    return $string;
}
Ejemplo n.º 5
0
function moodlist($sel = 0, $return = false)
{
    global $loguserid, $log, $loguser;
    $sel = floor($sel);
    $a = array("None", "neutral", "angry", "tired/upset", "playful", "doom", "delight", "guru", "hope", "puzzled", "whatever", "hyperactive", "sadness", "bleh", "embarrassed", "amused", "afraid");
    //if ($loguserid == 1) $a[99] = "special";
    if ($return) {
        return $a;
    }
    $c[$sel] = " checked";
    $ret = "";
    if ($log && $loguser['moodurl']) {
        $ret = '
			<script type="text/javascript">
				function avatarpreview(uid,pic)
				{
					if (pic > 0)
					{
						var moodav="' . htmlspecialchars($loguser['moodurl']) . '";
						document.getElementById(\'prev\').src=moodav.replace("$", pic);
					}
					else
					{
						document.getElementById(\'prev\').src="images/_.gif";
					}
				}
			</script>
		';
    }
    $ret .= "<b>Mood avatar list:</b><br><table cellpadding=0 border=0 cellspacing=0><tr><td width=150px style='white-space:nowrap;'>";
    foreach ($a as $num => $name) {
        $jsclick = $log && $loguser['moodurl'] ? "onclick='avatarpreview({$loguserid},{$num})'" : "";
        $ret .= "<input type='radio' name='moodid' value='{$num}'" . filter_string($c[$num]) . " id='mood{$num}' tabindex='" . (9000 + $num) . "' style=\"height: 12px;\" {$jsclick}>\n             <label for='mood{$num}' " . filter_string($c[$sel]) . " style=\"font-size: 12px;\">&nbsp;{$num}:&nbsp;{$name}</label><br>\r\n";
    }
    if (!$sel || !$log || !$loguser['moodurl']) {
        $startimg = 'images/_.gif';
    } else {
        $startimg = htmlspecialchars(str_replace('$', $sel, $loguser['moodurl']));
    }
    $ret .= "</td><td><img src=\"{$startimg}\" id=prev></td></table>";
    return $ret;
}
Ejemplo n.º 6
0
function setlayout($post)
{
    global $sql, $loguser, $postl;
    if ($loguser['viewsig'] != 1) {
        $post['headid'] = $post['signid'] = 0;
    }
    if (!$loguser['viewsig']) {
        $post['headtext'] = $post['signtext'] = '';
        return $post;
    }
    if ($loguser['viewsig'] != 2) {
        if ($headid = filter_int($post['headid'])) {
            // just in case
            if ($postl[$headid] === NULL) {
                $postl[$headid] = $sql->resultq("SELECT text FROM postlayouts WHERE id={$headid}");
            }
            $post['headtext'] = $postl[$headid];
        }
        if ($signid = filter_int($post['signid'])) {
            // just in case
            if ($postl[$signid] === NULL) {
                $postl[$signid] = $sql->resultq("SELECT text FROM postlayouts WHERE id={$signid}");
            }
            $post['signtext'] = $postl[$signid];
        }
    }
    $post['headtext'] = settags($post['headtext'], filter_string($post['tagval']));
    $post['signtext'] = settags($post['signtext'], filter_string($post['tagval']));
    if ($loguser['viewsig'] == 2) {
        $post['headtext'] = doreplace($post['headtext'], $post['num'], ($post['date'] - $post['regdate']) / 86400, $post['name']);
        $post['signtext'] = doreplace($post['signtext'], $post['num'], ($post['date'] - $post['regdate']) / 86400, $post['name']);
    }
    $post['headtext'] = doreplace2($post['headtext']);
    $post['signtext'] = doreplace2($post['signtext']);
    //	$post['text']=doreplace2($post['text'], $post['options']);
    return $post;
}
Ejemplo n.º 7
0
reload();
?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>

    <body>
        <form method="post">
            <input type="text" name="string">
            <input type="submit">
        </form>

        <?php 
filter_string();
?>

        <hr>

        <form method="post">
            <input type="submit" value="reload from site" name="reload">
        </form>

        <?php 
if (id_param_available()) {
    display_single_article();
} else {
    display_articles_list();
}
?>
Ejemplo n.º 8
0
//  обработка всей информации, кроме обложки
if (!empty($_POST)) {
    $au1_fname = filter_string($connection, $_POST['au1_fname']);
    $au1_lname = filter_string($connection, $_POST['au1_lname']);
    $au2_fname = filter_string($connection, $_POST['au2_fname']);
    $au2_lname = filter_string($connection, $_POST['au2_lname']);
    $au3_fname = filter_string($connection, $_POST['au3_fname']);
    $au3_lname = filter_string($connection, $_POST['au3_lname']);
    $title = filter_string($connection, $_POST['title']);
    $max_file_size = $_POST['MAX_FILE_SIZE'];
    $genre = filter_string($connection, $_POST['genre']);
    // $abstract = filter_string($_POST['abstract']);
    $abstract = preg_replace("/[\r\n]+/", "</p><p>", filter_string($connection, $_POST['abstract']));
    $year = filter_string($connection, $_POST['year']);
    // $year = $_POST['year'];
    $price = filter_string($connection, $_POST['price']);
    if ($_POST['have'] == 'on') {
        $have = 1;
    } else {
        $have = 0;
    }
}
// получение изображения обложки
/* if (!empty($_FILES)) {
  @is_uploaded_file($_FILES['cover']['tmp_name']) or die('Incorrect file!');
  @getimagesize($_FILES['cover']['tmp_name']) or die('Your file isn\'t an image');
  if (!isset($max_file_size)) {die('No $_POST!');}
  if ($_FILES['cover']['size'] > $max_file_size) { die('Your file too large'); }
  $upload_filename = $_SERVER['DOCUMENT_ROOT'].trim('\data\covers\ ').$_FILES['cover']['name'];
  @move_uploaded_file($_FILES['cover']['tmp_name'], $upload_filename) or die('Can\'t load your file here');
  $img_name = $_FILES['cover']['name'];
Ejemplo n.º 9
0
 if (!$error) {
     $sign = $user['signature'];
     $head = $user['postheader'];
     // @TODO: Remove this code
     if ($user['postbg']) {
         $head = "<div style=background:url({$user['postbg']});height=100%>{$head}";
     }
     $numposts = $user['posts'] + 1;
     $numdays = (ctime() - $user['regdate']) / 86400;
     $tags = array();
     $message = doreplace($message, $numposts, $numdays, $username, $tags);
     $tagval = $sql->escape(json_encode($tags));
     $rsign = doreplace($sign, $numposts, $numdays, $username);
     $rhead = doreplace($head, $numposts, $numdays, $username);
     $currenttime = ctime();
     if (filter_string($_POST['submit'])) {
         $sql->query("UPDATE `users` SET `posts` = {$numposts}, `lastposttime` = '{$currenttime}' WHERE `id` = '{$userid}'");
         if (filter_bool($nolayout)) {
             $headid = 0;
             $signid = 0;
         } else {
             $headid = getpostlayoutid($head);
             $signid = getpostlayoutid($sign);
         }
         $closeq = "";
         $stickq = "";
         if ($ismod) {
             if (filter_bool($_POST['close'])) {
                 $closeq = "`closed` = '1',";
             } else {
                 $closeq = "`closed` = '0',";
Ejemplo n.º 10
0
<br>
<?php 
if ($rs) {
    foreach ($rs as $key => $value) {
        ?>
<h4><a href='/blog/detail/<?php 
        echo $value->id;
        ?>
-<?php 
        echo createSlug($value->blog_title);
        ?>
'><?php 
        echo $value->blog_title;
        ?>
</a></h4><?php 
        echo substr(filter_string($value->blog_content), 0, 200);
        ?>
<div class="text-right"><a href='/blog/detail/<?php 
        echo $value->id;
        ?>
-<?php 
        echo createSlug($value->blog_title);
        ?>
' class="btn btn-info">Read more »</a></div>
			<?php 
        if ($this->session->userdata('user')) {
            ?>
<p><a href="/blog/input/<?php 
            echo $value->id;
            ?>
"><i class="fa fa-pencil"></i></a></p><?php 
Ejemplo n.º 11
0
function postcode($post, $set)
{
    global $tzoff, $smallfont, $ip, $quote, $edit, $dateshort, $dateformat, $tlayout, $textcolor, $numdir, $numfil, $tblstart, $hacks, $x_hacks, $loguser;
    $tblend = "</table>";
    $exp = calcexp($post['posts'], (ctime() - $post['regdate']) / 86400);
    $lvl = calclvl($exp);
    $expleft = calcexpleft($exp);
    if ($tlayout == 1) {
        $level = "Level: {$lvl}";
        $poststext = "Posts: ";
        $postnum = "{$post['num']}/";
        $posttotal = $post['posts'];
        $experience = "EXP: {$exp}<br>For next: {$expleft}";
        $totalwidth = 96;
        $barwidth = $totalwidth - round(@($expleft / totallvlexp($lvl)) * $totalwidth);
        if ($barwidth < 1) {
            $barwidth = 0;
        }
        if ($barwidth > 0) {
            $baron = "<img src=images/{$numdir}" . "bar-on.gif width={$barwidth} height=8>";
        }
        if ($barwidth < $totalwidth) {
            $baroff = "<img src=images/{$numdir}" . 'bar-off.gif width=' . ($totalwidth - $barwidth) . ' height=8>';
        }
        $bar = "<br><img src=images/{$numdir}" . "barleft.gif height=8>{$baron}{$baroff}<img src=images/{$numdir}" . 'barright.gif height=8>';
    } else {
        $level = "<img src=images/{$numdir}" . "level.gif width=36 height=8><img src=numgfx.php?n={$lvl}&l=3&f={$numfil} height=8>";
        $experience = "<img src=images/{$numdir}" . "exp.gif width=20 height=8><img src=numgfx.php?n={$exp}&l=5&f={$numfil} height=8><br><img src=images/{$numdir}" . "fornext.gif width=44 height=8><img src=numgfx.php?n={$expleft}&l=2&f={$numfil} height=8>";
        $poststext = "<img src=images/_.gif height=2><br><img src=images/{$numdir}" . "posts.gif width=28 height=8>";
        $postnum = "<img src=numgfx.php?n={$post['num']}/&l=5&f={$numfil} height=8>";
        $posttotal = "<img src=numgfx.php?n={$post['posts']}&f={$numfil}" . ($post['num'] ? '' : '&l=4') . " height=8>";
        $totalwidth = 56;
        $barwidth = $totalwidth - round(@($expleft / totallvlexp($lvl)) * $totalwidth);
        if ($barwidth < 1) {
            $barwidth = 0;
        }
        if ($barwidth > 0) {
            $baron = "<img src=images/{$numdir}" . "bar-on.gif width={$barwidth} height=8>";
        }
        if ($barwidth < $totalwidth) {
            $baroff = "<img src=images/{$numdir}" . 'bar-off.gif width=' . ($totalwidth - $barwidth) . ' height=8>';
        }
        $bar = "<br><img src=images/{$numdir}" . "barleft.gif width=2 height=8>{$baron}{$baroff}<img src=images/{$numdir}" . 'barright.gif width=2 height=8>';
    }
    if (!$post['num']) {
        $postnum = '';
        if ($postlayout == 1) {
            $posttotal = "<img src=numgfx.php?n={$post['posts']}&f={$numfil}&l=4 height=8>";
        }
    }
    $reinf = syndrome(filter_int($post['act']));
    if ($post['lastposttime']) {
        $sincelastpost = 'Since last post: ' . timeunits(ctime() - $post['lastposttime']);
    }
    $lastactivity = 'Last activity: ' . timeunits(ctime() - $post['lastactivity']);
    $since = 'Since: ' . @date($dateshort, $post['regdate'] + $tzoff);
    $postdate = date($dateformat, $post['date'] + $tzoff);
    $threadlink = "";
    if (filter_string($set['threadlink'])) {
        $threadlink = ", in {$set['threadlink']}";
    }
    $post['edited'] = filter_string($post['edited']);
    if ($post['edited']) {
        //		.="<hr>$smallfont$post[edited]";
    }
    $sidebars = array(1, 3, 19, 89, 387, 45, 92, 47);
    $sidebars = array(1, 19, 89, 387, 45, 92, 47, 1420, 1090, 2100, 2069);
    // Large block of user-specific hacks follows //
    if ($post['uid'] == 1 && !$x_hacks['host'] && true) {
        global $numdir;
        $numdir_ = $numdir;
        $numdir = "num3/";
        if ($post['num']) {
            $numtext = generatenumbergfx($post['num'], 1, true) . "<br>" . generatenumbergfx($post['posts']);
        } else {
            $numtext = generatenumbergfx($post['posts'], 1, true);
        }
        $numdir = $numdir_;
        return "\n\t{$tblstart}\n\t{$set['tdbg']} rowspan=2 style='padding: 5px 1px 5px 1px;'>\n\t  <center>{$set['userlink']}{$smallfont}<br>\n\t  {$set['userrank']}\n\t\t{$reinf}\n\t\t<br>\n\t\t<br>{$set['userpic']}\n\t\t<br><br>{$numtext}</center>\n\t  <br><img src=images/_.gif width=200 height=1>\n\t</td>\n\t{$set['tdbg']} height=1 width=100%>\n\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t    <td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t    <td width=255><nobr>{$quote}{$edit}{$ip}\n\t  </table><tr>\n\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t{$tblend}";
    }
    // Inu's sidebar
    // (moved up here for to display for everyone during doomclock mode!)
    if ($post['uid'] == "2100" && !$x_hacks['host']) {
        $posttable = "<table style=\"border:none;border-spacing:0px;\">";
        // doomclock
        if (($doomclock_time = mktime(12, 20, 0, 4, 20, 2014) - cmicrotime()) >= 0) {
            $doomclock_secs = (int) ($doomclock_time % 60);
            $doomclock_mins = (int) ($doomclock_time % 3600 / 60);
            $doomclock_hrs = (int) ($doomclock_time / 3600);
            $doomclock_str = sprintf(" %d=%02d=%02d", $doomclock_hrs, $doomclock_mins, $doomclock_secs);
            $doomclock_desc = "{$doomclock_hrs} hours, {$doomclock_mins} minutes, {$doomclock_secs} seconds";
            $posttable .= "<tr><td><img src=\"images/inu/cifont/d.gif\" title=\"Doomsday\"></td><td align='right'>";
            $posttable .= inu_hexclock($doomclock_desc, $doomclock_time);
            $posttable .= "</td><td align='right'><img src=\"/images/inu/7sd.php?s=>FFF{$doomclock_str}\"></td></tr>";
        }
        if ($post['num']) {
            $posttable .= "<tr><td><img src=\"images/inu/cifont/p.gif\" title=\"Post Number\"></td><td>";
            $posttable .= inu_binaryposts($post['num'], "images/dot3.gif", "images/dot1.gif", $post['posts']);
            $posttable .= "</td><td align='right'><img src=\"/images/inu/7sd.php?s=" . sprintf("%4d", $post['num']) . "\"></td></tr>";
        }
        $posttable .= "<tr><td><img src=\"images/inu/cifont/t.gif\" title=\"Total Posts\"></td><td>";
        $posttable .= inu_binaryposts($post['posts'], "images/dot5.gif", "images/dot1.gif");
        $posttable .= "</td><td align='right'><img src=\"/images/inu/7sd.php?s=>F90" . sprintf("%4d", $post['posts']) . "\"></td></tr></table>";
        /*
        		$lp = ((!$post['lastposttime']) ? "" : 'Last posted >fff'.timeunits(ctime()-$post['lastposttime']).' >0f0ago');
        		$la ='Last active >fff'.timeunits(ctime()-$post['lastactivity']).' >0f0ago';
        		$jd ='Joined >f11'.@date("m.d.Y",$post['regdate']+$tzoff);
        
        		return "$tblstart
        			". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"font-size: 12px;\">
        				".inu_hexclock()."
        				 <a name=$post[id]></a><a href=\"profile.php?id=2100\"><img src=\"/images/inu/7sd.php?s=- >EC1Inuyasha>0f0 -\"></a>
        				$smallfont
        				<br><marquee scrolldelay=250 scrollamount=30 width=30 height=8 behavior=alternate><img src=\"/images/inu/7sd.php?s=>f0012=00\"><img src=\"/images/inu/7sd.php?s=>f00  =%20%20\"></marquee>
        				<br>$reinf
        				$set[userpic]
        				<br>
        				<br>". ($hacks['noposts'] ? "" : "$posttable") ."
        				<br>
        				<br><img src=\"/images/inu/7sd.php?s=$jd\">
        				<br>
        				<br><img src=\"/images/inu/7sd.php?s=$lp\">
        				<br><img src=\"/images/inu/7sd.php?s=$la\"></font>
        				<br><img src=images/_.gif width=200 height=1>
        			</td>
        		$set[tdbg] height=1 width=100%>
        			<table cellspacing=0 cellpadding=2 width=100% class=fonts>
        				<td>Posted on $postdate$threadlink$post[edited]</td>
        				<td width=255><nobr>$quote$edit$ip
        			</table><tr>
        		$set[tdbg] height=220 id=\"post". $post['id'] ."\">$post[headtext]$post[text]$post[signtext]</td>
        		$tblend"; */
        // non-image old version
        $lp = !$post['lastposttime'] ? "" : 'Last posted ' . timeunits(ctime() - $post['lastposttime']) . ' ago';
        $la = 'Last active ' . timeunits(ctime() - $post['lastactivity']) . ' ago';
        $jd = 'Joined ' . @date("m.d.Y", $post['regdate'] + $tzoff);
        $dstyle = '';
        // [D]Inuyasha
        if ($post['moodid'] == 5) {
            $post['headtext'] = str_replace(array('class="inu-bg"', 'class="inu-tx"'), array('class="inu-dbg"', 'class="inu-dtx"'), $post['headtext']);
            $set['userlink'] = ' <a name=' . $post['id'] . '></a><a class="url2100" href="profile.php?id=2100"><font color="FF0202">[D]Inuyasha</font></a>';
            $set['userrank'] = 'Now you\'ve done it...!';
            $set['userpic'] = '<img src="http://inuyasha.rustedlogic.net/personal/moodav/5.png">';
            $dstyle = ' style="color:#b671e8;background:black;"';
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set['tdbg']) . "{$dstyle} rowspan=2 align=center style=\"font-size: 12px;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] . "<br>" : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t<br>\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>\n\t\t\t\t<br>" . ($hacks['noposts'] ? "" : "{$posttable}") . "\n\t\t\t\t<br>\n\t\t\t\t<br>{$jd}\n\t\t\t\t<br>\n\t\t\t\t<br>{$lp}\n\t\t\t\t<br>{$la}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t{$set['tdbg']}{$dstyle} height=1 width=100%>\n\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts{$dstyle}>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t{$set['tdbg']}{$dstyle} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t\t{$tblend}";
    }
    // End Inu's sidebar
    if ($post['uid'] == 18 && !$x_hacks['host'] && $x_hacks['mmdeath'] >= 0 && !$_GET['test2']) {
        return "\n\t<table style=\"background: #f00 url('numgfx/red.gif');\" cellpadding=3 cellspacing=1>\n\t{$set['tdbg']} style='background: #000;' rowspan=2>\n\t\t<br><center class='stupiddoomtimerhack'><img src='numgfx.php?f=numdeath&n=" . $x_hacks['mmdeath'] . "' height=32 style=\"background: #f00 url('numgfx/red.gif');\" title=\"Doom.\"></center>\n\t\t<br>\n\t  <center>{$set['userlink']}{$smallfont}<br>\n\t\t<br>\n\t\t<br>{$set['userpic']}\n\t\t</center>\n\n\t\t<br><img src=images/_.gif width=194 height=1>\n\t</td>\n\t{$set['tdbg']} style='background: #000;'height=1 width=100%>\n\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t    <td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t    <td width=255><nobr>{$quote}{$edit}{$ip}\n\t  </table><tr>\n\t{$set['tdbg']} style='background: #000;' height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t{$tblend}";
    }
    // Default layout
    if (!(in_array($post['uid'], $sidebars) && !$x_hacks['host']) || $loguser['viewsig'] == 0) {
        return "\n\t<div style='position:relative'>\n\t{$tblstart}\n\t{$set['tdbg']} rowspan=2>\n\t  {$set['userlink']}{$smallfont}<br>\n\t  {$set['userrank']}{$reinf}<br>\n        {$level}{$bar}<br>\n\t  {$set['userpic']}<br>\n\t  " . (filter_bool($hacks['noposts']) ? "" : "{$poststext}{$postnum}{$posttotal}<br>") . "\n\t  {$experience}<br><br>\n\t  {$since}<br>" . str_ireplace("&lt;br&gt;", "<br>", substr(htmlspecialchars($set['location']), 10)) . "<br><br>\n\t  {$sincelastpost}<br>{$lastactivity}<br>\n\t  </font>\n\t  <br><img src=images/_.gif width=200 height=1>\n\t</td>\n\t{$set['tdbg']} height=1 width=100%>\n\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t    <td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t    <td width=255><nobr>{$quote}{$edit}{$ip}\n\t  </table><tr>\n\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t{$tblend}\n\t</div>";
    } elseif ($post['uid'] == "1" && !$x_hacks['host']) {
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post['lastactivity']) . "<font color=#bbbbbb> ago";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        //". str_replace('valign=top', 'valign=top', $set[tdbg]) ."
        return "<table width=100% cellpadding=0 cellspacing=0 style=\"background: #004c5a; background-position: top right; background-repeat: repeat-x; border: 1px solid #000;\">\n\t\t\t<tr>\n\t\t\t<td rowspan=2 valign=top align=center style=\"font-size: 12px; color: #fff; font-family: Verdana, sans-serif; border-right: 3px double #000; background: #004c5a;\">\n\t\t\t\t&mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] . "<br>" : "") . "\n\t\t\t\t<br>{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color=#cccccc>" : "<br>Post{$postss} {$postnum}<font color=#cccccc>{$posttotal}") . "\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t" . (false ? "<br><a href=sendprivate.php?uid=1>PM</a> - <a href=rateuser.php?id=1>Rate</a>" : "") . "\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t<td height=1 width=100% style=\"font-size: 12px; color: #ddd; font-family: Verdana, sans-serif; background: #004c5a; border-bottom: 1px solid #000;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t<td valign='top' id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "3" && !$x_hacks['host']) {
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . '<font color=#bb0000> ago';
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: #000; font-size: 12px; color: #f00; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color=#bb0000>" : "<br>Post{$postss} {$postnum}<font color=#bb0000>{$posttotal}") . "\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: #000000; font-size: 12px; color: #ff0000; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
        // ************************************************************
        // SYAORAN COLIN
        // ************************************************************
    } elseif ($post['uid'] == "45" && !$x_hacks['host']) {
        $fcol1 = "#204080";
        $fcol2 = "#3070a0";
        $fcol3 = "#f0f8ff";
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color={$fcol2}>" : "<br>Post{$postss} {$postnum}<font color={$fcol2}>{$posttotal}") . "\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td style='color: {$fcol1};'>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "47" && !$x_hacks['host']) {
        $fcol1 = "#204080";
        $fcol2 = "#3070a0";
        $fcol3 = "#ffffff";
        $fcol1 = "#9966bb";
        $fcol2 = "#ccaadd";
        $fcol3 = "#000000";
        if ($post['posts'] >= 20000) {
            $fcol1 = "#bbaadd";
            $fcol2 = "#eebbff";
            $fcol3 = "#000000";
        }
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}" . ($post['posts'] >= 20000 ? " url('http://www.ffalexandria.com/orlandu/anya/side_bg.jpg'); background-position:bottom left" : "") . "; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t<br>{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t<br><br>{$set['userpic']}\n\t\t\t\t<br><br>Post{$postss} {$postnum}{$posttotal}\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td style='color: {$fcol1};'>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
        return "\n\t\t{$tblstart}\n\t\t{$set['tdbg']} rowspan=2 style='padding: 5px;'>\n\t\t  <img src='images/smilies/bigeyes.gif' title='o_O' align='absmiddle'> {$set['userlink']}{$smallfont}<br>\n\t\t  " . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t<br>\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>\n\t\t\t\t<br>Post{$postss} {$postnum}{$posttotal}\n\t\t  </center><br><img src=images/_.gif width=190 height=1>\n\t\t</td>\n\t\t{$set['tdbg']} height=1 width=100%>\n\t\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t  </table><tr>\n\t\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t\t{$tblend}";
        // ************************************************************
        // SAKURA HIRYUU
        // ************************************************************
    } elseif ($post['uid'] == "4xxxxxxxxxxx7" && !$x_hacks['host']) {
        $fcol1 = "#802040";
        $fcol2 = "#a07030";
        $fcol3 = "#fff0f8";
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color={$fcol2}>" : "<br>Post{$postss} {$postnum}<font color={$fcol2}>{$posttotal}") . "\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td style=\"color: {$fcol1};\">Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
        // ************************************************************
        // REAL HIRYUU
        // ************************************************************
    } elseif ($post['uid'] == "92" && !$x_hacks['host']) {
        $fcol1 = "#e2bbff";
        $fcol2 = "#bb70dd";
        $fcol3 = "#220033";
        $fcol1 = "#ffeeaa";
        $fcol2 = "#998844";
        $fcol3 = "#221100";
        $fcol1 = "#ffaaaa";
        $fcol2 = "#ff7777";
        $fcol3 = "#661111";
        $fcol1 = "#ffffff";
        $fcol2 = "#eeeeee";
        $fcol3 = "#000000";
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color={$fcol2}>" : "<br>Post{$postss} {$postnum}<font color={$fcol2}>{$posttotal}") . "\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "19" && !$x_hacks['host']) {
        $fcol1 = "#bbbbeb";
        $fcol2 = "#8888a8";
        $fcol3 = "#080818 url('http://bloodstar.rustedlogic.net/layout/background.png')";
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $joindate = 'Joined </font>' . date($dateshort, $post[regdate] + $tzoff) . "<font color={$fcol2}>";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] . "<br>" : "") . "\n\t\t\t\t{$reinf}\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color={$fcol2}>" : "<br>Post{$postss} {$postnum}<font color={$fcol2}>{$posttotal}") . "\n\t\t\t\t<br>\n\t\t\t\t<br>{$joindate}\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "4" && !$x_hacks['host']) {
        $fcol1 = "#9999cc";
        $fcol2 = "#7777aa";
        $fcol3 = "#000011";
        $lastactivity = 'Active </font>' . timeunits(ctime() - $post[lastactivity]) . "<font color={$fcol2}> ago";
        $joindate = 'Joined </font>' . date($dateshort, $post[regdate] + $tzoff) . "<font color={$fcol2}>";
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t &mdash; {$set['userlink']} &mdash;\n\t\t\t\t{$smallfont}\n\t\t\t\t" . ($set['userrank'] ? "<br>" . $set['userrank'] . "<br>" : "") . "\n\t\t\t\t{$set['userpic']}\n\t\t\t\t<br>" . ($hacks['noposts'] ? "<font color={$fcol2}>" : "<br>Post{$postss} {$postnum}<font color={$fcol2}>{$posttotal}") . "\n\t\t\t\t<br>\n\t\t\t\t<br>{$joindate}\n\t\t\t\t<br>{$lastactivity}</font>\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "387" && !$x_hacks['host']) {
        if (!$x_hacks['rpgstats'][$post['uid']]) {
            $css = "<style> .a1{ height:100%; min-height: 286px; background:#000 url(http://acmlm.rustedlogic.net/etc/nismilly/bg.jpg) 50% 0% no-repeat; } div.a2{ height:100%; min-height: 286px; background:url(http://acmlm.rustedlogic.net/etc/nismilly/map.png) 50% 226px no-repeat; font:9px tahoma; color:#FD4; text-align:center; line-height:19px; } div.a2 img{ margin-top:-5px; border:0px; } div.a2 span{ color:#DEF; } </style>";
            $x_hacks['rpgstats'][$post['uid']] == "lol";
        }
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s:";
        }
        return "{$tblstart}\n\t\t\t" . str_replace('\' valign=top', ' a1\' valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t{$css}\n\t\t\t\t<div class=a2>\n\t\t\t\t\tPost{$postss} <span><b>{$postnum}</b></span><span><b>{$posttotal}</b></span> (<span>" . timeunits(ctime() - $post[lastposttime]) . "</span>),\n\t\t\t\t\tonline <span>" . timeunits(ctime() - $post[lastactivity]) . "</span> ago\n\t\t\t\t\t<a href=//jul.rustedlogic.net/profile.php?id=387>\n\t\t\t" . (strpos($_SERVER['USER_AGENT'], "MSIE 6.0") ? "<img src=_.png style=filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php)>" : "<img src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php>") . "\n\t\t\t\t\t</a>\n\t\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif ($post['uid'] == "89" && !$x_hacks['host']) {
        $fcol1 = "#bbbbbb";
        $fcol2 = "#555555";
        $fcol3 = "#181818";
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 align=center style=\"background: {$fcol3}; font-size: 14px; color: {$fcol1}; font-family: Verdana, sans-serif; padding-top: .5em;\">\n\t\t\t\t{$set['userlink']}\n\t\t\t\t<br><span style=\"letter-spacing: 0px; color: {$fcol2}; font-size: 10px;\">Collection of nobodies</span>\n\t\t\t\t<br><img src=images/_.gif width=200 height=200>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"background: {$fcol3}; padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
    } elseif (($post['uid'] == "16" || $post['uid'] == "5") && !$x_hacks['host']) {
        // top bg #614735
        // mid-bg #e1cfb6
        // darker #d0bca4
        if (!function_exists("basestat")) {
            require 'lib/rpg.php';
        }
        if (!$x_hacks['rpgstats'][$post['uid']]) {
            $eq = array('1' => "<center style=\"text-align: center; color: #b09080;\">(Weapon)</center>", '2' => "<center style=\"text-align: center; color: #b09080;\">(Armor)</center>", '3' => "<center style=\"text-align: center; color: #b09080;\">(Shield)</center>", '4' => "<center style=\"text-align: center; color: #b09080;\">(Helm)</center>", '5' => "<center style=\"text-align: center; color: #b09080;\">(Shoes)</center>", '6' => "<center style=\"text-align: center; color: #b09080;\">(Acc.)</center>");
            $user = mysql_fetch_array(mysql_query("SELECT name,posts,regdate,users_rpg.* FROM users,users_rpg WHERE id='" . $post['uid'] . "' AND uid=id"));
            $d = (ctime() - $user[regdate]) / 86400;
            $eqitems = mysql_query("SELECT * FROM items WHERE id={$user['eq1']} OR id={$user['eq2']} OR id={$user['eq3']} OR id={$user['eq4']} OR id={$user['eq5']} OR id={$user['eq6']}") or print mysql_error();
            while ($item = mysql_fetch_array($eqitems)) {
                $items[$item[id]] = $item;
                $eq[$item['cat']] = $item['name'];
            }
            if ($ct) {
                $GPdif = floor($items[$user['eq' . $ct]][coins] * 0.6) - $items[$it][coins];
                $user['eq' . $ct] = $it;
            }
            $st = getstats($user, $items);
            $st[GP] += $GPdif;
            if ($st[lvl] > 0) {
                $pct = 1 - calcexpleft($st[exp]) / totallvlexp($st[lvl]);
            }
            $st['expn'] = calcexpleft($st[exp]);
            $st['eq'] = $eq;
            $x_hacks['rpgstats'][$post['uid']] = $st;
        } else {
            $st = $x_hacks['rpgstats'][$post['uid']];
        }
        $lastactivity = 'Active ' . timeunits(ctime() - $post[lastactivity]) . " ago";
        $joindate = 'Joined ' . date($dateshort, $post[regdate] + $tzoff);
        $postnum = $post['num'] . "/";
        $posttotal = $post['posts'];
        if (!$post['num']) {
            $postnum = '';
            $postss = "s";
        }
        if (!$set['picture']) {
            $set['picture'] = "images/_.gif";
        }
        if ($_GET['z']) {
            print_r($st['eq']);
        }
        return "{$tblstart}\n\t\t\t" . str_replace('valign=top', 'valign=top', $set[tdbg]) . " rowspan=2 width=200>\n\t\t\t\t <table style=\"font-family: Tahoma; font-size: 12px; color: #000; background: #e1cfb6;\" width=100% cellspacing=0>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"background: #614735; text-align: left; padding: 2px 0px 2px 15px; font-size: 14px; letter-spacing: 1px; border: 2px outset #614735;\" colspan=4>{$set['userlink']}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"border: 2px outset #614735;\" colspan=4>\n\t\t\t\t\t\t\t <table width=100% cellspacing=0 cellpadding=0 style=\"color: #000; font-size: 12px;\">\n\t\t\t\t\t\t\t\t<tr><td rowspan=5 width=0 style=\"padding: 0 3px 0 0;\"><img src=\"" . $set['picture'] . "\" width=80 height=80></td>\n\t\t\t\t\t\t\t\t\t<td width=100% colspan=4 style=\"font-size: 14px; letter-spacing: 1px; padding: 0 0 7px 0;\">" . $set['userrank'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"font-weight: bold;\"><td colspan=2 width=50%>Lv</td><td style=\"text-align: right;\" colspan=2 width=50%>" . $st['lvl'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Post{$postss}</td><td style=\"text-align: right;\" colspan=2 width=50%>{$postnum}{$posttotal}</tr>\n\t\t\t\t\t\t\t\t<tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Counter</td><td style=\"text-align: right;\" colspan=2 width=50%>2</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"font-weight: bold;\"><td>Mv</td><td style=\"text-align: right;\">7</td><td style=\"padding: 0 0 0 5px;\">Jm</td><td style=\"text-align: right;\">26</td></tr>\n\t\t\t\t\t\t\t</table>\t\t\t\t\n\n\t\t\t\t\t\t\t<table width=100% cellspacing=0 cellpadding=0 style=\"color: #000; font-size: 12px; font-weight: bold;\">\n\t\t\t\t\t\t\t\t<tr style=\"background: #d0bca4;\"><td style=\"font-variant: small-caps;\">Hp</td><td style=\"text-align: right;\" colspan=3>" . $st['HP'] . "/" . $st['HP'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td style=\"font-variant: small-caps;\">Sp</td><td style=\"text-align: right;\" colspan=3>" . $st['MP'] . "/" . $st['MP'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"background: #d0bca4;\">\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps;\">Atk</td><td style=\"text-align: right; padding: 0 4px 0 0;\">" . $st['Atk'] . "</td>\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps; padding: 0 0 0 4px;\">Int</td><td style=\"text-align: right;\">" . $st['Int'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               >\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps;\">Def</td><td style=\"text-align: right; padding: 0 4px 0 0;\">" . $st['Def'] . "</td>\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps; padding: 0 0 0 4px;\">Spd</td><td style=\"text-align: right;\">" . $st['Spd'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"background: #d0bca4;\">\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps;\">Hit</td><td style=\"text-align: right; padding: 0 4px 0 0;\">" . $st['Dex'] . "</td>\n\t\t\t\t\t\t\t\t\t<td style=\"font-variant: small-caps; padding: 0 0 0 4px;\">Res</td><td style=\"text-align: right;\">" . $st['MDf'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td style=\"font-variant: small-caps;\">Exp</td><td style=\"text-align: right;\" colspan=3>" . $st['exp'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr style=\"background: #d0bca4;\"><td style=\"font-variant: small-caps;\">Next</td><td style=\"text-align: right;\" colspan=3>" . $st['expn'] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4><img src=\"images/_.gif\" height=4 width=1></td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][1] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][2] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][3] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][4] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][5] . "</td></tr>\n\t\t\t\t\t\t\t\t<tr                               ><td colspan=4>" . $st['eq'][6] . "</td></tr>\n\t\t\t\t\t\t\t</table>\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\n\t\t\t\t<br><img src=images/_.gif width=200 height=1>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100% style=\"background: {$fcol3}; font-size: 12px; color: {$fcol1}; font-family: Verdana, sans-serif;\">\n\t\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} style=\"padding: 0;\" id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>{$tblend}\n\t\t";
        /*
        <!--
        				$smallfont
        				<br>$joindate
        				<br>$lastactivity</font>
        */
    } elseif ($post['uid'] == 1090 && !$x_hacks['host']) {
        $brltype = "catgirlredux2011";
        $brsidebar = "\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"http://lain.rustedlogic.net/layouts/css/_br_sidebar.css\" />\n\t\t\t{$tblstart}\n\t\t\t{$set['tdbg']} rowspan=2>\n\t\t\t\t<div class=\"brsidebar lain-sidebar-{$brltype}\">\n\t\t\t\t<div class=\"bruserlink\">&mdash; {$set['userlink']} &mdash;</div>\n\t\t\t\t<div class=\"bruserrank\">{$set['userrank']}</div>" . (!empty($reinf) ? "<div class=\"brsyndrome\">{$reinf}</div>" : "") . "\n\t\t\t\t<div class=\"bruserpic\">{$set['userpic']}</div>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t{$set['tdbg']} height=1 width=100%>\n\t\t\t<table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t\t\t<td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t\t\t<td width=255><nobr>{$quote}{$edit}{$ip}\n\t\t\t</table><tr>\n\t\t\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t\t\t{$tblend}";
        return $brsidebar;
    } else {
        return "\n\t{$tblstart}\n\t{$set['tdbg']} rowspan=2>\n\t  {$set['userlink']}{$smallfont}<br>\n\t  {$set['userrank']}{$reinf}<br>\n\t  <br><img src=images/_.gif width=200 height=1>\n\t</td>\n\t{$set['tdbg']} height=1 width=100%>\n\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t    <td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t    <td width=255><nobr>{$quote}{$edit}{$ip}\n\t  </table><tr>\n\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t{$tblend}";
    }
}
 public function test_filter_string()
 {
     $this->assertEquals(filter_string("<p>Con gái yêu dấu</p>"), "Con gái yêu dấu");
 }
Ejemplo n.º 13
0
 // проверка подтверждения пароля
 if ($_POST['psw1'] != $_POST['psw2']) {
     $errors[] = "You make a mistake when confirming the password";
 }
 // валидация e-mail
 if (!preg_match("|^[-0-9a-z_\\.]+@[-0-9a-z_^\\.]+\\.[a-z]{2,6}\$|i", $_POST['email'])) {
     $errors[] = "Wrong e-mail format";
 }
 // проверка на наличие ошибок, возникших при заполнении формы регистрации
 if (count($errors) != 0) {
     print_r($errors);
 } else {
     // если ошибок нет, заполняем соответсвующие поля в БД
     $user_name = filter_string($connection, $_POST['username']);
     $user_psw = filter_string($connection, $_POST['psw1']);
     $user_email = filter_string($connection, $_POST['email']);
     // хэширование пароля
     $hash_user_psw = hash('ripemd128', $user_psw);
     // вставка данных пользователя в БД, защищенный способ
     $query = 'PREPARE statement FROM "INSERT INTO users VALUES(?,?,?,?,?,?,?,?)"';
     $result = $connection->query($query);
     if (!$result) {
         die($connection->error . ". Error code: " . $connection->errno);
     }
     $query = "SET @uid = NULL,\n                      @uname = '{$user_name}',\n                      @hpassword = '******',\n                      @email = '{$user_email}',\n                      @admin = 'false',\n                      @ava = 'defaultava.jpg',\n                      @date = '',\n                      @status = ''";
     $result = $connection->query($query);
     if (!$result) {
         die("1. " . $connection->error . ". Error code: " . $connection->errno);
     }
     $query = 'EXECUTE statement USING @uid, @uname, @hpassword, @email, @admin, @ava, @date, @status';
     $result = $connection->query($query);
Ejemplo n.º 14
0
//определение имени пользователя и его отображение
if (!empty($_POST)) {
    $user_name = filter_string($connection, $_POST['username']);
    echo "<h2>" . $user_name . "</h2>";
} else {
    echo "<h2>Register please...</h2>";
}
?>
  </header>
  <hline>
  <div class="inline" id="user_profile"> 
    <?php 
// получение данных о пользователе из формы входа
if (!empty($_POST['username'])) {
    $user_name = filter_string($connection, $_POST['username']);
    $user_psw = filter_string($connection, $_POST['psw']);
    $hash_user_psw = hash('ripemd128', $user_psw);
} else {
    die("No user data");
}
$user_data = array();
// получение данных пользователя из БД
$query = 'PREPARE statement FROM "SELECT * FROM users WHERE uname = (?) AND hpassword = (?)"';
$result = $connection->query($query);
if (!$result) {
    die($connection->error . ". Error code: " . $connection->errno);
}
$query = "SET @uname = '{$user_name}',\n                  @hpassword = '******'";
$result = $connection->query($query);
if (!$result) {
    die("1. " . $connection->error . ". Error code: " . $connection->errno);
Ejemplo n.º 15
0
require 'lib/layout.php';
$sql->query("UPDATE `users` SET `name` = 'Xkeeper' WHERE `id` = 1");
# I'm hiding it here too as a 'last resort'. Remove this and I'll make that Z-line a month instead.
// You know me, I find it more fun to hide code to replace your name everywhere instead of altering the DB <3
//	$sql->query("UPDATE `users` SET `sex` = '1' WHERE `id` = 2100");  // Me too <3 ~Ras
if ($x_hacks['smallbrowse'] == 1 and false) {
    require 'mobile/index.php';
    // alternate markup for mobile clients.
} else {
    if (filter_string($_GET['action']) == 'markforumread' and $log) {
        $sql->query("DELETE FROM forumread WHERE user={$loguserid} AND forum='{$forumid}'");
        $sql->query("DELETE FROM `threadsread` WHERE `uid` = '{$loguserid}' AND `tid` IN (SELECT `id` FROM `threads` WHERE `forum` = '{$forumid}')");
        $sql->query("INSERT INTO forumread (user,forum,readdate) VALUES ({$loguserid},{$forumid}," . ctime() . ')');
        return header("Location: index.php");
    }
    if (filter_string($_GET['action']) == 'markallforumsread' and $log) {
        $sql->query("DELETE FROM forumread WHERE user={$loguserid}");
        $sql->query("DELETE FROM `threadsread` WHERE `uid` = '{$loguserid}'");
        $sql->query("INSERT INTO forumread (user,forum,readdate) SELECT {$loguserid},id," . ctime() . ' FROM forums');
        return header("Location: index.php");
    }
    $postread = readpostread($loguserid);
    $users1 = $sql->query("SELECT id,name,birthday,sex,powerlevel,aka FROM users WHERE FROM_UNIXTIME(birthday,'%m-%d')='" . date('m-d', ctime() + $tzoff) . "' AND birthday ORDER BY name");
    $blist = "";
    for ($numbd = 0; $user = $sql->fetch($users1); $numbd++) {
        if (!$numbd) {
            $blist = "<tr>{$tccell2s} colspan=5>Birthdays for " . date('F j', ctime() + $tzoff) . ': ';
        } else {
            $blist .= ', ';
        }
        $users[$user['id']] = $user;
Ejemplo n.º 16
0
function ai_settings()
{
    global $ai_db_options;
    if (isset($_POST[AD_FORM_SAVE])) {
        check_admin_referer('save_adinserter_settings');
        $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . '0';
        if (isset($_POST[$import_switch_name]) && $_POST[$import_switch_name] == "1") {
            // Import Ad Inserter settings
            $saved_settings = $ai_db_options;
            $ai_options = @unserialize(base64_decode(str_replace(array("\\\""), array("\""), $_POST["export_settings_0"])));
            if ($ai_options === false) {
                $ai_options = $saved_settings;
                $invalid_blocks[] = 0;
            }
        } else {
            // Try to import individual settings
            $ai_options = array();
            $invalid_blocks = array();
            for ($block = 1; $block <= AD_INSERTER_BLOCKS; $block++) {
                $ad = new ai_Block($block);
                $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . $block;
                if (isset($_POST[$import_switch_name]) && $_POST[$import_switch_name] == "1") {
                    $saved_settings = $ai_db_options[$block];
                    $exported_settings = @unserialize(base64_decode(str_replace(array("\\\""), array("\""), $_POST["export_settings_" . $block])));
                    if ($exported_settings !== false) {
                        foreach (array_keys($ad->wp_options) as $key) {
                            if ($key == AI_OPTION_NAME) {
                                $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
                                if (isset($_POST[$form_field_name])) {
                                    $ad->wp_options[$key] = filter_option($key, $_POST[$form_field_name]);
                                }
                            } else {
                                if (isset($exported_settings[$key])) {
                                    $ad->wp_options[$key] = filter_option($key, $exported_settings[$key], false);
                                }
                            }
                        }
                    } else {
                        $ad->wp_options = $saved_settings;
                        $invalid_blocks[] = $block;
                    }
                } else {
                    foreach (array_keys($ad->wp_options) as $key) {
                        $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
                        if (isset($_POST[$form_field_name])) {
                            $ad->wp_options[$key] = filter_option($key, $_POST[$form_field_name]);
                        }
                    }
                }
                $ai_options[$block] = $ad->wp_options;
                delete_option(str_replace("#", $block, AD_ADx_OPTIONS));
            }
            $adH = new ai_AdH();
            $adF = new ai_AdF();
            foreach (array_keys($adH->wp_options) as $key) {
                $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_HEADER_OPTION_NAME;
                if (isset($_POST[$form_field_name])) {
                    $adH->wp_options[$key] = filter_option_hf($key, $_POST[$form_field_name]);
                }
            }
            foreach (array_keys($adF->wp_options) as $key) {
                $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_FOOTER_OPTION_NAME;
                if (isset($_POST[$form_field_name])) {
                    $adF->wp_options[$key] = filter_option_hf($key, $_POST[$form_field_name]);
                }
            }
            $ai_options[AI_HEADER_OPTION_NAME] = $adH->wp_options;
            $ai_options[AI_FOOTER_OPTION_NAME] = $adF->wp_options;
            $ai_options[AI_GLOBAL_OPTION_NAME] = ai_plugin_options(filter_string($_POST['syntax-highlighter-theme']), filter_html_class($_POST['block-class-name']));
        }
        if (!empty($invalid_blocks)) {
            if ($invalid_blocks[0] == 0) {
                echo "<div class='error' style='margin: 5px 15px 2px 0px; padding: 10px;'>Error importing Ad Inserter settings.</div>";
            } else {
                echo "<div class='error' style='margin: 5px 15px 2px 0px; padding: 10px;'>Error importing settings for block", count($invalid_blocks) == 1 ? "" : "s:", " ", implode(", ", $invalid_blocks), ".</div>";
            }
        }
        update_option(WP_OPTION_NAME, $ai_options);
        // Reload options
        ai_load_options();
        delete_option(str_replace("#", "Header", AD_ADx_OPTIONS));
        delete_option(str_replace("#", "Footer", AD_ADx_OPTIONS));
        delete_option(AD_OPTIONS);
        echo "<div class='updated' style='margin: 5px 15px 2px 0px; padding: 10px;'><strong>Settings saved.</strong></div>";
    } elseif (isset($_POST[AD_FORM_CLEAR])) {
        check_admin_referer('save_adinserter_settings');
        $ai_options = array();
        for ($block = 1; $block <= AD_INSERTER_BLOCKS; $block++) {
            $ad = new ai_Block($block);
            $ai_options[$block] = $ad->wp_options;
            delete_option(str_replace("#", $block, AD_ADx_OPTIONS));
        }
        $adH = new ai_AdH();
        $adF = new ai_AdF();
        $ai_options[AI_HEADER_OPTION_NAME] = $adH->wp_options;
        $ai_options[AI_FOOTER_OPTION_NAME] = $adF->wp_options;
        $ai_options[AI_GLOBAL_OPTION_NAME] = ai_plugin_options();
        update_option(WP_OPTION_NAME, $ai_options);
        // Reload options
        ai_load_options();
        delete_option(str_replace("#", "Header", AD_ADx_OPTIONS));
        delete_option(str_replace("#", "Footer", AD_ADx_OPTIONS));
        delete_option(AD_OPTIONS);
        echo "<div class='error' style='margin: 5px 15px 2px 0px; padding: 10px;'>Settings cleared.</div>";
    }
    print_settings_form();
}