The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Import Unread News from a Forum Details »» | |||||||||||||||||||||||||
This hack will allow you to specify one or more forum IDs in your Admin CP as "news forums". Every time a thread is created in these forums, all users will see an "Unread news" notification at the top of every page of the forum until they view the unread news thread. If many news threads are unread, they will all be shown in the notification and removed one by one as each thread is viewed.
This hack both serves to make sure all users are aware of posted news and to give users who return after a long absence a quick rundown of what has been going on in the forums since they last were there. As of version 2.0, it is possible to specify: - Time cutoff: all news older than x days will count as read - Only check for read status on latest x threads: only the latest x news will be shown if unread; all older news will always be treated as read - Maximum number of news to display at one time: if a user has more unread news (after the time cutoff and latest x filter) than the number specfied, only that number will actually be displayed on the page - Whether to make users see news created before they joined as unread - Whether to show the date and time when each news thread was made or just the date Please note that you must have Paul_M's Display who has read a thread hack installed for this to function correctly! You don't need to actually have the people who have read the thread shown for anybody at all (heck, if you're completely uninterested in what that hack does, you don't even need to make the template edit for it), but as long as it's installed, this hack will work. Version 3.0 adds the ability to have more than one news forum and to set a PHP condition for each forum which must be met in order for news from that forum to be imported. Installation Simply download the product attached to this post and import it via the Admin CP Product Manager. Then make one template edit: add Code:
$unreadnews ------------------------------------ If using PHP version 4.x (or if you are getting an error message that looks something like Fatal error: Call to undefined function: array_combine() in /public_html/global.php(359) : eval()'d code on line 139), you additionally need to find this line in the Import News plugin on the hook global_start: PHP Code:
PHP Code:
------------------------------------ Afterwards, go to your vBulletin options, find the News Import System setting group, specify your news forum(s), set the other settings if you want, and turn the system on. Don't forget to click Install if it's working for you. Enjoy! Version 3.0: Added ability to have multiple news forums and use conditionals. Version 2.23: Important bugfix from version 2.22 Version 2.22: Bugfixes Version 2.21: Cutting off on the user's join date has been made an optional feature specified in the admin CP, and some unnecessary code has been removed. Also added alternative templates for no particular reason. Version 2.2: Fixed uncached template, added "More..." link that links to the news forum when unread news are cut off by "Maximum number of news to display at one time" option, and all news created before the user registered will now count as read for that user. (Imagine registering and having twenty "unread news" notifications you have to plough through...) Version 2.01: Added template edit information (I'm an official idiot for forgetting that) and fixed table prefixes. Version 2.0: Added functionality (see above) ---------------------------- EXTRA: Alternative templates If you don't like the way the current unread news box looks, I've got some more standard-looking templates you can use instead if you want. This also allows you to collapse the unread news, which might be useful. Just replace the templates, see how it looks, and revert the templates again if you liked the other look better. Alternative custom_unreadnews template: Code:
<if condition="$show['unreadnews']"> <br /> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <thead> <tr> <td class="tcat"><a href="#top" style="float:$stylevar[right]" onclick="return toggle_collapse('unreadnews')"><img id="collapseimg_unreadnews" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_unreadnews].gif" alt="" border="0" /></a> Unread News</td> </tr> </thead> <tbody id="collapseobj_unreadnews" style="$vbcollapse[collapseobj_unreadnews]"> $newsitems <if condition="$show['importnewscutoff']"> <tr> <td class="alt1"><a href="forumdisplay.php?$session[sessionurl]f={$vbulletin->options['importnewsforum']}" class="smallfont">More...</a></td> </tr> </if> </tbody> </table> </if> Code:
<tr> <td class="alt1">$timestamp: <strong><a href="showthread.php?$session[sessionurl]t=$id">$info[title]</a></strong></td> </tr> Show Your Support
|
Comments |
#32
|
|||
|
|||
Well, I tried again:
Fatal error: Call to undefined function: array_combine() in /public_html/global.php(359) : eval()'d code on line 139 Still not working. |
#33
|
||||
|
||||
You're using PHP 4.x. Follow the special instructions in the first post about editing the Import News plugin on global_start.
(I added information about that error message, too, for others who don't know what PHP version they're using - better play it safe.) |
#34
|
|||
|
|||
This mod is great, works here!
|
#35
|
|||
|
|||
FINALY i unistall the global anouchements i install you hack and i unstall again tha GLOBAN anouch...
And everything Work Fine |
#36
|
||||
|
||||
Quote:
Incidentally, thank you for posting that. It made me realize why I was having problems with something else: the order in which plugins are loaded depends on the time of installation. There must have been some plugins in Global Announcements that had to be loaded after some in my hack for some reason, which is why you were having those problems. Another thing to know for future hacks... |
#37
|
|||
|
|||
can you tell me now how i fix this
Uncached templates: custom_newsbit (3) The number (3) change if there is more news now there is 3 |
#38
|
||||
|
||||
Oh, right, I forgot to cache that one.
Just add PHP Code:
Updated XML will be up soon; I'm going to add a couple of hack features anyway so I'll let it wait until I'm done with that. |
#39
|
|||
|
|||
I have already add this i fount a tutorial about I waitng for more Features
|
#40
|
||||
|
||||
Version 2.2 up, with a couple of additions and the template cache fix.
Any feature suggestions would be very much appreciated. I like working on this thing. |
#41
|
|||
|
|||
nice..
Suggestion : in new version you add all news created before the user registered will now count as read for that user.. byt now with this all new users dont know the news about forum... i install it for that reason NEW Members READ THE NEWS I thing it better to cutoff more than 5 and with More Link the BLOCK LOAD THE REST (if there is more news..) I keep for the time the old Version new users must read the NEWS... Keep going |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|