vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - Display Unread Posts and New Reputation Comments (https://vborg.vbsupport.ru/showthread.php?t=197485)

jscieza 09-03-2010 01:43 AM

Hello Paul,

First of all I'm very sorry for the off topic but I have just read that I can use your hack to get notifications when I receive one or more "post thank you(s)" and I'd like to know if that's true. If this isn't true then may I ask you if there is any chance to see something like this in your first post in the near future? "Version 3.8.005 adds support for the "Post Thank You Modification" (by Abe1)." :D

Thank you,
Jonathan

Paul M 09-03-2010 12:40 PM

Quote:

Originally Posted by jscieza (Post 2093070)
Hello Paul,

First of all I'm very sorry for the off topic but I have just read that I can use your hack to get notifications when I receive one or more "post thank you(s)" and I'd like to know if that's true.

I have no idea if its true, there is no specific code for it.

jscieza 09-04-2010 05:21 AM

You forgot this:

Quote:

then may I ask you if there is any chance to see something like this in your first post in the near future? "Version 3.8.005 adds support for the "Post Thank You Modification (by Abe1)." :D

Paul M 09-04-2010 10:08 AM

Quote:

Originally Posted by jscieza (Post 2093543)
You forgot this:

No, I didnt ;)


Nothing new is going to be added to this. Sorry.

Morrus 09-15-2010 10:29 PM

This is a silly question, probably.

Clicking on a reputation notification takes me to usercp.php. There is no section mentioning reputation there. Does that require another mod, or have I somehow disabled the display?

Paul M 09-15-2010 11:26 PM

You have somehow disabled the display.

Alfa1 09-16-2010 09:46 AM

Does this addon allow me to add new reputation count to the 'your notifications' drop down?
Is it possible to not display 'Unread posts' ?

Thanks.

Paul M 09-16-2010 12:22 PM

The answer to both is in the main post ;)

Morrus 09-16-2010 04:36 PM

Quote:

Originally Posted by Paul M (Post 2098858)
You have somehow disabled the display.

Apparently so. I have it on the profile page, though. What template is the destination URL on, so that I can edit it to point at the profile instead?

Morrus 09-16-2010 10:07 PM

I just did a search in templates and phrases and couldn't find the reference.

Morrus 09-16-2010 10:12 PM

OK, found it in the XML file.

I tried replacing the reference to "usercp?" with "member.php?$session[sessionurl]u=$bbuserinfo[userid]" but that doesn't work.

Anyone got any ideas what I need to put there to have it go to the user's profile page?

Paul M 09-17-2010 10:41 AM

Why dont you just enable your reputation display in your usercp.

Morrus 09-17-2010 11:05 AM

Because I can't find the control to do so. As far as I can tell from the AdminCp it is set to show. The code must have gotten deleted from the USERCP temlpate somehow.

Paul M 09-17-2010 07:23 PM

Sounds unlikely, are you sure you havent just disabled it in your usercp ?

Morrus 09-17-2010 07:53 PM

Quote:

Originally Posted by Paul M (Post 2099767)
Sounds unlikely, are you sure you havent just disabled it in your usercp ?

Yes, I am sure.

It may have sounded unlikely, but the code was missing. I copied it over from someone else's vBulletin board, and now it's back. Thanks to that person for their help.

Tourmeister 10-22-2010 04:17 AM

Can't think of a better place to ask this, so here it goes.

What I have is a forum section with several subforums that are populated using the RSS feed system in VB. People want to be able to see these forums, but because of the number of threads, they don't want them showing up in the search results for unread posts. So using the new version of the Unread Posts mod in conjunction with the Selective Forum Filter won't work because that would prevent them from seeing the subforums at all.

The code below is from the Unread Posts mod version I have installed (version 1.02). So what I am hoping is that it might be a simple case of just adding a conditional or something to the PHP code to force the exclusion of those subforums from the search all the time. The problem is I don't know squat about coding in PHP. Can someone please indicate what I would have to add/change to accomplish this?

Code:

$unread = "";
if ($vbulletin->userinfo['userid'] AND $vbulletin->options['threadmarking'])
{
        $unread = "No unread posts";

        $xforum_ids = array_keys($vbulletin->forumcache);

        foreach ($xforum_ids AS $key => $xforum_id)
        {
                $xfperms = & $vbulletin->userinfo['forumpermissions']["$xforum_id"];
                $xforum = & $vbulletin->forumcache["$xforum_id"];
                if ( !($xfperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($xfperms & $vbulletin->bf_ugp_forumpermissions['cansearch']))
                {
                        unset($xforum_ids["$key"]);
                }
        }

        if (empty($xforum_ids))
        {
                $xforum_list = "0";
        }
        else
        {
                $xforum_list = implode(', ', $xforum_ids);
        }

        if ($vbulletin->options['unreadlv'])
        {
                $cutoff = $vbulletin->userinfo['lastvisit'];
        }
        else
        {
                $cutoff = TIMENOW - ($vbulletin->options['markinglimit'] * 86400);
        }

        $postcount = $vbulletin->db->query_first("
                SELECT COUNT(post.postid) as unread
                FROM " . TABLE_PREFIX . "post as post
                INNER JOIN " . TABLE_PREFIX . "thread as thread ON (thread.threadid = post.threadid)
                LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " . $vbulletin->userinfo['userid'] . ")
                INNER JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
                LEFT JOIN " . TABLE_PREFIX . "forumread AS forumread ON (forumread.forumid = forum.forumid AND forumread.userid = " . $vbulletin->userinfo['userid'] . ")
                WHERE thread.forumid IN($xforum_list)
                AND thread.sticky IN (0,1) AND thread.visible IN (0,1,2)
                AND thread.lastpost > IF(threadread.readtime IS NULL, $cutoff, threadread.readtime)
                AND thread.lastpost > IF(forumread.readtime IS NULL, $cutoff, forumread.readtime)
                AND thread.lastpost > $cutoff
                AND post.dateline > IF(threadread.readtime IS NULL, $cutoff, threadread.readtime)
                AND post.dateline > IF(forumread.readtime IS NULL, $cutoff, forumread.readtime)
                AND post.dateline > $cutoff
        ");

        if ($postcount['unread'])
        {
                if ($postcount['unread'] == 1)
                {
                        $unread = "1 Unread Post";
                }
                else
                {
                        $unread = $postcount['unread']." Unread Posts";
                }
        }

        if ($vbulletin->options['unreadlv'])
        {
                $unread = "<a href='/forums/search.php?do=getnew'><b>" . $unread . "</b></a> since your last visit.<br />";
        }
        else
        {
                $unread = "You have <a href='/forums/search.php?do=getnew'><b>" . $unread . "</b></a><br />";
        }

        $search_text = '</strong><br />';
        $vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar']);
}

Thanks.

Paul M 10-22-2010 03:16 PM

Version 1.02 ? Thats ancient vb3.5 code !

If you change the forum option "Index New Posts in Search Engine" to no, they will be excluded. Other than that it would require a bit of new code.

Tourmeister 10-25-2010 04:41 PM

Quote:

Originally Posted by Paul M (Post 2112804)
Version 1.02 ? Thats ancient vb3.5 code !

Yeah, I know it is ancient code, hehe. However, when we tried upgrading to one of the newer versions a while back, we kept having server load spikes that would shut down our site. When we reviewed the logs it constantly showed that it was queries by the Unread Post mod that were causing the spikes. When we disabled the mod, the spikes stopped. When we re-enabled it, they started again. The old version was working fine so we just stayed with it. I have not tried the latest version though, which I may do since it appears you have released a new version or two since we last tried.

Quote:

If you change the forum option "Index New Posts in Search Engine" to no, they will be excluded. Other than that it would require a bit of new code.
I have tried that. It works for some users but not others. What is strange is that all the users are in the same default "Registered Users" usergroup. I even set the permissions for the RSS feed forum so that Registered Users can't search it.

If I upgrade to the new version of the mod, does it have a setting that lets me exclude individual forum sections from the search but would still allow users to see those forums if they want to view them?

Tourmeister 10-25-2010 06:05 PM

Problem solved.

I have the forum properties for "Index New Posts in Search Engine" set to NO. But your comment got me to thinking...

I did not have the forum permissions for ALL usergroups set to NO for searching as well. I had the default "Registered Users" set to NO for searching, but some of those users are also members of other additional usergroups whose permissions for searching searching the forum were still set to yes. The forum permission system will always pick the yes if there is a conflict between settings in different places. I set ALL those other groups to NO as well, and now everything works fine!

Thanks!

khurtsiya 12-13-2010 07:29 PM

is it possible to insert this count near the link New Posts in navbar? F.e.:

New Posts (429)

Been Told 03-26-2011 08:57 PM

I am sorry if this has been asked already... But are there any plans for this Addon to be updated for vB4?

Eq4bits 03-26-2011 11:59 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=231060" target="_blank">Here for vB4 mod</a>

Been Told 03-27-2011 07:16 AM

Thanks, I appreciate it!

viper357 09-02-2011 01:41 PM

Quote:

Originally Posted by khurtsiya (Post 2133437)
is it possible to insert this count near the link New Posts in navbar? F.e.:

New Posts (429)

+1

Please Paul ;) :D:D:D:D

Max Taxable 03-11-2012 12:27 AM

Paul, I am late to this party but just did download and install this Mod. There is a conflict with this Mod and Quick Account Switch - they're trying to occupy the same space, apparently attached to the same phrase in the welcome box.

Can you coach me exactly where this is in the Navbar template so I can edit?

Paul M 03-11-2012 01:49 PM

The phrase it attaches to is 'welcome_x_link_y'.

Max Taxable 03-11-2012 02:23 PM

Quote:

Originally Posted by Paul M (Post 2308530)
The phrase it attaches to is 'welcome_x_link_y'.

Thank you. Any suggestions on editing the XML file replacing that with 'private_x_link_y' or whatever the exact correct phrase is, to get this under the line, "Private Messages Unread X Total XXX?"

This, so I can upload the XML again and get this replacement globally instead of having to hunt through all eight skins I have manually?

In reality, I think my problem would be gone if there was a page break inserted, separating this from the QAS script. Any suggestions on this possibility?

Paul M 03-12-2012 01:22 AM

If you search the XML for 'welcome_x_link_y' you will see the code you need to modify to suit your requirements.

Max Taxable 03-12-2012 01:48 AM

Quote:

Originally Posted by Paul M (Post 2308710)
If you search the XML for 'welcome_x_link_y' you will see the code you need to modify to suit your requirements.

Should be able to then stick in a </ br> ??

Paul M 03-13-2012 05:27 PM

Try it and see.

Max Taxable 03-13-2012 11:33 PM

Quote:

Originally Posted by Paul M (Post 2309138)
Try it and see.

Too skeered.

dethfire 05-19-2013 10:02 PM

wish there was warning that it added an index. took forever on my large forum and eventually timed out and mysql crashed

SKREETS.NET 07-25-2013 05:00 AM

thank you so much!! i love you

TTayfun 12-14-2017 03:35 PM

files????

Mark.B 12-14-2017 10:18 PM

Quote:

Originally Posted by TTayfun (Post 2591585)
files????

The author, Paul M, has taken the decision to remove all his add-ons from this site.

This is the right of anyone who releases add-ons here, and as such the add-on is no longer available.

In line with normal policy, at some point Paul's add-ons will be moved to the Modification graveyard.


All times are GMT. The time now is 10:09 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.01503 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (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
  • (35)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