It appears you have not yet registered with our community. To register please click here...

vbulletin-skins-forum
| Discussions: 2,432 | Messages: 7,174 | Members: 5,994 | Online: 25 | Newest : Hitat (Welcome!)
Logo
All times are GMT -5. The time now is 09:40 PM.

Go Back   Forums Help - vBulletin, IPB, phpBB, SMF skins and community > Forums Help Services & Products Area > Forums Help Free Stuff > Add-ons

Add-ons Products, Plug-ins, and code modifications.

Tags: , , , , ,

Comment
 
LinkBack Release Tools Search this Release Display Modes
antialiasis
Visiting Coder

vB Version:
 

Mod Version:
 

Released: 10-22-2006
 

Installs: 1
 

Last Update: n/a
 

Rating:
 
Supported
DB Changes
Installer Included
Uses Plugins
Template Changes
Code Changes
Additional Files
Is a Beta!
[3.6.0 Beta 3] Import Unread News from a Forum

This is a port of the hack for vBulletin 3.5. Upgrading the hack after upgrading the forum should not be necessary.


Quote:
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

to the bottom of the header template.

------------------------------------

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:
$newsarray = array_combine($newsids, $newsinfo);



Replace it with

PHP Code:
$newsarray = array();
foreach (
$newsids AS $key => $id)
{
$newsarray["$id"] = $newsinfo["$key"];
}



If using PHP 5 or later (which is the case if you don't get that error message), you will not need to make this edit.

------------------------------------

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>

Alternative custom_newsbit template:

Code:
<tr> <td class="alt1">$timestamp: <strong><a href="showthread.php?$session[sessionurl]t=$id">$info[title]</a></strong></td> </tr>
Release
Attached Images To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.
Attached Files To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.

Release Tools

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #1 (permalink)  
By ForumsHelp on 10-22-2006, 10:30 PM
Please Note: Visiting Coders mods and add-ons are published at Forums Help by the permission of original authors and they are for personal use only and not to be distrebuted or re-published without the authors permission.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
By without_soul666 on 01-06-2008, 12:48 PM
nice man.thanks for share this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Comment



Release Tools Search this Release
Search this Release:

Advanced Search
Display Modes

Posting Rules
You may not post new releases
You may not post comment
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1
Points Per Thread: 15
Points Per Reply: 5



Links: Babyforum.com | Deejayforum.com | Hometalkcafe.com | Equineboard.com | Evboard.com


Forums Help: Forum Skin Design and Professional Services RSS Feeds



Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Forums Help - All Rights Reserved
Release powered by GARS 2.1.6b ©2005-2006