Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newtito

macrumors member
Original poster
Nov 6, 2006
55
19
Hello all,

I am looking to create a website that updates its main page automatically depending on the article that I create, much like Macrumors.com does. What technology is behind this? Is it PHP linked with MySQL? What would be the best way of doing this?

Thanks for your help,
newtito
 
Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd
 
Clarification

Sorry if I wasn't specific enough, but I did not mean the Forum area of Macrumors. I meant the home page of Macrumors. More specifically, I am trying to create a page for my family's web site where if I create a new post on the "Blog" page, for example, the post's title and a snippet of its contents are automatically posted on the home page.

Thanks again,
newtito
 
I don't know about Mac Rumors specifically, but that type of page would usually be done with PHP and MySQL. It could also be done with other server side languages like Ruby on Rails, Java Server Pages, ASP, C# .Net, etc. If you're pulling stuff from a blog, it'll depend on how the blog stores things for how these other languages will access it. If it stores it in a database then the languages will access it that way, or if it's flat files (plain text), then they'll be accessing from there. There's literally dozens of ways to do things here.

Let us know more about your setup and we might be able to give a little more concrete examples of things to look at and where to head next, but it'll likely to be to tutorials or maybe some developed solutions you can use.
 
I think i get it, he wants a website that has a blog page and displays snippets of the latest blog articles on his home page a bit like the bar for the forum on the right hand side of this site.

That can be done with php and mySql though it will need a little bit of coding, the home page link is basically calling the database entries from the blog table with your rules such as the newest 10 posts and then formating the data with css to make it fit your home page.

This can be very difficult if you have limited knowledge of SQL and PHP and to date i have never found anything off the shelf that will work. Though a starting point is the actual code for the blog page as you are creating a condensed version of that on your home page.
 
thanks

Thanks for the feedback. I know this will require some work, I just need to know where to get started. Here goes a very simple mockup of what I want to achieve. I want to be able to post a poem, for example, and have the main page reflect the new addition. Any other suggestions would be great.

Thanks again,
~newtito
 

Attachments

  • familyMockup.JPG
    familyMockup.JPG
    50 KB · Views: 95
How are you currently doing your blog? Are you using WordPress, Blogger, a custom blog, etc.? Need to know so we know what technology is behind it. Also is the blog a part of your current domain or is it hosted on another web site?

Edit: Also, what is your skill level with PHP, MySQL? This will help determine what level of a solution to give (so we don't talk over your head), though if you don't know how to work with these technologies much we probably can't give too much help as we would need to know a lot about your setup, though can definitely give theoretical advice on how to proceed. In that case you may want a more pre-built system like a CMS, which Dejavu is suggesting below.
 
You're looking for a Content Management System (CMS). There are several: Joomla and Drupal being the two popular ones. MacRumors, I believe, runs off custom code or it's heavily modified. Maybe if you get arn drunk or greased up, he might provide it for you. :D
 
How are you currently doing your blog? Are you using WordPress, Blogger, a custom blog, etc.? Need to know so we know what technology is behind it. Also is the blog a part of your current domain or is it hosted on another web site?

I currently do not have a blog as all of this is in a pre-production stage. I would probably be doing a custom blog or using wordpress (i don't know the pros and cons of either other than ease of use and ease of setup).

The purpose of the site is not simply a blog, but a place where relatives can go to look at new pictures, read about a vacation, etc.

~newtito

You're looking for a Content Management System (CMS). There are several: Joomla and Drupal being the two popular ones. MacRumors, I believe, runs off custom code or it's heavily modified. Maybe if you get arn drunk or greased up, he might provide it for you. :D

Thanks, I'll look into that (not the getting arn drunk part :D)
 
you can do what you are looking to do using a quality open-source content management system without knowing a lot of PHP. THE CMS will handle the calls to mySQL for you, unless you are doing MAJOR modifications.
 
Wow thanks for the tip and links guys, to the OP, I'm looking into building the same thing like what you wanted.

I use wordpress so far but no luck into doing like what I wanted (which is the same as what you wanted). Anyone know a good site to learn doing something like the OP wants but using Wordpress?
 
I did this a few versions ago on my own website, my home page pulled my latest wordpress post and latest pixelpost image to display on the home page. I used just a simple script from dynamic drive:

RSS Display Box

You don't need to know MySQL or PHP, just follow the instructions on that and you should be good. As long as your blog has an RSS feed you'll be good.

Oh, I just remembered I set it up for this website:

Stock Investor Newsletter

Each section of the newsletter has its own independent Wordpress install, each writer blogs for each section. Every Tuesday the main admin publishes the individual sections and the feed gets updated on the link above so it never changes. So that page is running 6 scripts of that RSS Display box.

PM me if you need any help. To me this would be easiest for you.
 
I put together some pieces of PHP/MySQL that shows the flow of what you need. This is not complete code on its own, it's as an example. I repeat: This is not copy and paste code! There's not a whole lot to it, the hard part will be gathering the needed information from the blog database.

PHP:
// connect to db
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'petstore'; // this would be whatever name the blog database is
mysql_select_db($dbname);

// Query for latest blog entries
// You'll need to update query for your database names and column names
// The first row returned will be the newest in the blog.
$query = "SELECT * FROM entries ORDER BY date DESC";
$result = mysql_query($query);

// Display blog entry as you want it. This will show the 2 latest blog entries
$entries_to_display = 2;
$shown = 0;
while($row = mysql_fetch_array($result, MYSQL_ASSOC)
  || ++$shown >= $entries_to_display)
{
  // Your output format can be whatever and you'll need to update column names
  //  used below.
  print "<h1>{$row['title']}</h1>" .
    "<p>{$row['message']}<p>";
}
This page is a good one for a quick tutorial on MySQL and using PHP to connect and use it.
 
Thanks

Wow,

Thanks for all of the excellent replies! I am thinking about using Joomla but will definitely keep all of the other suggestions in mind. As far as my level of expertise with PHP and MySQL, I have used it for a couple of websites (maintaining a database of MP3's for my church's website, etc.) so I am knowledgeable with the coding.

Once again, thanks for all the great responses.

~newtito
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.