function shareLinks($stype = 'getsharelinks', $sid, $name, $url = '', $logo = '', $descrip = '', $threadorder = 0, $ifcheck = 0) { //友情链接 require_once R_P . 'admin/cache.php'; if ($stype == 'getsharelinks') { $sharelinkdb = array(); $query = $this->db->query("SELECT * FROM pw_sharelinks"); while ($rt = $this->db->fetch_array($query)) { $sharelinkdb[$rt['sid']] = $rt; } return new ApiResponse($sharelinkdb); } elseif ($stype == 'upsharelinks') { $sid = $this->db->get_value('SELECT sid FROM pw_sharelinks WHERE sid=' . S::sqlEscape($sid)); if ($sid) { $pwSQL = S::sqlSingle(array('name' => $name, 'url' => $url, 'logo' => $logo, 'descrip' => $descrip, 'threadorder' => $threadorder, 'ifcheck' => $ifcheck)); $this->db->update("UPDATE pw_sharelinks SET {$pwSQL} WHERE sid=" . S::sqlEscape($sid)); updatecache_i(); } else { $pwSQL = S::sqlSingle(array('threadorder' => $threadorder, 'name' => $name, 'url' => $url, 'logo' => $logo, 'descrip' => $descrip, 'ifcheck' => $ifcheck)); $this->db->update("INSERT INTO pw_sharelinks SET {$pwSQL}"); $sid = $this->db->insert_id(); updatecache_i(); } return new ApiResponse($sid); } elseif ($stype == 'remove') { $this->db->update('DELETE FROM pw_sharelinks WHERE sid=' . S::sqlEscape($sid)); updatecache_i(); return new ApiResponse($sid); } elseif ($stype == 'state') { $sid = $this->db->get_value('SELECT sid FROM pw_sharelinks WHERE sid=' . S::sqlEscape($sid)); return new ApiResponse($sid); } }
function updatecache($array = '') { if (empty($array) || !is_array($array)) { updatecache_i(1); if (R_P == D_P || !file_exists(D_P . 'data/bbscache/config.php') || !file_exists(D_P . 'data/bbscache/dbreg.php')) { updatecache_c(); } updatecache_p(1); updatecache_w(); updatecache_sy(); updatecache_g(); updatecache_bk(); updatecache_df(); updatecache_ol(); updatecache_mddb(1); updatecache_ml(); updatecache_f(1); updatecache_l(1); updatecache_gr(1); updatecache_inv(); updatecache_plan(); updatecache_ftp(); updatecache_field(1); updatecache_form(); updatecache_help(); cache_read(); updatecache_hotforum(); updatecache_openforum(); updatecache_topic(); updatecache_postcate(); updateCacheActivity(); updatecache_conf('nf', false, 'newinfo_config.php'); //updateStampCache(); //updateBlockCache(); } else { foreach ($array as $value) { $value(); } } }
} elseif ($_POST['delete']) { S::gp(array('deiaid'), 'P'); if (!$deiaid) { adminmsg('operate_error'); } foreach ($deiaid as $sid) { $db->update("DELETE FROM pw_sharelinks WHERE sid=" . S::sqlEscape($sid)); } updatecache_i(); adminmsg('operate_success'); } elseif ($_POST['order']) { S::gp(array('vieworder'), 'P'); foreach ($vieworder as $sid => $value) { $db->update('UPDATE pw_sharelinks SET threadorder = ' . S::sqlEscape($value) . ' WHERE sid= ' . S::sqlEscape($sid)); } updatecache_i(); adminmsg('operate_success'); } elseif ($action == 'types') { $query = L::loadClass('SharelinksTypeService', 'site'); $typeCates = $query->getAllTypesName(); $ajax_basename_add = EncodeUrl($basename . "&action=addtype"); include PrintEot('sharelink'); exit; } elseif ($action == 'addtype') { define('AJAX', 1); S::gp(array('step'), 'P'); if (empty($step)) { $ajax_basename_add = EncodeUrl($basename . "&action=addtype"); $ifable_Y = 'checked'; include PrintEot('sharelink'); ajax_footer();
!$atc_content && Showmsg('annouce_content'); $pwSQL = pwSqlSingle(array('fid' => $fid, 'ifopen' => $ifopen, 'vieworder' => $vieworder, 'author' => $windid, 'startdate' => $startdate, 'enddate' => $enddate, 'url' => $url, 'subject' => $atc_title, 'content' => $atc_content)); $db->update("INSERT INTO pw_announce SET {$pwSQL}"); if ($ifopen && (!$enddate || $enddate >= $timestamp)) { require_once R_P . 'require/updatenotice.php'; updatecache_i($fid); } } else { $rt = $db->get_one('SELECT aid,fid,content FROM pw_announce WHERE aid=' . pwEscape($aid)); !$atc_title && Showmsg('annouce_title'); !$atc_content && Showmsg('annouce_content'); (!$rt['aid'] || $rt['fid'] != $fid) && Showmsg('data_error'); $pwSQL = pwSqlSingle(array('ifopen' => $ifopen, 'vieworder' => $vieworder, 'startdate' => $startdate, 'enddate' => $enddate, 'url' => $url, 'subject' => $atc_title, 'content' => $atc_content)); $db->update("UPDATE pw_announce SET {$pwSQL} WHERE aid=" . pwEscape($aid)); require_once R_P . 'require/updatenotice.php'; updatecache_i($fid); } refreshto("forumcp.php?action=edit&fid={$fid}", 'operate_success'); } } elseif ($type == 'report') { InitGP(array('page'), 'GP', 2); $page < 1 && ($page = 1); $limit = pwLimit(($page - 1) * $db_perpage, $db_perpage); if ($forums['childid'] == 1) { foreach ($forum as $key => $value) { if ($value['fup'] == $fid) { $fiddb[] = $key; } if (in_array($value['fup'], $fiddb)) { $fiddb[] = $key; }
$db_menuinit .= ",'td_post' : 'menu_post','td_post1' : 'menu_post','td_special' : 'menu_special'"; if ($winddb['shortcut']) { $myshortcut = 'true'; } else { $myshortcut = 'false'; } if (defined('M_P') && file_exists(M_P . 'thread.php')) { require_once M_P . 'thread.php'; } require_once PrintEot('thread'); $noticecache = 900; $foruminfo['enddate'] && $foruminfo['enddate'] <= $timestamp && ($foruminfo['aidcache'] = $timestamp - $noticecache); if ($foruminfo['aidcache'] && $timestamp - $foruminfo['aidcache'] > $noticecache - 1 && ($foruminfo['startdate'] > $timestamp || $foruminfo['enddate'] && ($foruminfo['enddate'] <= $timestamp || $foruminfo['aids']))) { $foruminfo['aid'] && ($foruminfo['aids'] .= ",{$foruminfo['aid']}"); require_once R_P . 'require/updatenotice.php'; updatecache_i($fid, $foruminfo['aids']); } footer(); function getstart($start, $asc, $count) { global $db_perpage, $page, $numofpage; $limit = $db_perpage; if ($page > 20 && $page > ceil($numofpage / 2)) { $asc = $asc == 'DESC' ? 'ASC' : 'DESC'; $start = $count - $page * $db_perpage; if ($start < 0) { $limit = $db_perpage + $start; $start = 0; } return array($start, $limit, $asc, 1); } else {