1
barkndog
News Module: Removing Comments from article, Submit news from menu
  • 2006/4/19 21:36

  • barkndog

  • Just popping in

  • Posts: 5

  • Since: 2006/4/19


This is regarding the News module, v1.1.
A little history: The web site I am working on will not have registered users, only the admin who will post news articles. Anonymous users do not have permission to submit news or comment on news stories. Searching the xoops.org site, I found out how to remove the user/login area and display the news to anonymous users, and I've got the permissions straight (very good documentation btw). Currently, anonymous users can see the main menu with home and news.

3 issues:

Issue 1) When they click "News" on the main menu, two sub-menu items appear, "Submit News" and "Archive". I don't want anonymous users to have the "Submit News" option, especially since they don't have rights to do so. How do I remove that from the menu?

Issue 2) When on the news page, they are presented with options to "Read More..." or "Comments". They don't have rights to add comments, so how do I remove the link to add comments?

Issue 3) How can I remove the "Posted by..." line on the news article? I don't mind it saying "Posted on [some date and time]", but I don't need the number of reads or who it was posted by.

Thanks for any help you can offer. As an old PostNuke user, I have to say that XOOPS is very easy to get up and running. Especially with the permissions and the layout. I like what I've seen so far.

2
barkndog
Re: News Module: Removing Comments from article, Submit news from menu
  • 2006/4/21 13:40

  • barkndog

  • Just popping in

  • Posts: 5

  • Since: 2006/4/19


Ok, I figured this out - I'll summarize my solution in case someone else tries to do the same thing.

I had already made all my content public and turned off the login block using this FAQ article. Its important to give anonymous users access to the modules, such as news, that you want everyone to see.

Issue 1: In modules/news/xoops_version.php I just commented the lines
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1
$modversion['sub'][1]['url'] = "submit.php";


For Issue 2 I went to modules/news/index.php and commented out a lot of the "$morelink" variable builds. I started commenting under the line
$ccount $sarray[$i]->comments();
which included a couple of $morelink assignments and the entire if/else block that followed.

Issue 3 was a bit tricky. First, you need to clone your templates and make sure they can be refreshed. See
FAQ: How do I build a theme? for steps to clone the templates - up through step 4 or so. Make sure to Set "update module template .html files from themes/your theme/templates directory?" to YES and select your templates in the preferences.

At that point, go to Admin, templates, then list the News templates from your new set of templates. You can edit news_item.html to take out the Posted By stuff.

The only problems will be when the news module gets upgraded, I'll probably have to go through most of this again. But it won't take as long next time

Login

Who's Online

348 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 348


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits