vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Cyb - Advanced 'New Posts' (AJAX) (https://vborg.vbsupport.ru/showthread.php?t=201308)

Valter 01-09-2009 10:00 PM

Cyb - Advanced 'New Posts' (AJAX)
 
1 Attachment(s)
Info:
This hack will show how many new posts/threads have been posted in forums since 'last visit' time. "New Posts" in navbar menu will be replaced with "New Posts: x (In y Threads)" which is updated via AJAX - no page refresh. User can manually check for new posts, or you can enable auto-check which is executed in defined time interval. Optionally you can enable and configure Smart Search Menu to give users ability to search only selected forum sections. See screenshots...

Installation:
Import product XML: AdminCP > Plugin System > Manage Products > [Add/Import Product]

To set options:
Go to: AdminCP > vBulletin Options > Cyb - Advanced 'New Posts'

Versions:
v1.0 - Apr 29. 2006.
-First version
v1.5 - Jun 25. 2006.
-Added - advanced searching of new posts (see screenshots)
-Fixed known bugs, code optimized
v1.6 - Jun 26. 2006.
-Advanced searching of new posts splitted into two navbar items
v1.7 - Jun 28. 2006.
-Depending on number of new posts different phrase is used
-Added links to phrases to hack options page so you can easily find and change/translate them.
v1.8 - Aug 04. 2006.
-Release of this hack for vB v3.6
v1.9 - Sep 28. 2006.
-Added Product Version Checking
-Fixed links to phrases in ACP (used to easily customize phrases)
-Added option to change text color
-Fixed bug (unneeded extra space after "SSM" in navbar menu)
-Product name changed to "Cyb - Advanced 'New Posts'"
NOTE: Before upgrading save somewhere content of "Menu Items" field to restore it after upgrade. It will be removed during upgrade process.
v2.0 - Jul 31. 2007.
-Added "No New Posts" to show when there is no new posts after user last visit
-Smart Search Menu (SSM) improved (no more need to write lines of code, just put forum IDs in setting field)
-SSM automatically hidden when there is no new posts
-A lot of improvements and optimization done, including:
*two templates removed
*improved integration with different styles (to avoid manual template edits)
v2.1 - May 03. 2008.
-Compatible with vBulletin 3.7
-Minor bugs fixed
v2.2 - Jan 14. 2009.
-New: New post check is now done via AJAX - no page refresh ;-)
-New: Auto-check for new posts every x seconds
-Ability to set order of items in Smart Search Menu
-Minor bugs fixed
v2.3 - Jan 15. 2009.
-New: Set how often user can manually check for new posts
-New: Option to colorize text only when there are new posts
-New: Option to disable product in selected styles
-Fixed some minor bugs
v2.4 - Jan 18. 2009.
-Added permissions check to fix problems where sometimes incorrect numbers are shown
-Fixed bug where unexpected content is shown on user session expiration

Mark as installed to get support and updates.

thunderclap82 01-12-2009 04:13 PM

After installing this mod I get an error when clicking on New Posts. It says it can't find the search.php?do=getnew file.

Blue91 01-12-2009 06:07 PM

Good hack! Installed.

Request for you...

Can it be made so the forums are listed in the order they are inserted into the "hack options" list? Right now, it orders them alphabetically.

Also, can it be made so that the forums listed are ONLY shown if they have new posts made in them? Otherwise, they aren't shown on the dropdown? This way I could add every forum and only the ones posted in latest would show!

Thanks!

Blue91 01-12-2009 06:19 PM

Also, it works 100% on my forums index (www.pomoforacing.com/forums). However, the "new posts" link does not work on my main page (vbAdvanced cmps).

On the forums index, the link goes to http://www.pomoforacing.com/forums/search.php?do=getnew

On the home page (vbadvanced cmps), the link goes to http://www.pomoforacing.com/search.php?do=getnew (note the absence of "forum"). As a result, I get a "can't be found". How can I fix this?

Thanks!

thunderclap82 01-12-2009 07:37 PM

Ah! That's the problem I'm having! It works in the main forum, but not vBadvanced. Good catch Blue91.

Trek 01-12-2009 07:47 PM

Funny, I was working on coding something like this today as my second mod ever... now I don't need to. Thanks again!

Although, I'm kinda pissed that I have to think of something new to mess around with! ;)

Trek 01-12-2009 07:54 PM

Ok, I installed, but have some issues.

The issues are, I use a custom style. It changes the default style without a problem. The bigger issue is, if it's enable, it breaks my custom style display.

I know this isn't really a fault of the mod, but am looking for any help you can provide as I'd like to use this!

My custom style has the navbar info in the header template, not the navbar template (Don't ask me why, I didn't make it, I just bought it).

This mod will remove the "new Posts" in the header, but it's not replaced with anything. so it's basically gone.

Can you tell me what I would need to insert into my header section to display this correctly in my custom style?

thunderclap82 01-12-2009 07:55 PM

UPDATE: I've gotten the link working properly in vBadvanced, but it doesn't seem to be displaying the new message number correctly.

To fix the link search your style(s) for search.php

In the list select cyb_advancednewposts

Find the href="search.php?" and replace with href="/<forum dir>/search.php?"

This will get the links working properly under vBadvanced.

Blue91 01-12-2009 08:20 PM

That got me fixed thunderclap82. Good job. I just changed it so I haven't gotten enough posts yet since I did it to see if the message number is correct.

Hopefully Cyb can help me with the other inquiries that I had about this mod!

Trek 01-12-2009 09:24 PM

Cybernetec: Do you do any custom work? Meaning I could toss a couple bucks your way? There's no way to contact you privately so... I'm leaving this message.

Anyway, let me know. I just want this mod tweaked to work with my forum templates.

Blue91 01-12-2009 10:15 PM

thunderclap82.... as it turns out, by adding forums/ in front of the search.php callout like you said, my newposts link on the actual forums doesn't work now.

So I'm back to square one, as described in post #4. :( Can someone out there help?

I suck at coding but I'm starting to wonder if I'm going to have to turn the entire cyb_advancednewposts template into an if/then statement. I have no idea how to do that (yet).

TimberFloorAu 01-12-2009 10:19 PM

Blue91 have you added this hack string to vb advanced in admincp.

ie. the bit where you specify prefix urls.?

Infopro 01-12-2009 10:27 PM

Quote:

Originally Posted by thunderclap82 (Post 1710118)
UPDATE: I've gotten the link working properly in vBadvanced, but it doesn't seem to be displaying the new message number correctly.

To fix the link search your style(s) for search.php

In the list select cyb_advancednewposts

Find the href="search.php?" and replace with href="/<forum dir>/search.php?"

This will get the links working properly under vBadvanced.

Change /<forum dir>/ to

{$vbulletin->options[bburl]}/

Infopro 01-12-2009 10:49 PM

1 Attachment(s)
I also had to change this:
<div class="vbmenu_popup" id="cyb_forumsearch_menu" style="display:none">

To this:
<div class="vbmenu_popup" id="cyb_forumsearch_menu" style="display:none;margin-top:3px" align="$stylevar[left]">

Still trying to locate the space in toolbar just before the "New Posts" text.

Blue91 01-12-2009 11:01 PM

Quote:

Originally Posted by TimberFloorAu (Post 1710287)
Blue91 have you added this hack string to vb advanced in admincp.

ie. the bit where you specify prefix urls.?

I wouldn't know where to add it. It looks like I got the search issue taken care of though (thanks infopro).

Now the issue is like thunderclap82 mentioned above... the "numbering" feature doesn't work with the main page. It just says "No New Posts". However, it works fine with the forums index, showing how many new posts there really are.

*shrug*

subnet_rx 01-12-2009 11:07 PM

Why is there so much space on both sides of the new posts link? Can that be fixed?

thunderclap82 01-12-2009 11:14 PM

Quote:

Originally Posted by Blue91 (Post 1710281)
thunderclap82.... as it turns out, by adding forums/ in front of the search.php callout like you said, my newposts link on the actual forums doesn't work now.

Really? It works for me. Did you include the slash before forums? (i.e. /forums/) You don't have it listed that way above. If not that could be causing the problem.

Infopro 01-12-2009 11:24 PM

Quote:

Originally Posted by Blue91 (Post 1710331)
I wouldn't know where to add it. It looks like I got the search issue taken care of though (thanks infopro).

Now the issue is like thunderclap82 mentioned above... the "numbering" feature doesn't work with the main page. It just says "No New Posts". However, it works fine with the forums index, showing how many new posts there really are.

*shrug*

There are 4 places to add what I posted. Search that template for href to find them.

thunderclap82 01-13-2009 12:38 AM

Quote:

Originally Posted by Infopro (Post 1710321)
I also had to change this:
<div class="vbmenu_popup" id="cyb_forumsearch_menu" style="display:none">

To this:
<div class="vbmenu_popup" id="cyb_forumsearch_menu" style="display:none;margin-top:3px" align="$stylevar[left]">

Still trying to locate the space in toolbar just before the "New Posts" text.

I tried adding this but in vBadvanced it still says "No New Messages".

Dax IX 01-13-2009 04:02 AM

Quote:

Originally Posted by thunderclap82 (Post 1710402)
I tried adding this but in vBadvanced it still says "No New Messages".

You need to add template variables into your vBA configuration under Portal Output Global Variables.

I have:
Code:

cybanp_ssmforums
cybanp_posts
cybanp_threads

Good luck. :)


I have a question, tho...how would I only show the forums that have new posts in them in the SSM list? Also, how would you only show the forums that a user has permission to view at the same time?

Thanks! :)

thunderclap82 01-13-2009 11:43 AM

Quote:

Originally Posted by Chani (Post 1710534)
You need to add template variables into your vBA configuration under Portal Output Global Variables.

That did it. Thanks!

Blue91 01-13-2009 01:16 PM

Yep yep, that worked. Thanks Chani. I too would like to show just the forums that have new posts in the SSM list. Until a way is figured out, I just turned that option off.

Infopro, I added the variable you gave yesterday and it worked. My reply was to the guy who posted above you. :)

Valter 01-13-2009 10:29 PM

v2.2 - Jan 14. 2009.
-New: New post check is now done via AJAX - no page refresh ;-)
-New: Auto-check for new posts every x seconds
-Ability to set order of items in Smart Search Menu
-Minor bugs fixed

To upgrade:
-Import XML, allow overwrite
-Check settings, update if needed
-Translate new phrases if needed

Blue91 01-13-2009 10:34 PM

Installed it... overwrote the existing... the link disappeared from the navbar. Removed and reinstalled 2.1, everything back to normal.

Trek 01-13-2009 10:44 PM

Installed, works fine on the default theme and doesn't mess up my custom theme anymore, but still doesn't work on the custom theme. (I'm still willing to pay someone to make this work with my theme if anyone is interested)

Also, when using the default theme, it says there are 5 new posts in 3 threads. However, clicking the link to see the new threads, takes me to the "There are no new posts" page... Which is correct, there are no new posts for me to read.

thunderclap82 01-14-2009 12:43 AM

Quote:

Originally Posted by Blue91 (Post 1711489)
Installed it... overwrote the existing... the link disappeared from the navbar. Removed and reinstalled 2.1, everything back to normal.

Same here. Unfortunately I don't have a backup of version 2.1 so I can't reinstall it.

lowey 01-14-2009 07:17 AM

Quote:

Originally Posted by Trek (Post 1711494)
Installed, works fine on the default theme and doesn't mess up my custom theme anymore, but still doesn't work on the custom theme. (I'm still willing to pay someone to make this work with my theme if anyone is interested)

Also, when using the default theme, it says there are 5 new posts in 3 threads. However, clicking the link to see the new threads, takes me to the "There are no new posts" page... Which is correct, there are no new posts for me to read.

Same here! :(

Blue91 01-14-2009 01:18 PM

Quote:

Originally Posted by thunderclap82 (Post 1711579)
Same here. Unfortunately I don't have a backup of version 2.1 so I can't reinstall it.

PM me your email address and I'll email it to you.

dvsDave 01-14-2009 02:26 PM

Feature Request: Can forum permissions be integrated into this? I want my moderators to be able to see new posts in their private forum, but I don't want normal users to even know it exists.

Pessimist 01-14-2009 06:37 PM

Feature Request: Extra option for Text Color.
Enable text coloring only when there are new messages: Yes/No

Pessimist 01-14-2009 07:09 PM

Cybernetec
And one HTML validation fix ;)

Line 48, Col. 125:
Code:

&
should be:
Code:

&amp;

Valter 01-14-2009 10:51 PM

v2.3 - Jan 15. 2009.
-New: Set how often user can manually check for new posts
-New: Option to colorize text only when there are new posts
-New: Option to disable product in selected styles
-Fixed some minor bugs

To upgrade:
-Import XML, allow overwrite
-Check product settings, update if needed

thunderclap82 01-14-2009 11:07 PM

Like v2.2, after the install the New Posts navbar button disappears. Had to revert to v2.1.

gwerzal 01-15-2009 02:37 AM

Im having the same problem as this dude.

Would really like to use this as well
Quote:

Installed, works fine on the default theme and doesn't mess up my custom theme anymore, but still doesn't work on the custom theme. (I'm still willing to pay someone to make this work with my theme if anyone is interested)

Also, when using the default theme, it says there are 5 new posts in 3 threads. However, clicking the link to see the new threads, takes me to the "There are no new posts" page... Which is correct, there are no new posts for me to read.

Blue91 01-15-2009 01:02 PM

Yep, install still isn't working on versions after 2.1. Can you verify the install setup?

webspider 01-15-2009 04:44 PM

Great mod. Would it be possible to have an exclude forum option?

Blue91 01-15-2009 06:46 PM

Anyone else having trouble with getting v2.3 to work/show up on the forums?

2.1 is working. 2.2 nor 2.3 worked for me.

Trek 01-16-2009 01:24 AM

1 Attachment(s)
Anyone have one of the older versions? 2.3 shows the incorrect numbers, I've attached a screenshot that will show exactly the problem.

Blue91 01-16-2009 01:52 AM

I can email you 2.1 tomorrow (I have it on my work laptop). I have 2.2 also but it never worked for me (took the entire thing out of the navbar).

Trek 01-16-2009 02:26 AM

Thanks, that'll be great! I found 2.2, but had the same issues with the counts being wrong.

Quote:

Originally Posted by Blue91 (Post 1714094)
I can email you 2.1 tomorrow (I have it on my work laptop). I have 2.2 also but it never worked for me (took the entire thing out of the navbar).



All times are GMT. The time now is 06:05 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.09863 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

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

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