PDA

View Full Version : Add-On Releases - vBISpy - AJAX real-time feed of new posts/threads


Pages : [1] 2 3 4

MPDev
06 Sep 2006, 14:53
After seeing the http://www.digg.com/spy application; I wondered if this could be done for vBulletin as well. I came across this webpage (http://blablist.crowdiq.com/iqueue/votespy_howto.jsp) which had a "how to" on how they built a similiar application to do the same thing. Taking a page from their book (i.e. the code), I modified it for use with vBulletin.

During development, I also came across this post (http://www.vbulletin.org/forum/showthread.php?t=113435&highlight=spy) here on vBulletin.Org where the very subject had already been discussed.

So I put this together; a simple ZIP file with a single PHP script, three javascript files and 4 images.

Installation

. UNZIP the file into your forums directory
. That's it!

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.

In your browser, open the URL:

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

You can see examples of this at:

http://www.viperalley.com/forum/vaispy.php
http://www.extremefitness.com/forum/vaispy.php

Note: I claim no ownership of this code except for the file vaispy.php - the rest of the files were using 'freely distributable' sources. As such, you may use these files as you wish, but please do not remove the copyrights.

This modification is for vBulletin 3.6 only, if you are running vBulletin 3.5 you will need to see this thread (http://www.vbulletin.org/forum/showthread.php?t=126027).

JOIN THE vBIspy Network!
Once you have this mod installed, you can join the vBIspy network (http://www.vbispy.com) to have your threads appear on this site; the vBIspy Network is a great way for people to see what's going on in various vBulletin communities and for forum owners to promote their sites and generate new traffic.

Optional add-ons

Who's Online mod for this: http://www.vbulletin.org/forum/showthread.php?t=126209

vBAdvanced Module: http://www.vbulletin.org/forum/showthread.php?t=126421

UPDATES
1.0.4
Added buro9's code from here (http://www.vbulletin.org/forum/showpost.php?p=1070584&postcount=130)

1.0.5 - 9.9.06
Modified some JavaScript in va_spy.js to remove split strings

1.0.6 - 9.10.06
Added date cuffoff code from here (http://www.vbulletin.org/forum/showpost.php?p=1071270&postcount=153) and changed init() to spyinit() - changed vaispy.php and va_spy.js files.

1.0.7 - 9.12.06
va_spy.js: Added a forum url variable to allow for integration with portals or other products outside the forum directory
va_spy.js: Added xmldelay variable at top of script for easier configuration or repolling
Updated files: vaispy.php, vb_spy.js

1.0.8 - 9.13.06
vaispy.php - changed code for checking for forum permissions to include password protected forums, added javascript tag for script code

1.0.9 - 9.16.06
vaispy.php
va_spy.js
va_effects.js
- modified to allow for proper display in Opera browsers and moved more html into vaispy.php to allow for stylevars, trimmed va_effects.js to remove unused code (ForumDog's suggestions (http://www.vbulletin.org/forum/showpost.php?p=1076094&postcount=226), except not using templates yet), changed way threads are parsed (removes html as well)

1.0.10 - 9.17.06
va_prototype.js - removed 20kb of unused code

1.1.11 - 9.25.2006
vaispy.php
va_spy.js
- added SirAdrian's mods for thread status icons and alternating row colors
- added code to prepopulate the first 10 rows with existing threads allowing for 5 new ones to be added in scrolling mode (versus scrolling starting from the first thread).
- added option to display subscribed threads only

1.1.12 - 9.26.2006
vaispy.php
- added code to add empty rows if initial pull has less than 20 rows.

MPDev
06 Sep 2006, 14:55
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.

Enjoy.

Cheertobi
06 Sep 2006, 15:05
Great stuff, does it check the forumspermissions?!

Tobi

MPDev
06 Sep 2006, 15:07
Yes, forum permissions are checked. You can also exclude specific forums by changing the line:

// Do not list these forums even if they have permissions (test categories, etc)
$blockforums = "26,13";

in vaispy.php - I use this to block test post forums and such.

-=Sniper=-
06 Sep 2006, 15:09
cool :)

Cheertobi
06 Sep 2006, 15:10
Great, right now, it does not dispay anything, but there are new post!

MPDev
06 Sep 2006, 15:15
Make sure you uploaded all your files properly into their respective directories; the javascript clients are required.

ericgtr
06 Sep 2006, 15:17
I am having the same problem here, the page shows up fine and the .js files are being called without any errors, only nothing shows up.

FFW
06 Sep 2006, 15:22
Working fine for me here (http://www.ureshi-now.com/forums/vaispy.php). Only thing I had to change was the forum title -- the php file contains the title of your site (Viper Alley).

Thanks a lot MPDev :)

Cheertobi
06 Sep 2006, 15:23
All files are uploaded and in the right directories!

MPDev
06 Sep 2006, 15:25
http://www.extremefitness.com/forum/vaispy.php

I just uploaded the files to here and it worked right out of the box. If you post a URL, I'll take a look using the Firefox JavaScript console.

ericgtr
06 Sep 2006, 15:27
Sure, the only thing I changed was the title http://www.guitarblast.com/vaispy.php All the .js files are in the clientscript directory.

MPDev
06 Sep 2006, 15:29
Okay, redownload and upload the vaispy.php script; when I loaded your page it didn't like an ampersand in the title.

Error: not well-formed
Source File: http://www.guitarblast.com/vaispy.php?do=xml&r=0.9394500932840069&_=
Line: 45, Column: 34
Source Code:
<title>Perfect Strangers (mange & Fredrik)</title>---------------------------------^

I added a call to htmlspecialchars_uni for the title and forum names.

Cheertobi
06 Sep 2006, 15:31
You also can check (http://www.cheerforum.de/vaispy.php) it here :-D

Tobi

MPDev
06 Sep 2006, 15:33
Working for me, Cheertobi. You, too, Ericgtr.

Cheertobi
06 Sep 2006, 15:33
Yep, I just uploaded the new files ;)

Thanks!

ericgtr
06 Sep 2006, 15:35
Okay, redownload and upload the vaispy.php script; when I loaded your page it didn't like an ampersand in the title.

Error: not well-formed
Source File: http://www.guitarblast.com/vaispy.php?do=xml&r=0.9394500932840069&_=
Line: 45, Column: 34
Source Code:
<title>Perfect Strangers (mange & Fredrik)</title>---------------------------------^

I added a call to htmlspecialchars_uni for the title and forum names.
Excellent, that fixed it, thanks! So how is this tracking exactly, I can see it updates in time intervals so each update will show when a user is viewing different forums, etc?

Zachariah
06 Sep 2006, 15:36
woohoo more Ajax
:D

janjalani
06 Sep 2006, 15:38
sweet! installed and working fine!

MPDev
06 Sep 2006, 15:39
No, it's just doing a single query to get new posts/threads; that's all. It's a global thing (with permissions), so it doesn't require looking at any specific forum.

I have ideas for future use and how to filter what you see; but this gets everyone started.

And was meant to be as simple as possible to get running. ;)

DementedMindz
06 Sep 2006, 15:39
nice work MPDEV but whats up with your sites title in the explorer bar? <title>ViperAlley iSpy</title> also if you use things like vBMicrostats http://www.vbulletin.org/forum/showthread.php?t=116027 they dont work.

MPDev
06 Sep 2006, 15:43
I removed the name from the ZIP, just an oversight.

janjalani
06 Sep 2006, 15:43
when I rename vaispy.php to spy.php it doesnt work anymore :(

djwins
06 Sep 2006, 15:43
Is this 3.6 only? I'm on 3.5.4 and get this mysql error:

Invalid SQL:

## GET LATEST THREADS ##
SELECT thread.*, post.pagetext AS preview
FROM thread AS thread
LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN post AS post ON(post.postid = thread.lastpostid)
WHERE open <> 10 AND thread.lastpostid > 0
AND forumid NOT IN (0,42)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
ORDER BY lastpost
DESC LIMIT 10;

MySQL Error : Unknown column 'thread.lastpostid' in 'where clause'
Error Number : 1054

EDIT: Yeah 'thread.lastpostid' is new in 3.6 :(

MPDev
06 Sep 2006, 15:44
It won't work it you rename the file without changing the code.

I don't have 3.5x to run it on for testing.

janjalani
06 Sep 2006, 15:45
oh! how to make it slower?

DementedMindz
06 Sep 2006, 15:45
if you use things like vBMicrostats http://www.vbulletin.org/forum/showthread.php?t=116027 they dont work its not picking that up for some reason.

ericgtr
06 Sep 2006, 15:49
when I rename vaispy.php to spy.php it doesnt work anymore :(
You also have to change it in the va_spy.js file.

ericgtr
06 Sep 2006, 15:50
BTW, I clicked the install button. This mod is slicker than a safeway chicken! :D

dirtycrow
06 Sep 2006, 15:51
i know you said it checks forum permissions, but how about password protected forums?

dirtycrow
06 Sep 2006, 16:02
answered my own question. it lets you view new posts and threads in forums that are simply password protected.

lasto
06 Sep 2006, 16:12
hmm looks good - one question MPdev could it pull the first img file from the first post in the thread as well ?

Boots
06 Sep 2006, 16:27
If I am logged in this shows nothing... if I logout it works fine.. any ideas?

DementedMindz
06 Sep 2006, 16:31
Yeah i can see it when im logged out lol and it looks horrible on internet explorer it looks like it has a bunch of lines under the last table

DementedMindz
06 Sep 2006, 16:39
seems like a nice way to kill someones site would be to dos this page. maybe you could make it so only registered user can see it or have some sort of permissions?

Adrian Schneider
06 Sep 2006, 16:39
Not bad... I'm glad someone finally made it (after seeing the request thread).

The only thing that would be better is if it read from the session table, but that would be a larger undertaking because you'd have to convert the location field to URL and then fetch the threadID, postID, etc like vBulletin does in WOL. Usergroup permissions (even hardcoded) is a must for this BTW.

ChrisSy
06 Sep 2006, 17:01
Aww man, this is just the kind of hack i was looking for!

Has anyone installed this on a large board yet? Im interested to know about server load.

MPDev
06 Sep 2006, 17:28
answered my own question. it lets you view new posts and threads in forums that are simply password protected.

You can try changing line 46 in vaispy.php to - I dont have any password protected forums.

if (($forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND verify_forum_password($forum["forumid"], null, false)) {

MPDev
06 Sep 2006, 17:37
seems like a nice way to kill someones site would be to dos this page. maybe you could make it so only registered user can see it or have some sort of permissions?

If I wanted to DDOS someone's site I would only have to call any one of the number of vBulletin scripts repeatedly.

da420
06 Sep 2006, 17:41
Very nice. Will install after work. :)

Trana
06 Sep 2006, 18:09
Nice hack.

It would be even cooler if you had some sort of fading background color for the table cells or div tags, so you could easily see what was new.

MPDev
06 Sep 2006, 18:15
I made a slight change to vaispy.php to wrap words a little better and removed my own preg_reaplce to use vB's code to remove quotes.

Boots
06 Sep 2006, 18:53
any idea why it won't work if I'm logged in?

MPDev
06 Sep 2006, 18:54
Sorry, no idea.

DementedMindz
06 Sep 2006, 19:00
If I wanted to DDOS someone's site I would only have to call any one of the number of vBulletin scripts repeatedly.


ok so you have no plans on making this members only or giving it permissions?

MPDev
06 Sep 2006, 19:10
I would consider it; although I would expect adding a couple lines of code to the script would take care of it (after the global.php include).

if ( !$vbulletin->userinfo['userid'] )
{
print_no_permission();
}

would suffice.

voteforbird
06 Sep 2006, 19:35
Mine definitely isn't working:
http://www.volconvo.com/forums/vaispy.php

It's displaying just the one batch of posts, and the posts are from random times (like yesterday or months ago). What's going on?

nymyth
06 Sep 2006, 19:53
Works great on my site... www.jaydabhi.com/forum/vaispy.php

Peace

Acers
06 Sep 2006, 20:37
a small fix...
in the by tab you have the userid pointing to the userid of the thread starter. It should be pointing to the guy who made the post..

change this in viaspy.php
find
SELECT thread.*, post.pagetext AS preview

make it
SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid




then find
<userid>{$thread['postuserid']}</userid>

replace with
<userid>{$thread['lastpuserid']}</userid>


grt addon though :) congrats :D

ps: i have it only for selected usergroups. For those who want permissions can simply do this

add this below
require_once('global.php') line in viaspy.php

//set up usergroup permissions for view

if (!is_member_of($vbulletin->userinfo , #usergroups to check#))
{
print_no_permission();
}

or


//set up usergroup permissions for view
$groupstocheck = explode(',', $vbulletin->options['spy_usergroups']);
if (!is_member_of($vbulletin->userinfo , $groupstocheck))
{
print_no_permission();
}


where spy_usergroups is admincp setting(make a new setting in admincp with same name) which contains comma separated list of allowed usergroups.(crude fix, best is to make a product and bitfield:D)

MPDev
06 Sep 2006, 20:55
I modified the va_spy.js and vaispy.php script to include the change above and also add a date stamp to the entry.

Hellmonkeys
06 Sep 2006, 21:09
Very cool mod, but a few comments:
* Fix the 'on' before dates Today and Yesturday, for example: "on Today 03:07 PM" -- that just doesn't sound right.

* Somehow add a drop-down quick reply or something along this nature to reply to the post.

EDIT: Also, you should make it so the image directory goes to the image directory of the current template, and not the /images/ directory in the root vBulletin install.

EDIT #2: For thoes who want to do this manually, replace all occurances of: images/misc WITH $stylevar[imgdir_misc] in vaispy.php

EDIT #3: There are also images in the va_spy.js that show up AFTER you pause it, and it won't work to replace thoes... I dunno, I don't have time to investigate right now.

nymyth
06 Sep 2006, 21:26
^^ I was just about to post edit2...lol....

Peace

Cheertobi
06 Sep 2006, 21:37
MPDev, with your new code I got:

Username
on null

But no timestamp...

Tobi

Get Shorty
06 Sep 2006, 21:44
This is great! I wonder how much it affects server load, though. I have a pretty small forum that I'll try it on soon. :)

BamaStangGuy
06 Sep 2006, 21:54
Not working for me here: http://www.mustangevolution.com/forum/spy.php

Pathor
06 Sep 2006, 21:57
It doesnīt work in IE6. Can anybody confirm that?

nymyth
06 Sep 2006, 21:57
^^did you make sure u uploaded the javascript files into the clientscript folder??

Peace

BamaStangGuy
06 Sep 2006, 21:58
I cant get it to work in either firfox or IE6 for my site.

nymyth
06 Sep 2006, 22:00
^^works fine in IE for me....

Peace

Cheertobi
06 Sep 2006, 22:01
I cant get it to work in either firfox or IE6 for my site.
You changed the name of the php file! As far as I know you also have to do this in some of the javascript files. Maybe you forgot to do this?!

Tobi

BamaStangGuy
06 Sep 2006, 22:05
You changed the name of the php file! As far as I know you also have to do this in some of the javascript files. Maybe you forgot to do this?!

Tobi
I tried it both ways, with default viaspy and this one. Plus none of the Javascript files reference the name of the file

BamaStangGuy
06 Sep 2006, 22:06
^^works fine in IE for me....

Peace
On my site?

nymyth
06 Sep 2006, 22:07
^^va_spy.js is the only javascript file that would need to be edited if you change the name of the php file.

Peace

BamaStangGuy
06 Sep 2006, 22:09
^^va_spy.js is the only javascript file that would need to be edited if you change the name of the php file.

Peace
Thanks I missed it

BamaStangGuy
06 Sep 2006, 22:14
Feature request: Parse Smilies :)

nymyth
06 Sep 2006, 22:14
Thanks I missed it
Seems to be working on your site....good stuff

Peace

nymyth
06 Sep 2006, 22:15
Feature request: Parse Smilies :)
yeah and parse images, spoiler tags, hide tags....etc...LOL

Peace

MPDev
06 Sep 2006, 22:17
I've made a couple more slight modifications to the vaispy.php and va_spy.js files - format changes and some slight enhancements for an integration package I am working on.

Pathor
06 Sep 2006, 22:17
^^did you make sure u uploaded the javascript files into the clientscript folder??

Peace

Yeah, because it works in firefox. ;)

MPDev
06 Sep 2006, 22:18
Smilies are probably okay; I think images would be obnoxious.

nymyth
06 Sep 2006, 22:19
Yeah, because it works in firefox. ;)
Is it everyones browser or just yours, maybe you have js disabled in IE

Smilies are probably okay; I think images would be obnoxious.
Is there anyway we can have urls to images parsed to read IMAGE IS LOCATED HERE instead of the whole url??

Peace

BamaStangGuy
06 Sep 2006, 22:22
Smilies are probably okay; I think images would be obnoxious.
Yea I wouldnt want images. But smilies would make it alot nicer than just the text

Cheertobi
06 Sep 2006, 22:23
Mhh, I still get no date, just null ;(

MPDev
06 Sep 2006, 22:23
Maybe, right now I have bb codes turned off because of potential formatting issues; big text, etc. But it is something we can play around with as we go.

Pathor
06 Sep 2006, 22:35
Is it everyones browser or just yours, maybe you have js disabled in IE

I think itīs a browser-bug. Iīll test it on another PC. ;)

Lizard King
06 Sep 2006, 22:56
There is a template bug with Opera , also is it possible to move templates to regular vbulletin templates ? So we can customize the look etc :)

MPDev
06 Sep 2006, 23:00
Templates are not that simple using this foundation because html code is included in the javascript files and as such, the layout in the javascript has to match the layout for the page - which is why I didn't put these into a template to begin with. But, with time, it could be possible.

In the meantime, you can modify the va_spy.js and vaispy.php scripts to customize the look.

Lizard King
06 Sep 2006, 23:14
Is it also possible to add poster avatars ? and admin - mod only visible actions like edit message , edit thread , move thread , delete message etc...

Doing test for last 15 min with 20 user keeping the page open and browsing the page and no increase in server load at all.

Great mod

Jon_Simmonds
06 Sep 2006, 23:43
nice, do you have any issues if i change the filename? (allready done so on my pc server but not done so on a public one, so i know it works!)

Jeordie015
06 Sep 2006, 23:57
Is there a way to make the thread title link to the latest post instead of the first post in the thread?

Acers
07 Sep 2006, 03:33
do this..
in vaispy.php find

<postid>{$thread['firstpostid']}</postid>

replace that with

<postid>{$thread['lastpostid']}</postid>

thats should be there as default actually.

voteforbird
07 Sep 2006, 03:46
Anyone know why mine won't work?

chadlyou812
07 Sep 2006, 04:38
can anyone help me? it isn't working for me???

http://www.deviousthreads.com/boards/vaispy.php

thanks!

MPDev
07 Sep 2006, 04:51
can anyone help me? it isn't working for me???

http://www.deviousthreads.com/boards/vaispy.php

thanks!

Powered by vBulletin Version 3.5.1

You are installed a mod from the vBulletin 3.6 forum on a vB3.5 forum.

I haven't released a 3.5 version yet.

MrNase
07 Sep 2006, 05:54
Is it using jQuery..? I have made something similar with it. :)

IMHO it's only good for very active forums. Or you have to wait a long time till someone makes a new thread/post. ;)

Cheertobi
07 Sep 2006, 08:01
IMHO it's only good for very active forums. Or you have to wait a long time till someone makes a new thread/post. ;)
Jap, it is kind of boring in my forums :-D

Tobi

da420
07 Sep 2006, 08:02
Installed, and very nice, But,

You know what would be cool?

You did every users move. So someone went into a thread, or user CP, or whatever, it would show it.

My opinion anyways, good job.

maroceve
07 Sep 2006, 11:38
not werkin on firefox here.

Boots
07 Sep 2006, 13:23
For those of you not working, logout of your forum and see if it works.

Allan
07 Sep 2006, 13:41
Yep nice ;)

It's possible to show it elsewhere ? (forumhome)

MPDev
07 Sep 2006, 14:43
I have posted a version for vB3.5 users at:

http://www.vbulletin.org/forum/showthread.php?t=126027

maroceve
07 Sep 2006, 15:31
even after logging out nothing

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

MPDev
07 Sep 2006, 15:34
Everyone should use Firefox to use the JavaScript console so they can see any errors or load the script with the "?do=xml" flag to see their output.

maroeve, your getting an error on the views item which contains "47&nbsp;059" - why do the number of views contain a space?

http://www.maroceve.com/forums/vaispy.php?do=xml

maroceve
07 Sep 2006, 15:38
i dunno ;( ?

Jon_Simmonds
07 Sep 2006, 15:46
I did have some java in my navber (well under it as a banner..) removing $navbar from the vaispy.php got it working on my main site (dont have banners on my test one) not yet took a proper look at things to work out why having the banner there breaks things though

amnesia623
07 Sep 2006, 16:43
I have a really weird problem...

I had some RSS feeds a while back. I since have deleted the feed, the forum topic, and user that posted the feed. But with this script, I am seeing the topics from the old feed as if they are still being pulled.

http://www.lakehavasucity.net/community/vaispy.php

*now that I think back, it seems I remember deleting the user the feed was posting from and the forum topic it was posting, but didn't delete the feed in the CP. But I look in the admin cp and the feed isn't there.

weird.

EDIT - Solved this (i think) by deleting the RSS feeds from the database

kompakt
07 Sep 2006, 17:10
I have the 3.5 version linking to threads just fine. But the 3.6 is linking to this...

http://www.website.org/vb/showthread.php?p=1#post1

this is with your latest update from yesterday.

btw, is it possible to let it display the actual new post instead of the 1st post of the thread?

MPDev
07 Sep 2006, 17:13
I am seeing the post just made and not just the 1st post in the thread.

kompakt
07 Sep 2006, 17:54
I am seeing the post just made and not just the 1st post in the thread.

Neither of mine show the post just made...

3.6 site (http://www.demna.org/vb/vaispy.php)
3.5 site (http://www.hagasny.com/forum/vaispy.php)

MPDev
07 Sep 2006, 18:08
Sorry, can't help you with the Opera issue; don't use it, don't know how to debug it.

MPDev
07 Sep 2006, 18:14
Neither of mine show the post just made...

3.6 site (http://www.demna.org/vb/vaispy.php)
3.5 site (http://www.hagasny.com/forum/vaispy.php)

As I cannot read your forums (requires login), not much I can do for you; you can try looking at the MySQL query to see why you might be getting different results.

Cheertobi
07 Sep 2006, 18:17
MPDev, do you have an idea why I do not get a date shown, just null?!

MPDev
07 Sep 2006, 18:21
Your date strings are being returned as:

<when>
<b>Heute</b>
19:18
</when>

I assume there is some issue with the translation because your date code contains html characters; but I am not sure.

Cheertobi
07 Sep 2006, 18:30
Ah, removed the html and it works! Thanks,

Tobi

realgoldtalk
07 Sep 2006, 19:20
Awesome seriousely its awesome how can i add spy button in navigation bars so users can also check it out:D

MPDev
07 Sep 2006, 19:23
Just add a link to the page in your navbar template.

tansu
07 Sep 2006, 20:18
installed, great stuff

digitalpoint
07 Sep 2006, 22:36
Hmmmm... looks remarkably like my code with someone else's copyright attached to the beginning of it. ;)

http://forums.digitalpoint.com/showthread.php?p=1384601#post1384601

Hicksatpd
07 Sep 2006, 22:37
Installed, and I really enjoy it. However, I have what I'm hoping is not too difficult of a request. When a new post is made, and it pops up, I'm ready to click it to read, but it only takes me to the FIRST post of the thread, not THAT post.

Could you please tell me what to change to make each link point to that post instead of the first? I don't mean that I want it to load the post all by itself, but still load the entire thread, only it takes me to where the specific post is.

I would go from really liking this feature to adoring it if you could do that.

MPDev
07 Sep 2006, 22:40
Hmmmm... looks remarkably like my code with someone else's copyright attached to the beginning of it. ;)

http://forums.digitalpoint.com/showthread.php?p=1384601#post1384601

Actaully, it's public domain code except for the script that generates the XML which I wrote - I added no such claim of ownership to any of those files.

On the other hand, it would appear you removed the copyrights from your files illegally.

digitalpoint
07 Sep 2006, 22:43
I don't have to put a copyright on files I code. :)

What "public domain" did you get that code from if it wasn't my domain?

MPDev
07 Sep 2006, 22:45
Actually, if you use public domain code as your baseline, you do.

DementedMindz
07 Sep 2006, 22:45
I don't have to put a copyright on files I code. :)

What "public domain" did you get that code from if it wasn't my domain?

its right in his first post where he got it from and he even claims no ownership

MPDev
07 Sep 2006, 22:47
I believe I was pretty clear with my post:

Note: I claim no ownership of this code except for the file vaispy.php - the rest of the files were using 'freely distributable' sources. As such, you may use these files as you wish, but please do not remove the copyrights.

digitalpoint
07 Sep 2006, 23:02
Actually, if you use public domain code as your baseline, you do.Okay, in that case wouldn't you have to leave a notice about my contributions? ;)

DementedMindz
07 Sep 2006, 23:04
Okay, in that case wouldn't you have to leave a notice about my contributions? ;)


what contributions did you give? cause from the looks of it all the code there was used on the site (http://blablist.crowdiq.com/iqueue/votespy_howto.jsp) in his first post...

MPDev
07 Sep 2006, 23:07
Actually, he did contribute by adding some IE compatibility code; but by removing the copyrights to the code he used as a baseline, I figured he would contact me and I would agree to give him credit if he restored the proper credits to those who provided him with his baseline. Public domain code modified remains in the public domain - everyone should get proper credit for their effects given thats all they can expect by releasing it.

You deserve credit as much as those who coded the original code do and once you put back their credits, I'll gladly add yours to this one. Only seems fair, IMO.

realgoldtalk
07 Sep 2006, 23:13
but i am not good with vb how to do that:(

Hicksatpd
07 Sep 2006, 23:22
Copyright/coding debates aside, is there any chance my request could be fulfilled at some point? I'm not asking for it to happen right now (though if it's a quick-fix that's terrific), but I would at least like to know if it could be in the works. Thanks!

MPDev
07 Sep 2006, 23:48
I'm wondering if its a browser issue - aren't the links the same as the links provided in your forums? Mine are and they work as I expect - even when I view forums here that say it isn't working.

Hicksatpd
07 Sep 2006, 23:53
Here's what I have:

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

MPDev
07 Sep 2006, 23:58
Okay, line 258 in vb_spy.js should read:

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

I've updated the zip with this fix.

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

Hicksatpd
08 Sep 2006, 00:14
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
08 Sep 2006, 00:16
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
08 Sep 2006, 00:34
Try:

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

nix
08 Sep 2006, 00:39
Yea that worked.

MPDev
08 Sep 2006, 00:52
Okay, I modified the vaispy.php script accordingly and posted it here.

Hicksatpd
08 Sep 2006, 00:53
Yep, that did it! Thank you very much for all of your work!

buro9
08 Sep 2006, 10:04
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:

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

to

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:

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

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

to

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 :)

bashy
08 Sep 2006, 11:11
Excellent, well done, i was watching that thread in anticipation,

Thanks alot m8 :)

theodonnells
08 Sep 2006, 11:13
No new posts show for me, getting this error in java console....
Error: syntax error
Source File: http://www.mysite.com/forums/vaispy.php?do=xml&r=0.46183621830258337&_=
Line: 1, Column: 31
Source Code:
<?xml version="1.0" encoding=""?>------------------------------^

Mark.B
08 Sep 2006, 11:28
Would be good if there was a way to stop guests viewing this.

buro9
08 Sep 2006, 11:33
No new posts show for me, getting this error in java console....

Do you have a different language pack from the default installed? It's missing the encoding, which is normally part of the localisation.

Indeed the line in the PHP file is:

echo '<?xml version="1.0" encoding="' . $stylevar['charset'] . '"?>' . "\r\n";

buro9
08 Sep 2006, 11:34
Would be good if there was a way to stop guests viewing this.


Add this:

if (empty($vbulletin->userinfo['userid']))
{
print_no_permission();
}


To the .php file, just below where it has this:

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

Mark.B
08 Sep 2006, 11:38
Add this:
To the .php file, just below where it has this:

Thanks...spot on. :D

bashy
08 Sep 2006, 12:18
Hi m8 is there away to change the amount of posts show please?

Perhaps to something like 30, or would this cause a lot more server load?

Floris
08 Sep 2006, 14:13
Very cool modification. Thumbsup

MPDev
08 Sep 2006, 14:48
Thanks, Floris; I have something really neat in store for people who use this modification that I should be ready to show shortly.

Thank you, buro9; I'll add that to the code immediately.

voteforbird
08 Sep 2006, 19:12
What line would I change to slow down how quick the posts display? I don't mean the database check time, but rather the time that each update is fed downwards.

buro9
08 Sep 2006, 19:22
What line would I change to slow down how quick the posts display? I don't mean the database check time, but rather the time that each update is fed downwards.

Change the pushtime value from 1000 (1 second) to 2000 (2 seconds) or whatever you want. Note that there is an instance of a hard-coded 1000 lower down in the code within a settimeout call... change that one too.

buro9
08 Sep 2006, 19:23
Hi m8 is there away to change the amount of posts show please?

Perhaps to something like 30, or would this cause a lot more server load?

In the PHP file I noticed a line that had this:
spymax = 25;

See what happens when you change it :)

buro9
08 Sep 2006, 19:27
And MPDev... fantastic hack :)

Don't mind me helping support it... I know from experience it can be a chore answering hack support questions, and I like this one a lot so I've already delved through most of the code and figured out a few tweaks here and there. I'll stick to sharing tips though :)

One thing that did come to mind... a way of caching according to usergroups. I haven't yet opened this up to guests as I'm wary of additional database load, but if I put in a per usergroup cache mechanism based on a users primary usergroup... then this would solve any potential load issue on large boards :)

MPDev
08 Sep 2006, 19:56
Are you kidding? I don't mind at all, in fact it's why I put it out here so that (hopefully) we could all enjoy it and improve it.

vBIspy.com (http://www.vbispy.com) is nearing ready for launch; once it's ready it'll be a fun way to see what people are talking about and promote our websites. (You just register your vbispy.php and vBIspy.com grabs a few threads on a polling cycle to promote your site).

jcr
08 Sep 2006, 23:43
Holy crap! This works great :D :D Mine is here (http://www.exsite.no/forum/vaispy.php)

jcr
08 Sep 2006, 23:51
BTW.. Could it be possible to add a external version to this one? A include version that I could post on an external website or the main portal page? ( non-vb-portal )

G_Man
08 Sep 2006, 23:53
Are you kidding? I don't mind at all, in fact it's why I put it out here so that (hopefully) we could all enjoy it and improve it.

vBIspy.com (http://www.vbispy.com) is nearing ready for launch; once it's ready it'll be a fun way to see what people are talking about and promote our websites. (You just register your vbispy.php and vBIspy.com grabs a few threads on a polling cycle to promote your site).


Right on!!!

I hope to get this up and running today... Darn Real World and Work!! :p



****edit - that was too easy!! Works a trick!!!!!!!!!!!!!!!!!!!!!!

Cheers Mate!

hotwheels
09 Sep 2006, 00:13
This is a great mod. I installed it on my site and set it up with a link under the actual post.
This way after someone replies to a post, all they need to do is click on "Realtime New Posts" and they are brought right back to the ajax page, which make's this very functional on my site.

Thanks hotwheels of insanemustangs.com :D

See the pic for my example:

Freesteyelz
09 Sep 2006, 00:29
Sweet mod. Thanks again, MPDev. :) *Clicked Install*

ZGeek
09 Sep 2006, 01:50
This is a really awesome hack and I'd love to see it developed further. (like a module for vbadvanced hehehehe)

Is there anything that can be done for the whos online page? When its viewed and people are on that page they are reported like this:

Unknown Location
/forum/vaispy.php?do=xml&last=993718&r=0.47118180120956643&_=

bashy
09 Sep 2006, 01:50
Hi m8, thanks but changing that actually stops it displaying any posts!! :(

Its this ya need to change ;)

ORDER BY lastpost DESC LIMIT 10");

Also....ya need to add more lines here i think, then perhaps change your amount that you posted

<tr id="row1" style="display: none;"></tr>
<tr id="row2" style="display: none;"></tr>
<tr id="row3" style="display: none;"></tr>
<tr id="row4" style="display: none;"></tr>
<tr id="row5" style="display: none;"></tr>
<tr id="row6" style="display: none;"></tr>
<tr id="row7" style="display: none;"></tr>
<tr id="row8" style="display: none;"></tr>
<tr id="row9" style="display: none;"></tr>
<tr id="row10" style="display: none;"></tr>
<tr id="row11" style="display: none;"></tr>
<tr id="row12" style="display: none;"></tr>
<tr id="row13" style="display: none;"></tr>
<tr id="row14" style="display: none;"></tr>
<tr id="row15" style="display: none;"></tr>
<tr id="row16" style="display: none;"></tr>
<tr id="row17" style="display: none;"></tr>
<tr id="row18" style="display: none;"></tr>
<tr id="row19" style="display: none;"></tr>
<tr id="row20" style="display: none;"></tr>
<tr id="row21" style="display: none; opacity:.85"></tr>
<tr id="row22" style="display: none; opacity:.65"></tr>
<tr id="row23" style="display: none; opacity:.45"></tr>
<tr id="row24" style="display: none; opacity:.25"></tr>
<tr id="row25" style="display: none; opacity:.05"></tr>


In the PHP file I noticed a line that had this:
spymax = 25;

See what happens when you change it :)

bashy
09 Sep 2006, 02:04
EDIT:

To change the amount of posts to show:
Find and change the 50 to the amount you require
50[/B]");

Find and change the 50 to the amount you require
spymax = 50;

Find and add more rows to the amount that you require
[php]<tr id="row1" style="display: none;"></tr>
<tr id="row2" style="display: none;"></tr>
<tr id="row3" style="display: none;"></tr>
<tr id="row4" style="display: none;"></tr>
<tr id="row5" style="display: none;"></tr>
<tr id="row6" style="display: none;"></tr>
<tr id="row7" style="display: none;"></tr>
<tr id="row8" style="display: none;"></tr>
<tr id="row9" style="display: none;"></tr>
<tr id="row10" style="display: none;"></tr>
<tr id="row11" style="display: none;"></tr>
<tr id="row12" style="display: none;"></tr>
<tr id="row13" style="display: none;"></tr>
<tr id="row14" style="display: none;"></tr>
<tr id="row15" style="display: none;"></tr>
<tr id="row16" style="display: none;"></tr>
<tr id="row17" style="display: none;"></tr>
<tr id="row18" style="display: none;"></tr>
<tr id="row19" style="display: none;"></tr>
<tr id="row20" style="display: none;"></tr>
<tr id="row21" style="display: none; opacity:.85"></tr>
<tr id="row22" style="display: none; opacity:.65"></tr>
<tr id="row23" style="display: none; opacity:.45"></tr>
<tr id="row24" style="display: none; opacity:.25"></tr>
<tr id="row25" style="display: none; opacity:.05"></tr>


This is mine as i have set it to 50
<tr id="row1" style="display: none;"></tr>
<tr id="row2" style="display: none;"></tr>
<tr id="row3" style="display: none;"></tr>
<tr id="row4" style="display: none;"></tr>
<tr id="row5" style="display: none;"></tr>
<tr id="row6" style="display: none;"></tr>
<tr id="row7" style="display: none;"></tr>
<tr id="row8" style="display: none;"></tr>
<tr id="row9" style="display: none;"></tr>
<tr id="row10" style="display: none;"></tr>
<tr id="row11" style="display: none;"></tr>
<tr id="row12" style="display: none;"></tr>
<tr id="row13" style="display: none;"></tr>
<tr id="row14" style="display: none;"></tr>
<tr id="row15" style="display: none;"></tr>
<tr id="row16" style="display: none;"></tr>
<tr id="row17" style="display: none;"></tr>
<tr id="row18" style="display: none;"></tr>
<tr id="row19" style="display: none;"></tr>
<tr id="row20" style="display: none;"></tr>
<tr id="row21" style="display: none;"></tr>
<tr id="row22" style="display: none;"></tr>
<tr id="row23" style="display: none;"></tr>
<tr id="row24" style="display: none;"></tr>
<tr id="row25" style="display: none;"></tr>
<tr id="row26" style="display: none;"></tr>
<tr id="row27" style="display: none;"></tr>
<tr id="row28" style="display: none;"></tr>
<tr id="row29" style="display: none;"></tr>
<tr id="row30" style="display: none;"></tr>
<tr id="row31" style="display: none;"></tr>
<tr id="row32" style="display: none;"></tr>
<tr id="row33" style="display: none;"></tr>
<tr id="row34" style="display: none;"></tr>
<tr id="row35" style="display: none;"></tr>
<tr id="row36" style="display: none;"></tr>
<tr id="row37" style="display: none;"></tr>
<tr id="row38" style="display: none;"></tr>
<tr id="row39" style="display: none;"></tr>
<tr id="row40" style="display: none;"></tr>
<tr id="row41" style="display: none; opacity:.95"></tr>
<tr id="row42" style="display: none; opacity:.85"></tr>
<tr id="row43" style="display: none; opacity:.75"></tr>
<tr id="row44" style="display: none; opacity:.65"></tr>
<tr id="row45" style="display: none; opacity:.55"></tr>
<tr id="row46" style="display: none; opacity:.45"></tr>
<tr id="row47" style="display: none; opacity:.35"></tr>
<tr id="row48" style="display: none; opacity:.25"></tr>
<tr id="row49" style="display: none; opacity:.15"></tr>
<tr id="row45" style="display: none; opacity:.08"></tr>

Lizard King
09 Sep 2006, 11:21
All the credit goes to TECK ( Floren )

In order to optimize the code Replace

$getthreads = $db->query_read("
SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid
FROM ".TABLE_PREFIX."thread AS thread
LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN ".TABLE_PREFIX."post AS post ON(post.postid = thread.lastpostid)
WHERE open <> 10 AND thread.lastpostid > $lastpostid
AND forumid NOT IN (0$blockforums)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC LIMIT 10");

with

// The number of days to scan the table for ...
// 86400 represents the number of seconds in 24hrs
$daysprune = 1;
$datecut = "AND thread.lastpost >= " . (TIMENOW - ($daysprune * 86400));

$getthreads = $db->query_read("
SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.lastpostid)
WHERE open <> 10 AND thread.lastpostid > $lastpostid
AND forumid NOT IN (0$blockforums)
AND thread.visible = '1'
AND deletionlog.primaryid IS NULL
$datecut
ORDER BY thread.lastpost DESC LIMIT 10
");

MPDev
09 Sep 2006, 23:25
Just curious about adding that to the query; does that speed up the query or is it to just make sure you only grab something from the past day?

Cole2026
09 Sep 2006, 23:32
Problem here.

The query is going correctly, it has valid information in it:
http://yourconvo.com/forums/vaispy.php?do=xml

However, The actual page is not filling up with data.
http://www.yourconvo.com/forums/vaispy.php

da420
09 Sep 2006, 23:34
Problem here.

The query is going correctly, it has valid information in it:
http://yourconvo.com/forums/vaispy.php?do=xml

However, The actual page is not filling up with data.
http://www.yourconvo.com/forums/vaispy.php

What do you mean it's not filling up with data?

It seems to be working for me...

DementedMindz
09 Sep 2006, 23:35
yeah me too

Cole2026
09 Sep 2006, 23:40
I just figured out what's wrong.

It won't work when there is no www.

MPDev
10 Sep 2006, 04:57
I made an update with some minor changes to the JavaScript to remove the split strings.

I'm not sure what to do about Opera; I just dont use it to know enough what might need to be done. I wonder if it works like IE and we need:

if (is_ie || is_opera)

in the javascript file va_spy.js.

Wired1
10 Sep 2006, 05:39
This is mine as i have set it to 50
<tr id="row49" style="display: none; opacity:.15"></tr>
<tr id="row45" style="display: none; opacity:.08"></tr>

row 49, then 45? :)

ConqSoft
10 Sep 2006, 15:54
Just curious about adding that to the query; does that speed up the query or is it to just make sure you only grab something from the past day?

It prevents full table scans which can bring huge sites to their knees.

MPDev
10 Sep 2006, 16:09
Sounds fair enough; although running on a 1m post forum I'm not seeing any kind of problem, it's worth adding anyways. Thanks!

ConqSoft
10 Sep 2006, 16:14
Off-Topic: Michael, did you get my PM on PhotoPost.com? The issue still exists, and it's possible it's not limited to only me.

Floris
10 Sep 2006, 20:49
I have installed this and using the free option. Thank you. But I felt quite surprised to read that more URLs would mean I have to buy a package, ranging from $20 a month to $1500 a year. But I kind of feel bad now knowing my site content won't get the priority like others, unless I put money down; and therefor show up later or less frequent. I also don't see why someone would like to pay $20 to get their content listed for a few seconds until it is being replaced by someone else their content. Is it being indexed too, is there an archive link or osmething to listed content that you paid for?

Good luck with your business, and I am going to consider keeping this installed or not.

DementedMindz
10 Sep 2006, 20:58
I have installed this and using the free option. Thank you. But I felt quite surprised to read that more URLs would mean I have to buy a package, ranging from $20 a month to $1500 a year. But I kind of feel bad now knowing my site content won't get the priority like others, unless I put money down; and therefor show up later or less frequent.

Good luck with your business, and I am going to consider keeping this installed or not.


lol thats a joke I guess just another way for someone to make money. Ashame when they truely didnt even write the script.

MPDev
10 Sep 2006, 20:58
Thanks, Floris; your account is already active and posting. Right now everyone is in a rotation for every 3 minute updates; however, my ability to scale this to hundreds of sites means being able to offer a "minimium" level of priority. Of course you are quoting a wide range of spectrum that covers upwards of a years service.

Assuming every site scan takes about a half second to process, then you can see how this will add up over time. By being up front from the start I feel that I am being honest from the start and will hopefully avoid the pitfalls of having to scale the system as it grows.

MPDev
10 Sep 2006, 21:02
lol thats a joke I guess just another way for someone to make money. Ashame when they truely didnt even write the script.

As I just posted setting the bar at a reasonable level from the start means being upfront enough to say that I can offer some level of service reliably as the system grows.

I didn't write all of the script; but I did write alot of code to support this kind of setup.

bashy
10 Sep 2006, 21:50
Hi

I have just updated and now, it dont work, I then tried to update all the files and still dont work, It just does not pull posts at all

Any ideas please?

http://www.bashys-place.com/forums/vaispy.php

MPDev
10 Sep 2006, 23:21
But I kind of feel bad now knowing my site content won't get the priority like others

It's only two days old; I've made some changes to allow up to 10 URLs and no paid options at this time, we'll see how the polling times are effected as the network grows; but how would you suggest one manage a growing number of sites and people's desire to have more frequent updates?

I think this is a fun way to get people to see a network of sites with common interests and drive traffic to member sites.

MPDev
10 Sep 2006, 23:22
Bashy, it's working for me when I click on your link.

bashy
10 Sep 2006, 23:49
Yeah it is now, thats really weird..
I have to do my blooming edits again lol :(

Cheers MP

MPDev
10 Sep 2006, 23:52
And you're up on the network, too.

Cheers!

bashy
10 Sep 2006, 23:57
Just got the email, thanks again....Great work, well done :)

TECK
11 Sep 2006, 02:44
Just curious about adding that to the query; does that speed up the query or is it to just make sure you only grab something from the past day?
Without the date cut, you scan the hole tables for threads/posts, then you simply select the first 10.
That's really bad, if you have a huge board, it could bring your server to it's knees... very easy.
The date cut will lower A LOT the table scans, because you select only a small segment of threads/posts.
So yes, it is a performance increase.

I made 2 comments there at the top, to explain how to set the date cut, depending on how busy is your board.

G_Man
11 Sep 2006, 05:06
So, what do have to do to get on this rotation??

To be honest, I am kind of lost with all this talk about a paid Mod, etc....

bashy
11 Sep 2006, 07:14
goto the vBIspy Network in MP's signature, there is a block on the left about adding your url/site its near the top

NeutralizeR
11 Sep 2006, 10:10
And you're up on the network, too.

Cheers!
Doesn't accept international forums?

GoTTi
11 Sep 2006, 10:58
so how far back does this thing search for in post?

MPDev
11 Sep 2006, 14:25
It only grabs the last 10 posts in the past (you can change the LIMIT if you want).

As for foreign sites on the vBIspy Network (http://www.vbispy.com); I'm trying to figure out how to support them, seems like I'll need to develop some kind of language filter so users can elect which feeds they see - no sense sending posts that users can't read.

This is not a paid mod; there was reference to some ideas I am tossing around for vBIspy.com, but that isn't related to this mod or your ability to use it as-is.

glenvw
11 Sep 2006, 15:04
Nothing showing up for me at all. Could you please check my site?

http://www.warmislands.com/tropical_island_forums/vaispy.php

In IE 6 I am also getting a script error that says

Line 308
Object Expected

MPDev
11 Sep 2006, 15:30
It doesn't appear you uploaded the clientscript/ files; I get Page Not Found when I try to bring up the link the to va_*.js files.

glenvw
11 Sep 2006, 15:39
It doesn't appear you uploaded the clientscript/ files; I get Page Not Found when I try to bring up the link the to va_*.js files.

Man I feel stupid. Got it fixed.

How can this help me with building traffic besides joining your VBiSpy Network? ( I have joined waniting approval)

stud
11 Sep 2006, 15:55
MPDEV - awesome mod. Thanks a million!!

Are you currently in the works of developing this as a CMPS vbAdvanced module?
This would be GREAT!

Capt. GannA
11 Sep 2006, 20:56
Dude, this is good stuff. *thumbs up*

glenvw
11 Sep 2006, 20:59
Is there an advanatage to have a link to the Vbspy page on your home page?

MPDev
11 Sep 2006, 21:08
If you want to offer this to your users as a way to monitor your site, yes; the mod by itself isn't necessarily going to drive more traffic to your site, but it does give those who spend alot of time on your site an alternative to clicking REFRESH all day long.

We have members who spend much of their day glancing at our site, they love this mod because they just glance at the vBIspy tab to see whats going on throughout the site quick and easy.

MPDev
12 Sep 2006, 03:34
MPDEV - awesome mod. Thanks a million!!

Are you currently in the works of developing this as a CMPS vbAdvanced module?
This would be GREAT!

You mean like this?

http://www.viperalley.com/index.php

rob30UK
12 Sep 2006, 03:52
I want to see this mod upgraded with Floren's (TECK) suggestion for performance improvement..... whole table look-ups are a definite NO-NO for big boards....

Please fix this oversight ASAP and notify those who have clicked the install button?

MPDev
12 Sep 2006, 03:57
If you read the UPDATES section you'd see it's already in the download.

MPDev
12 Sep 2006, 13:25
Right you are, there you go; that should fix it.

MPDev
12 Sep 2006, 13:50
Or on the FORUMHOME?

http://www.viperalley.com/forum/

Capt. GannA
12 Sep 2006, 16:14
You mean like this?

http://www.viperalley.com/index.php


How can I do that? I'd like to have it on my CMPS main too.

ForumDog
12 Sep 2006, 18:28
The inability to use $stylevar[imgdir_misc] is a real thorn in my side at the moment too. :D

Something to add to the pile...

In vaispy.php,

FIND:
eval('$navbar = "' . fetch_template('navbar') . '";');

ADD ABOVE:
$navbits = array();
$navbits[$parent] = 'iSpy';
$navbits = construct_navbits($navbits);

Voila, breadcrumb. Should change <title>iSpy</title> to <title>$vboptions[bbtitle] - iSpy</title> for consistency too.

Edit: The closing body and html tags are missing too, I'm sure you can guess where they go. :D

Love the mod, give yourself a thorough pat on the back.

MPDev
12 Sep 2006, 19:23
The thing I don't like about stylevar is having to explain to everyone that they have to copy those images to all their style directories. This is much more simplistic.

Thanks for the other changes; I'll add them in the next update.

SaN-DeeP
12 Sep 2006, 23:49
will there be any issues renaming vaispy.php to some other name ?
any changes which might be required for this ?

MPDev
13 Sep 2006, 00:14
You'd have to change the name of the script in the va_spy.js script, too.

SaN-DeeP
13 Sep 2006, 00:30
You'd have to change the name of the script in the va_spy.js script, too.
thanks for quick reply :)
thats a very small change overall.

Will test this script now.

warnmar10
13 Sep 2006, 04:30
any idea why it won't work if I'm logged in?
Other than that one, minor annoyance this is a nice add.

On my site, in Firefox or IE, it only works for guest.

If I log in and run vaispy.php?do=xml under Firefox, everything looks to be in order, I see exactly what I would expect to see but it doesn't display anything on the vaispy.php page.

If I log out in Firefox, browse to vaispy.php it works.

If I open a new tab and log in, it continues to work in the 1st tab.

If while I'm logged in on the 2nd tab I refresh the first tab it continues to work but it doesn't show me as logged in.

If I log in to the working instance on tab 1 it stops working.

I read all 5 pages and saw this problem mentioned 4 or 5 times, did I read past the answer somewhere?

Very cool for my guests though.

SaN-DeeP
13 Sep 2006, 04:56
One last question, how can i remove the event and by columns completely from this script ?

Looks wonderful :) how i missed this modification.

regards,

Chris-777
13 Sep 2006, 05:56
/me nominates this for MOTM

kall
13 Sep 2006, 07:30
Nice. :)

Although.. it doesn't seem to like either GARS or the RSS bot feature..

http://www.nzboards.com/forums/nzbpostspy.php

Only the New Post has a 'Forum' entry.

*edit* In Firefox, that is.

nix
13 Sep 2006, 07:59
I'm using it with RSS feeds and its working fine in FF. Same with Gars.

kall
13 Sep 2006, 08:14
Here's the code.. it looks like something is being stripped.

<td class="alt1Active"><strong><a href="showthread.php?t=30950">Object from 'space' found by chance - Stuff.co.nz</a></strong><br><div class="smallfont"><br><table border="0" cellpadding="2" cellspacing="7" width=""><tbody><tr><t><a... replies="" 0="" views="" (0=""></a...></t><td class="alt1" align="center"><div class="smallfont"><strong><a href="forumdisplay.php?f=76">New Zealand News Feeds</a></strong></div></td></tr></tbody></table></div></td>

I see this in one of the .js files:
if (e instanceof RangeError) return '...';

Range error for those threads that have 0 replies and are posted by the RSS bot.. in FF?

ForumDog
13 Sep 2006, 12:40
The thing I don't like about stylevar is having to explain to everyone that they have to copy those images to all their style directories. This is much more simplistic.

True, it just makes it impossible for people with multiple themes to be consistent. Up to you if you want to do this since it adds a tiny amount of uncached js, but for everyone else wanting to use multiple themed buttons (or having no choice because of multiple style directories)...

In va_spy.js

REMOVE

function pauseSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "images/misc/play_up.gif";
playimg.alt = "Click to Play";
pauseimg.src = "images/misc/pause_down.gif";
pauseimg.alt = "Paused...";

pause();
}

function playSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "images/misc/play_down.gif";
playimg.alt = "Playing...";
pauseimg.src = "images/misc/pause_up.gif";
pauseimg.alt = "Click to Pause";

resume();
}

function pause() {
play = 0;
}

function resume() {
play = 1;
}




In vaispy.php

FIND:

<script language="javascript" type="text/javascript">
<!--
spymax = 25;
// -->
</script>

Note: I added the js commenting for older browser compatbility and the javascript type for code validation, I'll just assume they'll be added in future versions. If you don't have it as above, replace it.



ADD BELOW:

<script language="javascript" type="text/javascript">
<!--
function pauseSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "$stylevar[imgdir_misc]/play_up.gif";
playimg.alt = "Click to Play";
pauseimg.src = "$stylevar[imgdir_misc]/pause_down.gif";
pauseimg.alt = "Paused...";

pause();
}

function playSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "$stylevar[imgdir_misc]/play_down.gif";
playimg.alt = "Playing...";
pauseimg.src = "$stylevar[imgdir_misc]/pause_up.gif";
pauseimg.alt = "Click to Pause";

resume();
}

function pause() {
play = 0;
}

function resume() {
play = 1;
}
// -->
</script>


FIND


<img id="vaplay" src="images/misc/play_up.gif" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="images/misc/pause_up.gif" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />


REPLACE WITH:

<img id="vaplay" src="$stylevar[imgdir_misc]/play_down.gif" style="cursor:pointer;" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="$stylevar[imgdir_misc]/pause_up.gif" style="cursor:pointer;" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />


Note: Added CSS to change the mouse to the hand icon when hovering over the buttons as well.

And make sure your Play/Pause buttons are uploaded to the misc directory of each individual theme.

Finis.

ForumDog
13 Sep 2006, 16:39
For those that use the selective forum fiter, you can have that apply also to this spy by doing this...

After:

$blockforums = "";

Add:

$selectivefiltered = $vbulletin->userinfo['excludeforumids'];

After:

AND forumid NOT IN (0$blockforums)

With:

AND forumid NOT IN (0$blockforums$selectivefiltered)

Could be worth adding this as default, not sure if it will cause errors for those that do not use the selective forum filters, but I doubt it.

Great stuff :D and these instructions also work in exactly the same way with the Andreas's Opt-Out Forums from Get New/Get Daily for 3.5.4 - also works on 3.6 - (http://www.vbulletin.org/forum/showthread.php?t=91025). Just instead of:

$selectivefiltered = $vbulletin->userinfo['excludeforumids'];

use:


$gnpoptoutforums = $vbulletin->userinfo['excludeforumsgnp'];

MPDev
13 Sep 2006, 18:31
I'd be curious if the selected forums code works on sites where people do not use that feature; if so, I can add it.

On another note, I've updated vBIspy.com so that it can pull threads using vBulletin's external.php script; so we can aggregate content with vBIspy client (you get some additional features like profile links, forum specific links, views/replies) or with vB's own internal RSS feed.

I am updating the download with a new version that changes the forumpermissions area to include checking for password protected forums.

ForumDog
13 Sep 2006, 18:46
It's not selected forums code, it's deselected forums code to exclude forums from getnew searches. It's not default vBulletin code so I don't see how it could work on those without the appropriate plugin installed but I don't see why it would cause a problem for people without it. Should just be skipped over. I'll try it properly later.

Um, could you possibly not advertise in the hack update feature. :p

MPDev
13 Sep 2006, 19:18
Um, could you possibly not advertise in the hack update feature. :p

Apologies. Given the time invested in the mod and having only sent out one update, I don't think a line about vbispy.com integration is out of place; but that's just me, others might disagree.

theodonnells
14 Sep 2006, 09:58
Do you have a different language pack from the default installed? It's missing the encoding, which is normally part of the localisation.

Indeed the line in the PHP file is:

echo '<?xml version="1.0" encoding="' . $stylevar['charset'] . '"?>' . "\r\n";

Ah the language problem again...See i had english and german languages on my forum.When i installed the german it changed some of my english phrases too.Have tried unsuccesfully to fix this..Got querys to run from vb.com etc reinstalled original language but nothing shifts it...So probably is the language that is a problem..

MPDev
15 Sep 2006, 00:21
It's not selected forums code, it's deselected forums code to exclude forums from getnew searches. It's not default vBulletin code so I don't see how it could work on those without the appropriate plugin installed but I don't see why it would cause a problem for people without it. Should just be skipped over. I'll try it properly later.

Um, could you possibly not advertise in the hack update feature. :p

I'd probably say that any code to support other plugins should not be standard; if you use that mod you can add the code as you documented.

soletrader
15 Sep 2006, 05:23
Does anybody know if this hack is server intensive?

buro9
15 Sep 2006, 09:34
Does anybody know if this hack is server intensive?

The original version was, it did a full table scan of the thread table. The version currently attached to the thread only scans the last 24 hours of the thread table. If you're on a busy forum you should have it scan less, I scan only the last hour.

Aside from that, take a look... turn on debug mode and add explain=1 to the do=xml querystring for the php file. I'm seeing the page generated in 5 queries, all taking less than 0.01 seconds, and the largest query isn't the spy query, but the ones that fetch the datastore and templates (I'm using the template layer for spy and not the echo'd HTML that spy originally shipped with).

I also reduced the number of refreshes fired by the JavaScript, from 7 seconds down to 20 seconds. As that is the highest rate of posting on my forum around peak time, so it seemed daft to be firing off so many useless AJAX calls. I'm considering dropping it further to 30 seconds, which would be about the maximum on a large forum before you degrade the user experience of the spy.

In summary: Doesn't need to be intensive, but the first version was.

Oh, and the JavaScript is horrible. All kinds of dodgy 1.0 stuff and bizarre splitting of strings. I'm very much inclined to re-write that stuff using proper DOM stuff. vBulletin is largely XHTML, there's not much excuse to break that on this page through the use of innerHTML rather than DOM manipulation. Besides... use one or the other, both are fast, but combined they are cludgy. So I'm going to change most of mine to fully use DOM stuff, and get rid of those arrays of data when objects would be just as good, or using the original responseXML.

Anyway... rambling... low server load if you use the latest version.

ForumDog
15 Sep 2006, 10:03
I'd probably say that any code to support other plugins should not be standard; if you use that mod you can add the code as you documented.

Fair enough. :) I've added the hack title and author name to the post so others can find it if they search.

buro9, would you release your improvements? I also moved the code except the inside of the table rows to the templating system and changed the non-IE XHTML to divs and spans with CSS for better markup and to fix the Opera rendering failure, plus some other cosmetic changes/additions. It's currently driving me nuts that the HTML is all inside the JS and I can't use conditionals or anything like that.

It would be really great if I could and the code was vB consistent if I could twist your arm. :)

buro9
15 Sep 2006, 10:19
When I've done the DOM JavaScript stuff I'll post it here. It may be a few weeks though, I'm still running the old javascript on my site, the new stuff I haven't had tested in many browsers (just Firefox on Ubuntu), so I've yet to even get it past IE on Windows ;) And I'm going to be distracted and slow working for a fortnight as my girl is coming to stay for a couple of weeks... this takes a lower priority ;)

As for the basics to make things better now:
In vaispy.php:
REPLACE:
$daysprune = 1;
WITH:
$daysprune = 0.04;

That will take one days worth of queries down to 1 hour worth of queries (57.1 minutes to be precise). So even fewer rows in the thread table locked.

In va_spy.js:
REPLACE:
var xmldelay = 7000;
WITH:
var xmldelay = 20 * 1000;

AND

REPLACE THE TWO INSTANCES OF:
setTimeout("getXML()", 5000);
WITH:
setTimeout("getXML()", xmldelay);

That changes the time between polling for updates from 7 seconds to 20. I prefer doing the math like that as it makes it obvious it's 20 x 1000 milliseconds = 20 seconds.

Changing that you will have taken each users average 10 queries per minute down to 3 queries per minute. Change it to 30 seconds and they'll be down to 2 queries per minute. Any time span higher than this will reduce the beauty and usability of the spy page too much for my liking. But quiet forums could easily get it to 1 minute per poll.

I also don't like * queries in SQL, so I changed in vaispy.php:

$getthreads = $db->query_read("
SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid
FROM ".TABLE_PREFIX."thread AS thread
LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN ".TABLE_PREFIX."post AS post ON(post.postid = thread.lastpostid)
WHERE open <> 10 AND thread.lastpostid > $lastpostid
AND forumid NOT IN (0$blockforums)
AND thread.visible = '1'
AND post.visible = 1
AND deletionlog.primaryid IS NULL
$datecut
ORDER BY lastpost DESC LIMIT 10");


TO:

$getthreads = $db->query_read("
SELECT thread.forumid,
thread.firstpostid,
thread.lastpost,
thread.lastposter,
thread.lastpostid,
thread.replycount,
thread.threadid,
thread.title,
thread.views,
post.pagetext AS preview,
post.userid AS lastpuserid
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.lastpostid)
WHERE open <> 10
$datecut
AND forumid NOT IN (0$blockforums)
AND thread.visible = '1'
AND thread.lastpostid > $lastpostid
AND post.visible = 1
AND deletionlog.primaryid IS NULL
ORDER BY thread.lastpost DESC LIMIT 10
");


The difference on that is neglible on performance, but I prefer to know what my queries return.

bashy
15 Sep 2006, 12:05
Hi peeps

Can someone please take a look at my vaispy.php as the opacity is not working this time. It worked the last time i edited the page to my liking, but then i updated and lot it all, so i have now done it again but the opacity is not working on the last few posts at all....

You can view it here untill i remove for guests http://www.bashys-place.com/forums/vaispy.php

I have enclosed the php for you to check if you have time please?

Also done a quick scout and cannot find how i could stop guests from using this please?
At present guests can only see 10 or so posts, memebsr can see 45, i dont want guests seeing any!

ForumDog
15 Sep 2006, 12:08
Hi peeps

Can someone please take a look at my vaispy.php as the opacity is not working this time. It worked the last time i edited the page to my liking, but then i updated and lot it all, so i have now done it again but the opacity is not working on the last few posts at all....

You can view it here untill i remove for guests http://www.bashys-place.com/forums/vaispy.php

I have enclosed the php for you to check if you have time please?

Also done a quick scout and cannot find how i could stop guests from using this please?
At present guests can only see 10 or so posts, memebsr can see 45, i dont want guests seeing any!

There's a post near the beginning that says how restrict permissions to member's only, have a search.

The opacity was not correct in the first place, it's one of the fixes I made I'll post it with the rest soon. Thanks buro9 :) great to see people working together on this mod.

MPDev
15 Sep 2006, 13:31
All kinds of dodgy 1.0 stuff and bizarre splitting of strings.

In the latest version I got rid of that code as well; for IE I just use a string.

I'll change the query in the next update so everyone can benefit from the improvement.

And nice to have others putting in the effort! Thanks.

bashy
15 Sep 2006, 16:22
I did have the opacity working the on 1st install, it was fine :)

There's a post near the beginning that says how restrict permissions to member's only, have a search.

The opacity was not correct in the first place, it's one of the fixes I made I'll post it with the rest soon. Thanks buro9 :) great to see people working together on this mod.

MPDev
15 Sep 2006, 18:03
It works for IE, but not on FF; I assume it's a tag, but haven't had the time to go looking just yet.

MPDev
16 Sep 2006, 03:55
I also moved the code except the inside of the table rows to the templating system and changed the non-IE XHTML to divs and spans with CSS for better markup and to fix the Opera rendering failure, plus some other cosmetic changes/additions.

The Opera fix would be helpful; as I am sure the others would be. Thanks for sharing.

bigtime
16 Sep 2006, 06:04
Hi,

Great add-on!

I would like to show this on a non-vb page as an include.

How can I do that without getting the "Unable to add cookies, header already sent." error?

Thanks!

Tim

ForumDog
16 Sep 2006, 10:42
The Opera fix would be helpful; as I am sure the others would be. Thanks for sharing.

Yes, ok ok ok. :D I'm still getting it up to scratch for my own site. But since you'd like to hear now, I'm not done but these are my changes so far, I will include what I already posted that has not yet currently been added for ease of reading.




The default title length as set by vBulletin is actually 85 characters not 80.

In vaispy.php

FIND:

(unhtmlspecialchars($thread['title']), 80)


REPLACE WITH:

(unhtmlspecialchars($thread['title']), 85)





I moved the HTML to a vBulletin template, it's easier to separate code from presentation that way and allows use of template caching more flexibility with conditionals and so on so I'll *assume* that's what you'll want to do. It's very easy to do manually as long as this isn't a plugin which for the time being is unnecessary.


FIND:
// pre-cache templates used by all actions
$globaltemplates = array();

REPLACE WITH:
// pre-cache templates used by all actions
$globaltemplates = array('vaispy');

Go to AdminCP > Styles & Templates > In the dropdown list for (Your Parent Style) choose 'Add new template' Name it vaispy.

Now we have to tell the page to fetch the template, and we're also going to add a couple of lines to keep the vBulletin breadcrumb going.

In vaispy.php

FIND:

eval('$navbar = "' . fetch_template('navbar') . '";');

$headinclude = process_replacement_vars($headinclude);
$navbar = process_replacement_vars($navbar);

eval('$footer = "' . fetch_template('footer') . '";');
$footer = process_replacement_vars($footer);



REPLACE WITH:

$navbits = array();
$navbits[$parent] = 'vaispy';
$navbits = construct_navbits($navbits);

eval('$navbar = "' . fetch_template('navbar') . '";');
$navbar = process_replacement_vars($navbar);

eval('$headinclude = "' . fetch_template('headinclude') . '";');
$headinclude = process_replacement_vars($headinclude);

eval('$footer = "' . fetch_template('footer') . '";');
$footer = process_replacement_vars($footer);

eval('print_output("' . fetch_template('vaispy') . '");');





Looking good! Now let's just transfer it over to the template.

REMOVE:

echo<<<VAPRINT


AND REMOVE:

VAPRINT;

?>


Then CUT everything that was between those two tags and PASTE it into your new template. Save the template so you don't lose it before the following template improvements. :D



This will allow Microstats to show up in the footer and whitespace strippers, template caches etc, makes the code valid too.

In template vaispy:

FIND:

$footer


ADD BELOW:

</body>
</html>





Because we're now in a template there's no reason not to use style-specific directories to allow people with multiple themes not to be forced to create a new top-level directory for the buttons. You must ensure your buttons are copied to each misc directory for every style you have installed. Also added is code to ensure the mouse changes to the hand icon over a button to show it is a clickable link, plus compatibility commenting for inline javascript code.

In va_spy.js

REMOVE

function pauseSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "images/misc/play_up.gif";
playimg.alt = "Click to Play";
pauseimg.src = "images/misc/pause_down.gif";
pauseimg.alt = "Paused...";

pause();
}

function playSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "images/misc/play_down.gif";
playimg.alt = "Playing...";
pauseimg.src = "images/misc/pause_up.gif";
pauseimg.alt = "Click to Pause";

resume();
}

function pause() {
play = 0;
}

function resume() {
play = 1;
}




In vaispy.php

FIND:

<script language="javascript" type="text/javascript">
<!--
spymax = 25;
// -->
</script>

ADD BELOW:

<script language="javascript" type="text/javascript">
<!--
function pauseSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "$stylevar[imgdir_misc]/play_up.gif";
playimg.alt = "Click to Play";
pauseimg.src = "$stylevar[imgdir_misc]/pause_down.gif";
pauseimg.alt = "Paused...";

pause();
}

function playSpy() {
var playimg = document.getElementById("vaplay");
var pauseimg = document.getElementById("vapause");

playimg.src = "$stylevar[imgdir_misc]/play_down.gif";
playimg.alt = "Playing...";
pauseimg.src = "$stylevar[imgdir_misc]/pause_up.gif";
pauseimg.alt = "Click to Pause";

resume();
}

function pause() {
play = 0;
}

function resume() {
play = 1;
}
// -->
</script>


FIND


<img id="vaplay" src="images/misc/play_up.gif" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="images/misc/pause_up.gif" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />


REPLACE WITH:

<img id="vaplay" src="$stylevar[imgdir_misc]/play_down.gif" style="cursor:pointer;" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="$stylevar[imgdir_misc]/pause_up.gif" style="cursor:pointer;" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />




Now we're going to make the opacity code which creates the nice fading effect work across all browsers instead of currently very few. I am currently pulling images into the post/thread Spy, so if you/the author decides to do this the fade effect is also already there for them too.

FIND:

opacity:.XX

(This will be in the last 5 rows of however many rows you chose to have)

REPLACE WITH:

class="spyfadeX"

(Replace the X with 1-5 for the last 5 rows, in correct numeric order)

FIND:

$headinclude


ADD AFTER:

<style type="text/css">
.spyfade1 div, .spyfade1 span,, .spyfade1 td, .spyfade1 img {
opacity:0.90;
filter:alpha(opacity=90);
-moz-opacity:0.90;
}
.spyfade2 div, .spyfade2 span, .spyfade2 td, .spyfade2 img {
opacity:0.80;
filter:alpha(opacity=80);
-moz-opacity:0.80;
}
.spyfade3 div, .spyfade3 span, .spyfade3 td, .spyfade3 img {
opacity:0.70;
filter:alpha(opacity=70);
-moz-opacity:0.70;
}
.spyfade4 div, .spyfade4 span, .spyfade4 td, .spyfade4 img {
opacity:0.50;
filter:alpha(opacity=50);
-moz-opacity:0.50;
}
.spyfade5 div, .spyfade5 span, .spyfade5 td, .spyfade5 img {
opacity:0.30;
filter:alpha(opacity=30);
-moz-opacity:0.30;
}
</style>


In va_spy.js


FIND:
if (i + 5 > spymax) {
document.getElementById("spy_table").rows[i].cells[0].className = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
document.getElementById("spy_table").rows[i].cells[1].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
document.getElementById("spy_table").rows[i].cells[2].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
document.getElementById("spy_table").rows[i].cells[3].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
}


REPLACE WITH (or remove entirely):

// if (i + 5 > spymax) {
// document.getElementById("spy_table").rows[i].cells[0].className = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
// document.getElementById("spy_table").rows[i].cells[1].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
// document.getElementById("spy_table").rows[i].cells[2].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
// document.getElementById("spy_table").rows[i].cells[3].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
// }




The reason Opera is failing to render properly is because it does not download elements with {display:none;}, unlike other browsers which download them but don't show them. This is actually quite a bandwidth saver at times and usually A Good Thing, but here it is causing problems because the table cells which the javascript is throwing out have no table row structure due to them having the attribute {display:none;}, so they're just piling up as lone cells without a row.

MPDev seemed to want this now :p, but otherwise it's fine. Since IE is already the one having trouble doing...more or less anything...and it can't handle the non-table code, we're going to continue the slightly painful IE-specific code theme.

I'm afraid I've already heavily optimised and customised the appearance to match my threadbit so I'm sorry to say this is rather vague.

In va_spy.js

FIND:

text = '<td class="alt1" align="center"><div class="smallfont"><strong>' + what + '</strong></div></td><td class="alt2"><div class="smallfont">' + poster_clip + '</div></td><td class="alt1Active">' + clip + '</td><td align="center" class="alt1"><div class="smallfont">' + where + '</div></td>';


REPLACE WITH:

***Note: I now have this working on any resolution with Opera & Firefox and hopefully every other browser, BUT I only use three cells not four like the default code so you're going to have to use my code as a template to work out the layout for four. Take note of the clears and floats and make sure you assign a % width to the thread/post section and a px width to all the others. Let me know if you need a hand.


// Did I mention IE is "special"? Help it avoid the scary clever presentation.
if (is_ie) {
text = '<td class="alt1 smallfont" align="center">' + ITEM + '</td>';
} else {
text = '<span class="alt1 smallfont" style="display:inline-block;float:left;width:30px;text-align:center;clear:left;"><img src="' + iconpath + '" alt="" border="0" /></span><span class="alt1 smallfont" style="display:inline-block;float:left;width:90%;clear:none;"><span class="alt1 smallfont" style="display:inline-block;float:right;width:200px;text-align:right;clear:none;">' + where + '</span>' + clip + '</span>';
}


Now also surround every clip = in the IF statements above the replaced code with <span></span> tags. The divs are unnecessary for the IE code as long as they're included with the innerHTML below, I've removed them.




Now we have to add the accompanying code to the template to match. Again it's a bit vague because of my template, sorry. This is the general idea. I can only test on Opera, Firefox and IE but it works across all 3, latest release versions, and should be good across other modern browsers as tables are really only used for things like this because IE can't handle anything more complicated.

FIND:

<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center" id="spy_table">
<thead>
<tr align="center"><td class="thead" width="100">Event</td><td class="thead" width="190">By</td><td class="thead">Thread/Post</td><td class="thead" width="190">Forum</td></tr>
</thead>
<tbody class="alt1">
<tr id="row1" style="display: none;">&nbsp;</tr>
<tr id="row2" style="display: none;">&nbsp;</tr>
<tr id="row3" style="display: none;">&nbsp;</tr>
<tr id="row4" style="display: none;">&nbsp;</tr>
<tr id="row5" style="display: none;">&nbsp;</tr>
<tr id="row6" style="display: none;">&nbsp;</tr>
<tr id="row7" style="display: none;">&nbsp;</tr>
<tr id="row8" style="display: none;">&nbsp;</tr>
<tr id="row9" style="display: none;">&nbsp;</tr>
<tr id="row10" style="display: none;">&nbsp;</tr>
<tr id="row11" style="display: none;">&nbsp;</tr>
<tr id="row12" style="display: none;">&nbsp;</tr>
<tr id="row13" style="display: none;">&nbsp;</tr>
<tr id="row14" style="display: none;">&nbsp;</tr>
<tr id="row15" style="display: none;">&nbsp;</tr>
<tr id="row16" style="display: none;">&nbsp;</tr>
<tr id="row17" style="display: none;">&nbsp;</tr>
<tr id="row18" style="display: none;">&nbsp;</tr>
<tr id="row19" style="display: none;">&nbsp;</tr>
<tr id="row20" style="display: none;">&nbsp;</tr>
<tr id="row21" style="display: none; opacity:.85">&nbsp;</tr>
<tr id="row22" style="display: none; opacity:.65">&nbsp;</tr>
<tr id="row23" style="display: none; opacity:.45">&nbsp;</tr>
<tr id="row24" style="display: none; opacity:.25">&nbsp;</tr>
<tr id="row25" style="display: none; opacity:.05">&nbsp;</tr>
</tbody>
</table>


REPLACE WITH:

<if condition="is_browser('ie')">

<table class="tborder" cellpadding="6" cellspacing="0" border="0" width="100%" align="center" id="spy_table">
<thead>
<tr align="center"><td class="thead" width="100">Event</td><td class="thead" width="190">By</td><td class="thead">Thread/Post</td><td class="thead" width="190">Forum</td></tr>
</thead>
<tbody class="alt1">
<tr id="row1" style="display:none;"></tr>
<tr id="row2" style="display:none;"></tr>
<tr id="row3" style="display:none;"></tr>
<tr id="row4" style="display:none;"></tr>
<tr id="row5" style="display:none;"></tr>
<tr id="row6" style="display:none;"></tr>
<tr id="row7" style="display:none;"></tr>
<tr id="row8" style="display:none;"></tr>
<tr id="row9" style="display:none;"></tr>
<tr id="row10" style="display:none;"></tr>
<tr id="row11" style="display:none;"></tr>
<tr id="row12" style="display:none;"></tr>
<tr id="row13" style="display:none;"></tr>
<tr id="row14" style="display:none;"></tr>
<tr id="row15" style="display:none;"></tr>
<tr id="row16" style="display:none;"></tr>
<tr id="row17" style="display:none;"></tr>
<tr id="row18" style="display:none;"></tr>
<tr id="row19" style="display:none;"></tr>
<tr id="row20" style="display:none;"></tr>
<tr id="row21" style="display:none;" class="spyfade1"></tr>
<tr id="row22" style="display:none;" class="spyfade2"></tr>
<tr id="row23" style="display:none;" class="spyfade3"></tr>
<tr id="row24" style="display:none;" class="spyfade4"></tr>
<tr id="row25" style="display:none;" class="spyfade5"></tr>
</tbody>
</table>

<else />

<table class="tborder" cellpadding="6" cellspacing="0" border="0" width="100%" align="center" id="spy_table">
<tr><td class="tcat" width="100%">
<span style="display:inline-block;float:left;width:50px;">Event</span><span style="display:inline-block;float:left;width:50px;">By</span><span style="display:inline-block;float:left;width:90%;">Thread/Post</span><span style="display:inline-block;float:left;width:200px%;">Forum</span>
</td></tr>
<tr><td>
<div id="row1" style="display:none;"></div>
<div id="row2" style="display:none;"></div>
<div id="row3" style="display:none;"></div>
<div id="row4" style="display:none;"></div>
<div id="row5" style="display:none;"></div>
<div id="row6" style="display:none;"></div>
<div id="row7" style="display:none;"></div>
<div id="row8" style="display:none;"></div>
<div id="row9" style="display:none;"></div>
<div id="row10" style="display:none;"></div>
<div id="row11" style="display:none;"></div>
<div id="row12" style="display:none;"></div>
<div id="row13" style="display:none;"></div>
<div id="row14" style="display:none;"></div>
<div id="row15" style="display:none;"></div>
<div id="row16" style="display:none;"></div>
<div id="row17" style="display:none;"></div>
<div id="row18" style="display:none;"></div>
<div id="row19" style="display:none;"></div>
<div id="row20" style="display:none;"></div>
<div id="row21" style="display:none;" class="spyfade1"></div>
<div id="row22" style="display:none;" class="spyfade2"></div>
<div id="row23" style="display:none;" class="spyfade3"></div>
<div id="row24" style="display:none;" class="spyfade4"></div>
<div id="row25" style="display:none;" class="spyfade5"></div>
</td></tr>
</table>

</if>




Finally, unless you've looked you won't be aware that the va_effects JS file contains considerably more effects than just the fade-in (called Appear) used by default. I went through most of them, I don't think any consistently worked properly (indeed, neither does the fade-in effect since it doesn't work in IE, this is probably due to the lack of varying opacity code as I mentioned earlier). However, since it's the default and obviously you can only use one effect I removed the other code from the effects file and trimmed it down to just the Appear effect. This saves 20kb from the initial download time.

The file is attached for anyone who wants it, to use it just place the attached file in your clientscript folder with the va_effects.js file and in your vaispy template just replace the words va_effects.js with va_appear.js.

Phew! Hope that helped.

ubblite
16 Sep 2006, 11:18
I'm glad you guys are working on a fix for Opera... once it's done I'll probably install this nice mod.

bashy
16 Sep 2006, 11:41
Cheers, I have added and the opacitiy is working well now, thanks alot :)

I actually have 2 monitors and i use the spu on the other monitor on the active desktop so that i get real time updates without even having to log on to the forum, its great :)

Thanks again peeps!!!!

Yes, ok ok ok. :D I'm still getting it up to scratch for my own site. But since you'd like to hear now, I'm not done but these are my changes so far, I will include what I already posted that has not yet currently been added for ease of reading.

MPDev
16 Sep 2006, 13:56
Thanks, ForumDog; I'll see about incorporating those change shortly. By creating a template, I also have to create a plug-in; which I was sort of trying to avoid, but might be the natural progression to take.

I left the effects javascript in tact, although the copyrights don't say we can't modify for our use. I'll leave the copyrights in place and just use the code from the file that we use.

ForumDog
16 Sep 2006, 14:04
Thanks, ForumDog; I'll see about incorporating those change shortly. By creating a template, I also have to create a plug-in; which I was sort of trying to avoid, but might be the natural progression to take.

I left the effects javascript in tact, although the copyrights don't say we can't modify for our use. I'll leave the copyrights in place and just use the code from the file that we use.

I feel that, never yet learned how to create plugins :D but if it's for other people to use it's very difficult to avoid.

Edited the above post slightly, just noticed that removing the style.filter code in the .JS allows the fade out to work in IE.

MPDev
16 Sep 2006, 14:09
Not a problem; I can make one, just liked the easy upload and go way of letting it run. ;)

I'll see what I can come up with - great work!

MPDev
16 Sep 2006, 18:23
***Note: I now have this working on any resolution with Opera & Firefox and hopefully every other browser, BUT I only use three cells not four like the default code so you're going to have to use my code as a template to work out the layout for four.

I am having an issue with the thread width - if I keep it at 80% or 90%, then the display in Opera doesnt adjust well and puts the spans onto different lines.

http://www.vbispy.com

If you narrow your window, you can see how this happens. I have the width at 50%. How do you force Opera to display those span's without any linebreaks?

ForumDog
16 Sep 2006, 18:40
Unfortunately I can't view how you've set it up by viewing the source code. PM me the text line code for non-IE browsers as you have it and I'll take a look when I've got a chance. It's not a high priority for me now since I've got it working for my site.

MPDev
16 Sep 2006, 19:06
I had better success using a table versus the spans; I'll keep playing with it in the meantime.

MPDev
16 Sep 2006, 20:26
Thanks, ForumDog! I have an Opera integration working at:

ViperAlley.Com (http://www.viperalley.com/forum/vaispy.php) and at vBispy.com (http://www.vbispy.com)

I'll post an update soon.

pdblizzard
16 Sep 2006, 21:31
*pam clicks install*
Great add on, thank you so much!

Two things, a question, and a suggestion:

Question: Is there way to limit the number of characters in the thread text preview (I'm using the VBAdvanced hack and want to squeeze up the size of each line on the page)

Suggestion: How about the option to play a sound file when a new post/thread is submitted so I can browse away or walk away from the comp and come back when I hear the sound file :cool:

kall
16 Sep 2006, 23:02
Ahh, the issue I was having with Firefox was caused by the Forum in question allowing HTML.

The <br> that the RSS feed started with was translating into a <br> in the vaispy display.

Manually removing the <br> seems to fix it, but it would be grand if it could be stripped before display. :)

MPDev
16 Sep 2006, 23:35
I strip bb code, so adding a strip for html code wouldn't be a problem; I'll do that as well.

The thread preview is set by the , 200); line in vaispy.php

Not sure about a sound.....

furst
17 Sep 2006, 02:20
I would LOVE to see a mix between this and Top X Stats or Cyb's Advanced Forum Statistics.

MPDev
17 Sep 2006, 03:09
Posted changes to fix Opera browsers, improve post parsing, trim javascript effects file and move some javascript into index.php to make using stylevars easier for those who want to stylize their copies.

Adrian Schneider
17 Sep 2006, 03:23
The only thing I'd like to see is checking for new private messages as well. I know it's not really the point of the hack, but then you can just leave the one page open and be updated with everything.

firstrebel
17 Sep 2006, 10:08
Can the second column - By - be made smaller or dynamic. It's too wide.

Bob

MPDev
17 Sep 2006, 14:50
The html for the columns is in va_spy.js at lines 268 and 270; you could modify the columns widths there.

firstrebel
17 Sep 2006, 17:27
That didn't work, so I looked at vaispy.php and removed the width="190" attribute from <td class="thead" width="190">By</td> at line 291.

Bob

Snake
17 Sep 2006, 19:11
Thanks. I'll check this out soon!

ZGeek
18 Sep 2006, 00:57
Ignore me.. im dumb

bjs144
18 Sep 2006, 11:25
Fab mod!!

So great!!

MPDev
18 Sep 2006, 19:56
That didn't work, so I looked at vaispy.php and removed the width="190" attribute from <td class="thead" width="190">By</td> at line 291.

Bob

Sorry about that, yeah, the header needed to be modified. On Opera browsers you still have to modify the javascript, though.

Shouzen
18 Sep 2006, 22:45
how do ia dd a link to my navbar?

MPDev
19 Sep 2006, 13:29
You can modify your navbar template and add the link to vaispy.php to it. If you aren't sure how to do that, let me know and I'll paste some code for it.

Lionel
19 Sep 2006, 14:39
I put valign="top"in every single <td> I could found, yet it still displays in the middle for poster name, forums etc...

ForumDog
19 Sep 2006, 17:03
Use style="vertical-align:top;".

Lionel
19 Sep 2006, 18:13
Use style="vertical-align:top;".

where exactly? I tried that in every single <td>

ForumDog
19 Sep 2006, 18:52
where exactly? I tried that in every single <td>

Might be because the code puts DIVS inside the table cells, which are overriding the table cell alignment. Vertical-align can't be applied to divs in that manner. Try this (untested, rough guess):

Add to your CSS:

.top span {
vertical-align:top;
}

Then change the code to (Presumably the innerHTML divs, since you're trying to apply it to a table cell):

<div class="top">
<span style="inline-block">What you want aligned to the top</span>
</div>