vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   [AJAX] Post Thank You Hack (https://vborg.vbsupport.ru/showthread.php?t=92410)

dinodonk 05-18-2006 06:42 AM

i do not want a postbit added when someone thanked... so i change thankspostbit to :
PHP Code:

<fieldset class="fieldset">
                    <
legend>The Following User(sSays Thank You For This Useful Post:<if condition="$bbuserinfo[usergroupid] == 6">&nbsp|&nbsp<a href="showthread.php?do=post_thanks_remove_all&amp;p=$post[postid]onclick="post_thanks_remove_all_$post[postid](); return false;">$vbphrase[post_thanks_remove]</a>
</if>&
nbsp;|&nbsp;<if condition="$post_thanks_user > 0 && $vboptions[post_thanks_delete_own] == 1">&nbsp<a href="showthread.php?do=post_thanks_remove_user&amp;p=$post[postid]onclick="post_thanks_remove_user_$post[postid](); return false;">$vbphrase[post_thanks_remove_user]</a></if></legend>
                    

<
table cellpadding="0" cellspacing="3" border="0">
                    
<
tr>

    <
td>$liste_user</td>
</
tr>

                    </
table>
            </
fieldset

and move
PHP Code:

<!-- Start Post Thank You Hack -->
$post_thanks
<!-- End Post Thank You Hack --> 

to above signature in postbit.

will that changes make any error to your hack??

Thanks!

dinodonk 05-18-2006 09:30 AM

Quote:

Originally Posted by Yorixz
Wonderful hack, really something I've been looking for.

I've got a few small problems though, because I'm trying to keep my forum a bit minimalistic (my taste ;)) I've been trying to put the list of users who thanked into a popup menu, similiar to the one you get if you click on a username.

To do this I've added a new button besides the "Reputation" one which needs to be clicked to see this menu.

The code I've used for this:
After "$post[iplogged]"
Code:

<!-- Start Modified Post Thank You Hack -->
$post_thanks
<!-- End Modified Post Thank You Hack -->

And in the template post_thanks_box I replaced the non-<script> content with
Code:

<!-- Start Modified Post Thank You Hack -->
<!-- post $post[postid] info menu -->

<div class="vbmenu_popup" id="infomenu_$post[postid]_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
                <td class="userinfo" id="post_thanks_box_$post[postid]">
                $post_thanks_box
                </td>
        </tr>
        </table>
</div>

<span id="infomenu_$post[postid]"><a href=""><img class="inlineimg" src="$stylevar[imgdir_button]/info.gif" alt="Post Info" border="0" /><script type="text/javascript"> vbmenu_register("infomenu_$post[postid]", true); </script></span>
<!-- End Modified Post Thank You Hack -->

In addition I've also removed the $spacer's out of the 'post_thanks_postbit_legacy' template.

It's working fairly well, I've got a few problems that I couldn't find a solution for though:
How can I 'extend' the hack some so I'll able to hide the info.gif image if there are no users who thanked for a post.
And how can I make sure the list will be updated when a user clicks the "Thanks" button? I'm afraid I destroyed the AJAX somewhere but can't figure out where it was.

Thanks a lot for your help, hopefully there are also other users interested in this.

Edit; reduced the template edits by one, still hoping for someone to help me fixing the bugs!

maybe you can use if with $postthanks

Abe1 05-18-2006 11:54 AM

Quote:

Originally Posted by dinodonk
i do not want a postbit added when someone thanked... so i change thankspostbit to :
PHP Code:

<fieldset class="fieldset">
                    <
legend>The Following User(sSays Thank You For This Useful Post:<if condition="$bbuserinfo[usergroupid] == 6">&nbsp|&nbsp<a href="showthread.php?do=post_thanks_remove_all&amp;p=$post[postid]onclick="post_thanks_remove_all_$post[postid](); return false;">$vbphrase[post_thanks_remove]</a>
</if>&
nbsp;|&nbsp;<if condition="$post_thanks_user > 0 && $vboptions[post_thanks_delete_own] == 1">&nbsp<a href="showthread.php?do=post_thanks_remove_user&amp;p=$post[postid]onclick="post_thanks_remove_user_$post[postid](); return false;">$vbphrase[post_thanks_remove_user]</a></if></legend>
                    

<
table cellpadding="0" cellspacing="3" border="0">
                    
<
tr>

    <
td>$liste_user</td>
</
tr>

                    </
table>
            </
fieldset

and move
PHP Code:

<!-- Start Post Thank You Hack -->
$post_thanks
<!-- End Post Thank You Hack --> 

to above signature in postbit.

will that changes make any error to your hack??

Thanks!

Try it.

dinodonk 05-18-2006 01:32 PM

Quote:

Originally Posted by Abe1
Try it.

tried.. nothing wrong, the ajax also works. Yorixz's idea is also great too but do not know if ajax is working..

b65ran 05-21-2006 12:25 AM

Quote:

Originally Posted by Smiry Kin's
when i click "Thank You" it doesnt seem to work :(

I have the same problem. After i installed vbrewrite
hack it doesn't work. Anybody please help me with it.

thanks in advanced.

Bubble #5 05-22-2006 07:08 AM

Hi Abe :) What code do we need to change to get the "The Following User Says Thank You..." message to appear on top of the 'Thank You table instead of on the side?

HuangA 05-22-2006 08:10 AM

Suggestion:
Can you please make the AJAX functions into a .js file; make the AJAX functions take postid as parameter; and pass parameter from the links instead of making copies of the function for each of the post on screen? This will DRASTICALLY reduce the bandwidth consumption by this hack as they do not require to be duplicated each time a post is displayed on the page.

kafi 05-22-2006 09:36 AM

Feature Request:

would be nice to have also reputation working only for desired forums (the same option as "Individual Forums to Have for Only First Post".

Thank you .-)

Abe1 05-22-2006 12:17 PM

Quote:

Originally Posted by Bubble #5
Hi Abe :) What code do we need to change to get the "The Following User Says Thank You..." message to appear on top of the 'Thank You table instead of on the side?

Copy the post_thanks_postbit_legacy templatge and use it to replace the whole post_thanks_postbit template.

Abe1 05-22-2006 12:20 PM

Quote:

Originally Posted by HuangA
Suggestion:
Can you please make the AJAX functions into a .js file; make the AJAX functions take postid as parameter; and pass parameter from the links instead of making copies of the function for each of the post on screen? This will DRASTICALLY reduce the bandwidth consumption by this hack as they do not require to be duplicated each time a post is displayed on the page.

I just started working with javascript and don't know how to use about 99.9% of it. I will try to make the javascript code come up only once. I can still leave it in a template but that only shows the tamplate once.


All times are GMT. The time now is 05:50 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03204 seconds
  • Memory Usage 1,781KB
  • 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
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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