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)

vktechnology 05-10-2006 05:07 PM

Uses AJAX technology so your users don't have to refresh when they thank.
--------------------
very cool feature

Yorixz 05-10-2006 06:26 PM

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!

bashy 05-10-2006 06:31 PM

Do you have a demo of your extra bit or a screener please,
Do you think you could do the same for the post groan?

Pehaps you can release yours as an add on for these 2 hacks..

Its just that my post bit is looking a tad full ya see and getting rid of the
thanks and groans amounts would be a godsend :)

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:

<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>
After "<!-- / post #$post[postid] -->"
Code:

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

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

<!-- 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>
<!-- / post $post[postid] info menu -->

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.


Yorixz 05-10-2006 06:39 PM

As soon as I've made sure all bugs are gone I'll definitely release it here (if Abe allows me, which shouldn't be too much of a problem as it's only a template edit).

You can find somewhat of a "demo" here: http://otfans.net/showthread.php?p=347708.
Code:

Logon with vBtest / test

bashy 05-10-2006 06:44 PM

wow...that is 100% brill m8...
look forward to the release if its allowed :)

Thanks for the login!

Abe1 05-11-2006 12:06 PM

Quote:

Originally Posted by Yorixz
As soon as I've made sure all bugs are gone I'll definitely release it here (if Abe allows me, which shouldn't be too much of a problem as it's only a template edit).

You can find somewhat of a "demo" here: http://otfans.net/showthread.php?p=347708.
Code:

Logon with vBtest / test

I have no problems with anyone releasing add-ons to my hacks.

Yorixz 05-11-2006 12:21 PM

I'm glad to hear that, could you also help me out some with the two problems I'm experiencing (which I posted a way up), thanks a lot.

bashy 05-13-2006 04:49 PM

Hi Yorixz I am not seeing a post_thanks_box template, i have a post_thanks_groan template though....?

Yorixz 05-13-2006 08:55 PM

I haven't got the Groan Hack installed so I don't know if/what templates it's overwriting. The post_thanks_box template is the one that has all the Javascript of the AJAX in it and at the bottom one line of HTML.

mktrilogy 05-14-2006 01:53 AM

im kinDA congfused, when u say

Do the template edits

in postbit AND postbit_lagacy:

find:
--------------------------------------------------------------------
$vbphrase[posts]: $post[posts]
--------------------------------------------------------------------

AFTER place this:
--------------------------------------------------------------------
<!-- Start Post Thank You Hack -->
<if condition="$post[userid]">
<br />
$vbphrase[post_thanks_thanks]: $post[post_thanks_user_amount]
<br />
<if condition="$post[post_thanks_thanked_times_on] == 1">
$vbphrase[post_thanks_time_post]
<else />
<if condition="$post[post_thanks_thanked_posts_on] == 1">
<phrase 1="$post[post_thanks_thanked_times]">$vbphrase[post_thanks_times_post]</phrase>
<else />
<phrase 1="$post[post_thanks_thanked_times]" 2="$post[post_thanks_thanked_posts]">$vbphrase[post_thanks_times_posts]</phrase>
</if>
</if>
</if>
<!-- End Post Thank You Hack -->
--------------------------------------------------------------------





i am using ------ Find and Replace in Templates (be careful!)-----


shoud i ------ Search for Text then =------- replace with text?

Meaning the value that u given should be replace or just add it to the variable ?

sample

$vbphrase[posts]: $post[posts] replace by <!-- Start Post Thank You Hack -->
<if condition="$post[userid]">
<br />
$vbphrase[post_thanks_thanks]: $post[post_thanks_user_amount]
<br />
<if condition="$post[post_thanks_thanked_times_on] == 1">
$vbphrase[post_thanks_time_post]
<else />
<if condition="$post[post_thanks_thanked_posts_on] == 1">
<phrase 1="$post[post_thanks_thanked_times]">$vbphrase[post_thanks_times_post]</phrase>
<else />
<phrase 1="$post[post_thanks_thanked_times]" 2="$post[post_thanks_thanked_posts]">$vbphrase[post_thanks_times_posts]</phrase>
</if>
</if>
</if>
<!-- End Post Thank You Hack -->



OR


$vbphrase[posts]: $post[posts]

then i just insert below this


<if condition="$post[userid]">
<br />
$vbphrase[post_thanks_thanks]: $post[post_thanks_user_amount]
<br />
<if condition="$post[post_thanks_thanked_times_on] == 1">
$vbphrase[post_thanks_time_post]
<else />
<if condition="$post[post_thanks_thanked_posts_on] == 1">
<phrase 1="$post[post_thanks_thanked_times]">$vbphrase[post_thanks_times_post]</phrase>
<else />
<phrase 1="$post[post_thanks_thanked_times]" 2="$post[post_thanks_thanked_posts]">$vbphrase[post_thanks_times_posts]</phrase>
</if>
</if>
</if>
<!-- End Post Thank You Hack -->


Sorry for the stupid question :)


All times are GMT. The time now is 04:55 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.01685 seconds
  • Memory Usage 1,762KB
  • 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
  • (7)bbcode_code_printable
  • (2)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