This hack allows you to choose which blogs appear in your all blog, which is quite useful if you run a multi-user blog system as each user can have their own Blog All (which could include their main blog and linkblog etc)
Probably the best way to do this is by using a pseudo stub file for each blog all
Create a stub with the following code :-
PHP:
| <?php |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
| $blog = 2; |
| |
|
|
|
|
| |
|
|
|
|
| $show_statuses = array(); |
| |
|
|
|
|
| |
|
|
|
|
| $linkblog_cat = ''; |
| |
|
|
|
|
| $linkblog_catsel = array( ); |
| |
|
|
|
|
| $timestamp_min = ''; |
| |
|
|
|
|
| $timestamp_max = 'now'; |
| |
|
|
|
|
| |
| <span style="color:red"> |
|
|
| </span> |
| |
| |
| <span style="color:red">$am_blog_all['include_blogs'] = array(31,119); |
| <span style="color:red">$blog=1; |
| |
| |
|
|
|
|
|
|
| require_once dirname(__FILE__).'/conf/_config.php'; |
| |
| require $inc_path.'_blog_main.inc.php'; |
| ?> |
Next, crack open inc/_blog_main.inc.php and make the following change :-
PHP:
|
|
| <span style="color:red"> if( empty( $am_blog_all ) ) $am_blog_all = array();</span> |
| $MainList = & new ItemList( |
| $blog, $show_statuses, $p, $m, $w, $cat, $catsel, $author, $order, |
| $orderby, $posts, $paged, $poststart, $postend, $s, $sentence, $exact, |
| $preview, $unit, $timestamp_min, $timestamp_max, $title, $dstart<span style="color:red">, '#', $am_blog_all</span> ); |
Finally, crack open inc/model/_itemlist.class.php and make the following changes :-
PHP:
|
|
| if( !empty($this->ItemQuery->where) ) |
| { |
| $where = 'WHERE '.$this->ItemQuery->where.$where; |
| } |
| else |
| { |
| $where = 'WHERE 1 '.$where; |
| } |
| |
| <span style="color:red"> if( !empty( $params['include_blogs'] ) ) $where .= ' and cat_blog_ID in ('.implode( ',', $params['include_blogs'] ).')'; |
|
|
|
|
|
|
Cool huh? ;)
¥
Recent comments