vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - vBISpy - AJAX real-time feed of new posts/threads (https://vborg.vbsupport.ru/showthread.php?t=125947)

Hicksatpd 09-07-2006 09:53 PM

Here's what I have:

http://www.pacersdigest.com/forums/vaispy.php

MPDev 09-07-2006 09:58 PM

Okay, line 258 in vb_spy.js should read:

Code:

                post_url = 'showthread.php?p=' + postid + '#post' + spyid;
I've updated the zip with this fix.

Hicksatpd 09-07-2006 10:08 PM

Hmm. It's the correct link now, but for some reason I'm being bumped back to post #1. ??

Hicksatpd 09-07-2006 10:14 PM

Oh, I think I know. The link doesn't specify a page #. It's sending me to page 1, and then looking for a post that's on page 2+.

Hicksatpd 09-07-2006 10:16 PM

Well, wait, now that I tried it on a thread with only one page, it still doesn't work. It sends me to the correct post, but then I'm immediately back at post #1.

MPDev 09-07-2006 10:34 PM

Try:

Code:

post_url = 'showthread.php?p=' + spyid + '#post' + spyid;

nix 09-07-2006 10:39 PM

Yea that worked.

MPDev 09-07-2006 10:52 PM

Okay, I modified the vaispy.php script accordingly and posted it here.

Hicksatpd 09-07-2006 10:53 PM

Yep, that did it! Thank you very much for all of your work!

buro9 09-08-2006 08:04 AM

Another minor thing.

If nothing is returned, you should return the Xml with an empty root node of <events />

This will avoid invalid Xml errors being silently thrown in the JavaScript.

Simply change this in the .php file:
PHP Code:

    if ( $output )
    {
        echo 
"<events>$output</events>";
    } 

to
PHP Code:

    if ( $output )
    {
        echo 
"<events>$output</events>";
    } else {
        echo 
"<events />";
    } 

And because that will now prevent the JavaScript exception, change this in the va_spy.js file:
Code:

        try {
                events = request.responseXML.getElementsByTagName("events")[0];
                event = events.getElementsByTagName("event");
        }

        catch (e) {
                setTimeout("getXML()", 5000);
                return;
        }

to
Code:

        try {
                events = request.responseXML.getElementsByTagName("events")[0];
                event = events.getElementsByTagName("event");
                if (event.length == 0) {
                        setTimeout("getXML()", 5000);
                        return;
                }
        }

        catch (e) {
                setTimeout("getXML()", 5000);
                return;
        }

We'll actually never use that catch statement now, but no harm in being extra defensive and leaving it in there :)


All times are GMT. The time now is 03:14 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.01609 seconds
  • Memory Usage 1,744KB
  • 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
  • (2)bbcode_php_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