vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to turn the "Post Thank You" hack into a "Likes" system similar to vBulletin.org (https://vborg.vbsupport.ru/showthread.php?t=266358)

BirdOPrey5 07-20-2011 12:54 AM

I really can't test it on 4.x right now. I know it works fine on 3.8. I would revert back to the "Thank You" hack and see if it works then- that would confirm a bug with the changed code or just a limitation of the mod itself.

Juggernaut 07-20-2011 01:16 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2222677)
I really can't test it on 4.x right now. I know it works fine on 3.8. I would revert back to the "Thank You" hack and see if it works then- that would confirm a bug with the changed code or just a limitation of the mod itself.

After checking the default postbit_display_complete plugin, it seems to be a bug with the changed code, as the reputation does work with the default code. Fixed, it seems I hadn't updated the code correctly, it was totally my fault.

Post Reader 07-21-2011 12:37 PM

BOP the problem is still there... AJAX feature is not working... when ever i click on the like button the page refreshes which in post thank you hack was not the case...

any solution?

BirdOPrey5 07-21-2011 01:04 PM

Quote:

Originally Posted by Post Reader (Post 2223195)
BOP the problem is still there... AJAX feature is not working... when ever i click on the like button the page refreshes which in post thank you hack was not the case...


any solution?

I suggest reverting back to the original Post Thank You Hack (re-install if you must and revert the templates) and see if AJAX is working before these edits are made.

Post Reader 07-21-2011 03:04 PM

have totally re installed the product but will try again now... let me do this, i'll get back to you... thank you

--------------- Added [DATE]1311308942[/DATE] at [TIME]1311308942[/TIME] ---------------

now its working fine... i have re-uploaded all files again and then imported the product.. Thanx BOP

Juggernaut 07-24-2011 01:08 AM

Quote:

Originally Posted by Tasking Mickey (Post 2217823)
I was just about to mention that, if your forum has lets say, 100 members, and you import the likes system, something like here, it would show

Likes (12): Tasking Mickey, Bird0Prey5, Lynne, Princetoon and 15 others

The 15 others, would show the other people who liked that post, it'd be much better, since it won't take up the whole post with like 20 usernames in the like box.

This would be nice, if posible. Only thing is, I don't think the vbulletin 4 version of the thanks system keeps track of the likes given and received, like the likes system here on vbulletin.org. Still way better than the original layout, in my opinion. :D

NTMID8 07-29-2011 10:02 PM

Quote:

Originally Posted by michal72 (Post 2222087)
I have modified a little bit Joe's proposal to work with vb4

The Likes box is centered under the post. How can I make it aligned left with the post and signature?

Also, I can clearly see where to change the width of the box, colors, etc, but where do I change the font and size of the text within the box?

Juggernaut 07-30-2011 01:31 AM

Quote:

Originally Posted by michal72 (Post 2222087)
I have modified a little bit Joe's proposal to work with vb4

Change post_thanks_box template to:

PHP Code:

<div <vb:if condition="!$post_thanks_box == 1"style="background-color: #f2f6f8; border: 1px ridge #417394; border-width: 1px 1px 1px 1px; padding: 2px; width:92%; margin: 

0px auto 0px auto; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; margin-top:10px; margin-bottom:0px;display:none" 
<vb:else /> 
style="background-color: #f2f6f8; border: 1px ridge #417394; border-width: 1px 1px 1px 1px; padding: 2px; width:92%; margin: 0px auto 0px auto; -webkit-border-radius: 5px; -

moz-border-radius: 5px; border-radius: 5px; margin-top:10px; margin-bottom:0px;"
</vb:if> id="post_thanks_box_{vb:raw post.postid}">
{
vb:raw post_thanks_box}
</
div

In posbit_legacy template find:
PHP Code:

<vb:if condition="$show['postedited'] || $post['signature']"

and add before:

PHP Code:

{vb:raw template_hook.postbit_messagearea_end

In Admin CP -> Plugin Manager, edit the plugin: Post Thank You Hack on hook: postbit_display_complete

Find:
PHP Code:

$template_hook['postbit_end'] .= $templater->render(); 

and replace with:
PHP Code:

    $template_hook['postbit_messagearea_end'] .= $templater->render(); 

You can also modify window's content:

In post_thanks_postbit template replace:

PHP Code:

    <h2 class="<vb:if condition="!$vboptions['legacypostbit']">post</vb:if>title">
        <
vb:if condition="$post['post_thanks_amount'] == 1">
            {
vb:rawphrase post_thanks_user_says, {vb:raw post.username}}
        <
vb:else />
            {
vb:rawphrase post_thanks_users_say, {vb:raw post.post_thanks_amount_formatted}, {vb:raw post.username}}
        </
vb:if>
    </
h2>
    <
div class="content">
        <
div id="post_thanks_bit_{vb:raw post.postid}">
            <
blockquote class="postcontent restore">
                {
vb:raw post.post_thanks_bit}
            </
blockquote>
        </
div>
    </
div

with:
PHP Code:

    <div class="content">
        <
div id="post_thanks_bit_{vb:raw post.postid}">
            <
blockquote class="postcontent restore">
                <
strong><vb:if condition="$post['post_thanks_amount'] == 1">
            {
vb:rawphrase post_thanks_user_says, {vb:raw post.username}}
        <
vb:else />
            {
vb:rawphrase post_thanks_users_say, {vb:raw post.post_thanks_amount_formatted}, {vb:raw post.username}}
        </
vb:if>
 </
strong>{vb:raw post.post_thanks_bit}
            </
blockquote>
        </
div>
    </
div

BR

This tutorial is exellent, but I've found that I can't change the background color or size of the post thanks box, no matter where I change the code. Has anybody else been able to make changes to the post thanks display?

michal72 07-30-2011 05:34 AM

Quote:

Originally Posted by Juggernaut (Post 2226653)
This tutorial is exellent, but I've found that I can't change the background color or size of the post thanks box, no matter where I change the code. Has anybody else been able to make changes to the post thanks display?

To be able to do it, first you have to modify post_thanks_postbit template.
Please try change it to:
PHP Code:

<vb:if condition="$bbuserinfo['usergroupid'] == 6 || $post['show_thanks_remove_option']">
    <
div class="smallfont" style="float:{vb:stylevar right}">
        <
vb:if condition="$bbuserinfo['usergroupid'] == 6">
            <
a href="post_thanks.php?do=post_thanks_remove_all&amp;p={vb:raw post.postid}"<vb:if condition="$vboptions['disable_ajax'] != 2"onclick="return post_thanks_remove_all({vb:raw post.postid}, <vb:if condition="$vboptions['post_groan_integrate']">true<vb:else />false</vb:if>);"</vb:if> rel="nofollow">{vb:rawphrase post_thanks_remove}</a>
        </
vb:if>
        <
vb:if condition="$bbuserinfo['usergroupid'] == 6 && $post['show_thanks_remove_option']">
            |
        </
vb:if>
        <
vb:if condition="$post['show_thanks_remove_option']">
            <
a href="post_thanks.php?do=post_thanks_remove_user&amp;p={vb:raw post.postid}"<vb:if condition="$vboptions['disable_ajax'] != 2"onclick="return post_thanks_remove_user({vb:raw post.postid}, <vb:if condition="$vboptions['post_groan_integrate']">true<vb:else />false</vb:if>);"</vb:if> rel="nofollow">{vb:rawphrase post_thanks_remove_user}</a>
        </
vb:if>
    </
div>
    </
vb:if>
 
    <
div class="content">
        <
div id="post_thanks_bit_{vb:raw post.postid}">
            <
blockquote class="postcontent restore">
                <
strong><vb:if condition="$post['post_thanks_amount'] == 1">
            {
vb:rawphrase post_thanks_user_says, {vb:raw post.username}}
        <
vb:else />
            {
vb:rawphrase post_thanks_users_say, {vb:raw post.post_thanks_amount_formatted}, {vb:raw post.username}}
        </
vb:if>
 </
strong>{vb:raw post.post_thanks_bit}
            </
blockquote>
        </
div>
    </
div

regards

PS. An appendix to post: https://vborg.vbsupport.ru/showpost....7&postcount=35

Juggernaut 07-30-2011 07:00 AM

Quote:

Originally Posted by michal72 (Post 2226708)
To be able to do it, first you have to modify post_thanks_postbit template.
Please try change it to:
PHP Code:

<vb:if condition="$bbuserinfo['usergroupid'] == 6 || $post['show_thanks_remove_option']">
    <
div class="smallfont" style="float:{vb:stylevar right}">
        <
vb:if condition="$bbuserinfo['usergroupid'] == 6">
            <
a href="post_thanks.php?do=post_thanks_remove_all&amp;p={vb:raw post.postid}"<vb:if condition="$vboptions['disable_ajax'] != 2"onclick="return post_thanks_remove_all({vb:raw post.postid}, <vb:if condition="$vboptions['post_groan_integrate']">true<vb:else />false</vb:if>);"</vb:if> rel="nofollow">{vb:rawphrase post_thanks_remove}</a>
        </
vb:if>
        <
vb:if condition="$bbuserinfo['usergroupid'] == 6 && $post['show_thanks_remove_option']">
            |
        </
vb:if>
        <
vb:if condition="$post['show_thanks_remove_option']">
            <
a href="post_thanks.php?do=post_thanks_remove_user&amp;p={vb:raw post.postid}"<vb:if condition="$vboptions['disable_ajax'] != 2"onclick="return post_thanks_remove_user({vb:raw post.postid}, <vb:if condition="$vboptions['post_groan_integrate']">true<vb:else />false</vb:if>);"</vb:if> rel="nofollow">{vb:rawphrase post_thanks_remove_user}</a>
        </
vb:if>
    </
div>
    </
vb:if>
 
    <
div class="content">
        <
div id="post_thanks_bit_{vb:raw post.postid}">
            <
blockquote class="postcontent restore">
                <
strong><vb:if condition="$post['post_thanks_amount'] == 1">
            {
vb:rawphrase post_thanks_user_says, {vb:raw post.username}}
        <
vb:else />
            {
vb:rawphrase post_thanks_users_say, {vb:raw post.post_thanks_amount_formatted}, {vb:raw post.username}}
        </
vb:if>
 </
strong>{vb:raw post.post_thanks_bit}
            </
blockquote>
        </
div>
    </
div

regards

PS. An appendix to post: https://vborg.vbsupport.ru/showpost....7&postcount=35

Thank you Michal, but the plugin edit you provided seems to have stopped working with vbulletin 4.1.5, I can't get the edit to funcion.

Edit: it still works great, I had overlooked one of the template edits.


All times are GMT. The time now is 07:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01482 seconds
  • Memory Usage 1,852KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete