本文整理匯總了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);