vb.org Archive

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

Paul M 08-13-2006 10:00 PM

Unread Posts and Reputation Comments (welcome box)
 
This modification is no longer available or supported.

Note: The unread posts portion of this hack only works if you use the database thread marking system.

This will display the actual number of posts that are still considered unread by you (and will show up in a 'getnew' search).

Versions 1.22+ also display the number of new reputation comments since you last checked your usercp.

There is the option to count the unread posts since your last visit, or all posts considered unread. This setting reflects the divider in the 'getnew' search display. There is also the option to disable the unread posts display or the new reputation comments display.

All settings are located in vBulletin Options > Display Unread Posts and Reputation.

To install this hack unzip the xml file and import it using the ACP Product Manager.


History:

v1.11 : First Release for vb 3.6 - various changes.
v1.12 : Updated for Version Checking.
v1.13 : Phrases Updated.
v1.14 : Dependancies updated, URL's updated.
v1.15 : Minor phrasing changes.
v1.16 : Changes to the way displayed messages are built.
v1.17 : SQL Changes to use slave.
v1.18 : Fixed broken Index creation (on install).
v1.19 : Modified slightly to exclude moderated or soft deleted posts (unless moderator).
v1.20 : Duplicate line of code removed.
v1.21 : ATCS and disable options added.
v1.22 : New reputation comments added. ATCS removed as now unnecessary.
v1.23 : Bug fixes. Added links prefix setting.
v1.24 : Fix reputation comments not being marked as read.
v1.25 : Permission check updated to include 'canviewthreads'.


nix 08-14-2006 01:41 AM

Thanks for the update. I was using the 3.5 version but its nice to have the official 3.6 one.

Roxie 08-14-2006 01:44 AM

Thanks!

Phaedrus 08-14-2006 01:53 AM

Okay, I loaded it, it shows up in my Products, but I have nothing about unread posts in the welcome box... What have I done wrong?

Roxie 08-14-2006 01:55 AM

I have the same issue. I actually went back to see if I needed to edit any templates. O_o

nix 08-14-2006 02:08 AM

Working fine here. Just unistalled the old one and installed the new one. Didn't need to do any edits or settings.

Phaedrus 08-14-2006 02:13 AM

I didn't have an old version. This is the first version I ever loaded...

I even see the two options in my CP as it stated I would. Just nothing in the welcome box.

Phaedrus 08-14-2006 02:33 AM

I uninstalled it now. I have it to try again later, but if it isn't working there is no real reason to keep it loaded...

Phaedrus 08-14-2006 02:40 AM

Okay, I figured out why it wasn't working, have reloaded it and it is working...

In ACP -> vBulletin options -> General Settings -> Thread/Forum Read Marking type... You need to select one of the Database options or it won't work....

pauloo 08-14-2006 06:23 AM

Thank you Paul

wii 08-14-2006 08:47 AM

Can this be modified to show in the header between calendar and seach, like this:

Calendar - New Posts (45) - Search

45 is just an example, this would be post count.

Thanks

Virtex-II 08-14-2006 10:18 AM

It works fine for me but I would prefer to place it below the "You last visited" string. How can it be done?

Yanay 08-14-2006 11:33 AM

Good hack Thanks

LoneWolfStudios 08-14-2006 11:41 AM

is a good mod, would be very helpful if i could get it to work...

The following dependencies were not met:
Quote:

1. This product is not compatible with version 3.6.0 Release Candidate 3 of vBulletin. (Compatible starting with 3.6.0)
can i get around this?

Paul M 08-14-2006 12:58 PM

Quote:

Originally Posted by LoneWolfStudios
can i get around this?

Yes, upgrade to the full version of 3.6, you should not be running an RC version.

Paul M 08-14-2006 01:00 PM

Quote:

Originally Posted by Phaedrus
Okay, I figured out why it wasn't working, have reloaded it and it is working...

In ACP -> vBulletin options -> General Settings -> Thread/Forum Read Marking type... You need to select one of the Database options or it won't work....

Hence the first line of the hack ;

Quote:

Note: This hack only works if you use the database thread marking system.
:)

Phaedrus 08-14-2006 01:20 PM

Quote:

Originally Posted by Paul M
Hence the first line of the hack ;

:)

Yeah, yeah, yeah... Hence my post about my own foolishness...

:D

Roxie 08-14-2006 01:24 PM

Looking forward to the new reps link. :D :D
Works great after I changed the database thread marking. I must be getting quite old because my eyes totally missed that tiny note.

Thanks!

Paul M 08-14-2006 02:45 PM

OK, I made it bigger. :p

Smoothie 08-14-2006 04:12 PM

Good one, installed

HMBeaty 08-15-2006 01:00 AM

How can we move the text to a different place? I'd prefer it under the "Private Messages: Unread/Total"

Luke Brown256 08-15-2006 01:35 AM

Brilliant mod, i used it on 3.5 and will use it on 3.6 so handy , although i do hate coming back online and seeing something like 4578 unread posts ;P

Paul M 08-15-2006 01:55 AM

Quote:

Originally Posted by Redlinemotorsports
How can we move the text to a different place? I'd prefer it under the "Private Messages: Unread/Total"

There is no option to move it.

HMBeaty 08-15-2006 02:38 AM

Quote:

Originally Posted by Paul M
There is no option to move it.

I know there isn't......which is why I was asking how would I go about moving it to another location? obviously the code has to modified but I have no experience with product modification.

Paul M 08-15-2006 03:06 AM

You would have to edit the plugin to disable the auto template update of the navbar, and then manually edit your navbar to put $unread where you want it.

Harry72 08-15-2006 06:57 AM

Thx Paul - very useful. :rolleyes:

bubba01 08-15-2006 09:47 AM

great hack big thx form me :)

Muellmann 08-15-2006 10:13 AM

Quote:

Originally Posted by Virtex-II
It works fine for me but I would prefer to place it below the "You last visited" string. How can it be done?

Go into the XML-File and replace

Code:

$search_text = '</strong><br />';
with

Code:

$search_text = '\$vbphrase[last_visited_x_at_y]</phrase>';
Then replace
Code:

$unread = construct_phrase('<a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
with
Code:

$unread = construct_phrase('<br /><a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
If I understood the Code correctly it should work fine for you!

Muellmann 08-15-2006 11:12 AM

Quote:

Originally Posted by wii
Can this be modified to show in the header between calendar and seach, like this:

Calendar - New Posts (45) - Search

45 is just an example, this would be post count.

Thanks

I agree, that it would be good, and so I did it and tested it for you :laugh:
Step 1: Open Paul's XML-File with Notepad
Step 2:

Search for:

Code:

$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar']);
Below add these four Lines:

Code:

$vbulletin->templatecache['navbar'] = str_replace("\$vbphrase[new_posts_nav]</a>","\$vbphrase[new_posts_nav] (".$postcount['unread'].")</a>",$vbulletin->templatecache['navbar']);
              $vbulletin->templatecache['navbar'] = str_replace("\$vbphrase[new_posts_nav]</a>","\$vbphrase[new_posts_nav] (".$postcount['unread'].")</a>",$vbulletin->templatecache['navbar']);
              $vbulletin->templatecache['navbar'] = str_replace("\$vbphrase[todays_posts]</a>","\$vbphrase[todays_posts] (".$postcount['unread'].")</a>",$vbulletin->templatecache['navbar']);
              $vbulletin->templatecache['navbar'] = str_replace("\$vbphrase[todays_posts]</a>","\$vbphrase[todays_posts] (".$postcount['unread'].")</a>",$vbulletin->templatecache['navbar']);

Step 3: Re-Import the XML (allow overwrite=Yes) - Yep you're done! :cool:
And don't forget to refresh your Browser :p

Muellmann 08-15-2006 11:31 AM

Quote:

Originally Posted by Redlinemotorsports
How can we move the text to a different place? I'd prefer it under the "Private Messages: Unread/Total"

Customize just the default Searchtext for proper Replacement

Find this in Paul's XML-Product-File:
Code:

$search_text = '</strong><br />';
Replace with:
Code:

$search_text = '\$vbphrase[private_messages_nav]</phrase></if>';
Find this:
Code:

$unread = construct_phrase('<a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
Replace with (just to ensure to have it in the new Line):
Code:

$unread = construct_phrase('<br /><a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
It should normally work (untested)!
Save with Notepad - Re-Import Hack, Allow overwrite 'yes', refresh Browser :)

Ivander 08-15-2006 02:38 PM

Can someone explain how i can add IP Data for User X ?

Example:

Welcome Paul (xx.xx.xx.xx)

Xx= Current IP of Paul


*excuse my bad English :(

Paul M 08-15-2006 05:28 PM

Quote:

Originally Posted by Ivander
Can someone explain how i can add IP Data for User X ?

Welcome Paul (xx.xx.xx.xx)

Xx= Current IP of Paul

Set the option to 'Yes' in the settings.

Paul M 08-15-2006 05:33 PM

Quote:

Originally Posted by Muellmann
Go into the XML-File and replace

Code:

$search_text = '</strong><br />';
with

Code:

$search_text = '\$vbphrase[last_visited_x_at_y]</phrase>';

This won't work, the template cache is not the same as the template itself - it is actually php code, you cannot search for vb template specific stuff like <if> and <phrase>.

Ivander 08-15-2006 07:06 PM

@Paul

Can you also add more info.Example

Number of unread Post: (already done)
new feature

- X new Post and y new Threads after your Last Visit

louis_chypher 08-15-2006 07:16 PM

I changed to location of where the link shows up by putting "<!-- Paul M, unread Post Count -->' at the template location I want the mod to be displayed.
then I changed the search text to:
Code:

$search_text = '<!-- Paul M, unread Post Count -->';
I also properly edited the line
Code:

$unread = construct_phrase('<a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
to reflect the proper html requirements of the selected location.

(The above only represents an example the changes of that I did to change the location of this modifications displayed info)

I can see why the author would not be supportive of moving the location due to the rather large possibilities of HTML combinations that exist in the templates.

This mod should be part of vB. Of all the mods that I've added to the site this mod ranks up there with the journal as the most praised and its only been on the site for a day. Thanks!

Ivander 08-15-2006 07:36 PM

Quote:

Originally Posted by Paul M
Set the option to 'Yes' in the settings.

Wrong Post ?

I am searching for a IP Solution after the Username ;)

Virtex-II 08-15-2006 08:48 PM

Quote:

Originally Posted by louis_chypher
I changed to location of where the link shows up by putting "<!-- Paul M, unread Post Count -->' at the template location I want the mod to be displayed.
then I changed the search text to:
Code:

$search_text = '<!-- Paul M, unread Post Count -->';
I also properly edited the line
Code:

$unread = construct_phrase('<a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
to reflect the proper html requirements of the selected location.

(The above only represents an example the changes of that I did to change the location of this modifications displayed info)

I can see why the author would not be supportive of moving the location due to the rather large possibilities of HTML combinations that exist in the templates.

This mod should be part of vB. Of all the mods that I've added to the site this mod ranks up there with the journal as the most praised and its only been on the site for a day. Thanks!


That was my solution too, plus I changed it a little bit more to make it look like the "Private Messages" line!!!

Paul M 08-15-2006 10:03 PM

Quote:

Originally Posted by Ivander
Wrong Post ?

I am searching for a IP Solution after the Username ;)

Sorry, yes, wrong mod. What you want is not related to this modification and you need to start a seperate thread.

HMBeaty 08-16-2006 02:54 AM

Quote:

Originally Posted by Muellmann
Customize just the default Searchtext for proper Replacement

Find this in Paul's XML-Product-File:
Code:

$search_text = '</strong><br />';
Replace with:
Code:

$search_text = '\$vbphrase[private_messages_nav]</phrase></if>';
Find this:
Code:

$unread = construct_phrase('<a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
Replace with (just to ensure to have it in the new Line):
Code:

$unread = construct_phrase('<br /><a href=\"search.php?do=getnew\">'.$vbphrase['unread_posts'].'</a><br />',$postcount['unread']);
It should normally work (untested)!
Save with Notepad - Re-Import Hack, Allow overwrite 'yes', refresh Browser :)

THANK YOU!!! At least YOU read and totally understood my post

HMBeaty 08-16-2006 03:05 AM

And it didn't work :(


All times are GMT. The time now is 10:38 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.01809 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
  • (20)bbcode_code_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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