Jump to Main Content
Content > XOOPS > News Module
News Module

The News Module is a great module for putting news articles onto your website. Good for news, magazine, blog, etc., types of sites. And it allows for comments and other interactions along with approval processes.

Latest Version: 1.63 | Web Site : Support Forums

Features

  • Topics, Sub-topics
  • Dated pre-publish and expiration of articles
  • Permissions (read, author, approve) by user group
  • Allows Advertising insert in Articles (HTML/javascript code)
  • Previous/Next article navigation
  • Summary Table
  • Multi-page support (with individual titling)
  • Supports Dublin Core Metadata, FireFox 2 micro summaries
  • Supports Social bookmarking links to Web 2.0 sites like del.icio.us, newsvine.com, yahoo search
  • RSS feeds
  • Numerous Blocks
  • Supports XOOPS notifications
  • Supports XOOPS search
  • Statistical usage information (Admin only)

Installation

Fresh Install

Installation is per standard XOOPS module installation - copy to the modules directory and install in the modules administration.

Upgrade Install

An upgrade requires additional steps. First install per Fresh Install (remove and replace existing module files). Next, while logged in as an administrator of the news module, access the following URL: XOOPS_URL/modules/news/admin/upgrade.php. After, you may remove the file, but it shouldn't be a problem to leave it either (according to the author).

Modifications

"hometext" error

FCKeditor users would get a pop-up error saying to include "hometext". If you posted again, then it would work. The issue is that there is a validation script that accesses the wrong info which is "fixed" after the initial Post click and then it validates. This is a workaround, and not a true solution. First noted in version 1.56; not fixed as of 1.63.

In news/include/storyform.inc.php, edit line 89 to:

$sform->addElement($editor,false);

HTML/Presentation Layer

I wanted to make changes on the presentation layer that were embedded in the functional layer. As a result, I had to touch the functional layer. [Note: NO HTML should be constructed in the code IMHO.] Edits I've made to make things friendlier to my templates and display needs:

  • class/class.newsstory.php
    • function imglink - changed return var (line 616) for presentation layer
    • function bodytext, hometext - (lines 1221-1283) presentation layer changes ($myts->displayTarea needed images and nl2br (line breaks) added changed to allow images and not line breaks to be added to better control in templates)
  • article.php
    • line 186, added $story['topic_titleText'] so I had the title text without links available in templates
    • lines 205, 224 added $story['textData'] to break up the $story['text'] info into component data and rebuilt in the presentation layer to have more control there
  • archive.php
    • added $story['titleData'] to break up the $story['title'] variable into its component data and rebuilt in the presentation layer.
  • xoops_version.php
    • changes of wording and re-arranged menu items

[Note: other files that may need this dealt with for proper display: comment_new.php, etc.]

Missing Caption

FIXED IN 1.63

Users reported that the "title" or caption was no longer there when selected. This required fixes in two locations: news module, and FCKeditor itself.

In news/include/functions.php, in function &news_getWysiwygForm, add new line 182:

$editor_configs['caption'] = $caption;

In XoopsRoot/class/xoopseditor/fckeditor/formfckeditor.php, change line 56 to (this doesn't exist in the one in XOOPS 2.3.x):

$this->XoopsFormTextArea(@$this->_caption, @$this->_name, @$this->_value);

FCKeditor

FIXED IN XOOPS 2.3.x

XOOPS 2.0.x users will need to make this change for it to work. Assuming you are using the XOOPSeditors framework (if not, you should be), you need to set the path correctly for your installation of FCKeditor. Depending upon the version of FCKeditor you have installed, you may have to change the way the variables are passed (changes between 2.4.3 and 2.5.x+). I got started using this article and implemented this (starting with version 1.56 using FCKeditor 2.5.x+):

In news/include/functions.php, in function &news_getWysiwygForm, change lines 212-217 to look like this instead:

case 'fck':
if ( is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php')) {
require_once(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php');
$editor = new XoopsFormFckeditor($editor_configs);
}
break;

SEO

There appears to be some sort of SEO capability for this module but I haven't investigated it's use further.

Notes

Just some miscellaneous notes/reminders:

  • Advertisement Code - if you put this in your module preferences, put a container around it
  • [ pagebreak ] works all the time, and you can't use titles or it won't work. The enhanced navigation allows you to add titles and one or more [summary], which is currently a series of links and titles with a break tag after each one. (Note that I put spaces in this usage, otherwise this article gets paginated).

Enhancement Requests / Defects

Separation of Presentation and Functional Layers

There is too much HTML embedded in the functional layer. This should be provided strictly as data to the presentation layer so the HTML can be specified there. Too many times, I've had to edit the functional layer to deal with such issues.

Attached Files

Two issues: I can't change the upload directory, and the visit page doesn't work correctly for me.

  • location (I'd like to be able to specify a directory other than the basic xoops uploads directory)
  • Viewing Attached Files - when I attach a PDF, then try to view the file, it goes to (on Firefox 2.0.x) a "where do you want to save this file" dialog box for visit.php file. If I cancel that and try again it opens the PDF window correctly. Probably another script issue?

My solution: Disable attached files and use the FCKeditor file editor upload capability. All content managed this way in all modules that use FCKeditor. Those that don't need to use it and the others. Once built-in, they're all pretty easy to setup. Teach clients how to manage their files is another thing.

Totals Missing in News by this Author

For the last table of data for the Topic, the totals aren't calculated in the code and passed to the template. I didn't debug.


Other Pages
Previous Page SmartProfile Module - A XOOPS Profile Module Contact Us - Liaise Next Page
 
Comments are solely the opionion of the author and not to be construed as the opinion of anyone else.

Poster Thread
Anonymous
Posted: 2007/8/9 14:41  Updated: 2007/11/3 19:40
 Re: News Module
could you please explain what are the changes to be made in the file class.newsstory.php for no double line breaks in the output?
thanks a lot
cristina
Reply

Poster Thread
me
Posted: 2008/4/23 13:30  Updated: 2008/4/23 13:30
Administrator
Joined: 2005/2/26
From: Austin, TX
Posts: 85
 Re: News Module
Here is the diff 1.56 vs my version:

1172c1177
> $html = $smiley = $xcodes = 1;
---
< $html = $smiley = $xcodes = $br = 1; // MPB
1174a1180
> $br = 0;
1181c1187
< $hometext = $myts->displayTarea($this->hometext,$html,$smiley,$xcodes);
---
> $hometext = $myts->displayTarea($this->hometext,$html,$smiley,$xcodes,1,0);
1204a1211
> $br = 1;
1206a1214
> $br = 0;
1213c1221
< $bodytext = $myts->displayTarea($this->bodytext,$html,$smiley,$xcodes);
---
> $bodytext = $myts->displayTarea($this->bodytext,$html,$smiley,$xcodes,1,0);

I hope that helps.
Reply
Login
 

 

 

(c) 2006-2007 - Mark Boyden
Privacy - Legal Stuff - Contacts