本文整理汇总了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')));
}