本文整理汇总了PHP中s::inArray方法的典型用法代码示例。如果您正苦于以下问题:PHP s::inArray方法的具体用法?PHP s::inArray怎么用?PHP s::inArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s
的用法示例。
在下文中一共展示了s::inArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getForumHtml
function getForumHtml($type)
{
global $_G, $db_plist, $db_tlist, $groupid, $db_filterids;
if (!s::inArray($type, array('thread', 'special'))) {
return array('', '', '');
}
$forumadd = $forumcache = '';
$notAllowedFids = $db_filterids ? explode(',', $db_filterids) : array();
//* include pwCache::getPath ( D_P . "data/bbscache/forumcache.php" );
extract(pwCache::getData(D_P . "data/bbscache/forumcache.php", false));
$_forumsService = L::loadClass('forums', 'forum');
/* @var $_forumsService PW_Forums */
if ($forums = $_forumsService->getsNotCategory()) {
foreach ($forums as $rt) {
$allowvisit = !$rt['allowvisit'] || $rt['allowvisit'] != str_replace(",{$groupid},", '', $rt['allowvisit']) ? true : false;
if ($rt['f_type'] == 'hidden' && $allowvisit) {
$forumadd .= "<option value=\"{$rt['fid']}\"> |- {$rt['name']}</option>";
} elseif ($rt['password'] || !$allowvisit || S::inArray($rt['fid'], $notAllowedFids)) {
$forumcache = preg_replace("/\\<option value=\"{$rt['fid']}\"\\>(.+?)\\<\\/option\\>\\r?\\n/is", '', $forumcache);
}
}
}
if ($_G['allowsearch'] > 1) {
$t_table = '';
if ($db_plist && count($db_plist) > 1) {
$p_table = "<select name=\"ptable\">";
foreach ($db_plist as $key => $val) {
$name = $val ? $val : ($key != 0 ? getLangInfo('other', 'posttable') . $key : getLangInfo('other', 'posttable'));
$p_table .= "<option value=\"{$key}\">" . $name . "</option>";
}
$p_table .= '</select>';
}
if ($db_tlist) {
$t_table = '<select name="ttable">';
foreach ($db_tlist as $key => $value) {
$name = !empty($value['2']) ? $value['2'] : ($key == 0 ? 'tmsgs' : 'tmsgs' . $key);
$t_table .= "<option value=\"{$key}\">{$name}</option>";
}
$t_table .= '</select>';
}
}
return array($forumcache, $p_table, $t_table, $forumadd);
}