flemingmike Posted July 9, 2010 Share Posted July 9, 2010 hello all, im going a website for a friend, and im having a hard time deciding how to let them control "Important Updates". Im not being paid for it, so i dont want to be responsible for everytime they need their daily announcements. The page is currently at http://durhamit.ca/dance/index.php and there is a Blue Box on the right hand side that they want to display their info. what is the best way for me to let them update this content without getting them into my code? Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/ Share on other sites More sharing options...
Wolphie Posted July 9, 2010 Share Posted July 9, 2010 The easiest way would be to create a web-based form for them to use where they can enter some text and it gets inserted into a database or a text file. Then you could pull the text from either the database or text file and display it on your web page. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083625 Share on other sites More sharing options...
Adam Posted July 9, 2010 Share Posted July 9, 2010 Install a WYSIWYG editor too so you don't have to format them anything. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083626 Share on other sites More sharing options...
JasonLewis Posted July 9, 2010 Share Posted July 9, 2010 You'd also need to make the section where the form is secured by an administrator login form. So only they can post updates, and not everyone else. Install a WYSIWYG editor too so you don't have to format them anything. If you're going to do that, I recommend TinyMCE. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083627 Share on other sites More sharing options...
Wolphie Posted July 9, 2010 Share Posted July 9, 2010 Personally, for such a small thing I would just use a text file to store the data. Check out: http://uk3.php.net/manual/en/function.file-get-contents.php http://uk3.php.net/manual/en/function.file-put-contents.php Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083628 Share on other sites More sharing options...
Adam Posted July 9, 2010 Share Posted July 9, 2010 "For such a small thing" .. What happens if they end up with a few hundred postings? It's also harder to remove and update previous posts. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083631 Share on other sites More sharing options...
JasonLewis Posted July 9, 2010 Share Posted July 9, 2010 "For such a small thing" .. What happens if they end up with a few hundred postings? It's also harder to remove and update previous posts. Agreed. A database, apart from being more secure, is a lot neater and easier to manage. If you have access to a database, then use it. If you don't, then well, stick with flat file. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083634 Share on other sites More sharing options...
Wolphie Posted July 9, 2010 Share Posted July 9, 2010 "For such a small thing" .. What happens if they end up with a few hundred postings? It's also harder to remove and update previous posts. Granted, I can agree if that is the case. However, from my understanding and the OP's description it seemed more like a twitter post. I.e. only a single post appears at a time, thus making it easy to update and remove. For this a database is just over-complicating matters. That is just an assumption, though. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083635 Share on other sites More sharing options...
Adam Posted July 9, 2010 Share Posted July 9, 2010 Fair point, I just remembered "daily announcements". Guess it depends if flemingmike wants to keep a history. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083639 Share on other sites More sharing options...
flemingmike Posted July 9, 2010 Author Share Posted July 9, 2010 Basically, they have access to the ftp site, so they can open a text document, or any type of document that they can then edit how many posts are shown at a time. if i were to use a text file, is it easy to format the text with using: <?php // <= PHP 5 $file = file_get_contents('./people.txt', true); // > PHP 5 $file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH); ?> Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083642 Share on other sites More sharing options...
Wolphie Posted July 9, 2010 Share Posted July 9, 2010 I think an XML file would be more ideal since you can easily use PHP's XML parser to parse different parts of the document. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083645 Share on other sites More sharing options...
Adam Posted July 9, 2010 Share Posted July 9, 2010 Incidentally.. <?php // <= PHP 5 $file = file_get_contents('./people.txt', true); // > PHP 5 $file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH); ?> Do exactly the same thing. FILE_USE_INCLUDE_PATH == true. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083648 Share on other sites More sharing options...
flemingmike Posted July 9, 2010 Author Share Posted July 9, 2010 im very familiar with parsing xml, but have never produced an xml. is this an easy task for me to setup for them to do? Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083650 Share on other sites More sharing options...
Adam Posted July 9, 2010 Share Posted July 9, 2010 I don't think XML is the right way to go here. Guess it depends if flemingmike wants to keep a history. If you want to keep a history of the posts, use a database. If you just want to keep the current announcement stored, store the HTML within a text file and read that from the web page. If they update the text file by FTP that kind of defeats the point of it, as they'll be coming back to you asking you to format the HTML everyday. Provide a simple admin interface for them to login and create a new post. If you're storing it in a file, purge it and write the content they entered in the WYSIWYG. Obviously if it's a database insert the new record and just display the latest post on the site. Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083653 Share on other sites More sharing options...
flemingmike Posted July 9, 2010 Author Share Posted July 9, 2010 ok, so im using $updates = file_get_contents('updates.txt', true); what would i use to show the results? Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083658 Share on other sites More sharing options...
flemingmike Posted July 9, 2010 Author Share Posted July 9, 2010 here is my code, i cant figure out how to get the text document into the frame because i broke out of php. anybody able to help? <?php include("style.php"); ?> <body bgcolor="#C0C0C0"> <div align="center"> <table border="0" width="825" cellspacing="0" cellpadding="0"> <tr> <td> <div align="center"> <table border="0" width="95%" cellspacing="0" cellpadding="0"> <tr> <td width="557"> <p align="center"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> <div align="center"> <table border="0" width="403" cellspacing="0" cellpadding="0"> <tr> <td> <font color="#FFFFFF" size="5">Welcome to the <i>NEW</i></font></td> </tr> <tr> <td> <p align="center"> <font color="#FFFFFF"> <font class="glowtitle" style="font-size: 28pt">Taylor Dance Centre</font></font></td> </tr> <tr> <td> <p align="right"> <font color="#FFFFFF" size="5">official website.</font></td> </tr> </table> </div> <p align="center"> <font color="#FFFFFF" size="4">Our dedicated, nationally acclaimed teaching staff will strive<br> to assist students in achieving their goals.<br> At TDC we'll help you to...<br><br> </font> <div align="center"> <table border="0" width="90%" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> <p align="center"> <img border="2" src="images/soar.png" width="207" height="280"><font color="#FFFFFF" size="4"><br>to new heights!</font></td> </tr> <tr> <td> <p align="center"> <img border="2" src="images/stretch.png" width="186" height="280"><font color="#FFFFFF" size="4"><br>all possibilities!</font></td> <td> <p align="center"> <img border="2" src="images/friends.png" width="269" height="178"><font color="#FFFFFF" size="4"><br>that last a lifetime!</font></td> </tr> </table> </div> </td> </tr> </table> </div> </td> <td valign="top" width="225"> <div align="right"> <p align="center"> </div> <div align="right"> <p align="center"> </div> <div align="center" class="myBoxbb"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> <p align="center">Updates Here</td> </tr> </table> </div> </td> </tr> </table> </div> </td> </tr> </table> <p align="center"> </div> Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1083663 Share on other sites More sharing options...
Adam Posted July 11, 2010 Share Posted July 11, 2010 Sorry I've been AFC all week-end. What do you mean "broke out of PHP"? Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1084563 Share on other sites More sharing options...
JasonLewis Posted July 12, 2010 Share Posted July 12, 2010 If by "broke out" you mean you closed the PHP tag, just open it again and echo the contents where you want to display the updates. <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> <p align="center"><?php echo $updates_variable; ?></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/207254-get-text/#findComment-1084662 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.