Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Anyone know a really simple PHP script for news and comments?

Featured Replies

I'm building a new site and this is the first PHP one in ages. I need a PHP script for a very simple news system. I had some like these already before on several sites of mine, I tried copying the codes and applying the whole database etc. infos, but somehow it won't work. I'm tired of trying and don't have much time. Plus this script didn't have a comment feature!

 

So I did some research and obviously I got a lot of results. But these scripts are all soooo complicated! This is way too complex for what I need. I don't want a whole CMS with a bunch of useless features!

 

Basically what I need is a script with following fields: title, content, user, date and ID.

 

ID and date would work automatically obviously, the rest I can enter whatever I want. The user field will automatically enter the username of the user who is logged in as admin at this moment, I'm building this site around a phpBB board so I will add the php code for getting the username myself.

 

For the comments, I never know how this worked. I first thought of a pop-up window that will open (comments.php) displayed the comments that go with the corresponding news. But instead I would just prefer: the news being displayed in full lenght on the main page, clicking the title goes to something like news.php?=1 which would again show the full news, but only this news obviously, and the comments below.

 

 

So… I'm not asking anyone to do this or something. I was just wondering, does anyone know of a script that would be good for me? Basically a script that is exactly what I'm searching? I'm really searching for the simplest possible with the above criteria.

 

 

Thanks guys :)

 

See you

I guess if you're competent enough to do something like this from scratch then good on you, but surely using something like WordPress which has all this built in would be much easier than building something like this from scratch. I don't think a PHP script for news and comments would ever be considered simple if you know what I mean.

  • Author

No I never did them from scratch, actually I got them from a course I did, and they were fantastic. I only used to modify them to my needs.

 

WordPress is useless for me as my site is based around the forum! I don't need a blog, I need a forum, and the news is something I decided to integrate. There's some mods, but they're all pretty bad (I've tested and uninstalled them) and they have no comment feature sadly.

 

With simple by the way I didn't mean in the sense of "simple to do", but more like "simple to use and not with tons of fonctions" :p I really don't need these… so how come there's so many complex news systems but not a single simple one? Nobody wants these, or what?! Everyone wants "bigger" and "better", but they forgot that simple and clean can sometimes stand out much more :)

No I never did them from scratch, actually I got them from a course I did, and they were fantastic. I only used to modify them to my needs.

 

WordPress is useless for me as my site is based around the forum! I don't need a blog, I need a forum, and the news is something I decided to integrate. There's some mods, but they're all pretty bad (I've tested and uninstalled them) and they have no comment feature sadly.

 

With simple by the way I didn't mean in the sense of "simple to do", but more like "simple to use and not with tons of fonctions" :p I really don't need these… so how come there's so many complex news systems but not a single simple one? Nobody wants these, or what?! Everyone wants "bigger" and "better", but they forgot that simple and clean can sometimes stand out much more :)

 

wordpress has a forum plugin called bbpress

  • Author

I prefer phpBB because I know it very well :) I know bbpress and I'm not really a fan (although I love wordpress, but again, not what I'm looking for).

Writing one from scratch isn't hard, just a little time consuming if you aren't familiar with all the aspect, such as connecting to your database. You could hop on google.com and search for "Lightweight PHP CMS" and you'll get roughly a dozen decent, light weight, and simple CMS's.

  • Author

Thanks! Actually I was going to say that I've already done the news script itself, now I'm looking for something that can manage the comments :) I have absolutely no idea how to do that!

  • Author

I have some little updates. I’m trying to get on this slowly.

 

So my news script is now finished and works 100%, and so does the News Control Panel that I’ve created for it.

 

The news are displayed on my default page which is home.php.

 

Next step for me is that I would like something that enables me to view one news individually. Something like home.php?news=13. How do I do that and what is this called? I can’t really search this anywhere, so I would need what it’s called :)

  • Author

http://disqus.com/ - is there anything better?

 

Thanks man but this is waaayyy to complex, I’m really looking for something very simple: username, comment, timestamp. Hehe :)

 

It's called query string data :)

 

Also, you don't want to have nasty URLs like site.co.uk/news/home.php?news=123, you want site.co.uk/news/news-title-here-keywords - have a google around for seo freindly urls (or pretty urls). Essentially you;re just storung the slug (E.g. news-title-here-keywords) in the database and querying that on the page). YOu have the id in too if required E.g. site.co.uk/news/123/news-title-here-keywords - but I prefer the shorter version.

 

Thanks man, I heard that those „nasty“ URLs are not very SEO-friendly. I’d prefer the news-title-here type then :) I just always thought the page.php?whatever=123 always looked nice and cool :santa_cool:

 

 

Still looking for a solution then :santa_cheesy:

  • Author

Well I didn’t mean complex in the way of „It’s too complex to install“ but more like „this has too many features“ :p

 

Thanks for the SEO link — I’m checking it out :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.