Jump to content

Get Text


flemingmike

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

"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.

Link to comment
Share on other sites

"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.

Link to comment
Share on other sites

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);
?> 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.