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

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


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

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. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
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

My mistake, yes.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
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: