Forum Moderators: coopster
I have a problem which have been annoying me for a while.
Im building a website.
On the site i want to have a "news"- or "dailies"-section. This means a section of the page which i can easily update only in seconds if i like, and that i get the wanted text out on the page immediately.
This without me having to manually update my index.html or index.php in e.g dreamweaver, and then uploading it to the server.
I have been searching the net for hours, to find a script ( free ) that can do this for me.
But, with no luck :-(
Anyone here know about such a script?
Im a newbie on php so i appreicate any help on the matter.
Best regards:
Gjermund
well, you could store that info in a database and have your main page always pull any stories that are marked for "frontpage" or something like that. If there are none there, then it won't show anything.
Then you could have a simple admin script where you can paste in and save you added content to the database and have a spot where you can set it to "frontpage".
We do have some threads in our PHP Library [webmasterworld.com] about working with mysql.
Do you know anyone who can make such a script for me? ( Or if such a script is already out there, whre i can find it? )
And which is easy to use? Such like filling in the text one want to be shown on the page in the "news flash", and then hit a button?
Im willing to pay for such a script, but not very much..( since im not a rich man ) :)
Lets say 5-6 USD? Not to provoke someone, but thats what im physically able to offer ;-)
Best regards:
Gjermund
>> but thats what im physically able to offer
most people are in the same situation that's why they start learning because time they may be able to free up. Sorry that amount wouldn't get you much.
here is a more explicit outline
create a mysql table, amybe something like this
news_id (auto_increment primary key)
newstitle (maybe varchar(100))
story (text)
frontpage (yes/no enum)
so once you have the table make a simple form, probably protected with an .htaccess file because it is easy. This form can be used to input your story, the form should mirror the table
news_id - don't worry about it mysql will take care of this
newstitle - a textfield with size and maxlength set to 100
story - textarea
frontpage - radios for yes and no
now you do a little php script that inserts it into the database. If you are the only one using it you could use a 'trusted' method to start where it doesn't do much error checking or input cleaning.
then on your mainpage you have a small chunk of php including the following steps
connect to mysql
select all news where frontpage=yes
loop through the reuls and display it
done
<?
$target = $_SERVER['DOCUMENT_ROOT']."/../newscache.txt";
$fp = fopen($target, "r") or die("can't open the file");
while(!feof($fp))
$data = fgets($fp);
fclose($fp);
?>
<form action="script.php" method="post">
<textarea rows="40" cols="80" name="data">
<? echo $data;?>
</textarea>
</form>
script.php
<?
$data = $_POST(data);
$fp = fopen($target, "w+");
fwrite($fp, $data);
fclose($fp);
?>
index.php
<!-- include imported data here -->
<?
$target = $_SERVER['DOCUMENT_ROOT']."/../newscache.txt";
$fp = fopen($target, "r") or die("can't open the file");
while(!feof($fp))
$data = fgets($fp);
fclose($fp);
echo $data;
?>
<!-- end of import -->
Sloppy, but close. (I know, there is no submit button in the form, but the main idea is there...)
WBF
The only difference between the paid and free version, is the "Content Management Powered by CuteNews" message on the page is killed when you register.
[sitescripts.com...]
Fusion News (free) looks really interesting.
To find live examples of CuteNews, simply search Google for the phrase "Content Management Powered by CuteNews" - you'll get heaps to view.