Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBadvanced CMPS - News Digest Module 1.02 Details »»
vBadvanced CMPS - News Digest Module 1.02
Version: 1.0.2, by Michael Morris Michael Morris is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 10-02-2004 Last Update: 10-31-2004 Installs: 15
 
No support by the author.

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:
SELECT thread.threadidpostusernamepostuseridthread.dateline AS postdatelinethread.forumidforum.title as titleforum.fhbanner as iconpost.postidpagetextallowsmilie 
Replace With:
PHP Code:
SELECT thread.threadidpostusernamepostuseridthread.dateline AS postdatelinethread.forumidforum.title as titlepost.postidpagetextallowsmilie 
Advanced Users Note: the only difference between these two blocks is the 2nd lacks the "forum.fhbanner as icon," entry. If you have already installed a hack that creates forum images for use with categories you can change this line to refer to the column you've set. For instance, on enworld the line is "forum.icon as icon,"

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>
Create a new template called adv_portal_newsdigest_category and insert the following into it.

HTML Code:
<b>$news[title]</b><if condition="$news['icon']"><img src="./images/forumicons/$news[icon]" align="right" height="60" weight="60"></if>
If you don't want category images insert this code instead:

HTML Code:
<b>$news[title]</b>
Create a new template called adv_portal_newsdigest_item and insert the following into it:

HTML Code:
<div align="justify">$news[message] - scoop submitted by $news[postusername]</div>
Step 3: Set up your News Forums
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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 05-30-2005, 12:37 PM
GiJoe GiJoe is offline
 
Join Date: Dec 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jaxx
GiJoe,

Take a look at my site: http://www.ahazi.org

It has the comments which was added in from the discussion on the 2nd page of this thread.

Is that basically what you mean?
Yep... Got it to work a little while ago thank you! http://wolfgaming.net
Reply With Quote
  #43  
Old 06-27-2005, 07:24 AM
PING1434a PING1434a is offline
 
Join Date: Jun 2005
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i tried to install this on a 3.0.7, no luck, the instructions on steps 4 and 5 dosn't apply. Anyone had any lucky on their 3.0.7? Perhaps someone can share the info?
Reply With Quote
  #44  
Old 07-31-2005, 06:32 PM
ragintajin ragintajin is offline
 
Join Date: Sep 2003
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is exactly what I need...any chance you'll update it for vb 3.5??
Reply With Quote
  #45  
Old 08-08-2005, 03:51 AM
Marris Marris is offline
 
Join Date: Jul 2005
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot for this mod. It was just what I was looking for.

I just wanted to add simple date breaks into the existing news, so I just used a snippet of the code to replace a line in news.php (CMPS v2.x):

in news.php replace:

PHP Code:
eval('$newsbits .= "' fetch_template('adv_portal_newsbits') . '";'); 
with:

PHP Code:
//datemod 1 of 2 start

            
$dayposted vbdate('njy'$news['postdateline']);

        
//Display The Current News Day
        
if ($dategroup != $dayposted)
            {
            
$datelongform vbdate('l, F jS, Y'$news['postdateline']);
            
$dategroup vbdate('njy'$news['postdateline']);
            
$prevdate true;        
            eval(
'$newsbits .= "' fetch_template('adv_portal_newsdigest_date') . fetch_template('adv_portal_newsbits') . '";');
            }else{
//datemod 1 of 2 end            
            
        
eval('$newsbits .= "' fetch_template('adv_portal_newsbits') . '";');    

//datemod 2 of 2 start
        
}                        
//datemod    2 of 2 end 
And in this case, you need to enclose the contents of adv_portal_newsdigest_date in <tr><td></td></tr> tags.

Also, note this only works if you have your News module option "Separate News Posts" set to "No", but it should be easy to figure out the code to change in news.php for this to work for the other mode.

All this does is divide up your normal News posts with a date bar. It doesn't have any of the extra functions of the full mod.

In using this with vB 3.0.8 and CMPS 2, I noticed I had to change the use of date() to vbdate() or else I would get discrepancies between the post dates and current time zone setting.
Reply With Quote
  #46  
Old 01-11-2007, 03:10 PM
regina64 regina64 is offline
 
Join Date: Jan 2007
Location: Duluth, MN
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I look forward to using your module.

I am currently running vb 3.6.4 and vBadvanced CMPS 2.2.1 and I would like to use the news digest module on it. Will this run on my version or do I need to wait for an update?

Had to ask before I tried to install.
Reply With Quote
  #47  
Old 01-11-2007, 03:31 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've decided to move to Joomla for content management so I won't be upgrading this for vba CMPS 2. If anyone wishes to do so they have my permission to post the code here.
Reply With Quote
  #48  
Old 01-11-2007, 03:43 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michael Morris View Post
I've decided to move to Joomla for content management so I won't be upgrading this for vba CMPS 2. If anyone wishes to do so they have my permission to post the code here.
Michael, with your OK I wouldn't mind taking this one over. I had almost forgotten about this thread until it got bumped and I realized I could use this on one of my sites. I need to go over the code a bit (since with CMPS 2.x you can just easily copy a module and then make edits to the copy) but it should be doable.
Reply With Quote
  #49  
Old 01-11-2007, 03:49 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KW802 View Post
Michael, with your OK I wouldn't mind taking this one over. I had almost forgotten about this thread until it got bumped and I realized I could use this on one of my sites. I need to go over the code a bit (since with CMPS 2.x you can just easily copy a module and then make edits to the copy) but it should be doable.
Go right ahead - code's yours.
Reply With Quote
  #50  
Old 01-11-2007, 03:54 PM
regina64 regina64 is offline
 
Join Date: Jan 2007
Location: Duluth, MN
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Michael, sorry to see you go to Joomla. I was really looking forward to trying out your module.

I hope KW802 can figure it out. It looks like exactly what I need (organizing my front end by category)

Can you tell me if this site is using your module? I have been trying to figure it out for days on how they are displaying their categories on the homepage, but yet I don't see them in the forum (the categories):

http://www.gotapex.com/

see where it says:
Posted on Thursday January 11th, 2007 by Lights in the "Computers" category

Also, is this mod similar to yours?

Thread Category / Prefix Hack
https://vborg.vbsupport.ru/showthread.php?t=61494
Reply With Quote
  #51  
Old 01-11-2007, 04:02 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michael Morris View Post
Go right ahead - code's yours.
Thanks.

Quote:
Originally Posted by regina64 View Post
I hope KW802 can figure it out. It looks like exactly what I need (organizing my front end by category)
It might be a day or so before I have a chance to work on it but I'll post whatever I come up with.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05306 seconds
  • Memory Usage 2,357KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (4)bbcode_html
  • (4)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete