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)

Abe1 05-22-2006 12:21 PM

Quote:

Originally Posted by kafi
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 .-)

I'll add this to the 'list'.

Hornstar 05-23-2006 12:01 AM

I had 4.2 do i need to do any template changes if i install 4.4 and which ones?

Or do i need to do the lot again?

Abe1 05-23-2006 02:39 AM

Quote:

Originally Posted by hornstar1337
I had 4.2 do i need to do any template changes if i install 4.4 and which ones?

Or do i need to do the lot again?

Just re-upload the xml file.

rmxs 05-23-2006 09:21 AM

hello i install it before some weeks nice hack byt can someone tell me how to remove from every post at the bottom the Who Said Thanks:

I get this in every post..
I have select to thanks only in first post byt i get the Who Said Thanks:in all posts

HuangA 05-23-2006 09:40 AM

Abe1:
Thanks for following up the request :) here's a little starter on how to make it so that you only really need it once. I've edited the postbit_button template to the following (it still comes up multiple times, but it only really need to be created 'once' at the top because its a function with parameters). It doesn't work yet because I am not familiar with call back functions, and I can't figure out how to pass the pid variable to the call back functions. If there's any AJAX guru or javascript expert who can help fix the rest, we can safely move the majority of the code to a separate .js file which can be cached by user browser and we can reduce the bandwidth usage by a lot (imagein the segment of code appear only once in a cached js VS appearing in html for each post appearing on page).

Code:

<script type="text/javascript">
<!--
function post_thanks_give( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                alert('state ready pid: ' + pid);
                alert('state: ' + do_thanks_button.handler.readyState);
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_' + pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_ajax&p='+pid)
       
        do_thanks_add = new vB_AJAX_Handler(true)
        do_thanks_add.onreadystatechange = function () {
                if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_add.handler.responseText
                }
        }
        do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}

function post_thanks_remove_all( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)
       
        do_thanks_remove_all = new vB_AJAX_Handler(true)
        do_thanks_remove_all.onreadystatechange = function () {
                if (do_thanks_remove_all.handler.readyState == 4 && do_thanks_remove_all.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_all.handler.responseText
                }
        }
        do_thanks_remove_all.send('showthread.php?do=post_thanks_remove_all_ajax&p='+pid)
}

function post_thanks_remove_user( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)

        do_thanks_remove_user = new vB_AJAX_Handler(true)
        do_thanks_remove_user.onreadystatechange = function () {
                if (do_thanks_remove_user.handler.readyState == 4 && do_thanks_remove_user.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_user.handler.responseText
                }
        }
        do_thanks_remove_user.send('showthread.php?do=post_thanks_remove_user_ajax&p='+pid)
}

document.write('<a href="#" id="post_thanks_button_$post[postid]" onclick="post_thanks_give( $post[postid] ); return false;"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>');
//-->
</script>
<noscript>
<a href="showthread.php?do=post_thanks_add&amp;p=$post[postid]"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>
</noscript>

Problems with the above so far: the call back doesn't work, so it doesn't properly achieve the ajax effect, and the remove functions doesn't work for whatever reason... do NOT, I repeat do NOT deploy / test the above on your production board. Hopefully someone can fine tune it to work and this hack would be perfect ;)

Abe1 05-23-2006 12:07 PM

Quote:

Originally Posted by rmxs
hello i install it before some weeks nice hack byt can someone tell me how to remove from every post at the bottom the Who Said Thanks:

I get this in every post..
I have select to thanks only in first post byt i get the Who Said Thanks:in all posts

That is very interesting. Try running all the re-counters for this hack. You can find them in the ACP under maintenance.

Abe1 05-23-2006 12:12 PM

Quote:

Originally Posted by HuangA
Abe1:
Thanks for following up the request :) here's a little starter on how to make it so that you only really need it once. I've edited the postbit_button template to the following (it still comes up multiple times, but it only really need to be created 'once' at the top because its a function with parameters). It doesn't work yet because I am not familiar with call back functions, and I can't figure out how to pass the pid variable to the call back functions. If there's any AJAX guru or javascript expert who can help fix the rest, we can safely move the majority of the code to a separate .js file which can be cached by user browser and we can reduce the bandwidth usage by a lot (imagein the segment of code appear only once in a cached js VS appearing in html for each post appearing on page).

Code:

<script type="text/javascript">
<!--
function post_thanks_give( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                alert('state ready pid: ' + pid);
                alert('state: ' + do_thanks_button.handler.readyState);
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_' + pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_ajax&p='+pid)
       
        do_thanks_add = new vB_AJAX_Handler(true)
        do_thanks_add.onreadystatechange = function () {
                if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_add.handler.responseText
                }
        }
        do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}

function post_thanks_remove_all( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)
       
        do_thanks_remove_all = new vB_AJAX_Handler(true)
        do_thanks_remove_all.onreadystatechange = function () {
                if (do_thanks_remove_all.handler.readyState == 4 && do_thanks_remove_all.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_all.handler.responseText
                }
        }
        do_thanks_remove_all.send('showthread.php?do=post_thanks_remove_all_ajax&p='+pid)
}

function post_thanks_remove_user( pid )
{
        do_thanks_button = new vB_AJAX_Handler(true)
        do_thanks_button.onreadystatechange = function () {
                if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
                {
                        fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
                }
        }
        do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)

        do_thanks_remove_user = new vB_AJAX_Handler(true)
        do_thanks_remove_user.onreadystatechange = function () {
                if (do_thanks_remove_user.handler.readyState == 4 && do_thanks_remove_user.handler.status == 200)
                {
                        fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_user.handler.responseText
                }
        }
        do_thanks_remove_user.send('showthread.php?do=post_thanks_remove_user_ajax&p='+pid)
}

document.write('<a href="#" id="post_thanks_button_$post[postid]" onclick="post_thanks_give( $post[postid] ); return false;"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>');
//-->
</script>
<noscript>
<a href="showthread.php?do=post_thanks_add&amp;p=$post[postid]"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>
</noscript>

Problems with the above so far: the call back doesn't work, so it doesn't properly achieve the ajax effect, and the remove functions doesn't work for whatever reason... do NOT, I repeat do NOT deploy / test the above on your production board. Hopefully someone can fine tune it to work and this hack would be perfect ;)

I'll try to figure this out when I have time. Right now I'm working on something for my 'Form Hack'. Something that can generate a form so people who dont understand php or html be able to get a custom form for their site.

Milad 05-25-2006 12:46 AM

Google clicks Thanks Button ...

So I added the green text to post_thanks_button template

Code:

<a href="showthread.php?$session[sessionurl]do=post_thanks_add&amp;p=$post[postid]" id="post_thanks_button_$post[postid]" onclick="post_thanks_give_$post[postid](); return false;" rel="nofollow">$post_thanks_button_image</a>

Abe1 05-25-2006 01:40 AM

Quote:

Originally Posted by Milad
Google clicks Thanks Button ...

So I added the green text to post_thanks_button template

Code:

<a href="showthread.php?$session[sessionurl]do=post_thanks_add&amp;p=$post[postid]" id="post_thanks_button_$post[postid]" onclick="post_thanks_give_$post[postid](); return false;" rel="nofollow">$post_thanks_button_image</a>

Why would it click 'thanks'? Only if you have a userID will the thanks link show. So if google is searching, the that button and link wont be there.

Milad 05-25-2006 01:46 PM

the visitors don't see the button picture but the link is still existing
take a look at the source of this page http://www.basharialep.com/forum/showthread.php?t=1259

HTML Code:

<a href="showthread.php?do=post_thanks_add&amp;p=14350" id="post_thanks_button_14350" onclick="post_thanks_give_14350(); return false;" rel="nofollow"></a>
I added rel="nofollow" but spiders are still clicking it :(

Thanks for your help


All times are GMT. The time now is 04:06 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.01657 seconds
  • Memory Usage 1,797KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (5)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