本文整理汇总了PHP中Sections::count_for_owner方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::count_for_owner方法的具体用法?PHP Sections::count_for_owner怎么用?PHP Sections::count_for_owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::count_for_owner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
* @author Bernard Paques
* @author GnapZ
* @author Christophe Battarel [email]christophe.battarel@altairis.fr[/email]
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
include_once '../comments/comments.php';
// initiate the wall
// the maximum number of personal sections per user
if (!isset($context['users_maximum_managed_sections'])) {
$context['users_maximum_managed_sections'] = 0;
}
// count sections owned by this surfer
$existing_sections = Sections::count_for_owner();
// load the skin before assessing permissions
load_skin('sections');
// surfer has to be an authenticated member --not accessible to subscribers
if (!Surfer::is_member()) {
$permitted = FALSE;
} elseif (Surfer::is_associate()) {
$permitted = TRUE;
} elseif ($existing_sections >= $context['users_maximum_managed_sections']) {
$permitted = FALSE;
} else {
$permitted = TRUE;
}
// do not always show the edition form
$with_form = FALSE;
// the path to this page
示例2: array
//
// my sections
//
$sections = '';
// managed sections
//
// the list of assigned sections
if (!$zoom_type || $zoom_type == 'sections') {
// build a complete box
$box = array('top' => array(), 'bottom' => array(), 'text' => '');
// the maximum number of personal sections per user
if (!isset($context['users_maximum_managed_sections'])) {
$context['users_maximum_managed_sections'] = 0;
}
// offer to extend personal spaces
if (Surfer::is($item['id']) && Surfer::is_member() && (Surfer::is_associate() || $context['users_maximum_managed_sections'] > Sections::count_for_owner())) {
Skin::define_img('SECTIONS_ADD_IMG', 'sections/add.gif');
$box['top'] += array('sections/new.php' => SECTIONS_ADD_IMG . i18n::s('Create a new web space'));
}
// associates can assign editors and readers
if (Surfer::is_associate()) {
Skin::define_img('SECTIONS_SELECT_IMG', 'sections/select.gif');
$box['top'] += array('sections/select.php?anchor=user:' . $item['id'] => SECTIONS_SELECT_IMG . i18n::s('Assign sections'));
}
// count the number of articles for this user
$count = Sections::count_for_user($item['id']);
if ($count) {
$box['bottom'] += array('_count' => sprintf(i18n::ns('%d section', '%d sections', $count), $count));
}
// navigation commands for articles
$home = Users::get_permalink($item);