Beispiel #1
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;
}
Beispiel #2
0
}
loadtlayout();
$user['headtext'] = $user['postheader'];
$user['signtext'] = $user['signature'];
$user['text'] = "Sample text. [quote=fhqwhgads]A sample quote, with a <a href=about:blank>link</a>, for testing your layout.[/quote]This is how your post will appear.";
$user['uid'] = $_GET['id'];
$user['date'] = ctime();
// so that layouts show up regardless of setting (for obvious reasons)
$loguser['viewsig'] = 1;
// shop/rpg such
$shops = $sql->query('SELECT * FROM itemcateg ORDER BY corder');
$eq = $sql->fetchq("SELECT * FROM users_rpg WHERE uid={$id}");
$itemids = array_unique(array($eq['eq1'], $eq['eq2'], $eq['eq3'], $eq['eq4'], $eq['eq5'], $eq['eq6'], $eq['eq7']));
$itemids = implode(',', $itemids);
$eqitems = $sql->query("SELECT * FROM items WHERE id IN ({$itemids})");
while ($item = $sql->fetch($eqitems)) {
    $items[$item['id']] = $item;
}
while ($shop = $sql->fetch($shops)) {
    $shoplist .= "\r\n\t\t\t<tr>\r\n\t\t\t{$tccell1s}>{$shop['name']}</td>\r\n\t\t\t{$tccell2s} width=100%>" . $items[$eq['eq' . $shop['id']]]['name'] . "&nbsp;</td>\r\n\t\t";
}
/* extra munging for whatever reason */
$user['email'] = urlencode($user['email']);
// AKA
if ($user['aka'] && $user['aka'] != $user['name']) {
    $aka = "{$tccell1l} width=150><b>Also known as</td>\t\t\t{$tccell2l}>{$user['aka']}<tr>";
} else {
    $aka = '';
}
print "\r\n\t{$header}\r\n\t<div>{$fonttag} Profile for <b>{$minipic}<span style='color:#{$namecolor}'>{$user['name']}</span></b></div>\r\n<table cellpadding=0 cellspacing=0 border=0>\r\n<td width=100% valign=top>\r\n{$tblstart}\r\n\t{$tccellh} colspan=2><center>General information<tr>\r\n\t<!-- {$tccell1l} width=150><b>Username</td>\t\t\t{$tccell2l}>{$user['name']}<tr> -->\r\n\t{$aka}\r\n\t{$tccell1l} width=150><b>Total posts</td>\t\t\t{$tccell2l}>{$user['posts']} ({$postavg} per day) {$projdate}<br>{$bar}<tr>\r\n\t{$tccell1l} width=150><b>Total threads</td>\t\t{$tccell2l}>{$threadsposted}<tr>\r\n\t{$tccell1l} width=150><b>EXP</td>\t\t\t\t\t{$tccell2l}>{$expstatus}<tr>\r\n" . (false ? "\t{$tccell1l} width=150><b>User rating</td>\t\t\t{$tccell2l}>{$ratingstatus}<tr>" : "") . "\r\n\t{$tccell1l} width=150><b>Registered on</td>\t\t{$tccell2l}>" . @date($dateformat, $user[regdate] + $tzoff) . " (" . floor((ctime() - $user[regdate]) / 86400) . " days ago)<tr>\r\n\t{$tccell1l} width=150><b>Last post</td>\t\t\t{$tccell2l}>{$lastpostdate}{$lastpostlink}<tr>\r\n\t{$tccell1l} width=150><b>Last activity</td>\t\t{$tccell2l}>" . date($dateformat, $user[lastactivity] + $tzoff) . "{$lastip}<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Contact information<tr>\r\n\t{$tccell1l} width=150><b>Email address</td>\t\t{$tccell2l}><a href='mailto:{$user['email']}'>{$user['email']}</a>&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Homepage</td>\t\t\t{$tccell2l}><a href='{$user['homepageurl']}'>{$homepagename}</a>&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>ICQ number</td>\t\t\t{$tccell2l}>{$user['icq']} {$icqicon}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>AIM screen name</td>\t\t{$tccell2l}><a href='aim:goim?screenname={$aim}'>{$user['aim']}</a>&nbsp;<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>User settings<tr>\r\n\t{$tccell1l} width=150><b>Timezone offset</td>\t\t{$tccell2l}>{$tzoffset} hours from the server, {$tzoffrel} hours from you (current time: {$tzdate})<tr>\r\n\t{$tccell1l} width=150><b>Items per page</td>\t\t{$tccell2l}>" . $user['threadsperpage'] . " threads, " . $user['postsperpage'] . " posts<tr>\r\n\t{$tccell1l} width=150><b>Color scheme</td>\t\t{$tccell2l}>" . $schname . "<tr>\r\n{$tblend}\r\n</td><td>&nbsp;&nbsp;&nbsp;</td><td valign=top>\r\n{$tblstart}\r\n\t{$tccellh}><center>RPG status<tr>\r\n\t{$tccell1l}><img src='status.php?u={$id}'>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Equipped Items<tr>\r\n\t{$shoplist}\r\n{$tblend}\r\n</td></table>\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Personal information<tr>\r\n\t{$tccell1l} width=150><b>Real name</td>\t\t\t{$tccell2l}>{$user['realname']}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Location</td>\t\t\t{$tccell2l}>{$user['location']}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Birthday</td>\t\t\t{$tccell2l}>{$birthday} {$age}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>User bio</td>\t\t\t{$tccell2l}>" . dofilters(doreplace2(doreplace($user['bio'], $user['posts'], (ctime() - $user['regdate']) / 86400, $user['name']))) . "&nbsp;<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Sample post<tr>\r\n\t" . threadpost($user, 1) . "\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellhs} colspan=2><center>Options<tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=thread.php?user={$id}>Show posts</a> | \r\n\t<a href=forum.php?user={$id}>View threads by this user</a>\r\n\t{$sendpmsg}\r\n  {$ratelink}\r\n  {$moodavatar}\r\n  <tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=postsbyuser.php?id={$id}>List posts by this user</a> |\r\n\t<a href=postsbytime.php?id={$id}>Posts by time of day</a> |\r\n\t<a href=postsbythread.php?id={$id}>Posts by thread</a> | \r\n\t<a href=postsbyforum.php?id={$id}>Posts by forum</td>{$sneek}\r\n\t{$tblend}{$footer}\r\n  ";
printtimedif($startingtime);
Beispiel #3
0
    $restricted = true;
}
$header = "{$header}\n\t\t{$fonttag}<a href=index.php>{$boardname}</a> - <a href=forum.php?id={$forumid}>{$forum['title']}</a> - {$thread['title']}<form action=newreply.php name=replier method=post autocomplete=\"off\"> {$tblstart}";
// Post preview
if (($power >= $forum['minpowerreply'] || $forum['minpowerreply'] < 1) && $id > 0) {
    $postlist = "<tr>{$tccellh} colspan=2 style=\"font-weight:bold;\">Thread history</tr><tr>{$tccellh} width=150>User</td>{$tccellh} width=*>Post</tr>";
    $qppp = $ppp + 1;
    $posts = $sql->query("SELECT name,posts,sex,powerlevel,user,text,options,num FROM users u,posts p,posts_text WHERE thread={$id} AND p.id=pid AND user=u.id ORDER BY p.id DESC LIMIT {$qppp}");
    $i = 0;
    while ($post = $sql->fetch($posts)) {
        $bg = $i++ & 1 ? 'tdbg2' : 'tdbg1';
        if ($ppp-- > 0) {
            $postnum = $post['num'] ? "{$post['num']}/" : '';
            $tcellbg = "<td class='tbl {$bg} font' valign=top>";
            $namecolor = getnamecolor($post['sex'], $post['powerlevel']);
            $postlist .= "<tr>\n\t\t\t\t\t{$tcellbg}<a href=profile.php?id={$post['user']}><font {$namecolor}>{$post['name']}</font></a>{$smallfont}<br>\n\t\t\t\t\tPosts: {$postnum}{$post['posts']}</td>\n\t\t\t\t\t{$tcellbg}" . doreplace2(dofilters($post['text']), $post['options']) . "</tr>\n\t\t\t\t";
        } else {
            $tcellbg = "<td bgcolor={$tablebg1} valign=top colspan=2";
            $postlist .= "<tr>{$tccellh} colspan=2>This is a long thread. Click <a href=thread.php?id={$id}>here</a> to view it.</td></tr>";
        }
    }
}
if (!filter_string($_POST['action']) && !$thread['closed'] && !($banned && $log) && ($power >= $forum['minpowerreply'] || $forum['minpowerreply'] < 1) && $id > 0) {
    print $header;
    print "";
    if ($log) {
        $username = $loguser['name'];
        $passhint = 'Alternate Login:'******'altlogin').style.cssText=''; this.style.cssText='display:none'\">Use an alternate login</a>\n\t\t\t\t<span id=\"altlogin\" style=\"display:none\">";
    } else {
        $username = '';
Beispiel #4
0
    $msg = $sql->fetchq("SELECT * FROM pmsgs,pmsgs_text WHERE id={$id} AND id=pid");
    if ($loguserid != $msg['userto']) {
        print "\n\t\t\t\t{$header}{$tblstart}\n\t\t\t\t{$tccell1}>Can't reply to this private message, because it was not sent to you.\n\t\t\t\t<br>" . redirect('private.php', 'your private message box', 0) . "\n\t\t\t\t{$tblend}{$footer}\n\t\t\t";
        printtimedif($startingtime);
        die;
    }
}
print "{$header}{$fonttag}<a href=index.php>{$boardname}</a> - <a href=private.php>Private messages</a>{$tblstart}";
if (!$action) {
    print '<body onload=window.document.REPLIER.message.focus()><FORM ACTION=sendprivate.php NAME=REPLIER METHOD=POST>';
    if ($log && $id) {
        $user = loaduser($msg['userfrom'], 1);
        $quotemsg = "[quote={$user['name']}]{$msg['text']}[/quote]\r\n";
        $subject = "Re: {$msg['title']}";
        $tcellbg = "{$tccell1l} valign=top";
        $postlist = "\n\t\t\t\t{$tccellh} width=150>User</td>\n\t\t\t\t{$tccellh}>Message<tr>\n\t\t\t\t{$tcellbg}><a href=profile.php?id={$user['id']}>{$user['name']}</a>{$smallfont}<br>\n\t\t\t\tPosts: {$postnum}{$user['posts']}</td>\n\t\t\t\t{$tcellbg}>" . doreplace2($msg[text]) . "<tr>\n\t\t\t";
    } else {
        $postlist = '';
    }
    if ($userid) {
        $user = loaduser($userid, 1);
    }
    $user['name'] = htmlspecialchars($user['name']);
    $subject = htmlspecialchars($subject);
    print "\n\t\t\t{$tccellh} width=150>&nbsp</td>\n\t\t\t{$tccellh}>&nbsp<tr>\n\t\t\t{$tccell1}><b>Send to:</td>\t {$tccell2l}>{$inpt}=username value=\"{$user['name']}\" size=25 maxlength=25><tr>\n\t\t\t{$tccell1}><b>Subject:</td>\t {$tccell2l}>{$inpt}=subject value=\"{$subject}\" size=60 maxlength=100><tr>\n\t\t\t{$tccell1}><b>Message:</td>\t {$tccell2l}>{$txta}='message' rows=20 cols={$numcols}>{$quotemsg}</textarea><tr>\n\t\t\t{$tccell1}>&nbsp</td>\t\t {$tccell2l}>\n\t\t\t{$inph}=action VALUE=sendmsg>\n\t\t\t{$inps}=submit VALUE='Send message'>\n\t\t\t{$inps}=preview VALUE='Preview message'></td>\n\n\t\t\t{$tblend}\n\t\t\t</FORM>\n\t\t\t<br>{$tblstart}{$postlist}{$tblend}\n\t\t\t{$fonttag}<a href=index.php>{$boardname}</a> - <a href=private.php>Private messages</a>\n\t\t";
}
if ($action == 'sendmsg') {
    $username = stripslashes($_POST['username']);
    $userid = checkusername($username);
    if ($userid == -1) {
        print "{$tccell1}>Couldn't send the message. You didn't enter an existing username to send the message to.\n\t\t\t\t<br>" . redirect('private.php', 'your private message box', 2);