예제 #1
0
 function putthread($name, $tpass, $boardnumber, $title, $body, $link, $ip, $mod, $pin, $lock, $permasage, $password = "", $tyme = false)
 {
     if ($tyme === false) {
         $tyme = time() + THtimeoffset * 60;
     }
     $q = "INSERT INTO " . THthreads_table . " ( board, title, body";
     $v = " VALUES ( " . $boardnumber . " ,'" . $this->escape_string($title) . "','";
     $v .= $this->escape_string($body);
     $q .= ", ip, pin, permasage, lawk, time, bump";
     $v .= "'," . $ip . " , " . $pin . " , " . $permasage . " , " . $lock . " , " . $tyme . " , " . $tyme;
     $globalid = $this->getglobalid($boardnumber);
     $q .= ", globalid";
     $v .= "," . $globalid;
     if ($name != null) {
         $q .= ", name";
         $v .= ",'" . $this->escape_string($name) . "'";
     }
     if ($tpass != null) {
         $q .= ", trip";
         $v .= "'" . $tpass . "'";
         //Not cleaning trip since it should be encoded.
     }
     if ($link != null) {
         if (!preg_match("/^(http:|https:|ftp:|mailto:|aim:)/", $link)) {
             $link = "mailto:" . $link;
         } else {
             $link = $this->escape_string($link);
         }
         $q .= ", link";
         $v .= ", '" . $this->escape_string($link) . "'";
     }
     if ($password != "") {
         $q .= ", password";
         $v .= ",'" . $this->escape_string(md5(THsecret_salt . $password)) . "'";
     }
     //echo($q.", time=".$tyme);
     //echo $q;
     $visible = 1;
     $q .= ",time,visible) ";
     $v .= "," . $tyme . "," . $visible . ")";
     $built = $q . $v;
     $this->myquery($built) or THdie("DBpost");
     if ($boardnumber == THnewsboard) {
         rebuild_rss();
     }
     smclearcache($boardnumber, -1, -1);
     // clear the cache for this board
     $tnum = sqlite_last_insert_rowid(THdblitefn);
     //help
     $this->myquery("update " . THboards_table . " set lasttime=" . $tyme . " where id='" . $boardnumber . "'") or THdie("DBpost");
     return $tnum;
 }
예제 #2
0
 function putthread($name, $tpass, $boardnumber, $title, $body, $link, $ip, $mod, $pin, $lock, $permasage, $password = "", $tyme = false)
 {
     if ($tyme === false) {
         $tyme = time() + THtimeoffset * 60;
     }
     $q = "insert into " . THthreads_table . " set board='" . $boardnumber . "', title='" . $this->clean($title) . "', body='";
     if ($boardnumber == THnewsboard || $boardnumber == THmodboard) {
         $q .= $this->escape_string($body);
     } else {
         $q .= $this->clean($body);
     }
     $q .= "', ip=" . $ip . ", pin=" . $pin . ", permasage=" . $permasage . ", lawk=" . $lock . ", time=" . $tyme . ", bump=" . $tyme;
     $globalid = $this->getglobalid($boardnumber);
     $q .= ", globalid=" . $globalid;
     if ($name != null) {
         $q .= ", name='" . $this->clean($name) . "'";
     }
     if ($tpass != null) {
         $q .= ", trip='" . $tpass . "'";
         //Not cleaning trip since it should be encoded.
     }
     if ($link != null) {
         if (!preg_match("/^(http:|https:|ftp:|mailto:|aim:)/", $link)) {
             $link = "mailto:" . $link;
         }
         $q .= ", link='" . $this->clean($link) . "'";
     }
     if ($password != "") {
         $q .= ", password='******'";
     }
     //echo($q.", time=".$tyme);
     //		echo $q;
     //		if ($link != null)
     //		{
     //			$q .= ", link='" . $this->clean($link) . "'";
     //		}
     $this->myquery($q) or THdie("DBpost");
     if ($boardnumber == THnewsboard) {
         rebuild_rss();
     }
     smclearcache($boardnumber, -1, -1);
     // clear the cache for this board
     $tnum = mysql_insert_id();
     $this->myquery("update " . THboards_table . " set lasttime=" . $tyme . " where id='" . $boardnumber . "'") or THdie("DBpost");
     return $tnum;
 }
예제 #3
0
파일: admin.php 프로젝트: taqsuqs/drydock
         rebuild_linkbars();
     }
     if (isset($_POST['sp'])) {
         rebuild_spamlist();
     }
     if (isset($_POST['fl'])) {
         rebuild_filters();
     }
     if (isset($_POST['cp'])) {
         rebuild_capcodes();
     }
     if (isset($_POST['al'])) {
         //Do EVERYTHING
         $sm->clear_all_cache();
         $sm->clear_compiled_tpl();
         rebuild_rss();
         rebuild_htaccess();
         rebuild_hovermenu();
         rebuild_linkbars();
         rebuild_filters();
         rebuild_capcodes();
         rebuild_spamlist();
         //save this for last just in case
     }
     $actionstring = "Housekeeping";
     writelog($actionstring, "admin");
     header("Location: " . THurl . "admin.php?a=hk");
 } elseif ($_GET['a'] == "bl") {
     if (THdbtype == null) {
         THdie("ADdbfirst");
     }