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 01-01-2012 09:18 PM

You have a custom style so your code will be different, you will have to figure out where things need to be. The code I provided was for the default style.

clutchthese 01-27-2012 06:58 PM

Nevamind. :)

Crimdog 04-10-2012 08:04 PM

nvm fixed :)

wishtheend 04-18-2012 10:06 PM

Anyone have any luck with 4.1.12? The 4.x instructions don't seem to work anymore. The edits in this just seem to mess it up. Tried uninstalling and reinstalling but something is a little screwy.

BirdOPrey5 04-19-2012 09:55 AM

Quote:

Originally Posted by wishtheend (Post 2321392)
Anyone have any luck with 4.1.12? The 4.x instructions don't seem to work anymore. The edits in this just seem to mess it up. Tried uninstalling and reinstalling but something is a little screwy.

Do you mean the edits in post #35 weren't working for you or the original edits in the first post? (The first post is of course for VB 3.x and not intended to work on 4.x.)

wishtheend 04-19-2012 08:32 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2321528)
Do you mean the edits in post #35 weren't working for you or the original edits in the first post? (The first post is of course for VB 3.x and not intended to work on 4.x.)

Yes, installed 7.7 and went to follow the 4.x steps in post 35/36. I'm getting an error that runs across the top, or takes me to sql error page

Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: post_thanks_navbar_search in [path]/includes/functions.php on line 4337

I uninstalled it, and then reinstalled but no luck. And when I go to edit the posbit display complete hook, the text the instructions tell to replace is not even listed.

BirdOPrey5 04-19-2012 09:49 PM

You installed or are using the VB 3.x plugin on VB 4.x. You need the VB4 version of the mod, not the VB3 version.

wishtheend 04-19-2012 10:19 PM

Thanks. I just installed 7.8.3 and the steps in #35 seem broken still. I'm not sure why there would a discrepancy, but the first 3 steps seem broken. I follow them exact and it looks like this

Screenshot 1

It looks fine with the edits not performed, just looks like the normal white box underneath the post, but any edit doesn't seem to work. Anyone else tried it 4.1.12?

ForceHSS 04-19-2012 11:45 PM

Quote:

Originally Posted by wishtheend (Post 2321738)
Thanks. I just installed 7.8.3 and the steps in #35 seem broken still. I'm not sure why there would a discrepancy, but the first 3 steps seem broken. I follow them exact and it looks like this

Screenshot 1

It looks fine with the edits not performed, just looks like the normal white box underneath the post, but any edit doesn't seem to work. Anyone else tried it 4.1.12?

this is why it does not work for you
Quote:

Originally Posted by BirdOPrey5 (Post 2321528)
(The first post is of course for VB 3.x and not intended to work on 4.x.)


wishtheend 04-20-2012 02:24 AM

Quote:

Originally Posted by ForceHSS (Post 2321760)
this is why it does not work for you

The only modifications I've made are the ones in post #35 which at least to my understanding the 4.x edits. I'm not making modifications from the first post of this thread.

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

Could someone post what it should look like after each edit? At least then I can maybe pinpoint where it's broken. For me, and on the default VB skin, the first edit on post #35 causes the regular thanks box to become some div that gets pushed behind the forum.

michal72 04-21-2012 08:55 AM

1 Attachment(s)
For me #35 is working fine on 4.1.12 .
See how it should more less look like.
Attachment 137949

Please check if post #49 will help you: https://vborg.vbsupport.ru/showpost....8&postcount=49

wishtheend 04-21-2012 04:30 PM

Quote:

Originally Posted by michal72 (Post 2322169)
For me #35 is working fine on 4.1.12 .
See how it should more less look like.
Attachment 137949

Please check if post #49 will help you: https://vborg.vbsupport.ru/showpost....8&postcount=49

Thanks, probably still seems to lie with the first edit in #35. The thank box code is says to place in there seems to mess up the formatting. I've tried it from a fresh install of 4.1.12 so not sure where the problem is. But making the first two edits causes the formatting to become all jumbled and bleeding into other parts of a post like the message body.

Merriweather 04-21-2012 08:18 PM

Thanks to everyone who took the time to post their knowledge in this thread. I just got my vB 4.1.12 working with the hacked "Likes" system pretty easily. :)

However, I use this Lightweight style for mobile device users: https://vborg.vbsupport.ru/showthread.php?t=249277

So far, I've added the "Like" button in between the "Edit" and "Reply" on my mobile style, like this:

HTML Code:

<vb:if condition="$post['editlink']"><a id="btn" href="{vb:raw post.editlink}">{vb:rawphrase edit}</a></vb:if>

<!-- Add "Like" button to mobile style -->
<a id="btn" href="post_thanks.php?{vb:raw session.sessionurl}do=post_thanks_add&amp;p={vb:raw post.postid}&amp;securitytoken={vb:raw bbuserinfo.securitytoken}">{vb:rawphrase post_thanks_thanks}</a>
<!-- End adding "Like" button -->

<vb:if condition="$post['replylink']"><a id="btn" href="{vb:raw post.replylink}" id="qrwq_{vb:raw post.postid}" rel="nofollow">{vb:rawphrase reply}</a></vb:if>

Basically, all I need are the conditionals to wrap around it so it won't show to users who don't have access to the post. I've been trying (without success) to create my own conditionals.

itilm 04-23-2012 11:03 AM

Code:

Step 2 is to change the following phrases. In Admin CP use Phrase Manager to "translate" these phrases from "Thank You" to "Like(s)":
Please Explain this step on screen shot for me please

BirdOPrey5 04-23-2012 09:07 PM

Quote:

Originally Posted by itilm (Post 2322716)
Code:

Step 2 is to change the following phrases. In Admin CP use Phrase Manager to "translate" these phrases from "Thank You" to "Like(s)":
Please Explain this step on screen shot for me please

In your Admin CP choose "Phrase Manager" from the side menu, it is under the "Languages & Phrases" group.

If you're noy sure where each phrase is use "Search in Phrases" instead. Put the phrase name in the "Search for Text" box, example: post_thanks_already

Choose the option: Phrase Variable Name Only

click find.

Click to edit the found phrase and on that page there is a box for an English translation (or whatever language you use) - Simply put in that box what you want it to say... So change "Thanks" to "Like"

Save.

Repeat for all phrases listed.

Crimdog 04-23-2012 09:38 PM

Loving this modification to the post thanks hack!

Working great.

I do have a question for you, if you don't mind pointing me in the right direction?

We use a star to like posts up next to the permalink. I'd like to have this button used as a "multi" button. In that when not liked, it's grayed (not yellow). Once you click "like" it changes to yellow. The text "remove like" would also be removed from the thanks box.

I've been digging around for a while with this conditional and haven't had any luck. Could you point me in the right direction so I could do the research? Much appreciated!

BirdOPrey5 04-23-2012 10:24 PM

Sorry swapping out images would likely involve editing the Ajax JavaScript and that is not something I am familiar with.

Crimdog 04-25-2012 10:14 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2322937)
Sorry swapping out images would likely involve editing the Ajax JavaScript and that is not something I am familiar with.

Thank you for the response.

I intend to go about this a different way :)

If possible, please review this:
PHP Code:

<!--Post Thanks Button-->
<!--
Post Thanks Button-->
<
a href="post_thanks.php?$session[sessionurl]do=post_thanks_add&amp;p=$post[postid]&amp;securitytoken=$bbuserinfo[securitytoken]id="post_thanks_button_$post[postid]"
<if condition="$vboptions[disable_ajax] != 2"onclick="return post_thanks_give($post[postid]
<if condition="
$vboptions[post_groan_integrate]">true<else />false</if>);"</if> 
<if 
condition="$display_thanks_image == 'none'">style="display:none"</if> rel="nofollow">
<
img src="$stylevar[imgdir_button]/post_like.png" alt="Like This Post" align="center" border="0" /></a>

<if 
condition="$bbuserinfo['usergroupid'] == 6 AND $post['show_thanks_remove_option']"></if>
<if 
condition="$post['show_thanks_remove_option']">
<
a href="post_thanks.php?do=post_thanks_remove_user&amp;p=$post[postid]"
<if condition="$vboptions[disable_ajax] != 2"onclick="return post_thanks_remove_user($post[postid]
<if condition="
$vboptions['post_groan_integrate']">true<else />false</if>);"</if>
<if 
condition="$display_thanks_image == ''">style="display:none"</if> rel="nofollow">
<
img src="$stylevar[imgdir_button]/post_liked.png" alt="Unlike This Post" align="center" border="0" /></a>
</if> 
<!--/
Post Thanks Button--> 

In testing this out, I've managed to get the images to display correctly to an extent. When you click the image, the image disappears, but the other image doesn't display until you refresh the page. When you refresh the page it looks fine again. Now, if you click "unlike this post", ajax refreshes immediately and you now have two images in the bar next to permalink (like and liked.png respectively) until you refresh the page.

I assume this is what you meant by the ajax function?

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

And apologies in advance, no matter what I do, copy/paste doesn't fully translate.

BirdOPrey5 04-26-2012 11:52 AM

The only work-around I could think of would be to disable AJAX in the mod completely which I don't think you'd want to do.

Crimdog 04-26-2012 11:58 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2323692)
The only work-around I could think of would be to disable AJAX in the mod completely which I don't think you'd want to do.

Yeah, that would in turn prevent the images from auto-display, which kinda defeats the purpose. :) Thanks anyway. I've got a co-worker that will assist since she writes AJAX in her sleep.

If we come up with a solution I'll be happy to let you know. Maybe someone else out there would be interested.

blueperspective 04-28-2012 08:39 PM

Is there anyone who installed/tested this thing on VB 4.1.12 ? Does it work ?

Ummm... nope, doesn't.

Maybe vB should integrate in its own code a thanks/likes option.

Merriweather 04-29-2012 11:50 PM

Quote:

Originally Posted by blueperspective (Post 2324412)
Is there anyone who installed/tested this thing on VB 4.1.12 ? Does it work ?

Ummm... nope, doesn't.

Maybe vB should integrate in its own code a thanks/likes option.

It does work if you install the right version of the mod and follow the additional info added within this thread. :)

yamahapaul 07-27-2012 10:12 AM

I've updated to the latest version and would simply like to move the box into the post. On 3.8 you can do this by simply following this step
Quote:

Originally Posted by BirdOPrey5 (Post 2217355)
The last steps are only if you want to integrate the Like box INTO the posts like on my forum.

If you do the next step is pretty easy-

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

Find the line:

Code:

eval('$template_hook[postbit_end] .= " ' . fetch_template('post_thanks_box') . '";');
and change it to:

Code:

eval('$template_hook[postbit_signature_end] .= " ' . fetch_template('post_thanks_box') . '";');
OK This will move the "Like" box into the actual post table instead of below it.

Again this is a good place to stop if you are happy.

I've gone through all the things for the 4.x change as seen here
Quote:

Originally Posted by MagicThemeParks (Post 2242426)
Post #35 and Post #36 help you with the 4.x install instructions and alternate placement. :up:

but still can't figure it out for the postbit template (not legacy), anyone got any suggestions??

AndrewSimm 08-16-2012 03:24 PM

We have found a way to get it to say "and XX others" like .org does?

Beckenbauer 08-23-2012 12:28 PM

I don't have space between the usernames. Only a comma. (vB 4.2.0)
Where ist the error?

post_thanks_postbit
Code:

<div style="font-size:11px;">
<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>
{vb:raw post.post_thanks_bit}
</div>


BirdOPrey5 08-26-2012 02:14 PM

Add tis code after each comma: &nbsp;

That will force a space.

Beckenbauer 08-26-2012 02:40 PM

Quote:

Originally Posted by Beckenbauer (Post 2359312)
I don't have space between the usernames. Only a comma. (vB 4.2.0)
Where ist the error?

post_thanks_postbit
Code:

<div style="font-size:11px;">
<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>
{vb:raw post.post_thanks_bit}
</div>


After this commas don't works.

BirdOPrey5 08-26-2012 03:07 PM

Link to a post on your site with multiple thanks (or likes)?

BirdOPrey5 08-26-2012 03:47 PM

sorry not after the commas, nevermind. It's different code somewhere else, I don't know off hand.

Beckenbauer 08-28-2012 09:56 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2360209)
sorry not after the commas,

After only this line:


Code:
---------
{vb:raw post.post_thanks_bit}
---------
So make it


Code:
---------
{vb:raw post.post_thanks_bit} &nbsp;
---------

***************

This code also don't works.

BirdOPrey5 08-29-2012 10:25 PM

Then I don't know.

McGyver 09-21-2012 04:41 AM

Quote:

Originally Posted by Beckenbauer (Post 2360812)
This code also don't works.

I think you need to fix the functions_post_thanks.php file.

Find the following in function fetch_thanks_bit (around line 218).
Code:

if ($cmpt<$number_rows)
                        {
                                $virg=",";
                        }

Add a space after the comma in the quotes and it should do the trick...

Beckenbauer 09-21-2012 11:47 PM

Quote:

Originally Posted by mgyver (Post 2367208)
I think you need to fix the functions_post_thanks.php file.

Find the following in function fetch_thanks_bit (around line 218).
Code:

if ($cmpt<$number_rows)
                        {
                                $virg=",";
                        }

Add a space after the comma in the quotes and it should do the trick...

You are a genius! Thx!

abbyxelizabeth 11-05-2012 03:41 AM

Parse error: syntax error, unexpected $end in /home/feathert/public_html/includes/class_postbit.php(345) : eval()'d code on line 52

This is the error I've gotten. How do I fix it? Any ideas?

BirdOPrey5 11-10-2012 08:17 PM

There is likely a typo in your postbit_display_start or postbit_display_complete plugin- if you can't find the error you could always reinstall the thank you mod but you will lose all customization.

MrSeth 11-12-2012 01:29 AM

Install went great thanks for everyone's input.

I would like to ask for some help on these two things..

1. removing the white space in the like box.

2. How to move the Like button to the left of or in between the "reply" or "Reply with quote"

https://vborg.vbsupport.ru/

MrSeth 11-18-2012 04:53 AM

Quote:

Originally Posted by MrSeth (Post 2380399)
Install went great thanks for everyone's input.

I would like to ask for some help on these two things..

1. removing the white space in the like box.

2. How to move the Like button to the left of or in between the "reply" or "Reply with quote"

https://vborg.vbsupport.ru/

Anychance I can get some help on this?

TinCow1 11-19-2012 01:06 PM

I'm having a formatting error that I can't figure out. Everything displays properly, with one exception. For posts with more than 6 Thanks, the list of Thanks (which is hidden behind a toggle-able spoiler-style box) no longer displays for a person who has Thanked that post. It displays perfectly fine if you haven't thanked, but once you add yourself to the list clicking the toggle button does nothing. What am I doing wrong?

Code:

<div class="postbody"<vb:if condition="$vboptions['legacypostbit']"> style="margin-{vb:stylevar left}: 0; border-left: 0px"</vb:if>>
        <div class="postrow">
        <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>
        <vb:if condition="!$vboptions['legacypostbit']">post</vb:if>
                <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>

<vb:if condition="$post['post_thanks_amount'] > 6">

<div class="smallfont" style="margin-bottom:0px"> <input type="button" value="Show List" style="width:60px;font-size:10px;margin:0px;padding:0px;float:left" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display
!= '') {this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display
= '';this.innerText = ''; this.value = 'Hide List'; } else {this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display
= 'none'; this.innerText = ''; this.value = 'Show List'; }"> </div><div class="alt1"><div style="display: none;"> &nbsp; {vb:raw post.post_thanks_bit}
</div></div>

<vb:else />
<span id="thanks">
        <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>
</span>
</vb:if>

        </div>
</div>
<hr />


bluidkiti 01-05-2013 05:51 PM

I love this. I have been looking for something like this a long time. Thank you! :)

Foxtrotelite 01-06-2013 12:07 AM

How can I move the like box into the post for 4.2? I have tried a couple code edits, but can't get it to work. I'm not sure if I'm just missing something simple or what.

Also, does anyone have a link to where I can have each "like" notify the poster his post was liked?


All times are GMT. The time now is 07:59 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.03046 seconds
  • Memory Usage 1,885KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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