Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2777

Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2791

Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2777

Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2791

Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2777

Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2791
Link Bar 0.5
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Link Bar 0.5

  1. #1
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default Link Bar 0.5

    Link Bar
    Version: 0.5
    Author: Nick Ramsay (based on work by shibuya246)
    Created on: 2010/03/23
    Last Updated: 2010/06/03
    Tested on: 1.3.0
    Plugins Required: None
    Plug & Play: Yes
    Supported: No

    Description
    A bare bones, external link bar shown at the top of each post visited from your site.

    "Link Bar" is very basic, but very extensible. By default, it shows your site name, link to the post on your site, and a link to close the bar. The CSS is separate from the usual merged archive file that hotaru uses because most of that is unnecessary for a simple bar, but I've included a way to override the default link_bar.css file if you copy it to your own theme folder and edit it there. The link_bar_top.php template can also be customized in the usual way, by copying it to your theme.

    Developing for Link Bar
    Plugin developers can easily extend Link Bar with these hooks:
    PHP Code:
    1. $h->pluginHook('link_bar_pre_template'); // in the code, immediately before showing the template file
    2. $h->pluginHook('link_bar_top'); // at the very top of the template, before anything is output to the screen
    3. $h->pluginHook('header_meta'); // the same hook that other plugins use to change meta descriptions and keywords
    4. $h->pluginHook('link_bar_css_js'); // include your own css or javascript files
    5. $h->pluginHook('link_bar'); // after the opening BODY tag
    6. $h->pluginHook('link_bar_logo'); // within the logo section
    7. $h->pluginHook('link_bar_post'); // within the post section
    8. $h->pluginHook('link_bar_more'); // within the more section
    9. $h->pluginHook('link_bar_end'); // before the closing BODY tag 
    Hooks 5-8 return $result. If $result is empty, the default section will show (i.e. whole bar, logo, post, or more). If a positive value is returned to those hooks, then the defaults will not be shown, i.e plugins will override the defaults.

    Click image for larger version. 

Name:	link_bar_screens&#104.png 
Views:	529 
Size:	126.5 KB 
ID:	744

    Add settings to the Link Bar Settings page
    Since it would be overkill to have settings pages for each plugin that hooks into Link Bar, I've made an example to show how you can add settings to the Link Bar settings page instead of needing your own. Download the attached Link Bar Example plugin for a demonstration.

    Click image for larger version. 

Name:	link_bar_setting&#11.png 
Views:	172 
Size:	11.4 KB 
ID:	745

    -----------------------------------------------

    Link Bar

    Instructions
    1. Upload the "link_bar" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.
    3. Enable/Disable the bar for logged in or logged out users in Admin -> Plugin Settings -> Link Bar
    4. If you want RSS links to use the link bar, you need to enable RSS forwarding in Admin -> Plugin Settings -> SB Base

    Changelog
    v.0.5 2010/05/27 - Nick - Updated for compatibility with the Bookmarking plugin
    v.0.4 2010/04/09 - Nick - Added global option to disable the Link Bar for logged in or logged out users
    v.0.3 2010/03/26 - Nick - Added option in user settings to disable the Link Bar (but it's on by default)
    v.0.2 2010/03/25 - Nick - Fix to revert $h->post->origUrl so that Video Inc, etc. can use it.
    v.0.1 2010/03/23 - Nick - Released first version (based on "SocialBar" by shibuya246)

    -----------------------------------------------

    Link Bar Example (for developers)

    Instructions
    1. Upload the "link_bar_example" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.
    3. Edit the example text in Admin -> Plugin Settings -> Link Bar

    Changelog for Link Bar Example
    v.0.2 2010/4/09 - Nick - Fix for example text not updating
    v.0.1 2010/3/23 - Nick - Released first version

    -----------------------------------------------

    Link Bar Vote

    This plugin adds a working vote button to the bar. The button itself is unstyled so you'll have to do that yourself. I recommend you copy the CSS from within the lb_vote_button template into your link_bar.css file.

    Instructions for
    1. Upload the "link_bar_vote" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.

    Changelog for Link Bar Vote
    v.0.1 2010/3/25 - Nick - Released first version

    -----------------------------------------------

    Please click "Rate Thread" and give this plugin a rating. Thank you.
    Attached Files Attached Files


  2. #2
    Designer mabujo's Avatar
    Join Date
    Mar 2010
    Location
    France
    Posts
    296
    Thanks
    45
    Thanked 156 Times in 101 Posts

    Default

    Great plugin, well played!
    This is a great way to keep the user at your site.
    mabujo
    Themes : Yonda - Isis - My Hotaru sites : Arsenal News - Coming soon : More Hotaru sites and Hotaru Themes

  3. #3
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default

    I've added a Link Bar Vote plugin to the attachments section in the first post. It looks very plain, adding simply "3Vote" or "4Un-vote" before the link to the Hotaru post, but it's a working vote button. Since Link Bar doesn't use CSS/JS merging, I put the CSS directly into the template, but I recommend you copy it into link_bar.css in the main plugin. Then you can style it however you like.

  4. #4
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default

    Updated Link Bar: v.0.2 2010/3/25 - Nick - Fix to revert $h->post->origUrl so that Video Inc, etc. can use it.

    I'm now using this on my own site:

    Click image for larger version. 

Name:	japansoc_link_bar&.png 
Views:	160 
Size:	35.5 KB 
ID:	765

    The comments link was done like this:

    Just after the "link_bar_top" hook at the top of the link_bar_top.php template, put this:

    PHP Code:
    <?php $h->includeLanguage('comments'); ?>
    That will get you the language file from the Comments plugin.

    I've then modified the "link_bar_post" DIV to look like this:

    PHP Code:
                <div class="link_bar_post">
                    <?php // plugin hook
                        
    $result $h->pluginHook('link_bar_post');
                        if (!
    $result) { ?>
                            <a id="link_bar_hotaru_post" href="<?php echo $h->url(array('page'=>$h->post->id)); ?>">View this article on <?php echo SITE_NAME?></a>
                            <a id="link_bar_comments" href="<?php echo $h->url(array('page'=>$h->post->id)); ?>"><?php echo $h->countComments(false); ?></a>
                    <?php ?>
                </div>
    You can see the $h->countComments function call which fetches the comment count. The false will return (by default) "Leave a comment". If you set it to true, it will say "No comments". Otherwise, it will show the number of comments.

    Edit: Also included a fix in 0.2 for the Link Bar not working with RSS forwarding enabled.

    Edit: From Hotaru 1.1.4, the countComments function call should be this:

    PHP Code:
    $h->countComments(false$h->lang['comments_leave_comment']) 
    Or if you only want the count, with no text, just use:
    PHP Code:
    $h->countComments(); 

  5. #5
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default Show source url on hover

    With Link Bar enabled, you'll notice that you can't see the original source url in the status bar anymore so you don't know where the post has come from until you click the link. Here's a small template hack to show the original post URL when you hover over the title link:

    In both sb_list.php and sb_post.php, find

    PHP Code:
    $user->getUserBasic($h$h->post->author); 
    and on the next line, add:

    PHP Code:
    $source $h->post->origUrl
    Further down, in the show_post_title DIV, add $source as a title. i.e:

    In sb_list.php
    PHP Code:
    <a href='<?php echo $h->post->origUrl?>' title='<?php echo $source?><?php echo $h->vars['target']; ?> class="click_to_source"><?php echo $h->post->title?></a>
    In sb_post.php
    PHP Code:
    <a href='<?php echo $h->post->origUrl?>' title='<?php echo $source?><?php echo $h->vars['target']; ?>><?php echo $h->post->title?></a>

  6. #6
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default

    Updated Link Bar: v.0.3 2010/3/26 - Nick - Added option in user settings to disable the Link Bar (but it's on by default)

    After putting the Link Bar on my site, the reaction by my visitors was surprisingly negative. So, version 0.3 includes an option to disable the bar from the individual user's settings page (no template or css changes necessary).

  7. #7
    Junior Member
    Join Date
    Oct 2009
    Location
    Rhode Island
    Posts
    15
    Thanks
    6
    Thanked 3 Times in 3 Posts

    Default

    Nick, another great one.

    A couple probing questions.

    1. Do you plan to add support for up/down voting?
    2. Any chance of a tutorial on how to add the Tweet this and other viral promotion options like you are using at Japansoc?

  8. #8
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default

    Quote Originally Posted by landshark View Post
    1. Do you plan to add support for up/down voting?
    Not really. I just wanted to get some basics out for people to use as a base and modify to their liking.

    Quote Originally Posted by landshark View Post
    2. Any chance of a tutorial on how to add the Tweet this and other viral promotion options like you are using at Japansoc?
    Not really, but here's a hint: Copy the sb_base_post_extra_fields hook into your link_bar_top template. Exclude plugins with the last array, e.g:

    PHP Code:
    <?php $h->pluginHook('sb_base_show_post_extra_fields''', array(), array('tags''vote')); ?>
    Then you'd need to play with the CSS.

  9. #9
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,862
    Blog Entries
    88
    Thanks
    485
    Thanked 809 Times in 528 Posts

    Default

    I've noticed a huge drop in the number of posts I have indexed in Google. I don't know if it's because of this plugin, but it's prompted me to make this update just in case:

    Updated: Link Bar - v.0.4 2010/4/09 - Nick - Added global option to disable the Link Bar for logged in or logged out users

    I've disabled the bar for logged out users so it doesn't confuse the Googlebot.

    Also fixed a bug in Link Bar Example:

    Updated: Link Bar Example - v.0.2 2010/4/09 - Nick - Fix for example text not updating

  10. #10
    Junior Member
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    where to find : sb_list.php and sb_post.php ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I cant submit any link
    By download in forum How-To and Troubleshooting
    Replies: 37
    Last Post: 12-15-2010, 11:29 PM
  2. external link toolbar
    By baadier in forum Plugin Suggestion Box
    Replies: 13
    Last Post: 09-22-2010, 02:48 PM
  3. How to Add an Account Link
    By Gunaxin in forum How-To and Troubleshooting
    Replies: 2
    Last Post: 03-19-2010, 06:15 PM
  4. Where's the link to my profile?
    By nothingman in forum How-To and Troubleshooting
    Replies: 12
    Last Post: 11-20-2009, 01:16 PM
  5. Permalinks, Redirect 301 and Link Structure
    By carlo75 in forum How-To and Troubleshooting
    Replies: 9
    Last Post: 10-21-2009, 07:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •