本文整理匯總了PHP中XoopsBlock::countSimilarBlocks方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsBlock::countSimilarBlocks方法的具體用法?PHP XoopsBlock::countSimilarBlocks怎麽用?PHP XoopsBlock::countSimilarBlocks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XoopsBlock
的用法示例。
在下文中一共展示了XoopsBlock::countSimilarBlocks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete_block
function delete_block($bid)
{
$myblock = new XoopsBlock($bid);
if ($myblock->getVar('block_type') == 'S') {
$message = _AM_SYSTEMCANT;
redirect_header('admin.php?fct=blocksadmin', 4, $message);
exit;
} elseif ($myblock->getVar('block_type') == 'M') {
// Fix for duplicated blocks created in 2.0.9 module update
// A module block can be deleted if there is more than 1 that
// has the same func_num/show_func which is mostly likely
// be the one that was duplicated in 2.0.9
if (1 >= ($count = XoopsBlock::countSimilarBlocks($myblock->getVar('mid'), $myblock->getVar('func_num'), $myblock->getVar('show_func')))) {
$message = _AM_MODULECANT;
redirect_header('admin.php?fct=blocksadmin', 4, $message);
exit;
}
}
xoops_token_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')), 'admin.php', sprintf(_AM_RUSUREDEL, $myblock->getVar('title')));
}