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)

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.


All times are GMT. The time now is 12:38 AM.

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.01454 seconds
  • Memory Usage 1,772KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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