Ejemplo n.º 1
0
function API_Re($tid, $co)
{
    global $Channel, $userid, $username, $onlineip;
    ToOnezCode($co);
    $arr = array('pid' => '', 'fid' => $Channel['forumid'], 'tid' => $tid, 'aid' => '0', 'author' => $username, 'authorid' => $userid, 'icon' => '0', 'postdate' => time(), 'subject' => '', 'userip' => $onlineip, 'ifsign' => '1', 'ipfrom' => getaddress($onlineip), 'ifconvert' => '2', 'ifwordsfb' => '2', 'ifcheck' => '1', 'content' => $co, 'anonymous' => '0', 'ifhide' => '0');
    Conn()->insert("posts", $arr);
    $pid = (int) Conn()->select("posts", "pid", "1 order by tid desc");
    Conn()->query("UPDATE " . Conn()->tbl . "threads SET replies=replies+1,hits=hits+1, lastposter='{$username}', lastpost='" . time() . "' WHERE tid= '{$tid}'");
    Conn()->query("UPDATE " . Conn()->tbl . "memberdata SET  postnum=postnum+1, todaypost=todaypost+1, monthpost=monthpost+1, lastpost='" . time() . "' WHERE uid= '1' ");
    Conn()->query("UPDATE " . Conn()->tbl . "forumdata SET tpost=tpost+'1',article=article+'1' ,lastpost= 'Re:\t{$username}\t" . time() . "\tread.php?tid={$tid}&page=e#a'  WHERE fid= '{$Channel['forumid']}' ");
    $value = (int) Conn()->select("elements", "value", "type='replysort' and mark='{$Channel['forumid']}'");
    $value++;
    Conn()->query("REPLACE INTO " . Conn()->tbl . "elements (type,mark,id,value,addition,special) VALUES  ('replysort','{$Channel['forumid']}','{$tid}','{$value}','','0') , ('replysortday','{$Channel['forumid']}','{$tid}','{$value}','" . time() . "','0') ");
    return 1;
}
Ejemplo n.º 2
0
function API_Re($tid, $co)
{
    global $Channel, $userid, $username, $onlineip;
    ToOnezCode($co);
    $arr = array('fid' => $Channel['forumid'], 'tid' => $tid, 'first' => '0', 'author' => $username, 'authorid' => $userid, 'dateline' => time(), 'message' => $co, 'useip' => $onlineip, 'bbcodeoff' => '0', 'smileyoff' => '-1', 'parseurloff' => '');
    Conn()->insert("posts", $arr);
    Conn()->query("UPDATE " . Conn()->tbl . "threads SET lastposter='{$username}', lastpost='" . time() . "', replies=replies+1 WHERE tid='{$tid}'");
    Conn()->query("UPDATE " . Conn()->tbl . "members SET posts=posts+('+1') , lastpost='" . time() . "'  WHERE uid IN ({$userid})");
    Conn()->query("UPDATE " . Conn()->tbl . "forums SET lastpost='{$tid}\t{$ti}\t" . time() . "\t{$username}', posts=posts+1, todayposts=todayposts+1 WHERE fid='{$Channel['forumid']}'");
    return 1;
}