$content_per_page = $userdata['content_per_page']; $HTTP_SESSION_VARS['content_per_page'] = $content_per_page; } else { $content_per_page = $HTTP_SESSION_VARS['content_per_page']; } } else { $content_per_page = $HTTP_GET_VARS['content_per_page']; $HTTP_SESSION_VARS['content_per_page'] = $content_per_page; if ($HTTP_SESSION_VARS['content_per_page'] == -1) { $HTTP_SESSION_VARS['first_content'] = 0; } elseif ($HTTP_SESSION_VARS['first_content'] + $HTTP_SESSION_VARS['content_per_page'] > $category->get_content_amount()) { $HTTP_SESSION_VARS['first_content'] = intval($category->get_content_amount() / $HTTP_SESSION_VARS['content_per_page']) * $HTTP_SESSION_VARS['content_per_page']; } } $smarty->assign('content_per_page', $content_per_page); $contents = get_content_of_cat($HTTP_GET_VARS['cat_id'], $HTTP_SESSION_VARS['first_content'], $content_per_page, &$viewable_amount); $smarty->assign('viewable_total_content', sprintf($lang['viewable_total_content'], $viewable_amount, $category->get_content_amount())); include "includes/view_thumbs.php"; // build navigtion if ($content_per_page > 0) { $i = 0; while ($i * $content_per_page < $viewable_amount) { $cat_nav_links[] = $i * $content_per_page; $i++; } // only assign if there is more than 1 page if (sizeof($cat_nav_links) > 1) { $smarty->assign('cat_nav_links', $cat_nav_links); } $smarty->assign('first_content', $HTTP_SESSION_VARS['first_content']); if ($HTTP_SESSION_VARS['first_content'] + $content_per_page >= $viewable_amount) {
function set_catgroup_id($new_catgroup_id, $recursive = false) { global $userdata; if ($this->id == 0 or check_cat_action_allowed($this->catgroup_id, $userdata['user_id'], 'edit')) { $this->catgroup_id = $new_catgroup_id; if ($recursive) { $child_content = get_content_of_cat($this->id); foreach ($child_content as $content) { $content->set_contentgroup_id($new_catgroup_id); $content->commit(); } $child_cats = get_cats_of_cat($this->id); foreach ($child_cats as $cat) { $cat->set_catgroup_id($new_catgroup_id, $recursive); $cat->commit(); } } return OP_SUCCESSFUL; } else { return OP_NP_MISSING_EDIT; } }
$vals['lock'] = $HTTP_POST_VARS['lock'][$i]; $vals['rotate'] = $HTTP_POST_VARS['rotate'][$i]; $vals['rotate_mode'] = $HTTP_POST_VARS['rotate_mode'][$i]; $vals['unlink'] = $HTTP_POST_VARS['unlink'][$i]; $vals['link'] = $HTTP_POST_VARS['link'][$i]; $vals['to_cat'] = $HTTP_POST_VARS['to_cat']; $vals['move'] = $HTTP_POST_VARS['move'][$i]; $vals['change_group'] = $HTTP_POST_VARS['change_group'][$i]; $vals['to_contentgroup'] = $HTTP_POST_VARS['to_contentgroup']; $vals['delete'] = $HTTP_POST_VARS['delete'][$i]; $contents[$i]->edit_content($vals, $cat_id); } } $smarty->assign('mode', 'view'); $smarty->assign('edited', true); $contents = get_content_of_cat($cat_id); } // check if user is allowed to unlink from this cat if ($mode == 'edit') { $smarty->assign('mode', 'edit'); if (is_object($category)) { $smarty->assign('allow_content_remove', check_cat_action_allowed($category->get_catgroup_id(), $userdata['user_id'], 'content_remove')); } // Check if user has rights to add content to a cat (zu irgendeiner) //dass auch $add_to_cats_unparsed = get_cats_data_where_perm('id,name', 'content_add'); $add_to_cats = get_cats_string($add_to_cats_unparsed); if (is_array($add_to_cats)) { $smarty->assign('allow_link', true); $smarty->assign('add_to_cats', $add_to_cats); }