Page 7 of 8 FirstFirst 1 2 3 4 5 6 7 8 LastLast
Results 91 to 105 of 107
Like Tree48Likes

Sidebar-Blocks on forum home for like feature

This is a discussion on Sidebar-Blocks on forum home for like feature within the General Discussion forums, part of the vBSEO SEO Plugin category; Originally Posted by Hendricius If we could have this for vBadvanced, this would be awesome :-). I managed to get ...

  1. #91
    Senior Member
    Real Name
    Bernard
    Join Date
    Aug 2007
    Location
    Friendswood, TX
    Posts
    184
    Liked
    2 times
    Quote Originally Posted by Hendricius View Post
    If we could have this for vBadvanced, this would be awesome :-).
    I managed to get it to work. Here's how I did it (it may not be the optimal solution, but it seems to be working fine as far as I can tell):

    Create a .php file with the following code and upload it to your /modules folder (I will call it recentlikes.php for reference here):
    PHP Code:
    <tr><td class="alt1"><span class="smallfont"><?php

    if(VBSEO_ENABLED

    vbseo_extra_inc('ui'); 
    echo 
    vBSEO_UI::likes_block('latest'); 


    ?></span></td></tr>
    Next, from your ACP, add the following template with the name vbseo_likes_widget (this template is missing from the 3x vBSEO XML import file, if you are running vB 4x, you will need to modify the existing template):
    Code:
    <vb:each from="likes" key="l_contentid" value="post">
    <if condition="$blocktype == 'topthread'">
    <h5 class="widget_post_header"><a href="showthread.php?t=$post[threadid]" class="title">$post[title]</a></h5>
    <div class="meta">
    $vbphrase[vbseo_liked]: $post[vbseo_likes] $vbphrase[vbseo_liked_times]
    </div>
    <elseif condition="$blocktype == 'toppost'" />
    $vbphrase[vbseo_like_post] $vbphrase[vbseo_by]
    <a class="comments_member_avatar_link" href="member.php?u=$post[userid]">$post[username]</a>
    <h5 class="widget_post_header"><a href="showthread.php?p=$post[postid]" class="title">$post[title]</a></h5>
    <div class="meta">
    $vbphrase[vbseo_liked]: $post[likes] $vbphrase[vbseo_liked_times]
    </div>
    <else />
    <a href="$vboptions[bburl]/member.php?u=$post[l_from_userid]">$post[l_from_username]</a> likes <a href="$vboptions[bburl]/member.php?u=$post[to_userid]">$post[to_username]</a>'s post in:
    <h5><a href="$vboptions[bburl]/$post[url]" class="title">$post[gtitle]</a></h5>
    Liked $post[likedate] @ <span class="time">$post[liketime]</span>
    <hr />
    </if>
    </vb:each>
    Note that this template code is only updated for the <else> block corresponding to the recent likes. If you want to build a module for top likes or whatever, you will need to edit the template accordingly.

    Next, create a new vBA php module. Select recentlikes.php (or whatever you called it) from the list. Add vbseo_likes_widget to the Templates Used field. Select Yes to Clean file output. Save and add to a page to test.
    I'm using vbSEO for my precious metals forum.

  2. #92
    Junior Member Nacho Vidal's Avatar
    Real Name
    Nacho Vidal
    Join Date
    Feb 2011
    Location
    Kidderminster, UK
    Posts
    23
    Liked
    5 times
    Hi Brian,

    Is there any way to increase he Likes count from 5 to 10?

    Also, the entries in the standard PHP widget appear to be padded over to the right? Is there any way to get them to line up to the left? If not then no probs!

    Cheers as always!

    Nach

  3. #93
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You would need to edit the raw query to change it from 5 to 10.
    The area should also be fully styled as well, to allow for any customizations you want to do via css. An element inspector tool bar is very helpful in this. I don't have the actual classes off hand.

  4. #94
    Junior Member Nacho Vidal's Avatar
    Real Name
    Nacho Vidal
    Join Date
    Feb 2011
    Location
    Kidderminster, UK
    Posts
    23
    Liked
    5 times
    Quote Originally Posted by Brian Cummiskey View Post
    You would need to edit the raw query to change it from 5 to 10.
    Would you hate me if I asked how? LOL!

    As for the styling, sod that...that can wait, just need more likes!!! My forum guys are addicted to this Likes stuff!

  5. #95
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    Assuming you are using the latest block (otherwise change that word to what you have) try changing
    Code:
    return vBSEO_UI::likes_block('latest');
    to

    Code:
    return vBSEO_UI::likes_block('latest',10);

    If that doesn't work, you will need to edit
    functions_vbseo_ui.php
    Code:
    public static function likes_block($blocktype, $perpage = 5)
    to
    Code:
    public static function likes_block($blocktype, $perpage = X)
    where X is the desired count

  6. #96
    Junior Member Nacho Vidal's Avatar
    Real Name
    Nacho Vidal
    Join Date
    Feb 2011
    Location
    Kidderminster, UK
    Posts
    23
    Liked
    5 times
    Quote Originally Posted by Brian Cummiskey View Post
    If that doesn't work, you will need to edit
    functions_vbseo_ui.php
    Code:
    public static function likes_block($blocktype, $perpage = 5)
    to
    Code:
    public static function likes_block($blocktype, $perpage = X)
    where X is the desired count
    The above did the trick as I was using the Most Liked threads with a 7 day reset on what is displayed.

    Cheers Brian, you're a genius!

  7. #97
    Junior Member
    Real Name
    Tran Tai
    Join Date
    Nov 2011
    Posts
    4
    Liked
    0 times
    Hi all,
    Please help me to add a "Top Likes received user" or "Top Likes received user/ posts"
    Rgds,
    vinase.com

  8. #98
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    The code is on the first page. You'll need to be more specific if you're having problems with it.

  9. #99
    Junior Member
    Real Name
    Tran Tai
    Join Date
    Nov 2011
    Posts
    4
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk View Post
    Hello,

    you can create those blocks in admincp with "Content type" set to "PHP", "Template to Use" set to "block_html" and the code for "Top Liked Threads":
    PHP Code:
    if(VBSEO_ENABLED)
    {
    vbseo_extra_inc('ui');
    return 
    vBSEO_UI::likes_block('topthread');

    and for "Recent Likes":
    PHP Code:
    if(VBSEO_ENABLED)
    {
    vbseo_extra_inc('ui');
    return 
    vBSEO_UI::likes_block('latest');

    Quote Originally Posted by Brian Cummiskey View Post
    The code is on the first page. You'll need to be more specific if you're having problems with it.
    You mean the code above?
    I'm not a expert of coding, anyone can help me for a "Top likes received Member/User" ?
    Many thanks

  10. #100
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You need to place that into the vb blocks manager.

    AdminCP -> Settings -> Options -> Forum Sidebar and Block Options -> Enable sidebar
    AdminCP -> Forums & Moderators -> Forum Blocks Manager -> Add sidebar

  11. #101
    Junior Member
    Real Name
    Tran Tai
    Join Date
    Nov 2011
    Posts
    4
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    You need to place that into the vb blocks manager.

    AdminCP -> Settings -> Options -> Forum Sidebar and Block Options -> Enable sidebar
    AdminCP -> Forums & Moderators -> Forum Blocks Manager -> Add sidebar
    I already know to do the sidebar. But I need a Code of Top Members who received Likes. I search on vbseo.com but there is only topthread, latestthread , but I can not find TOP users!

  12. #102
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You will need to make your own 'case' statememnt in the code and write the query for that. there's a couple examples in this thread.

  13. #103
    Junior Member
    Real Name
    Tran Tai
    Join Date
    Nov 2011
    Posts
    4
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    You will need to make your own 'case' statememnt in the code and write the query for that. there's a couple examples in this thread.
    But I'm not a Coder :( ! it's impossible to make a code ! terrible.

  14. #104
    Senior Member
    Real Name
    husam
    Join Date
    Mar 2008
    Posts
    180
    Liked
    16 times
    how to exclude certain forum to appear in the block?

    note : i don't want to disable the like in these forum

    only i want to prevent its appearance in the block

    thanks

  15. #105
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    It is not supported on current installation and i doubt it will be supported in future versions. However feel free to request this as a feature request.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

Page 7 of 8 FirstFirst 1 2 3 4 5 6 7 8 LastLast

Similar Threads

  1. vBulletin 3.x vbSEO blocks private forum
    By designguy in forum Troubleshooting
    Replies: 1
    Last Post: 08-15-2010, 10:32 PM
  2. Description and keywords on home and forum home
    By Zagis in forum General Discussion
    Replies: 3
    Last Post: 07-29-2008, 03:27 PM
  3. How to have forum blocks like the attached picture?
    By HiSoC8Y in forum vBSEO.com Styles
    Replies: 2
    Last Post: 02-27-2008, 07:57 PM

Posting Permissions

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