Im trying to make a news system for the company i work for which is proving to be simple enough, except for one little bit where im now stuck.
I have a user login system for the news script which allows a user to add a news article once they've logged in. I've managed this using the IF statement (example coming shortly)
Now, what i want to do is restrict what a user can do, this is because i want to have an administrator section where myself or someone within the company can review and authorise an article before it is displayed on the website itself.
I've decided to opt for defining user levels by numbers (1 - 5) 1 being a normal user and 5 being an admin.
at current the navigation within the side of the website is echoed like this;
<?php if (empty($email)) {?><a href="/index.php">Home</a>
<a href="/viewall.php">View Article</a>
<a href="/searcharticle.php">Search Article</a>
<?php } else {?><a href="/index.php">Home</a>
<a href="/viewall.php">View Article</a>
<a href="/searcharticle.php">Search Article</a>
<a href="/add.php">Add Article</a>
<?php } ?>
My original plan was to use a recordset to pull back the users 'user level' after they had logged into the website, however. Im templating the design we're using for ease of making the pages which means anything i put in a recordset at the top of the page, wouldnt nessecarily be output to the pages i create from the said template. I thought about adding the recordset in the body of the template but as far as i know the recordset needs to be above the HTML at the top of the document.
This is where the problem is, because if i put the recordset anywhere else it buggers my template.
I considered doing this using an include file, but im not sure as to whether this would be suitable. Or how i would go about doing this exactly.
As far as i can tell the only thing thats posing a problem is the fact im templating it using the dreamweaver template. but then again, i think its safe to say i just dont know anymore
Does anybody have any ideas on what i should/could do? or does anyone understand what im trying to do? because im beginning to think that i dont understand it myself
Thank you to anyone who thinks they know what im on about, and anyone who might be able to help or at least point me in the right direction.
