function stripFidByCateid($fids, $cateid) { global $SCR, $fid; $cateid = (int) $cateid; if ($SCR == 'cate' && !$cateid) { $cateid = $fid; } if ($cateid) { $temp_forum = getForumCache(); foreach ($fids as $key => $value) { if (!isset($temp_forum[$value]) || getCateid($value) != $cateid) { unset($fids[$key]); } } } return $fids; }
$piece = $invokeService->getInvokePieceByInvokeId($key); $invokeService->updateCacheDataPiece($piece['id']); } $update_invoke = array('descrip' => $descrip); if ($invokedata['ifloop']) { @(include_once D_P . 'data/bbscache/forum_cache.php'); foreach ($loops as $key => $value) { if ($forum[$value]['type'] == 'category') { unset($loops[$key]); } } if ($cateid) { $invoke = $invokeService->getInvokeByName($name); !$invoke['loops'] && ($invoke['loops'] = array()); foreach ($invoke['loops'] as $key => $value) { if (getCateid($value) == $cateid) { unset($invoke['loops'][$key]); } } $loops = array_merge($invoke['loops'], $loops); } $update_invoke['loops'] = $loops; } $invokeService->updateInvokeByName($name, $update_invoke); adminmsg('operate_success', $basename . '&action=show&scr=' . $scr . '&showid=' . $cateid); } } elseif ($action == 'editinvoketpl') { InitGP(array('step', 'name', 'scr', 'cateid'), 'GP'); $invokedata = $invokeService->getInvokeByName($name); if ($step) { $tagcode = miniChar_cv($_POST['tagcode']);
function getCateid($fid) { global $forum; if (in_array($forum[$fid]['type'], array('sub2', 'sub', 'forum'))) { return getCateid($forum[$fid]['fup']); } elseif ($forum[$fid]['type'] == 'category') { return $fid; } else { return false; } }
$invokeService = L::loadClass('InvokeService'); $url = str_replace('=', '=', $url); $attachurl = str_replace('=', '=', $attachurl); $cimgurl = str_replace('=', '=', $cimgurl); list($invoke, $loopid) = explode(',', $invokename); $loopid = intval($loopid); $invokepiece = $invokeService->getInvokePieceByInvokeName($invoke); (empty($invokepiece) || !isset($invokepiece[$titleid])) && Showmsg('undefined_action'); $offset = (int) $offset; $mInvoke = $invokepiece[$titleid]; if ($offset < 1 || $offset > $mInvoke['num']) { $offset = 1; } $read = $db->get_one("SELECT * FROM pw_threads WHERE tid=" . pwEscape($selid)); empty($read) && Showmsg('data_error'); $cateid = getCateid($read['fid']); $fid = $read['fid']; $tid = $selid; if (!checkEditAdmin($windid, $cateid)) { Showmsg('admin_forum_right'); } $custom = array(); foreach ($mInvoke['param'] as $key => $value) { switch ($key) { case 'title': $custom[$key] = $subject; break; case 'url': $custom[$key] = $url; break; case 'descrip':