Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Need Help: Give Privileges to Only Admin, for categories !  (Read 959 times)

om11

  • Newbie
  • *
  • Karma: 0
  • Posts: 5

From last two months I used SnewsMU with my website. And realize that to making a categories or sub-categories rights should be in Admin Hand.

Because if there are more Editor, Super Editor. Then they create number of categories. Which make site not quite useable.

Is anyone help me to know, How can I give Privileges only to Admin ?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Need Help: Give Privileges to Only Admin, for categories !
« Reply #1 on: May 02, 2011, 09:02:04 PM »

I'm not sure what you mean. The Admin already has all privileges.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

om11

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
Re: Need Help: Give Privileges to Only Admin, for categories !
« Reply #2 on: May 04, 2011, 08:39:01 AM »

I Mean to Say that, If Editor (level 2 and 3) log for article then they have rights to make some own categories. Which are increased any numbers. I like to Give Privileges to only the Admin to create the categories. In which others post the articles.

Because if there are more Editor, Super Editor. Then they create number of categories. Which make site not quite useable.

How do I do this ?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Need Help: Give Privileges to Only Admin, for categories !
« Reply #3 on: May 05, 2011, 05:19:59 AM »

OK. This will be relatively easy if you have not made many modifications to function administration() in your snewsMU.php file.

1.  Open the file and locate the function by searching for it.

2.  If the top part of your function is still in its default state, look for these four strings, starting about 14 lines down from the top:
     These strings generate the link to the "Add New" categories and "View" categories links.

Code: [Select]
<?php // disregard this tag

echo '<p>'.l('categories').': <a href="admin_category/" title="'.l('add_new').'">'.l('add_new').'</a>';
$link ' '.l('divider').' <a href="';
if (stats('categories','') > 0) {echo $link.'categories/" title="'.l('view').'">'.l('view').'</a>';}
echo '</p>';

// disregard this tag ?>


What we need to do is wrap (enclose) them in a contitional statement string-set so that they only get generated if the condition is met. In this case, if the person logged in is the Admin. Here is the same as above but with the conditional string-set (and informational comments added).

3.  Replace the four strings with this complete string-set and see how it works for you.

Code: [Select]
<?php // do not copy this tag

# If the Admin is logged in
if (get_identity($_SESSION['id'], 'level') == '1') {
# Display the "Add New" and "View" categories links
echo '<p>'.l('categories').': <a href="admin_category/" title="'.l('add_new').'">'.l('add_new').'</a>';
$link ' '.l('divider').' <a href="';
if (stats('categories','') > 0) {echo $link.'categories/" title="'.l('view').'">'.l('view').'</a>';}
echo '</p>';
}else{
# If the Admin is NOT logged in, show the "No Access" message
echo l('mu_noaccess');
}

// do not copy ?>

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

om11

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
Re: Need Help: Give Privileges to Only Admin, for categories !
« Reply #4 on: May 08, 2011, 11:32:28 PM »

I have few more query (my English is not so good); The Article Which the Editors (level 2 and 3) post, don't have a list of categories and sub-categories on the below of article test box. It  was shown inside on Customize it must be below of article shows.

Is this one gives me :-  Admin have rights to make the categories and sub-categories, in which other level 2 and 3 have right to post the article on the given categories, If level 2 and 3 want's more categories and sub-categories, then they request to the Admin to create categories and sub-categories for them ! !

Note:For sub categories i used mod upload by Ken Dahlin.

Should I use : Is it possible that if I make some sub-domain, then the categories hyperlink to these sub-domain. and when ever I click to those sub-domains home link then, it will back to my main domain home page and sub-domain home page. Is main domain and sub-domain have different home link. All the Links shown left pane display on all sub-domain How I do This ?
Logged

om11

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
Re: Need Help: Give Privileges to Only Admin, for categories !
« Reply #5 on: May 20, 2011, 08:08:57 AM »

Is it Possible that, Main Cate.... and Sub-Cate... are display on separate drop down list. I like to build up drop down list in which main cate... object or text names linked to sub-cate..... and displayed accordingly. I like to put this code main index file so that it displayed on header at browser. And on Article Posting I chose easily, to which cate.. or sub-cate.... my article posted.

Please look a small view to My Previous Post still alive,  Solve that.

Logged