1
fluent
disabling submit news to non admins
  • 2003/12/16 19:51

  • fluent

  • Just popping in

  • Posts: 43

  • Since: 2003/11/22


Hi there,

I would like to disable the submit news link in the main menu for users who are not admins. Currently it shows for all registered users. Ideally I would like the link to be gone completely and not just having the link not work..

Jonathan

2
JackJ
Re: disabling submit news to non admins
  • 2003/12/16 20:28

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


To remove it completely go to

modules/news/

open xoops_version.php and take out these two lines:

$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";

3
Anonymous
Re: disabling submit news to non admins
  • 2003/12/16 20:31

  • Anonymous

  • Posts: 0

  • Since:


Hey Thanks for asking and thanks for answering. I was just going to ask for the same thing. Gotta love the forums and helpful people!

4
fluent
Re: disabling submit news to non admins
  • 2003/12/17 0:31

  • fluent

  • Just popping in

  • Posts: 43

  • Since: 2003/11/22



Thanks, is it possible to put an if statement around that so it doesnt show for People not in a certain group?

5
Anonymous
Re: disabling submit news to non admins
  • 2003/12/17 7:46

  • Anonymous

  • Posts: 0

  • Since:


Case 1: Submenus for admins only.

Quote:

global $xoopsUser;
if ( $xoopsUser ) {
$newsModule = XoopsModule::getByDirname("news");
if ( $xoopsUser->isAdmin($newsModule->mid()) ) {
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}


Case 2: Submenus for specified groups.

Quote:

global $xoopsUser;
if(!empty($xoopsUser)) {
$group = $xoopsUser->getGroups();
if (in_array(1, $group)) { //or other group-IDs
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}

6
bobdt
Re: disabling submit news to non admins
  • 2003/12/17 19:46

  • bobdt

  • Just popping in

  • Posts: 38

  • Since: 2003/9/11


MORE THANKS Francis some days ago I want make this mods !!!

You have read in my mind!!!

But I need an little help... I'm creating an little newspaper for an my friend of have ask to me for an no profit org. , I've put the news module for homr page but I want put into of the main menu the category of the news in automatic mode when add a news category, then how I can put it here? I've think of copy the info of the category box into of the file xoops_version of the news module but what I must change for show it?

Bob

7
Catzwolf
Re: disabling submit news to non admins
  • 2003/12/23 13:27

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


After removing those lines, you will have to update the module from system admon/modules for this to be updated.

As I have stated previous, all XOOPS modules will have a feature where they can choose which groups can or cannot submit.

Hope that helps

8
Olivier
Re: disabling submit news to non admins
  • 2003/12/23 14:29

  • Olivier

  • Just popping in

  • Posts: 16

  • Since: 2002/6/16


Thanks to all, it will help me for a school project

9
Anonymous
Re: disabling submit news to non admins
  • 2003/12/27 4:46

  • Anonymous

  • Posts: 0

  • Since:


Curious, where would you place this? I mean which file and does it matter where it is placed.


Thanks

10
wtravel
Re: disabling submit news to non admins

Thanks everyone for this code

You need to insert this code into the xoops_version.php file for the module you wish to set the submenu for.

Regards,

Martijn

Login

Who's Online

61 user(s) are online (33 user(s) are browsing Support Forums)


Members: 0


Guests: 61


more...

Donat-O-Meter

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

Latest GitHub Commits