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)
-   -   Miscellaneous Hacks - vBISpy - AJAX real-time feed of new posts/threads (https://vborg.vbsupport.ru/showthread.php?t=233759)

Eric 01-20-2010 10:00 PM

vBISpy - AJAX real-time feed of new posts/threads
 
1 Attachment(s)
This is a port of vBISpy by MPDev to vBulletin4. MPDev has given me permission to port this modification, if any staff need to see it, I can forward the PM.


If you use this modification, please >> Mark As Installed, Nominate for MOTM, or Support Developer <<, thank you :)


What is this!?
vBISpy is an AJAX real-time feed of new posts/threads for your vBulletin 4.0 forum.

Please note that this is currently in Beta. The style is not perfect, but the mod should be fully functionial.


Current Version
2.0.4 - You can find the 3.6.x version, here.


Features flagged for future version(s):
  • looking for suggestions


Will this work on x.x.x ??
Unless otherwise stated, this will work on all 4.0.x versions. This will not work on 3.x.


Sounds cool. How do I install?
  1. Extract the zip, you should have the following directories/files:

    Code:

    /
    |_ vaispy.php

    /clientscript/
    |_ va_effects.js
    |_ va_prototype.js
    |_ va_spy.js

    /images/
            /misc/
            |_ pause_down.gif
            |_ pause_up.gif
            |_ play_down.gif
            |_ play_up.gif

  2. Upload: (in the below instructions 'yourforum' would be where you have vBulletin installed)
    • vaispy.php to /yourforum/vaispy.php
    • /clientscript/*.js to /yourforum/clientscript/*.js
    • /images/misc/*.gif to /yourforum/images/misc/*.gif


Upgrading
Unless noted otherwise, just upload and overwrite 'vaispy.php'.


Customization
Virtually all the code to customize the page is in the vaispy.php script; there are no plugins, no templates and no phrases. You do not need to do anything further; this should work right out of the box.

If you'd like to block certain usergroups from viewing vBISpy; or certain forums from being displayed - edit vaispy.php
PHP Code:

/**
* Do not list these forums even if they have 
* permissions (test categories, etc)
*
* Enter them by ID, separated by commans (eg: 1,2,3)
*/
$blockforums '';

/**
* Do not allow these groups.
*
* Enter them by ID, separated by commans (eg: 1,2,3)
*/
$blockgroups ''

In your browser, open the URL:

http://www.yourforum.com/forum/vaispy.php

You can see examples of this at:
  • Anyone wanting to list here as an example?


Note: Neither I nor MPDev claim ownership of this code except for the file vaispy.php - the rest of the files were using 'freely distributable' (although modified to suit vBISpy) sources. As such, you may use these files as you wish, but please do not remove the copyrights.


Changelog
2.0.4 - June 23, 2011
- Changed 'xml' to 'feed' when the script is requesting data via AJAX
- Updated code that checks for blocked groups and forums so that it works properly.
- Added version string (?v=) to script calls.
- Updated template html to include facebook data if enabled.
- Updated css link rendering to determine if templates are stored as files or not.

2.0.3 - March 25, 2010
- Updated alternate row colors to use stylevars.
- Added ability to block certain usergroups by editing vaispy.php.
- Fixed possible bug where in certain situations a database error would occur.

2.0.2 - January 23, 2010
- Hopefully the incorrect showthread link is now fixed.
- Added alternate row colors.
- Changed default xml delay in va_spy.js to 3000 from 7000.

2.0.1 - January 21, 2010
- Fixed issue with incorrect path to thread statusicon's
- Edits to clientscript/va_spy.js to hopefully fix issues with incorrect showthread link.
- Removed &nbsp;'s from the rows generated if displayed rows are less than 20

2.0.0 - January 21, 2010
- Ported to vBulletin4 with permission from MPDev



If you use this modification, please >> Mark As Installed, Nominate for MOTM, or Support Developer <<, thank you :)

cbehan 01-21-2010 05:08 PM

Looks very interesting...I'll test it out.

akee 01-21-2010 05:33 PM

Nice!
Thanks!
I try it now

-----edit--------

Installed, thanks

Alien 01-21-2010 06:52 PM

My members have been CRAVING to have this back.

I'll test it out and report back!

Alien 01-21-2010 07:03 PM

Apparently this is incompatible with Lynne's additional_css and additional_css2 templates made by her modification. I'd like to move to the built-in solution that vB has made but they broke it and don't call it from the usercp and other places which sucks.

I tried this with the default style though and it's killer, just needs a little style tweaking!

Thanks!

SpongeBob71 01-21-2010 07:04 PM

Works fine EXCEPT my "thread_dot.gif" is located in the correct path./

It assumes it is in the root of my website instead of the forum -->images path.

Just an FYI...

Great Job!

-Sponge

TimberFloorAu 01-21-2010 07:18 PM

We have installed. Very good.

Styling does need looking at tho :) Perhaps alternate backgrounds for each new post/thread and better definition for URL's

Excellent, thanks.

Ste

www.yobromofo.com/forum/vaispy.php

TimberFloorAu 01-21-2010 07:20 PM

Quote:

Originally Posted by Alien (Post 1962650)
Apparently this is incompatible with Lynne's additional_css and additional_css2 templates made by her modification. I'd like to move to the built-in solution that vB has made but they broke it and don't call it from the usercp and other places which sucks.

I tried this with the default style though and it's killer, just needs a little style tweaking!

Thanks!

We use Lynnes CSS , no issues. What problem do you have ??

Eric 01-21-2010 07:40 PM

Yeah, the styling needs a lot of work - it's the one thing about vB4 that will take me some getting used to :p

The main issue with styling, at least for the tables, I think is how vB has implemented the YUI reset CSS.

I'll try to get it worked out though :)

Alien 01-21-2010 07:46 PM

Quote:

Originally Posted by TimberFloorAu (Post 1962670)
We use Lynnes CSS , no issues. What problem do you have ??

Do you save CSS as files, or save CSS in the database?

If you save the CSS as files, external scripts like this and Photopost are unable to locate your custom css. They only know how to look in the default vBulletin locations as far as I can tell?

clmazin 01-21-2010 07:49 PM

Works well for me, except for this:

When it pulls up the new threads, those threads are properly linked. Older threads listed on the page, however, get a strange "t=3459" type of syntax, which does not link properly.

Any thoughts?

Otherwise, very cool!

C.

Eric 01-21-2010 07:51 PM

Quote:

Originally Posted by SpongeBob71 (Post 1962651)
Works fine EXCEPT my "thread_dot.gif" is located in the correct path./


It assumes it is in the root of my website instead of the forum -->images path.



Just an FYI...



Great Job!




-Sponge

I think I have a fix for that - looking into it now.

Quote:

Originally Posted by clmazin (Post 1962701)
Works well for me, except for this:

When it pulls up the new threads, those threads are properly linked. Older threads listed on the page, however, get a strange "t=3459" type of syntax, which does not link properly.

Any thoughts?

Otherwise, very cool!

C.

Hmm, might be the javascript in clientscript/va_spy.js - will look into this as well.

clmazin 01-21-2010 07:58 PM

Thanks for the quick support, SecondV!

C.

Eric 01-21-2010 08:14 PM

I'll have to look into this as well.

Quote:

Originally Posted by Alien (Post 1962696)
Do you save CSS as files, or save CSS in the database?

If you save the CSS as files, external scripts like this and Photopost are unable to locate your custom css. They only know how to look in the default vBulletin locations as far as I can tell?


Eric 01-21-2010 08:19 PM

Updated to 2.0.1 to attempt to fix a couple issues:

2.0.1 - January 21, 2010
- Fixed issue with incorrect path to thread statusicon's -- this appears to show the vB3 type icons... may try doing the vB4 ones, but they are larger
- Edits to clientscript/va_spy.js to hopefully fix issues with incorrect showthread link.
- Removed &nbsp;'s from the rows generated if displayed rows are less than 20

clmazin 01-21-2010 08:22 PM

Downloaded the update. Still getting the "t=xxx" syntax on older threads instead of the proper "showthread" syntax.

Status icons working though...looks good...

C.

SpongeBob71 01-21-2010 08:23 PM

MUCH better.....thank you so much! :D



-Sponge

Eric 01-21-2010 08:25 PM

Very weird.

Did you use the vB3 version at one time, was it doing the same thing? I don't beleive I really made any changes (initially) to the code that generates the link.

By chance, do you have vBSEO installed? I'm wondering if that may be affecting it at all.

Quote:

Originally Posted by clmazin (Post 1962754)
Downloaded the update. Still getting the "t=xxx" syntax on older threads instead of the proper "showthread" syntax.

Status icons working though...looks good...

C.


clmazin 01-21-2010 08:29 PM

1 Attachment(s)
This is my first install; never used it on 3.x.

vBSEO is not installed.

It appears the most recent five threads get the proper link, and the others get the t=xxxx version.

Attaching a snapshot of my installed products...

DjEddie 01-21-2010 08:56 PM

very nice mod .. will be installin soon .. just quick suggestion ...

could there be like a mini version of this made to go onto the CMS as a widget in some way?

Thanks :)

sqzdog 01-21-2010 09:23 PM

I second that! If this were a widget, I could definitely use it. Thank you!

MPDev 01-21-2010 10:10 PM

For the record, yes, I gave permission for this to be ported.

SpongeBob71 01-21-2010 10:29 PM

Oh wow....I def. second the widget idea if this is possible.

-Sponge

Eric 01-21-2010 11:09 PM

I do not have access to vB4 Suite (simply because I can't afford it), so it may prove difficult to build a widget for it, myself.

Eric 01-21-2010 11:11 PM

Quote:

Originally Posted by clmazin (Post 1962759)
This is my first install; never used it on 3.x.

vBSEO is not installed.

It appears the most recent five threads get the proper link, and the others get the t=xxxx version.

Attaching a snapshot of my installed products...

I've not been able to reproduce this with my testing - however I will try to look into the code more to see if I can find any problems.

Just out of curiosity, what browser are you using - and have you had any users noticing the same problem? Also, would you mind linking me to your forum? (you can PM if you don't want to post it publicly)

Eric 01-21-2010 11:14 PM

Quote:

Originally Posted by MPDev (Post 1962838)
For the record, yes, I gave permission for this to be ported.

:) Thanks for posting this!

Alfa1 01-22-2010 01:08 AM

Please include new group discussions into the feed. New blogs would also be awesome.

New Joe 01-22-2010 02:19 AM

I get this after installing and going to the vBISPY page:

Quote:

vBulletin Message

You have been banned for the following reason:
No reason was specified.

Date the ban will be lifted: Never
Although I'm not banned when I go back to the Forum.

patt1293 01-22-2010 02:37 AM

Quote:

Originally Posted by clmazin (Post 1962701)
Works well for me, except for this:

When it pulls up the new threads, those threads are properly linked. Older threads listed on the page, however, get a strange "t=3459" type of syntax, which does not link properly.

Any thoughts?

Otherwise, very cool!

C.

This is a quick a Dirty fix for your problem
Go into the vbispy.php and find
PHP Code:

$post_url 'showthread.php?' . ($etype == 'New Thread') ? "t=$thread[threadid]"p=$thread[lastpostid]#post$thread[lastpostid]"

Replace with this
PHP Code:

$post_url 'showthread.php?' . ($etype == 'New Thread') ? "showthread.php?t=$thread[threadid]"p=$thread[lastpostid]#post$thread[lastpostid]"


clmazin 01-22-2010 04:07 AM

Patt1293:

That did the trick! Thanks!

SecondV:

Firefox 3.5.7 on Snow Leopard.

C.

New Joe 01-22-2010 04:36 AM

Did anyone have the same problem as me?

sematopdemir 01-22-2010 04:52 AM

Thanks

New Joe 01-22-2010 06:05 AM

Quote:

Originally Posted by New Joe (Post 1963014)
I get this after installing and going to the vBISPY page:



Although I'm not banned when I go back to the Forum.

This was a user group option permission problem, this is now ok.

The new problem I have is when the forum has been left standing for 5 mins or so and a new thread is started it doesn't up date on the ispy page.

New Joe 01-22-2010 06:34 AM

I remeber having the same problem with MPDev's version, but after doing this:
Quote:

Keep in mind, this kind of script can add to your server load if alot of users are using it; it polls the lookup script every 7 seconds to give it a real-time effect; you may need to adjust this to suit your own needs.

The last line of the file:
setTimeout("getXML()", 7000);
can be changed to allow for greater periods of delay between polling.
It worked fine, I changed 7000 to 1000

But i have looked in the va_spy_js file in this new version and the above is different:
Quote:

setTimeout("getXML()", xmldelay);
Any help would be great.
Thanks.

New Joe 01-22-2010 08:16 AM

Another small bug is that when you click on the newly posted post, it will take you to the first post and first page of that Thread, instead of taking you right to the last post, the on you've just clicked on in iSpy.

DjEddie 01-22-2010 12:25 PM

Quote:

Originally Posted by SecondV (Post 1962894)
I do not have access to vB4 Suite (simply because I can't afford it), so it may prove difficult to build a widget for it, myself.

If u would like access to mine, as the widget ideas seems like a good one .. then pm me for details and ill sort u an account out ... :)

skariko 01-22-2010 12:41 PM

Quote:

Originally Posted by clmazin (Post 1962754)
Downloaded the update. Still getting the "t=xxx" syntax on older threads instead of the proper "showthread" syntax.

C.

Same here! :)

clmazin 01-22-2010 03:44 PM

Quote:

Another small bug is that when you click on the newly posted post, it will take you to the first post and first page of that Thread, instead of taking you right to the last post, the on you've just clicked on in iSpy.
Yes. If you fix that one, this mod will be really useful!

C.

Eric 01-22-2010 03:55 PM

I'll try to have a new version out within the next day or two - possibly Monday, since it's the weekend. :)

Highwayfrunkis 01-22-2010 09:46 PM

:( I can't get this to show up

edit - I got the page to show up, but when I click on a link I'm getting:

"Oops! Something is wrong. Please try again. "


All times are GMT. The time now is 06:47 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.01718 seconds
  • Memory Usage 1,851KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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