Current location: Hot Scripts Forums » Programming Languages » PHP » Starting Small - A simple news script


Starting Small - A simple news script

Reply
  #1 (permalink)  
Old 03-05-04, 10:26 PM
RaiTid_R RaiTid_R is offline
New Member
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Starting Small - A simple news script

Even though I've been dealing with PHP for years... I still consider myself a newbie because I can only manipulate PHP... and understand what needs to do what (and only a limited understanding and manipulation) but am unable to actually create. Which is what I wanted to change.


So I'm working on this new project of mine and I want to to be driven with PHP. But I don't want to use any unnecessary php which is why i didn't go with CMS or anything like that.


All I want to start is a way to keep members in a database with limited information. But only members that will be related to the news script.


It may not even need a database but I will try to enlighten the reader of this posts as to what I desire to accomplish.


If possible the news to be kept in a text file to save DB usage is fine by me. But... I'd like it to be able to recognize a posting author.

So if I log in and post something... the news will be added to a pre-defined table maybe via the phpinclude function. And it will add the news in a table of it's own.

2 Rows 2 columns. THe top row in the left column shows the assigned avatar of the author. In the right... the name and post time / date.

The bottom row will have merged columns and the text for the news will be placed in there.



I see it as being very doable and extremely simple. But I could be wrong. The reason I lead away from keeping the users out of a DB and the News is because I want to separate sections of the site in categories and the likes... but less i confuse someone that's a new project a different day. I want to focus on making the above described a reality.


It may already have been done... 100 times over... but I'd like to do it myself. If I could be pointed into the right set of directions. Maybe a news posting tutorial where the news is stored in a text file and has a user panel of a sorts. As well as making it function to direct to a specific place and perform the table functions I desire.

Or I don't know... Help Please
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-06-04, 08:37 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Have you settled on a templating engine and a db abstraction engine ? Those two things would definately help you get started. My choices would be Smarty and ADOdb.

Once that is done, then I would work on the database schema so that it could hold all of the data that I had for it. Then, it is designing the screens (login, latest news, main index, main admin, wrong password, email password, register, individual post, extended post, etc).

Once you get to this point, 80% of the work has been done, you simply code the DB queries, load the templates, replace variables in the templates, and output the pages - for all the actions that you want to occur.

That's probably backwards compared to what some people would tell you - just get in there and start coding... - but it prevents you from being suprised - you want it to store THAT in the DB ? - and in my experience, results in a completed application much quicker.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-06-04, 08:50 AM
RaiTid_R RaiTid_R is offline
New Member
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I don't know about Templating or DB extraction specifically for news posting or php in general.

I has assumed you could get by with html in echo tags and forget the template. As far as DB extraction... that would be totally new to me. You can use php to pull information from a db... so I'm lost there.



So let's just assume that I have a news posting script that posts the values into a database. And I have a script that pulls news from a database. (I don't however, there are many tutorials for creating one to go into a text file... but I haven't looked extensively for database integration)

How would I get the script that pulls news to insert it into a format like...

-----------------------
|Avatar|Posted By Info|
-----------------------
|News----------------|
-----------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-06-04, 09:06 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Check out:

http://smarty.php.net/crashcourse.php

http://php.weblogs.com/adodb_tutorial

They give good examples of how you could do what you want more efficiently then "html in echo tags"...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-06-04, 01:45 PM
RaiTid_R RaiTid_R is offline
New Member
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I appreciate the guide in a particular set of directions. But I think I'm going to save that information until I become a little more proficient with all the php values and the likes.

As stated... i've manipulated code from simple forms to bbs and cms. But I've never "Created" it. So I don't know where either of those would apply in a news script.

I'll stick with php extensions and just use HTML and insert as I go along. Tedious and annoying... but only available option.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM
Need a simple image with info text script (I can even pay you for this) nezbie Script Requests 2 04-05-04 10:47 AM
Please help me sort out a small part of my php script... robertisunemployed PHP 8 03-03-04 11:02 PM
VERY simple weblog script? mixermanic PHP 2 02-02-04 10:44 AM
a mysql news script darkcarnival General HotScripts Site Discussion 2 07-25-03 11:49 AM


All times are GMT -5. The time now is 07:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.