Search Results for 'Hide Admin'
-
Search Results
-
Topic: Hide Plugins from WPMU users
is there a plugin that will allow me to hide plugins from my users, in the same way that in Site Admin I can hide themes? I don’t want someone inadvertantly trying to use a BP plugin on their blog within my wpmu community.
Hi,
I would like to have an option to ignore someone in the activity stream or report unwanted behavior to a mod. The 2nd option might be more complicated but I think both are pretty important on bigger sites:
An example: http://img96.imageshack.us/img96/2088/ignore.png
ignore: hides future status updates/activity from the user in question. When you want to view his/her stream again it should be done through his/her profile page: “stop ignoring this person”
report: reports the user to an moderator/admin.
I’ve been trying to get my admin theme panel gui working so that my users can select from a list of their categories, in order to choose which categories to exclude from the homepage loop.
I believe that I am very close, but can’t seem to get the output correct.
Here is where I am:
I have the following code inside my theme functions file admin panel
// CUSTOM LOOP (homepage)
function category_loopes($options) {
$cats = get_categories('hide_empty=0');
foreach ($cats as $cat) {
$options[] = array( "name" => $cat->cat_name,
"desc" => "Check this box if you wish to exclude this category of articles from the homepage display",
"id" => "zoo_cat_box_".$cat->cat_ID,
"std" => "",
"type" => "checkbox");
}
return $options;
}I then have the ‘selector’ code as:
$options[] = array( "name" => "Homepage Categories to Exclude from homepage articles",
"type" => "heading");
$options = category_loopes($options);Ok so far so good…
What this gives me is another panel in my wp theme admin where it actually lists the categories properly, with a checkbox next to each one.
The user is able to select the categories to exclude and they are saved.
The database has entries in the options table like:
zoo_cat_box_4 true
zoo_cat_box_3 false
Perfect… so i am getting a true in the database for each category to exclude, so far so good.
The problem:
I have to modify the homepage loop to exclude those categories, that part is not working.. Here is the function I am trying for that.
// Custom loops
function get_exclude_categories_loop($labelz) {
$labelz = "zoo_cat_box_";
$include = array();
$counter = 0;
$cats = get_categories('hide_empty=0');
foreach ($cats as $cat) {
$counter++;
if ( get_option( $labelz.$cat->cat_ID ) == 'true') {
$excludecats[] = $cat->cat_ID;
}
}
if(!empty($excludecats)){
$excludecats = implode(',',$excludecats);
}
return $excludecats;
}Finally I place the following on the homepage:
<?php {
$args=array(
'paged'=>$paged,
'category__not_in' => get_option('get_exclude_categories_loop'),
);
};
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post();
?>What is happening is that I am seeing all the posts from all the categories on the homepage. It is not excluding the ones I wish it to.
I’m guessing that something is either wrong with my final function, or I am not filtering the loop properly.
Would a code ninja mind taking a peek?
(I know this is not bp related, more wp, but once I learn this, I plan on using the same logic to exclude bp groups from the listings)
sorry for such a long post, I’m really trying hard to learn this stuff the right way….