function print_categories($categories, $cat_id) { if ($cat_id == 0) { echo '<ul>'; foreach($categories[0] as $child_cat_id) { print_categories($categories, $child_cat_id); } echo '</ul>'; } else { echo '<li>'; if ($cat_id == $_REQUEST['cat_id']) { echo '<strong>'.$categories[$cat_id]['cat_name'].'</strong>'; } else if ($cat_id == $_REQUEST['pcat_id']) { echo '<a href="'.$_SERVER['PHP_SELF'].'?cat_id='.$cat_id.'"><b>'.$categories[$cat_id]['cat_name'].'</b></a>'; } else { echo '<a href="'.$_SERVER['PHP_SELF'].'?cat_id='.$cat_id.'">'.$categories[$cat_id]['cat_name'].'</a>'; } echo ' <small class="spacer">('.$categories[$cat_id]['num_courses'].' '; if ($categories[$cat_id]['num_courses'] == 1) { echo _AT('course'); } else { echo _AT('courses'); } echo ')</small>'; if (is_array($categories[$cat_id]['children'])) { echo '<ul>'; foreach($categories[$cat_id]['children'] as $child_cat_id) { print_categories($categories, $child_cat_id); } echo '</ul>'; } echo '</li>'; } }
_e('Posted By', 'wp-print'); ?> <u><?php the_author(); ?> </u> <?php _e('On', 'wp-print'); ?> <?php the_time(sprintf(__('%s @ %s', 'wp-print'), get_option('date_format'), get_option('time_format'))); ?> <?php _e('In', 'wp-print'); ?> <?php print_categories('<u>', '</u>'); ?> | <u><a href='#comments_controls'><?php print_comments_number(); ?> </a></u></p> <div id="BlogContent"><?php print_content(); ?> </div> <?php } ?> <hr class="Divider" style="text-align: center;" /> <?php if (print_can('comments')) {
function kategorije($greska = 0) { function print_categories($query) { $queried = mysql_query($query); $menu = '<ul>'; while ($result = mysql_fetch_array($queried)) { $menu .= '<li>' . $result['category_id'] . ' ' . $result['category_name'] . '</li>'; } $menu .= '</ul>'; return $menu; } echo print_categories("SELECT category_id, category_name FROM category"); $this->load->view('admin/view_header'); }
if ($cperm['hasdata']) { $temp = array(); $temp['categorypermissionid'] = $cperm['categorypermissionid']; $temp['categorypermissions'] = $cperm['categorypermissions']; $permscache["{$cperm['blogcategoryid']}"]["{$cperm['usergroupid']}"] = $temp; } } // get usergroup default permissions $permissions = array(); foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) { $permissions["{$usergroupid}"] = $usergroup['vbblog_general_permissions']; } echo '<center><div class="tborder" style="width: 89%">'; echo '<div class="alt1" style="padding: 8px">'; echo '<div class="darkbg" style="padding: 4px; border: 2px inset; text-align: ' . vB_Template_Runtime::fetchStyleVar('left') . '">'; print_categories($permscache, $permissions, array(), 0); echo "</div></div></div></center>"; } // ###################### Start edit category permission ####################### if ($_REQUEST['do'] == 'editcp') { $vbulletin->input->clean_array_gpc('r', array('categorypermissionid' => TYPE_UINT, 'blogcategoryid' => TYPE_UINT, 'usergroupid' => TYPE_UINT)); ?> <script type="text/javascript"> <!-- function js_set_custom() { if (document.cpform.useusergroup[1].checked == false) { if (confirm('<?php echo addslashes_js($vbphrase['must_enable_custom_permissions']); ?>
<time> <?php the_time(sprintf(__('%s @ %s', 'wp-print'), get_option('date_format'), get_option('time_format'))); ?> </time> <span> <?php _e('In', 'wp-print'); ?> <?php print_categories(); ?> | </span> <a href='#comments_controls'> <?php print_comments_number(); ?> </a> </span> </header> <div class="entry-content">
function print_categories($permscache, $permissions, $inheritance = array(), $parentid = 0, $indent = ' ') { global $vbulletin, $vbphrase; if (empty($vbulletin->vbblog['icategorycache']["0"]["$parentid"])) { return; } foreach ($vbulletin->vbblog['icategorycache']["0"]["$parentid"] AS $blogcategoryid) { echo "$indent<ul class=\"lsq\">\n"; // get current forum info $category =& $vbulletin->vbblog['categorycache']["0"]["$blogcategoryid"]; // make a copy of the current permissions set up $perms = $permissions; // make a copy of the inheritance set up $inherit = $inheritance; echo "<li><b><a name=\"category$blogcategoryid\" href=\"blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=modifycat&blogcategoryid=$blogcategoryid\">$category[title]</a></b>"; echo "$indent\t<ul class=\"usergroups\">\n"; foreach($vbulletin->usergroupcache AS $usergroupid => $usergroup) { if ($inherit["$usergroupid"] == 'col-c') { $inherit["$usergroupid"] = 'col-i'; } // if there is a custom permission for the current usergroup, use it if (isset($permscache["$blogcategoryid"]["$usergroupid"])) { $inherit["$usergroupid"] = 'col-c'; $perms["$usergroupid"] = $permscache["$blogcategoryid"]["$usergroupid"]['categorypermissions']; $cplink = 'categorypermissionid=' . $permscache["$blogcategoryid"]["$usergroupid"]['categorypermissionid']; } else { $cplink = "blogcategoryid=$blogcategoryid&usergroupid=$usergroupid"; } // work out display style $liStyle = ''; if (isset($inherit["$usergroupid"])) { $liStyle = " class=\"$inherit[$usergroupid]\""; } if (!($perms["$usergroupid"] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewcategory'])) { $liStyle .= " style=\"list-style:circle\""; } echo "$indent\t<li$liStyle>" . construct_link_code($vbphrase['edit'], "blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=editcp&$cplink") . $usergroup['title'] . "</li>\n"; } echo "$indent\t</ul><br />\n"; print_categories($permscache, $perms, $inherit, $blogcategoryid, "$indent "); echo "$indent</li>\n"; unset($inherit); echo "$indent</ul>\n"; if ($category['parentid'] == 0) { echo "<hr size=\"1\" />\n"; } } }