vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Show Thread Enhancements - [AJAX] Post Thank You Hack (https://vborg.vbsupport.ru/showthread.php?t=231666)

agentaeon 07-11-2012 06:30 PM

1 Attachment(s)
Attachment 139670

I am using ForceHSS' version of the hack and I have been unable to find any information regarding how to make the box where it says people have thanked for this useful post look like the attached image.

I am using a theme that takes advantage of postbit legacy.

Can someone help?

Thanks.

Hippy 07-11-2012 06:44 PM

That's because it's a article that BOP5 write look at the post of mine in the first post or my Sig. The link to it is there

Sarteck 07-17-2012 05:16 PM

I'm wracking my brains trying to figure out how to make this work after moving parts of my vB4 suite to sub-domains (the forums and the blogs).

When we click on Thanks, nothing happens except for the "Thanks" bit disappearing. When the thread is re-loaded, nothing has changed, either.

When we middle-click or otherwise open the "Thanks" in a new Tab/Window, it works fine.

I tried making a post_thanks.php file in my forums sub-directory that has the same stuff most everything else in that directory has:
PHP Code:

<?php
require_once(dirname(__FILE__) . "/vb_dir.php");
chdir($vb_dir);
require_once(
$vb_dir '/' basename(__FILE__));
?>

But it didn't change a thing. (And here I thought I was being clever. :< )



It worked great before the change to the new sub-domain. It still does not work on a clean Style. I (obviously) haven't tried disabling all my plugins, since this one would be included. XP


Am I missing something?

ForceHSS 07-18-2012 12:33 AM

Quote:

Originally Posted by Sarteck (Post 2349027)
I'm wracking my brains trying to figure out how to make this work after moving parts of my vB4 suite to sub-domains (the forums and the blogs).

When we click on Thanks, nothing happens except for the "Thanks" bit disappearing. When the thread is re-loaded, nothing has changed, either.

When we middle-click or otherwise open the "Thanks" in a new Tab/Window, it works fine.

I tried making a post_thanks.php file in my forums sub-directory that has the same stuff most everything else in that directory has:
PHP Code:

<?php
require_once(dirname(__FILE__) . "/vb_dir.php");
chdir($vb_dir);
require_once(
$vb_dir '/' basename(__FILE__));
?>

But it didn't change a thing. (And here I thought I was being clever. :< )



It worked great before the change to the new sub-domain. It still does not work on a clean Style. I (obviously) haven't tried disabling all my plugins, since this one would be included. XP


Am I missing something?

Have you tried removing and reinstalling

Sarteck 07-18-2012 03:27 AM

Quote:

Originally Posted by ForceHSS (Post 2349112)
Have you tried removing and reinstalling

No, but I did re-download, and re-installed (allowing uploaded files to overwrite the old files) with "Allow Overwrite" set when I imported the XML.

If I remove it, won't that remove the database of Thanks I already have? :(

Note that Thanking is still possible; one can still "Thank" by opening the thank link itself in a new tab/window. It's just the AJAX that seems to crap out.

ForceHSS 07-18-2012 04:23 AM

Version you are using and vb version?

ForceHSS 07-18-2012 04:26 AM

Quote:

Originally Posted by Sarteck (Post 2349148)
No, but I did re-download, and re-installed (allowing uploaded files to overwrite the old files) with "Allow Overwrite" set when I imported the XML.

If I remove it, won't that remove the database of Thanks I already have? :(

Note that Thanking is still possible; one can still "Thank" by opening the thank link itself in a new tab/window. It's just the AJAX that seems to crap out.

You said you moved parts to your sub as I said above to reinstall after removing might fix the problem as some error might of happened after the move. But it is very hard to see without site links and screenshots so can only go by what you say

Sarteck 07-18-2012 04:34 AM

I'm using 7.84. I -think- I was using 7.83 before I re-installed it, but it might have been 7.84.

vB version is 4.1.11. (Was on 4.1.10, but when we moved stuff to subdomains, there was a bug for going to the first unread post of a thread, and that was fixed in 4.1.11, so we just upgraded last night.)



I have the site on three subdomains, basically. Normal content (including CMS) is on the plain old www.domain, forums are on forums.domain, and blogs (not that it matters) are on blogs.domain.

What I "moved," well, it wasn't really a move. I left everything installed as normal. I then created a new file in my forums sub-directory on the server called post_thanks.php (originally, there was just the one on the main part of the site). I put into it the content you see above (which is the content in most files in stub directories like mine).



I will install this onto my clean testing forum tonight (I split it into sub-domains as well not too long ago), and see if the problem persists.

ForceHSS 07-18-2012 04:43 AM

Quote:

Originally Posted by Sarteck (Post 2349165)
I'm using 7.84. I -think- I was using 7.83 before I re-installed it, but it might have been 7.84.

vB version is 4.1.11. (Was on 4.1.10, but when we moved stuff to subdomains, there was a bug for going to the first unread post of a thread, and that was fixed in 4.1.11, so we just upgraded last night.)



I have the site on three subdomains, basically. Normal content (including CMS) is on the plain old www.domain, forums are on forums.domain, and blogs (not that it matters) are on blogs.domain.

What I "moved," well, it wasn't really a move. I left everything installed as normal. I then created a new file in my forums sub-directory on the server called post_thanks.php (originally, there was just the one on the main part of the site). I put into it the content you see above (which is the content in most files in stub directories like mine).



I will install this onto my clean testing forum tonight (I split it into sub-domains as well not too long ago), and see if the problem persists.

Why not have it on the one domain like all other forums. Well the problem could be because of ur setup. I am sure with a bit of recoding you can fix

Sarteck 07-18-2012 07:32 AM

Quote:

Originally Posted by ForceHSS (Post 2349167)
Why not have it on the one domain like all other forums. Well the problem could be because of ur setup. I am sure with a bit of recoding you can fix

...because it's how I have my forum set up...? O.o

You do realize that vBulletin 4.1+ allows for subdomains to separate blogs, forums, and CMS, yeah?





ANYways, back to the issue.

I altered the post_thanks.js to have the following function changed:
Code:

var post_thanks_handleFailure = function(o)
{
        if(o.responseText !== undefined)
        {
                alert(o.responseText);
        }
        else {console.debug("Here is the request object (failed): %o", o);}
}

When debugging, the response I get is:

Code:

Here is the request object (failed): Object { tId=1, status=0, statusText="communication failure"}






Ah, fixed it.





That new post_thanks.php that I put up in my forums stub directory, I put that back in, and THEN I prefixed the "sUrl" in each of the three functions with PATHS.forum+'/'. (Full code will follow at the end of this post.)

Thanks is now working just fine.










Code:

/*======================================*\
|| #################################### ||
|| # Post Thank You Hack version 7.84 # ||
|| # Original version by Abe1        # ||
|| # Updated by Forcehss              # ||
|| #################################### ||
\*======================================*/
var post_thanks_base_url = PATHS.forum+'/';
var post_thanks_handleSuccess = function(o)
{
        if(o.responseText !== undefined)
        {
                if (post_thanks_callback.object_name[o.tId] !== undefined)
                {
                        fetch_object(post_thanks_callback.object_name[o.tId]).innerHTML = o.responseText;
                }
        }
}
var post_thanks_handleFailure = function(o)
{
        if(o.responseText !== undefined)
        {
                alert(o.responseText);
        }
        else {console.debug("Here is the request object (failed): %o", o);}
}
var post_thanks_callback =
{
        success: post_thanks_handleSuccess,
        failure: post_thanks_handleFailure,
        timeout: vB_Default_Timeout,
        cache: false,
        object_name: new Array()
};
function post_thanks_give(postid, integrate)
{
        fetch_object('post_thanks_button_' + postid).style.display = 'none';
        fetch_object('post_thanks_separator_' + postid).style.display = 'none';

        if (integrate == true)
        {
                fetch_object('post_groans_button_' + postid).style.display = 'none';
        }

        var sUrl = post_thanks_base_url + 'post_thanks.php';
        var postData = 'do=post_thanks_add&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

        var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);

        post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;

        fetch_object('post_thanks_box_' + postid).style.display = '';

        return false;
}
function post_thanks_remove_all(postid, integrate)
{
        var sUrl = post_thanks_base_url + 'post_thanks.php';
        var postData = 'do=post_thanks_remove_all&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

        var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);

        post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;

        fetch_object('post_thanks_button_' + postid).style.display = ''
        fetch_object('post_thanks_separator_' + postid).style.display = '';

        if (integrate == true)
        {
                fetch_object('post_groans_button_' + postid).style.display = '';
        }

        fetch_object('post_thanks_box_' + postid).style.display = 'none';

        return false;
}
function post_thanks_remove_user(postid, integrate)
{
        var sUrl = post_thanks_base_url + 'post_thanks.php';
        var postData = 'do=post_thanks_remove_user&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

        var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);

        post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;

        fetch_object('post_thanks_button_' + postid).style.display = ''
        fetch_object('post_thanks_separator_' + postid).style.display = '';

        if (integrate == true)
        {
                fetch_object('post_groans_button_' + postid).style.display = '';
        }

        fetch_object('post_thanks_box_' + postid).style.display = 'none';

        return false;       
}



All times are GMT. The time now is 12:40 PM.

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