| « Conditional CSS through PHP | Quotes around blockquote » |
New item in blogroll
Adding an extra item to the menu (blogroll) in B2evolution -like the forum link in this blog- should be easy, and fortunately it is. It requires a minor hack though. The development team and especially ¥åßßå promised a solution for the 2 branche. Until that time you'll have to do with the hacks.
For 1.10 and earlier do this:
In ../blogs/skins/_bloglist.php add before:
PHP:
// Output: | |
echo $blog_list_start; | |
echo implode( $blog_list_separator, $blog_links ); | |
echo $blog_list_end; |
this piece of code:
PHP:
/* Start hack to add static links to blog bar */ | |
/* Compose the link from various existing pieces */ | |
$extra_blog_link = $blog_item_start; | |
$extra_blog_link .= '<a href="'; | |
$extra_blog_link .= 'http://www.b2evolution.net'; /* URL */ | |
$extra_blog_link .= '" class="'.$blog_other_link_class.'" title="'; | |
$extra_blog_link .= 'B2evolution website'; /* title (mouse over) */ | |
$extra_blog_link .= '">'; | |
$extra_blog_link .= $blog_other_name_before; | |
$extra_blog_link .= 'B2evolution'; /* title in label */ | |
$extra_blog_link .= $blog_other_name_after; | |
$extra_blog_link .= '</a>'; | |
$extra_blog_link .= $blog_item_end; | |
| |
/* Add to existing blogs */ | |
$blog_links[] = $extra_blog_link; | |
/* Repeat all previous steps for more links */ | |
| |
/* End hack */ |
and change it to your preferences.
You may or may not want to add 'target="_blank"' in $extra_blog_link .= '">'; like so:
PHP:
$extra_blog_link .= '" target="_blank">'; |
In B2evo v 2.1 you need to hack a quit different file: ../blogs/inc/widgets/model/_widget.class.php. Find this piece of code and add the 'Forum hack' to it:
PHP:
if( $Blog [amp]amp;[amp]amp; $l_blog_ID == $Blog->ID ) | |
{ // This is the blog being displayed on this page: | |
echo $this->disp_params['item_selected_text_start']; | |
echo $l_Blog->dget( 'shortname', 'htmlbody' ); | |
echo $this->disp_params['item_selected_text_end']; | |
echo ''; | |
echo $this->disp_params['item_selected_end']; | |
} | |
else | |
{ | |
echo $this->disp_params['item_text_start']; | |
echo $l_Blog->dget( 'shortname', 'htmlbody' ); | |
echo $this->disp_params['item_text_end']; | |
echo ''; | |
echo $this->disp_params['item_end']; | |
} | |
} | |
/* | |
* Add forum to bloglist | |
* | |
*/ | |
echo '<li><a href="http://www.forum.hemminga.net" class="default" title="Forum">Forum</a></li>'; | |
// End Forum | |
| |
echo $this->disp_params['list_end']; | |
| |
echo $this->disp_params['block_end']; |
I will update this post once the New version is out.
Happy blogging
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)