The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vBadvanced CMPS - News Digest Module 1.02 Details »» | |||||||||||||||||||||||||||
vBadvanced CMPS - News Digest Module 1.02
Developer Last Online: Jun 2009
This header message last editted October 10th.
News Digest for vBadvanced CMPS vers. 1.0.2 This hack allows your vBadvanced hompage to display news in a digest format. Instead of having each article appear in a box, it will appear as an item in a bulleted list. These lists are sorted by date and then by category. If you're site has more than a couple of news items per day you should find this hack useful, especially if those news items are particularly small by themselves (only a line or two of text). Live examples: http://www.enworld.org/forums/index.php (starting below the ad for Dundjinni). This hack requires that you have vBadvanced CMPS of course. Image support for the categories (as seen on the enworld site) can be accomplished by installing BeerMonster's banner images on forumhome hack. If you don't want to install this other hack, or if you're boards has a different hack that associates images with forums, you'll need to modify the provided newsdigest.php file. BeerMonster's hack is found here... https://vborg.vbsupport.ru/showthread.php?t=63994 During the installation of this hack you will create 3 templates. This hack requires no file modifications in and of itself, but some supplemental hacks do require such modifications, and they'll be dealt with in detail shortly. First, the primary hack: Step 1: Prepare the newsdigest.php file. Download the attached file and put it in [yourforum]/modules/ Step 1A: If you don't want to have any forum images for your categories, or don't wish to install the forum banners hack above then open the newsdigest.php file and search for the following code. Find: PHP Code:
PHP Code:
Step 2: Create the Templates Create a new template called adv_portal_newsdigest_date and insert the following into it: HTML Code:
<if condition="$prevdate"><br /><hr></if> <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="center" valign="top" class="tborder"> <table align="center" border="1" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%"> <tr> <td align="center" valign="top" class="tcat"> $datelongform </td> </tr> </table> </td> </tr> </table> <br> HTML Code:
<b>$news[title]</b><if condition="$news['icon']"><img src="./images/forumicons/$news[icon]" align="right" height="60" weight="60"></if> HTML Code:
<b>$news[title]</b> HTML Code:
<div align="justify">$news[message] - scoop submitted by $news[postusername]</div> Go to your forum manager and create one news forum for each news category you desire to have on your news page. Also choose their display order at this step by modifying the display orders of the forums themselves. Note their forum #'s Step 4: Prepare the News Page Open your vBadvanced CMPS control panel and select "Add Module" Module Title: News Digest File to Include: newsdigest.php Templates to Include: adv_portal_newsdigest_date, adv_portal_newsdigest_category, adv_portal_newsdigest_item Step 5: Activate the Module Go to your page settings and turn the original news module off (It's redundant). Enter the forum #'s of each forum you want in any order (the display order of the categories is the same as the forums. Turn the newsdigest module on. --------------------------------------------------------- FINISHED. Version History Version 1.0.0 had several little glitches due to me rushing it out the door in my excitement from creating my first big hack. I'll demonstrate a bit more patience in the future. Version 1.0.1 (and prior) has a serious month wrap bug. Version 1.0.2 is current. If you like this hack please click install - thx. --------------------------------------------------------- Supplemental Hack: Bump and Debump News The date of the news is important with this hack. If you find an item displaying on the wrong day then you can use the following tools to scoot it around. Note - this "supplemental" hack is almost exactly like Rigel Kentaurus' "Bump Thread and Make Thread Older" hack, so I'm not going to take any credit for originality. Here is the modified version of his hack for bumping news items around for the digester. Code:
Code Modifications: 2 in 1 file Template Modifications: 2 in 1 template New phrases: 4 ################################################################### # Code modifications in file "postings.php" ################################################################### ------------------------------------------------------------------- search for this code: ------------------------------------------------------------------- case 'removeredirect': ------------------------------------------------------------------- change it to: ------------------------------------------------------------------- case 'removeredirect': // Hack: bump and debump case 'bumpnews': case 'debumpnews': ------------------------------------------------------------------- search for this code: ------------------------------------------------------------------- // ############################### start do open / close thread ############################### ------------------------------------------------------------------- change it to: ------------------------------------------------------------------- // ############################### start news bump and de-bump ########################### if ($_REQUEST['do'] == 'bumpnews') { // only mods with the correct permissions should be able to access this if (!can_moderate($threadinfo['forumid'], 'caneditthreads')) { print_no_permission(); } // Bump $DB_site->query("UPDATE ".TABLE_PREFIX."thread SET dateline=".TIMENOW." WHERE threadid='".$threadinfo['threadid']."'"); $url = "forumdisplay.php?$session[sessionurl]f=$threadinfo[forumid]"; eval(print_standard_redirect('redirect_bumpnews')); } if ($_REQUEST['do'] == 'debumpnews') { // only mods with the correct permissions should be able to access this if (!can_moderate($threadinfo['forumid'], 'caneditthreads')) { print_no_permission(); } // De-Bump $DB_site->query("UPDATE ".TABLE_PREFIX."thread SET dateline=dateline-86400 WHERE threadid='".$threadinfo['threadid']."'"); $url = "forumdisplay.php?$session[sessionurl]f=$threadinfo[forumid]"; eval(print_standard_redirect('redirect_debumpnews')); } ################################################################### # Template modifications in SHOWTHREAD ################################################################### ------------------------------------------------------------------- search for this: ------------------------------------------------------------------- <option value="removeredirect">$vbphrase[remove_redirects]</option> ------------------------------------------------------------------- change it to: ------------------------------------------------------------------- <option value="removeredirect">$vbphrase[remove_redirects]</option> <option value="bumpnews">$vbphrase[bumpnews]</option> <option value="debumpnews">$vbphrase[debumpnews]</option> ------------------------------------------------------------------- search for this: ------------------------------------------------------------------- <div><label for="ao_rrd"><input type="radio" name="do" id="ao_rrd" value="removeredirect" />$vbphrase[remove_redirects]</label></div> ------------------------------------------------------------------- change it to: ------------------------------------------------------------------- <div><label for="ao_rrd"><input type="radio" name="do" id="ao_rrd" value="removeredirect" />$vbphrase[remove_redirects]</label></div> <div><label for="ao_bump"><input type="radio" name="do" id="ao_bump" value="bumpnews" />$vbphrase[bumpnews]</label></div> <div><label for="ao_dbump"><input type="radio" name="do" id="ao_dbump" value="debumpnews" />$vbphrase[debumpnews]</label></div> ################################################################### # New phrases ################################################################### Add these four phrases in the admin control panel (Phrase Manager -> Add new Phrase) Type: Show thread Name: bumpnews Text: Bump News Type: Show thread Name: debumpnews Text: Make News older Type: Front-End Redirect Messages Name: bumpnews Text: The News item is now set to today Type: Front-End Redirect Messages Name: debumpnews Text: The News Item is now one day older Supporters / CoAuthors Show Your Support
|
Comments |
#12
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
|
#13
|
|||
|
|||
Thank you for the very fast response !
Now, it is starting to take shape by showing just 2 days. However, it is showing up to 18 stories from the same category. I've looked where to change this to just up to 5 but I'm not sure. The story length cut down to 100 causes some of the stories to have all of the text linked/underlined. I've set it to 200 and stories are all red past a certain point. Any ideas? |
#14
|
||||
|
||||
Quote:
|
#15
|
|||
|
|||
Quote:
I've updated the front of www.whatisnew.com now and am adding more of these "news" forums for each category. |
#16
|
||||
|
||||
Quote:
Signing off now, and have a good day. |
#17
|
|||
|
|||
Thanks a bunch.
I very pleased with it, you did a great job on it. Is there any chance of getting some type of mod that would count the replies to a news article and put (# comments) next to it? *edit* Now that brings up, how would you moderate the new thread, but not the replies? |
#18
|
||||
|
||||
I think you can set up a forum so that only new threads are moderated and not new posts without performing any hacks.
Anyway, ENWorld runs an archive of news items by using vbulletin's syndicator - it shows the 20 most recent news items for each topic. To add one to go with this system create a new page, turn all modules off on that page and point it's custom content at a new template (I used adv_portal_headlines) The content for us is... HTML Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="tborder"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td class="tcat" align="center">Headline Summary Page</td></tr> </table></td></tr></table> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="tborder"> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Site News</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=162&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Software</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=179&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Community</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=178&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> </td></tr></table></td> <td width="34%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="tborder"> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Official WotC</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=164&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Books & Novels</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=180&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Other</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=181&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> </td></tr></table></td> <td width="33%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="tborder"> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">D20/OGL</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=163&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">PDF/e-publishing</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=111&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr><td align="center" class="thead">Sci-Fi/Fantasy</td></tr> <script type="text/javascript" src="http://www.enworld.org/forums/external.php?forumids=110&type=js"></script> <script type="text/javascript"> <!-- var max = 10; if(threads.length < max) max = threads.length; for(i = 0; i < max; i++) { if (threads[i].title.length > 45) { threads[i].title = threads[i].title.substring(0, 45) + '...'; } document.writeln("<tr><td class=\"alt2\"><a href=\"http://www.enworld.org/forums/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "</a></td></tr>"); } //--> </script> </table> </td></tr></table></td> </tr> </table> <br /> <div align="center"><a href="http://www.enworld.org/forums/news.php?page=syndicate">Click here to syndicate these headlines</a>.</div> <br /> For this to work on your page you have to go to vboptions >> syndication and turn it on, choosing XML syndication. At that point a link will appear in each forum "Syndicate this page" Follow this instructions that appear. If you need any help just yell. |
#19
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
PHP Code:
Doing that captures the reply count. You can now slip it into the news item by putting $news[replycount] into the template. For example, change the adv_portal_newsdigest_item template to: HTML Code:
<div align="justify">$news[message] - submitted by $news[postusername]. <a href="showthread.php?t=$news[threadid]">Comments: $news[replycount]</a></div> |
#20
|
|||
|
|||
Thanks a bunch.
I ran across this though after doing the above. Sorry to be a bother, still relatively new to php. Code:
Database error in vBulletin 3.0.3: Invalid SQL: SELECT thread.threadid, replycount, postusername, postuserid, thread.dateline AS postdateline, thread.forumid, forum.title as title, forum.fhbanner as icon, post.postid, pagetext, allowsmilie FROM thread AS thread LEFT JOIN post AS post ON (post.postid = thread.firstpostid) LEFT JOIN forum AS forum ON (forum.forumid = thread.forumid) LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread') WHERE thread.dateline>UNIX_TIMESTAMP(CURDATE()) AND thread.forumid IN(45,46,42,43,44) AND thread.visible = 1 AND thread.open != 10 AND deletionlog.primaryid IS NULL GROUP BY post.postid ORDER BY forum.displayorder mysql error: Column: 'replycount' in field list is ambiguous mysql error number: 1052 Date: Thursday 28th of October 2004 04:52:27 AM Script: http://www.ahazi.org/forums/showthread.php?p=53981 Referer: http://www.ahazi.org/forums/editpost.php?do=editpost&p=53981 |
#21
|
||||
|
||||
No problem
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|