vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBISpy - AJAX real-time feed of new posts/threads (for vB3.5) (https://vborg.vbsupport.ru/showthread.php?t=126027)

scottct1 09-09-2006 01:59 AM

Is there any way for it to display the last post in the thread instead of the first post in the thread?

MPDev 09-09-2006 02:38 AM

I didn't notice that until now; but the problem is I'm not sure how to get that. vB3.5 doesn't store the lastpostid made (where 3.6 does). So I'm not sure how to JOIN the post and thread table to grab the last preview text.

Try changing line 57 in vaispy.php to:

Code:

        LEFT JOIN ".TABLE_PREFIX."post ON (post.dateline = thread.lastpost)
The potential problem with this is on one large site with 1 million posts the query takes 10 seconds versus the .003 seconds for the original one! So, I'm not sure this is the best way.

Edit: However, if I manually add an index on the dateline field in the post table the query drops to .008 seconds on the same site. So this can work, if you add the index manually; unless someone has a better idea.

Gizmo5h1t3 09-09-2006 08:13 AM

Quote:

Originally Posted by MPDev
I didn't notice that until now; but the problem is I'm not sure how to get that. vB3.5 doesn't store the lastpostid made (where 3.6 does). So I'm not sure how to JOIN the post and thread table to grab the last preview text.

Try changing line 57 in vaispy.php to:

Code:

        LEFT JOIN ".TABLE_PREFIX."post ON (post.dateline = thread.lastpost)
The potential problem with this is on one large site with 1 million posts the query takes 10 seconds versus the .003 seconds for the original one! So, I'm not sure this is the best way.

Edit: However, if I manually add an index on the dateline field in the post table the query drops to .008 seconds on the same site. So this can work, if you add the index manually; unless someone has a better idea.

nope, edited line 57. and im still getting placed on the first post on a page m8...but only on some threads, others seem to work..weird.

MPDev 09-09-2006 11:55 AM

Quote:

Originally Posted by Gizmo5h1t3
nope, edited line 57. and im still getting placed on the first post on a page m8...but only on some threads, others seem to work..weird.

I'm not following you - this change would make the preview text display as that of the last last - does this not work for you or are you saying that when you click on a link it doesn't take you to the last post?

Snake 09-09-2006 05:38 PM

Thank you very much!

MPDev 09-09-2006 09:26 PM

Sure, Snake! Don't forget to click INSTALL! ;)

Gizmo5h1t3 09-10-2006 12:33 AM

Quote:

Originally Posted by MPDev
I'm not following you - this change would make the preview text display as that of the last last - does this not work for you or are you saying that when you click on a link it doesn't take you to the last post?


sorry for being unclear m8...im saying its not taking me to the final post in a thread....

MPDev 09-10-2006 12:48 PM

Can you grab the current download and update your vaispy.php and va_spy.js files?

djwins 09-10-2006 06:31 PM

Would there be a way to modify this so that the latest activity is called only one time every few seconds and not each time as a user hits the vbispy.php page?

If you can get the information to be pulled via a cron job (once every 10 seconds or so) and then have everything displayed on a static page, wouldn't this be much easier on the server load?

Quote:

Originally Posted by RFViet
Hmm I have the same problem . Yes I have java script at footer but I don't want to remove it.

Is there a way to make this compatible with microstats? https://vborg.vbsupport.ru/showthrea...ght=microstats

Maybe just a conditional in the footer that wouldt not display microstats on the vbispy page...anyone know how to do that?

Karabaja 09-10-2006 08:26 PM

Great stuff, thx. But it doesn't take me to last post either. Just to top of the thread.

Karabaja 09-10-2006 08:34 PM

It could have something to do with me using seo rewrite rules.

MPDev 09-10-2006 09:32 PM

I'm not sure - can you give me a link to look at?

RFViet 09-10-2006 10:24 PM

The latest update works for me, thanks

MPDev 09-10-2006 10:25 PM

Some people are suing rewrites of URLs and the links wont always work to take you to the last post. In these cases, you might try rewriting line 262 in va_spy.js to:

Code:

                post_url = 'showthread.php?t=' + threadid + '&goto=lastpost';
Which tells the link to take you to the last post in the thread and seems to get rewritten correctly on the system I tested it on.

Karabaja 09-10-2006 10:32 PM

Quote:

Originally Posted by MPDev
Some people are suing rewrites of URLs and the links wont always work to take you to the last post. In these cases, you might try rewriting line 262 in va_spy.js to:

Code:

                post_url = 'showthread.php?t=' + threadid + '&goto=lastpost';
Which tells the link to take you to the last post in the thread and seems to get rewritten correctly on the system I tested it on.


Yes, that worked great for me. Now it is got everything :)
Thx MPDev

lexx27 09-10-2006 11:14 PM

Ι tested this in 3 browsers. It only shows the first 7 posts and then it does not update...
Does anybody else have this problem? It might have to do with Thread/Forum Read Marking Type...

Karabaja 09-10-2006 11:35 PM

It would be good if there was a way to restrict guests from visiting that page. So that they can't cause high loads.

MPDev 09-10-2006 11:47 PM

In the 3.6 area is the code for blocking access to un-registered users; just be sure to put it below the XML code if you are using the vBIspy Network.

This mod doesn't use read flags; its just waiting for new posts to be made.

The Chief 09-10-2006 11:48 PM

Installed and looks great, thanks for the product :)

Last post feature also doesn't work... :D

RFViet 09-11-2006 12:27 AM

MPDev,
How to make it just a box to display on main Forum ???

The Chief 09-11-2006 12:52 AM

For some reason, Ajax is not working...

When there is a new post it doesn't automatically updating...did I miss something?

djwins 09-11-2006 02:25 AM

Quote:

Originally Posted by MPDev
I'm not sure - can you give me a link to look at?

In case you were talking to me:
http://www.cheapassgamer.com/forums/vaispy.php


Also, I really like the idea of vbispy.com network and website. I think the key here will be to make this mod as server load friendly as possible, so you can have lots of good forums feeding your vbispy page.

MPDev 09-11-2006 12:22 PM

djwins,

Update your clientscript/va_spy.js file from the download - you still have the "old" one that has init() defined and the new code uses spyinit() to prevent any conflicts with other JavaScript.

Gizmo5h1t3 09-11-2006 02:38 PM

Quote:

Originally Posted by MPDev
Some people are suing rewrites of URLs and the links wont always work to take you to the last post. In these cases, you might try rewriting line 262 in va_spy.js to:

Code:

                post_url = 'showthread.php?t=' + threadid + '&goto=lastpost';
Which tells the link to take you to the last post in the thread and seems to get rewritten correctly on the system I tested it on.


thats working fine now m8...nice work!!

djwins 09-11-2006 05:41 PM

Quote:

Originally Posted by The Chief
For some reason, Ajax is not working...

When there is a new post it doesn't automatically updating...did I miss something?

Mine also pulls the 10 latest threads and then doesnt update (unless I refresh the browser).

MPDev 09-11-2006 06:05 PM

I'll take a look.

MPDev 09-11-2006 06:28 PM

The problem is in your postid's - for some reason your post ids are all over the place - <id>393555</id> in the last post made, but <id>2182585</id> the post just before that.

So what I do not understand is, why are the postids so out of whack? They should be incremental given they are new posts added to the post table.

MPDev 09-11-2006 06:34 PM

You can try the change from this post:

https://vborg.vbsupport.ru/showpost....8&postcount=42

And see if that makes a difference.

djwins 09-11-2006 06:34 PM

Really? Seems ok to me...

Could it have somethingt o do with people editing old posts?

MPDev 09-11-2006 06:37 PM

No, must be the query I am using; I only have one 3.5 site to test on and the query works using the moficiation in the link above.

I use the postid as a marker for the last post I grabbed; but when those number are so out of whack, then it never sees anything else because that first record id was so high. We might need to switch to using a datestamp variable.

MPDev 09-11-2006 06:59 PM

Okay, I did some checking - the postid is coming from the first post in the thread; not the last. This is a problem for vB3.5 and requires making the change I outlined above.

I can update the module here, but people running larger sites will want to add an index on dateline in the post table.

djwins 09-12-2006 06:53 AM

Quote:

Originally Posted by MPDev
You can try the change from this post:

https://vborg.vbsupport.ru/showpost....8&postcount=42

And see if that makes a difference.

I cant find where to make the change.
My line 57 is blank.

MPDev 09-12-2006 11:26 AM

Download from the current file and upload the va_spy.js and vaispy.php files.

djwins 09-12-2006 01:35 PM

I want to make the change you posted here, but not sure my line 267 is the same as yours. Can you post the code from the line before as well?

MPDev 09-12-2006 01:46 PM

It would be easier if you just downloaded the current files.

ChurchMedia 09-12-2006 03:04 PM

Thanks for the cool hack!

On mine, it isn't following permissions correctly. It's showing *all* the threads no matter who you are. Could this be because I'm running 5.2?

Gizmo5h1t3 09-12-2006 03:19 PM

ok, ive uploaded the most recent files, which obviously overwrite the old ones...thing is, the fix u supplied in the last one to get the thing to go to the last post in a thread, the code u supplied i cant find now in the file to adapt...can u help, as now the newestfiles dont go to the last post, they go to the FIRST.....

MPDev 09-12-2006 05:17 PM

Well, the only change I can think of is in va_spy.js at line 279:

Code:

                post_url = vburl + 'showthread.php?t=' + threadid + 'goto=laspost';

djwins 09-13-2006 11:34 AM

Actually, this is better:
Code:

        post_url = vburl + 'showthread.php?goto=lastpost&t=' + threadid;
Is there a way to get that query/performance improvement ported over to the 3.5 version?

stud 09-13-2006 03:56 PM

i noticed this also. The link it is generating is incorrect:

http://www.domain.com/forum/showthread.php?t=1484#60

#60 will not work as a modifier


All times are GMT. The time now is 11:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01388 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete