HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Only staff can submit news.

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#1369 (In Topic #330)
Avatar

Fan in training

Only staff can submit news.

If u want to only staff submit news then :

in do_news() function … start.php

Function do_news()
{
.
.
.

if ((get_user()!=get_guest_id())&&(is_staff(get_user())))
    $news_text.="<p align=\"center\"><a href=\"".build_url(array("page"=>"news"))."\">More News</a> | <a href=\"".build_url(array("page"=>"submit","ipage"=>"newsadd"
))."\">Submit News</a></p>";
   else
    $news_text.="<p align=\"center\"><a href=\"".build_url(array("page"=>"news"))."\">More News</a> </p>";


 put_in_table($news_text,"width='100%'",0,"News");
}

im newsview.php u can do the same … use the condition :

 if ((get_user()!=get_guest_id())&&(is_staff(get_user())))
Back to the top
 
Posted
Rating:
#1370
Avatar

ocStaff (admin)

That stops everyone but staff viewing news, not submitting it. Two further points…

1) No one can submit news to your site and have it display, unless you as a member of staff validate it.

2) If you really want to stop non-admincenter-submission of news…

In pages/submit.php delete the following lines…

Code

 &nbsp; if &#40;&#036;page==&#39;newsadd&#39;&#41; include &#40;get_file_base&#40;&#41;.&#34;/admincenter/pages/newsadd.php&#34;&#41;;

Code

 &nbsp; else if &#40;&#40;&#036;page==&#39;newsadd&#39;&#41; && &#40;&#036;itype==&#39;_ad&#39;&#41;&#41; _newsadd&#40;&#41;;

Code

 &nbsp; else if &#40;&#40;&#036;page==&#39;newsadd&#39;&#41; && &#40;&#036;itype==&#39;ad&#39;&#41;&#41; newsadd&#40;&#41;;



Become a fan of ocPortal on Facebook or add me as a friend.

Expand: Was I helpful? Was I helpful?

Expand: Follow me on Twitter Follow me on Twitter







If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource.
Back to the top
 
Posted
Rating:
#1371
Avatar

Fan in training

Originally posted by Chris Graham@Jun 9 2004, 12:11 PM
 That stops everyone but staff viewing news, not submitting it. Two further points…

1) No one can submit news to your site and have it display, unless you as a member of staff validate it.

2) If you really want to stop non-admincenter-submission of news…

In pages/submit.php delete the following lines…

Code

   if &#40;&#036;page==&#39;newsadd&#39;&#41; include &#40;get_file_base&#40;&#41;.&#34;/admincenter/pages/newsadd.php&#34;&#41;;

Code

   else if &#40;&#40;&#036;page==&#39;newsadd&#39;&#41; && &#40;&#036;itype==&#39;_ad&#39;&#41;&#41; _newsadd&#40;&#41;;

Code

   else if &#40;&#40;&#036;page==&#39;newsadd&#39;&#41; && &#40;&#036;itype==&#39;ad&#39;&#41;&#41; newsadd&#40;&#41;;
 
Ok but still need that to remove links , isnt it ?
Back to the top
 
Posted
Rating:
#1372
Avatar

ocStaff (admin)

My mistake, yes.



Become a fan of ocPortal on Facebook or add me as a friend.

Expand: Was I helpful? Was I helpful?

Expand: Follow me on Twitter Follow me on Twitter







If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource.
Back to the top
 
Posted
Rating:
#1373
Avatar

Fan in training

In submit.php u need to change the function like this :
function newsadd()
{
 if (is_staff(get_user()))
   interface_add_newsadd(build_url(array("page"=>"_SELF","ty
pe"=>"_ad","ipage"=>"newsadd")));
 else
  echo "Access denied";
}

To prevent a user of link to the page using a direct link. (i think)  :P
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: