...

View Full Version : Blog help.



kin
07-23-2011, 05:19 PM
Well, I made this kind of update blog for a gameserver me and a bud run. The problem is, the way i created it. I just made a php system with a javascript edit button(visible to everyone) that prompts for a password. I did not want this type of system in the first place though. The system i originally tried to create was a normal blog type thing. Where it would have newpost at the top then edit post in all the individual posts, for an example: http://corruptionx.com, now do not tell me its by vbadvanced etc. Its an example of what i wish it to look like, so if you guys can help me develop the first couple of lines, and give me a few functions from mysql or php or w/e is required. I can build off of that, thanks for your help in advance.

BluePanther
07-23-2011, 05:35 PM
I'm not really sure exactly what you mean.

Wordpress would give you all you require, would just need to either buy a template, get a free one or make your own following the many tutorials on the website.

If you're wanting your own, you'll have to make the user system (if that is what you want) and then basically make a simple CMS. There's a few posts around the PHP board on that subject, and definitely lots on the internet about that as well.

Hope I helped and pointed you in the right direction :)

kin
07-23-2011, 07:55 PM
I'm not really sure exactly what you mean.

Wordpress would give you all you require, would just need to either buy a template, get a free one or make your own following the many tutorials on the website.

If you're wanting your own, you'll have to make the user system (if that is what you want) and then basically make a simple CMS. There's a few posts around the PHP board on that subject, and definitely lots on the internet about that as well.

Hope I helped and pointed you in the right direction :)

Thanks, but problem is... i have already created a working user system. And no i want to create something similar to that blog. In the middle of the page. Not a replica but something different.

BluePanther
07-23-2011, 08:03 PM
In that case, just give the users an numerical access level. Users with an access level >= the level required to edit, can see the edit button. You'll also have to verify the user level at the actual edit page and processing page, for security reasons (to stop people just navigating to the edit page without having a decent access level). Author of news will be the id of the user in the database to uniquely identify them and dynamically get their user details. Everything else will work similarly, the rest is just styling.

Hopefully I have steered you in the right direction :)

kin
07-23-2011, 10:30 PM
In that case, just give the users an numerical access level. Users with an access level >= the level required to edit, can see the edit button. You'll also have to verify the user level at the actual edit page and processing page, for security reasons (to stop people just navigating to the edit page without having a decent access level). Author of news will be the id of the user in the database to uniquely identify them and dynamically get their user details. Everything else will work similarly, the rest is just styling.

Hopefully I have steered you in the right direction :)

you did, but i am having troubles fetching the numerical value of rights from mysql. Think you can help me out? Also, how would i make posts stack, instead of just making an edit button :S?

BluePanther
07-23-2011, 10:36 PM
Don't really get what you mean by stack, but for access levels just have an extra field in the user table called "access_level" then define a simple bunch of levels. Something like, Guest = 0, registered user = 1, news writer = 2, admin = 3. Then, assign users whatever level you want.

kin
07-23-2011, 10:47 PM
Yes, but how do i check it in php? I have had troubles with that, and what i mean by stack is. You do not edit the same post over and over again. It creates a new one once an admin clicks new post.

EDIT: Fixed the login issue

now how do i check the rights section in php, im using


if(mysql_query("SELECT rights FROM Users WHERE rights='3'"))

kin
07-23-2011, 11:54 PM
Please help?

BluePanther
07-24-2011, 01:00 AM
Well, you'd be wanting to check if a particular user has the correct rights, and you're almost there with your query.


$query = "SELECT rights FROM users WHERE id=$id;";

$result = mysql_query($query) or die(mysql_error());
$info = mysql_fetch_array($result);

// Check for access
if($info['rights'] >= *minimum level user has to be to do task/see information*){
}

guelphdad
07-24-2011, 02:09 AM
kin, please don't bump your own thread after an hour. if you haven't got a response on a thread in 12-24 hours then you can consider it reasonable to ask again for help.

BluePanther
07-25-2011, 01:02 PM
How about this. On login, save the users rights into a session variable. Then just check that to see if that variable is equal or higher than the access level required.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum