Thread: Show Thread Enhancements - [AJAX] Post Thank You Hack
View Single Post
  #1303  
Old 06-20-2007, 04:22 PM
NolF's Avatar
NolF NolF is offline
 
Join Date: Nov 2006
Location: You don't wanna know
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by adam2484
basically i'd like the names of anybody who thanks the poster to be available as a dropdown if selected. not to be visible at all times, many thanks
There are a number of ways to achieve this.

Option A (is the one I use on my site) is to use a hidden div and make it visible when you click on an image. [Warning: this system is not compatible with Opera. I have tried to use it but pressing the images with Opera doesn't seem to work sadly]

Option B is to set a profile field to indicate if you want them visible or not.

-------------
Option A
Go to post_thanks_postbit_legacy template and add at the beginning
<div id="elos_$post[postid]" style="display:none"> and </div> at the end

Now on the postbit(_legacy) add where you want to display the expansion buttons
PHP Code:
<if condition="$post['post_thanks_amount'] > 0 OR $post['post_groan_amount'] > 0">
<
img class="inlineimg" src="- image url" onclick="getElementById('elos_$post[postid]').style.display='none';" title="Close" />
<
img class="inlineimg" src="+ image url" onclick="getElementById('elos_$post[postid]').style.display='';" title="Open" />
</if> 
Delete the " OR groan.... etc" if you are not using that hack. Well it doesn't change anything but.

I have tried to use the collapse system from vbulletin, but failed to make it compatible with this.
I'm not sure if it is a problem or not, but it only works when it is pressed, meaning that if you leave the psot and come back the box will be hidden again and you will have to press the button once again to see its contents

------------
Option B
Create a profile field, maybe a list box with options (for example: Yes and NO).
Go to post_thanks_postbit_legacy template and add at the beginning
<if condittion="$post[fieldXX] == Yes"> all the code </if>
(means that if the field is = to Yes it WILL show all the code)

You could combaine it with option A tho
Go to post_thanks_postbit_legacy template and add at the beginning
PHP Code:
<if condittion="$post[fieldXX] == Yes">
<
div id="elos_$post[postid]style="display:none;">
<else />
<
div id="elos_$post[postid]style="display:">
</if>
All code
</div
Means that if the field is = to Yes then it will be hidden by default, and only when clicked on the image it will reveal its contents

-----
I could elaborate on any of this two systems if the explanation has only confused you more ^^


:::::::::::::::::..
Quote:
Originally Posted by sunnycher
I have a question! How easy or hard would it be to do this and it say Congratulations? Or Way To Go?
Just change the phrases and images to whatever you want tho show or say

Quote:
Originally Posted by Fungsten
I found this in the first two "Edit Plugins". Is it a misspelling?
I've noticed that one too, but didn't think it was important, after all the name of the plugin doesn't change anything

Quote:
Originally Posted by tekguru
Any ideas how they got duplicated in the first place?
Maybe you got slightly distracted while adding the hooks ^^

Quote:
Originally Posted by sim20
Thanks, i have used the 6.0 gold version, followed instructions but i still get no button, have double checked everything and am sure everything was uploaded correctly and all template edits were done correctly, any help please guys..
No button means that either the button image is not in the button folder of your skin, you don't have enough "permissions" to see it (thank ppl) or that the template modification regarding the button was done incorrectly
Quote:
find:
--------------------------------------------------------------------
<!-- controls -->
--------------------------------------------------------------------

AFTER place this:
--------------------------------------------------------------------
<!-- Start Post Thank You Hack -->
$post_thanks_button
<!-- End Post Thank You Hack -->
--------------------------------------------------------------------
I'm wondering do you see the other features of the thank you hack? such as the user info, or info in the user profile page?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01326 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete