chmpdog Posted November 9, 2007 Share Posted November 9, 2007 Hi, My client has me tied down right now. To untangle myself I was thinking of using an admin panel. I want them to be able to edit each page without any knowledge of coding. For the site I am using a file system where there is only one index and each page's content is hosted individually. So how would I do this? Is there a program that I could use? Thanks Quote Link to comment Share on other sites More sharing options...
severndigital Posted November 9, 2007 Share Posted November 9, 2007 This is a tough one .. there are php softwares out there but IMO they either take forever to implement and/or you still need to have some coding knowledge. unless you are running a CMS system, it's almost a trade off getting the editing script up and running and doing the edits yourself. I've used this one in the past. http://www.snippetmaster.com/index.php but again, you will need to have a little bit of experience coding. Quote Link to comment Share on other sites More sharing options...
chmpdog Posted November 9, 2007 Author Share Posted November 9, 2007 I know php, html, and css. It is the client that dosent know. Everything is made in notepad from scratch. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 9, 2007 Share Posted November 9, 2007 make a php file, that has the users "Username" and "password (md5)", this will allow you to keep away from databases. Example: <?php $user = "fred"; $pass = "8dm4ujg04j8ndkco3mfpqnt85hnwmci4"; ?> then when they login, check that file, create some sessions. the make a function to check if the user is logged in: functions.php <?php function is_logged(){ if($_SESSION['logged']) $logged = TRUE; else $logged = FALSE; return $logged; } ?> next at the top of every page where they need to be logged in place this: <?php session_start(); include 'functions.php'; if(!logged()){ header("location: login.php"); exit; } ?> That would be somewhat of a start... Quote Link to comment Share on other sites More sharing options...
chmpdog Posted November 9, 2007 Author Share Posted November 9, 2007 make a php file, that has the users "Username" and "password (md5)", this will allow you to keep away from databases. Example: <?php $user = "fred"; $pass = "8dm4ujg04j8ndkco3mfpqnt85hnwmci4"; ?> then when they login, check that file, create some sessions. the make a function to check if the user is logged in: functions.php <?php function is_logged(){ if($_SESSION['logged']) $logged = TRUE; else $logged = FALSE; return $logged; } ?> next at the top of every page where they need to be logged in place this: <?php session_start(); include 'functions.php'; if(!logged()){ header("location: login.php"); exit; } ?> That would be somewhat of a start... But what about the actual re-write of the content. Thanks for the help Quote Link to comment Share on other sites More sharing options...
chmpdog Posted November 10, 2007 Author Share Posted November 10, 2007 Bump Quote Link to comment Share on other sites More sharing options...
kratsg Posted November 11, 2007 Share Posted November 11, 2007 Check out PHP's Smarty feature. This will allow them to edit templates of codes, without affecting the php behind it, etc... I believe it's along the lines of what you want... Or are you saying that they have NO experience with coding whatsoever and you need something like Dreamweaver's Design View for these people? Quote Link to comment Share on other sites More sharing options...
centerwork Posted November 11, 2007 Share Posted November 11, 2007 Create a protected Directory using a .htaccess and .htpasswd. Then create and index file in the dir. with the pages that they would like to modify. Or on file with a drop down menu of each page on on the site. In your database create a table for pages. Include a section for body text. (Body text will be the information that gets swapped out on each new page). This java script works well for converting text to html. It uses a simple textarea. The customer does not need to know any html or coding. http://tinymce.moxiecode.com/ (Download it and upload it to the site.) How to use it. http://wiki.moxiecode.com/index.php/TinyMCE:Installation This program has the ability to customize the tools that are shown. This will make it a little more simple for your customers. Here is a link to the different default buttons. (You can also modify them your self.) http://wiki.moxiecode.com/examples/tinymce/installation_example_00.php Have your form set up so that it adds the information to your database. Then all you have to do is pull the information from the database for each webpage. If you need more detail information just ask. Quote Link to comment Share on other sites More sharing options...
chmpdog Posted November 11, 2007 Author Share Posted November 11, 2007 Create a protected Directory using a .htaccess and .htpasswd. Then create and index file in the dir. with the pages that they would like to modify. Or on file with a drop down menu of each page on on the site. In your database create a table for pages. Include a section for body text. (Body text will be the information that gets swapped out on each new page). This java script works well for converting text to html. It uses a simple textarea. The customer does not need to know any html or coding. http://tinymce.moxiecode.com/ (Download it and upload it to the site.) How to use it. http://wiki.moxiecode.com/index.php/TinyMCE:Installation This program has the ability to customize the tools that are shown. This will make it a little more simple for your customers. Here is a link to the different default buttons. (You can also modify them your self.) http://wiki.moxiecode.com/examples/tinymce/installation_example_00.php Have your form set up so that it adds the information to your database. Then all you have to do is pull the information from the database for each webpage. If you need more detail information just ask. Thanks, but I have two questions. How would I get the iformation from the database for each page? And how do I send the info to the database? Thanks again Quote Link to comment Share on other sites More sharing options...
centerwork Posted November 11, 2007 Share Posted November 11, 2007 This is incomplete code you will need to fill in the gaps and customize it to your databases tables and fields. Establishes A Connection With The Database in your php script. This is part of the code you would you on your webpage that the public sees. $query = "SELECT * FROM pages WHERE pg_id = 1"; /*pages would be the name of the table in your DB. pg_id would be the information you would like to request for the page you are loading.*/ $results = mysql_query($query) or die (mysql_error()); //This runs the query and retreves the information. $rows = mysql_fetch_array($results) //This loads the results form the query into an array. $pg_name = $rows['pg_bodytxt']; //This loads the results form the query into an array. //Put this code on your website templete where you want the body text to be loaded. <?php echo $pg_name ?> Create your form with the textarea. //This pulls the information from your form that was submited. $body_text = $_post['body_text']; //You will need to load your DB Table with entries for each page on your site that your customer would like to edit. //This code updates your db tabe info. $query2 = "UPDATE pages SET pages.bodytxt='$body_text WHERE pages.pg_id = '1'";//Updates DB information. $result2 = mysql_query($query2) or die(mysql_error());//Runs Query if($result2 =="1") { echo '<br /><div style=" color:#FF0000;"><h3>'.$sel_pg_name.' has been updated.</h3></div><br />'; } THIS CODE IS NOT COMPLETE... You stated early that you new PHP. If you have problems fallowing this script I would recomend downloading the PHP & MYSQL Video Training form the link below. It is free and gives a lot of good informtion that you need for working with any PHP & mysql. http://www.3dbuzz.com/vbforum/sv_dl_tr.php Create a login and then click on "PHP & MySQL Integration". Have fun with this it is a very useful and you can charge a good amount for intigrating customer admin to a site. Quote Link to comment Share on other sites More sharing options...
nevesgodnroc Posted November 30, 2007 Share Posted November 30, 2007 Regarding making the admin panel, It is begining to be quite an undertaking that i started some time ago if you would like i can give you a basic structure on how i started mine and give advice along the way. Mine is far from finished but what application ever is? If you have fair to good knowlegde of php and mysql its more of a ime consuming thing than being hard. Let me know if you would like some help. Quote Link to comment Share on other sites More sharing options...
mikebyrne Posted December 1, 2007 Share Posted December 1, 2007 I'm about to start an admin frontend so any info would be great!! Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 1, 2007 Share Posted December 1, 2007 Have patience when making the application, the stress and anger will get to you if you try to do everything on your own. I suggest you build the application roughly without security protection, and work your way up. Quote Link to comment Share on other sites More sharing options...
Distant_storm Posted December 1, 2007 Share Posted December 1, 2007 Iam half way trhough making an admin panel. Admin panels for me need to be. 1) User friendly 2) secure 3) easy to navigate 4) supported by you Firstly start of with what you need the user to be able to do such as... Upload files Edit/change files Block ip's The main idea I tend to use is templates for the main site. Think simple for your admin panel because by time you get round to it you will have a list as long as your arm that you need to impliment and it will be slow and not time effective. Templated main site the user to create new pages which can then be integrated into the main design. so data could be stored in a database or files. I suggest a database. Admin panel step one: Make graphical interface with menu options (baring in mind any menu changes and other pages you may want to make) 2) make a secure login. - Login using sessions as data holders. The path of your sessions are usually default to tmp although there are disadvantages as if on a shared host it will be accessable from other users too so not majorly secure. Although if you move the session path to something above your servers http folder the garbage collection will not happen and you can be left with again unsecure sessions. Choice is yours though. -encrypt data such as passwords using md5 or sha1 for example. -make sessions time-out after say 30 minutes. -don't use obvious names such as password or username, although it helps to navigate your code it is potential window. -Once you have session securty and such set up check the user is authorised to view everytime they go to a new page or carry out a new routine. - once you have done basic security and your happy with your administration set up more security such as captcha's to stop automated scripted attacks once thats done its pretty much easy from there Quote Link to comment Share on other sites More sharing options...
nevesgodnroc Posted December 1, 2007 Share Posted December 1, 2007 The first thing I did to build mine was figure out a basic layout for the admin section. Then I set up a couple of Tables in Mysql one for Pages and one for page elements or sections of HTML code. Then the first thing to get working is an html editor. The one I have been using is TinyMce it turns a basic textarea into a text editor. This will let your client write basic html code without having to know HTML. you set up the textarea in a form and send the data via POST to a php script page that will store the data in a Data Base Be sure however that you use html_entities() to encode your data to prevent uh ohs in your query. This is a very important step that took me a while to fiure out. And be sure to decode it with html_entity_decode() when echoing that data back to the content section of your template. Your template page should work by using Get variables this will allow visitors to still book mark the page and set up links to it a link will look something like "page.php?page_id=1" Then you will run a query on your DB something like $query = "SELECT * FROM PageElements WHERE Id='$page_id'"; $result=mysql_query($query); and out put whith a while ($row=mysql_fetch_array($result)){ echo $row['Content'] . "<br />"; } That should give a good start The Hardest part is figuring out where to start, so my advice is just make it do something and build from there. And when any body get to where they can figure out how to use TinyMce to insert an image by browsing a folder on you server Feel free to let me know where to start. I am kind of at a stand still. Although some one somewhere on this forum said they wrote a script for just that purpose. I got a $10 donation for php Freaks once someone shares. Hope that this advice helps someone Quote Link to comment Share on other sites More sharing options...
marcus Posted December 1, 2007 Share Posted December 1, 2007 You could have seriously made this a lot easier. If each page was, navigated by like: index.php?page=this And 'this' was an included file such as: includes/this.inc Whilst being an admin, have an admin-only link on the bottom of the page that would say "Edit this Page," then you would be prompted with like. admin.php?act=edit&page=this Using fread and fwrite, you can easily have the person just edit the file as a whole. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.