Recent Topics

1 Nov 30, 2005 05:22    

Problem: I've noticed that the commonly used Blog List code respects the Blog Setting for Listing in Public Blog Listing set in the admin area of each Blog, the code which generates the Categories Listing on the 'All' blog does not respect this setting.

Question: Is there a way in which the categories listing for the all blog can be coded to check this permission for each blog before generating the listing.

Thanks

Blog listing code:

if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );

	
if( ! $display_blog_list )
	{	// We do *not* want the blog list to be displayed
		return;
	}

	


# this is what will start and end your blog links
	if(!isset($blog_list_start)) $blog_list_start = '<div class="menuBox">';				
	if(!isset($blog_list_end)) $blog_list_end = '</div>';				
	

# this is what will separate your blog links
	if(!isset($blog_item_start)) $blog_item_start = '';				
	if(!isset($blog_item_end)) $blog_item_end = "\n";
	

# This is the class of for the selected blog link:
	if(!isset($blog_selected_link_class)) $blog_selected_link_class = 'menuItem';
	

# This is the class of for the other blog links:
	if(!isset($blog_other_link_class)) $blog_other_link_class = 'menuItem';
	

# This is additionnal markup before and after the selected blog name
	if(!isset($blog_selected_name_before)) $blog_selected_name_before = '';				
	if(!isset($blog_selected_name_after)) $blog_selected_name_after = '';
	

# This is additionnal markup before and after the other blog names
	if(!isset($blog_other_name_before)) $blog_other_name_before = '';				
	if(!isset($blog_other_name_after)) $blog_other_name_after = '';
	
# This is the blogparam that will be displayed as the name:
	if(!isset($blog_name_param)) $blog_name_param = 'name';
	

# This is the blogparam that will be displayed as the link title:
	if(!isset($blog_title_param)) $blog_title_param = 'name';
	
	/**
	 * We now call the default bloglist handler...
	 * However you can replace this file with the full handler (in /blogs) and customize it!
	 */
	require get_path('skins').'/_bloglist.php';

?>

Categories code:

if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );

# You can customize the following as you wish:
if(!isset($cat_all)) $cat_all = 'All'; // Set to empty to hide
# global category list delimiters:
if(!isset($cat_main_start)) $cat_main_start = '';
if(!isset($cat_main_end)) $cat_main_end = '';
# Category delimiters:
if(!isset($cat_line_start)) $cat_line_start = '<li>';
if(!isset($cat_line_end)) $cat_line_end = '</li>';
if(!isset($cat_line_checkbox)) $cat_line_checkbox = false;
# Category group delimiters:
if(!isset($cat_group_start)) $cat_group_start = '<ul>';
if(!isset($cat_group_end)) $cat_group_end = '</ul>';
# When multiple blogs are listed on same page:
if(!isset($cat_blog_start)) $cat_blog_start = '<h4>';
if(!isset($cat_blog_end)) $cat_blog_end = '</h4>';

/**
 * We now call the default categories handler...
 * However you can replace this file with the full handler (in /blogs) and customize it!
 */
require get_path('skins').'/_categories.php';

?>

2 Nov 30, 2005 06:43

No need to post an entire file since most of us who'll be able to answer have seen them before eh?

Take a look at skins/_categories.php and look for this bit:

		{ # by uncommenting the following lines you can hide some blogs
			// if( $curr_blog_ID == 2 ) continue; // Hide blog 2...

Removing the first // from the second line would exclude blog 2 cats from displaying in the categories section of blog #1. You can hide multiple blogs by simply duplicating the line for each of the blogs you want to keep out of that display. Unfortunately it isn't automatically done based on if the blog is included in the bloglist.

3 Nov 30, 2005 07:31

re: code post - noted
For completeness I thought that others trying to solve this issue may find it useful to know what we were chatting about, and I take your point. Anyone reading this and doing this should be able to find these files.

URL: http://testing.nthview.com/index.php?blog=1

Follow on: my thought was that since the _bloglist.php code (or something it 'calls') is able to discern a blog that should not be in the public listing that this same 'code' would be able to be incorporated into the _categories.php code and thereby solve this issue. Seems an odd thing that they are not in sync.

Thanks Again!

BTW - paypal donate button is not working don't know if it is their end or yours


Form is loading...