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)
-   -   Mini Mods - Subscribed Threads in Notifications (https://vborg.vbsupport.ru/showthread.php?t=250461)

MoMan 09-13-2010 10:00 PM

Subscribed Threads in Notifications
 
1 Attachment(s)
As seen on www.pentaxforums.com/forums/ , I'm bringing you a handy mod that adds the number of new subscribed threads to the notifications area, as well as a link to subscription.php. This means that whenever someone replies to one of your subscribed threads, you don't have to check your user cp or your e-mail inbox- just click on the notification! Notifications can also be reset via the User CP (memcached version only*).

This mod is provided free of charge, but I ask that the copyright and contact information be retained within the SOURCE. There are no visible copyrights for this mod. Furthermore, I ask that you do not re-use this code without my permission.

Non-Memcached Version:
Time to install: <1 minute (upload 1 product file)
Current Version: 1.1.0
Queries: 1 per pageload for logged in users
Templates: 0
New Phrases: 1
Compatibility: vB 3.7.x-4.x

Love this mod? Support further projects by donating: http://www.pentaxforums.com/forums/donations/

Enjoy and don't forget to mark this as installed if you decide to use it! Limited support will be offered to those who click install.

Note to owners of large forums: I also offer a version of this mod that does not add any global queries and instead utilizes memcached. I can install this premium version on your site for an hourly charge, assuming your server already has memcached installed. Send me a PM for details.

MagicThemeParks 09-14-2010 10:35 AM

Thanks for this MoMan :)

I'll be adding this for the coming weekend. How do your members enjoy this mod? Do they feel that it's useful or have you not received many comments about it on your own site?

MoMan 09-14-2010 12:33 PM

They feel it's very useful- but requested a "notification reset" link, which I've now implemented. I expect to release the updated version shortly.

vijayninel 09-14-2010 02:02 PM

Brilliant. Waiting for the new version to be released. :)

MoMan 09-14-2010 02:33 PM

New version is out! Keep it mind that the new functionality is memcached-only, and further features will only be implemented in that version.

karlm 09-15-2010 03:12 AM

Interesting... what would you need for a test board? I mean, I have one I use for testing various things and could loan you admin access for a while if needed...

MoMan 09-16-2010 01:51 AM

I'd simply need to log in to the plugins system and see how notifications are handled in vB4. The same code should run no problem, but I bet that it needs to be put in a different place.

MoMan 09-16-2010 01:52 AM

Update: try changing the hook location for the main code from global_complete to global_bootstrap_init_complete

That should make it work in vB4- let me know!

jscieza 09-16-2010 06:43 AM

Quote:

Originally Posted by MoMan (Post 2098131)
New version is out! Keep it mind that the new functionality is memcached-only, and further features will only be implemented in that version.

There are lots of people not using memcache but xCache. You should make a version compatible with xCache... just a suggestion.

Alfa1 09-16-2010 09:55 AM

Please add an X-cache version. I'd really like to add this to my big board.

vijayninel 09-16-2010 10:46 AM

And make one for Wincache as well please.

MoMan 09-16-2010 03:25 PM

I currently don't intend on supporting any caching system other than memcached. If someone would like to adapt this to xcache/whatever other caching system, you have my permission to re-post the plugin in this thread. The adaptation is purely syntactical, and as such, should be quite easy to do.

jscieza 09-16-2010 03:53 PM

What the "Notification reset" link does?

MoMan 09-16-2010 05:11 PM

It removes the notifications currently being shown.

Taringa! CS 09-20-2010 03:02 PM

Hi!

I've got a problem using memcache... the prashe on notification dropdown it's empty on all pages but subscription.php

Eduardo Leon 09-20-2010 03:34 PM

well as i see ...

i know this mod have a problem

like "in ur DB" have got a problem.

just modify your DB in that "query" ,,,

PS :

Send me pm if you talk in spanish ....

MoMan 09-21-2010 06:36 PM

I sent you a PM. No clue what you're talking about, though!

Taringa! CS 09-30-2010 05:09 PM

Quote:

Originally Posted by Taringa! CS (Post 2100993)
Hi!

I've got a problem using memcache... the prashe on notification dropdown it's empty on all pages but subscription.php

Any updates on this?

MoMan 10-01-2010 11:16 PM

Quote:

Originally Posted by Taringa! CS (Post 2105185)
Any updates on this?

Enable debug mode, then go to your phrase manager and change the phrase type of new_subscribed_threads to global.

Taringa! CS 10-02-2010 10:16 AM

It's already on global

MoMan 10-03-2010 02:47 AM

If it's global, then the phrase should be displaying properly.

jscieza 10-13-2010 05:19 AM

When you get a bit of free time, could you please please please make a xCache compatible version?

Thank you, thank you, thank you!

MoMan 10-19-2010 07:20 AM

If I ever do get it installed on my server, I'll consider it. As I said earlier, it shouldn't be hard at all.

I've also developed an improved version of this mod for my purposes which uses an added database table instead of memcached to store read marking times. This is much more stable, and if I get time, I'll release it here as well.

Alfa1 10-19-2010 08:58 AM

Thanks. I'll wait on that then.

jscieza 10-22-2010 04:23 PM

Instead of making use of Memcache specific code why don't you simply make use of vBulletin cache, and if your vB uses xCache/Memcache/etc., then the hack will get advantage of this? Also if you go in this way you will not need two versions of your mod anymore as because if your vB doesn't make use of any cache then nothing will be cached.

Take in account that caching in memory is faster than storing the information on the database and both ways are stable.

My two cents :)

MoMan 10-23-2010 04:50 AM

Is there any documentation on that? I'll gladly tweak the public version of this mod to use the vBulletin interface if such an interface is available.

On my forum, I don't use vB_Datastore_Memcached as the database is actually faster for simple select queries from the datastore than memcached. I use memcached for mods whose queries take > 0.1s, such as iTrader, LXT, latest threads on forum home, and vBulletin's showgroups page, and the database for mods which spit out information that rarely or never changes. I'd still need two versions of the plugin :p

jscieza 10-23-2010 05:03 PM

Will be any noticeable performance impact if we use the non-cache enabled version in a busy forum? Let's say, 250 members and 2,250 guests at the same time with a cookie timeout of 30 minutes.

Thank you,
Jonathan

MoMan 10-24-2010 12:45 AM

Probably not, as it doesn't add any queries for guests. It depends on whether or not mysql is the bottleneck on your site.

The queries in this mod are relatively light unless a user has hundreds of subscribed threads. It shouldn't add much load, but does add 1 query for all users, and 2 additional queries for users with subscribed threads. On my forum, the non-cached version of this mod added just under 0.01s to the generation time of each page. The memcached version, on the other had, doesn't add anything at all, since most of the time, the queries aren't run.

jscieza 10-24-2010 05:18 AM

Hello,

Thanks for clearing things up.

I went ahead and installed the NOMEMCACHED version of your mod and it appears not to be working at all. There are two problems:
  1. There is no phrase for the notification but in usercp.php or subscription.php. Same problem reported by another user here. I don't know if phrase new_subscribed_threads is declared as global or not. Demo: http://img440.imageshack.us/img440/609/nophrase.jpg
  2. I'm not getting notifications when there are new replies to a subscribed thread.
I'm running vBulletin 3.8.5. Could you please check this?

EDIT: tested on another forum running vBulletin 3.8.1, same issues.

Thank you,
Jonathan

MoMan 10-24-2010 05:15 PM

Quote:

Originally Posted by jscieza (Post 2113494)
Hello,

Thanks for clearing things up.

I went ahead and installed the NOMEMCACHED version of your mod and it appears not to be working at all. There are two problems:
  1. There is no phrase for the notification but in usercp.php or subscription.php. Same problem reported by another user here. I don't know if phrase new_subscribed_threads is declared as global or not. Demo: http://img440.imageshack.us/img440/609/nophrase.jpg
  2. I'm not getting notifications when there are new replies to a subscribed thread.
I'm running vBulletin 3.8.5. Could you please check this?

EDIT: tested on another forum running vBulletin 3.8.1, same issues.

Thank you,
Jonathan

You should probably add this to init_startup:

$phrasegroups[] = 'user';

OR add a new custom global phrase for the product with the correct key.

This will be included in the next version of the hack.

So you're getting notifications for new threads, but not for threads with replies? That shouldn't be the case. Let me try checking if there are any problems with the code in the simple version.

jscieza 10-24-2010 05:21 PM

Quote:

Originally Posted by MoMan (Post 2113681)
You should probably add this to init_startup:

$phrasegroups[] = 'user';

OR add a new custom global phrase for the product with the correct key.

This will be included in the next version of the hack.

I prefer to wait until you release a fixed version. Please update both versions the non-cache enabled and the cache-enabled one.

Quote:

Originally Posted by MoMan (Post 2113681)
So you're getting notifications for new threads, but not for threads with replies? That shouldn't be the case. Let me try checking if there are any problems with the code in the simple version.

I have installed this and then added subscriptions to some threads... when someone replies to these subscribed threads I'm not getting the notification in top right corner (drop down). It's always (0) even when there are new replies to my subscribed threads. In other words, this product isn't working at all for me and I don't know why.

MoMan 10-25-2010 02:26 AM

When I get the time, I'll be willing to log in to your site and try to debug this. It could be the case that there are other plugins on my site not present on yours that are otherwise required. However, please note that I am pretty busy with other things at the moment and am not planning on actively maintaining the non-memcached version beyond the one released here, nor will I be releasing a single version that includes an option to enable/disable memcached.

Version 1.2.1, which I use on my site, is working flawlessly. I will do my best to release it here as well, but haven't had the time to write the install/uninstall queries needed for it to work. As I mentioned earlier, it uses the database to store marking times, so that even if memcached is flushed, threads beyond the user-set cutoff will not be displayed.

If you'd like to install memcached on your server, try the following command:
pecl install memcached

MoMan 10-25-2010 06:01 AM

I've now updated the non-memcached version to 1.0.1 final. This includes the missing phrase. Try that- do the notifications work for you?

jscieza 10-25-2010 06:17 AM

Thanks for the update!

The missing phrase issue is now fixed but unfortunately notifications aren't working.

MoMan 10-25-2010 01:32 PM

I've just realized that this mod requires DB-based thread read marking to work. Make sure that's enabled in your vB options. By default, the cookie-based method is used.

I've now added this to the OP.

jscieza 10-25-2010 04:48 PM

Yes, that was the problem. I changed from cookie based to DB based and now the product is working fine. However I prefer to continue using the cookie based method. Is there any way to adapt your product to work in a cookie based enviroment? Hope it can be possible as because most people use the default method in their forums.

Thank you,
Jonathan

MoMan 10-25-2010 10:04 PM

If the threadread cookie stores your latest thread read times, then yes, it would be possible, as that's the only piece of information that this mod needs to work. AFAIK, though, there's a 15-day expiration or something like that, so I'd recommend you make the permanent switch to the DB-based system, as it really doesn't add any load to your board.

I'm willing to adapt this to use the cookie info on a freelance basis, if you'd like to go down that road.

jscieza 10-26-2010 05:05 AM

Yes, I'll love to be able to use this product while using the cookie-based method. Hope you can do it when you get a bit of free time.

Again, take in account that most people are using the cookie-based method.

Thank you,
Jonathan

asd_ra7la 10-26-2010 08:25 AM

Fatal error: Class 'Memcache' not found in /home/XXXXX/XXXX/global.php(400) : eval()'d code on line 588

MoMan 10-26-2010 05:18 PM

Quote:

Originally Posted by jscieza (Post 2114309)
Yes, I'll love to be able to use this product while using the cookie-based method. Hope you can do it when you get a bit of free time.

Again, take in account that most people are using the cookie-based method.

Thank you,
Jonathan

I won't be doing that as part of this plugin. As I mentioned earlier, this would be something that I could consider for freelance work.


All times are GMT. The time now is 06:24 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01260 seconds
  • Memory Usage 1,821KB
  • 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_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