Webmaster Forum
Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs

UK Web Hosting
UK Web Hosting
Website Hosting
Website Hosting
UK One Way
UK One Way
Get Top 10 Exposure
 
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2007, 04:08 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default Creating your own blog

OK, did you ever think about creating your own blog?

I know it sounds complicated but it's not. You need a database, and a couple of PHP files to start.
The idea of this thread is to create a simple blog step by step.
First we'll create a database, a simple backend and a simple CSS style.
Later we'll expand all of this, add new functions, effects, enhace the look of the blog and so on.

This thread will be updated at least once a week with new functions for the blog until we end up with a completely finished blog application.

Once finalized this blog could power your personal blog.

I know there are many free blog solutions available on the net and they all have more features than this blog will ever have (unless I get a very large open source development community ), but creating your own blog would give your site a unique look and feel. And this script, once written can be easily modified to act as a CMS.

OK, this was the intro. First lesson tomorrow.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 05-02-2007, 10:02 AM
Senior Member
 
Join Date: Jan 2007
Posts: 194
iTrader: 0 / 0%
UK WW ex member is on a distinguished road
Default

Hi Very intersting ,posting here to subscribe the thread and be informed the progress.

Wishing you good luck
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 05-02-2007, 05:26 PM
Bisje's Avatar
Senior Member
 
Join Date: Feb 2007
Posts: 208
iTrader: 0 / 0%
Bisje has a spectacular aura aboutBisje has a spectacular aura aboutBisje has a spectacular aura about
Default

And I post for exactly the same reason
Looking forward to the first lesson ! Great idea.
__________________
Take a look at Eric's Books Site to know what I read or at Eric's Boeken Site for the Dutch talking.
Add your book-related site to my Books Directory...my First attempt to LBS
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2007, 12:15 AM
Member
 
Join Date: Mar 2007
Posts: 61
iTrader: 0 / 0%
Nonactiveuser8999 is on a distinguished road
Send a message via Yahoo to Nonactiveuser8999
Default

melkior that is a great idea maybe we can all contribute to this project
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2007, 12:35 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

Well, when the blog is finished anyone can expand it as he sees fit.
The base idea of this thread is for it to be a tutorial for now.
But thanks for your offer.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 05-03-2007, 12:46 AM
Member
 
Join Date: Mar 2007
Posts: 61
iTrader: 0 / 0%
Nonactiveuser8999 is on a distinguished road
Send a message via Yahoo to Nonactiveuser8999
Default

Ok I guess I didn't read very good the first post anyway I'll keep an eye on this thread
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-03-2007, 02:25 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default Lesson 1 - The Theory

Well seeing that this thread caused interest I better move along.
Well, first of all, let me tell you that this tutorial will be written for those who have an elementary knowledge of PHP, HTML and MySQL although it's not necessary.
I'll try to keep it as simple as possible and you can ask me about the details on any part of this project anyway.

OK, a little bit of theory for a start.
The logic behind the basic functions of a blog is fairly simple:
Each blog consists of 3 parts (2 if you divide them by type). First part is the user interface. In this case it'll be a collection of PHP scripts which will work as a whole to generate the pages for the visitors to view.
Second part of the blog is the administration control panel which allows the admin (in this case you) to add new posts, add links to the blogroll and so on.
And the final, third part is the database. The database contains all the posts, links and everything else in your blog.
These 3 parts interact together and create what we call a blog.
The user interface fetches the data from the database and formats it as a webpage, while the admin control panel inserts the data into the database.

OK, next post -- some real programming.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 05-03-2007, 03:11 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default Lesson 2 - The Database

Before writing any code we need to design the database cause we really need to know what data we'll be using in the script and also what functions we'll need to create.

We'll start with a simple database - it will use only one table. We don't need too much at first anyway.
We'll need a date on the posts, their titles, the text in the post and we'll add an ID for the posts (we'll need that later).
So here's the SQL code for creating the table. You can run this query in phpmyadmin after creating the database or import it or whatever suits you.
Code:
CREATE TABLE `blog` (
`id` INT( 128 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`date` TIMESTAMP NOT NULL ,
`title` VARCHAR( 100 ) NOT NULL ,
`text` TEXT NOT NULL
);
So now we have a table named blog ready for our inputs.
We'll be expanding this database in future tutorials.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 05-03-2007, 03:29 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default Lesson 3 - First PHP code

Now that we have a database ready we need something to input the data and something to display the data from the database.

First, what we'll do is create a config.php file. It will include settings for the database connection and some other configuration info.
Here's the code:
PHP Code:
<?php

$dbuser
= 'username'; //database username
$dbname = 'blog'; // database name
$dbpass = 'password'; //database password
$dbhost = 'localhost'; //database host -- usually 'localhost' but best to check with your host

$sitename = 'My Blog'; //name of your site

mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);

?>
We'll include this file in our other files in the next step.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 05-03-2007, 04:00 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

Well, we have the config file.
We need something that will display our blog.
We need to create an index.php file.
This is the source code:
PHP Code:
<?php

include ("config.php");

?>

<HTML>
    <HEAD>
        <TITLE><?php echo $sitename; ?></TITLE>
    </HEAD>
    <BODY>
        <H1><?php echo $sitename; ?></H1>
        <?php
        $sql
="SELECT * FROM blog ORDER BY id DESC LIMIT 10";
        
$result=mysql_query($sql);
        while (
$record = mysql_fetch_object($result)) {
        echo
"<dt><b>$record->title</b></dt>";
        echo
"<em>$record->date</em>";
        echo
"<dd>$record->text</dd>";
        echo
"<p></p>";
        }
        
?>
    </BODY>
</HTML>

<?php

mysql_close
();

?>
We start by including the data from the config file which also manages connecting to the database for us.
After that we switch to HTML to format a normal web page but we include dynamic content.
We use the PHP echo statement to write out the name of the site in the header and also in the first line after the opening BODY tag. The name is taken from the $sitename variable in the config.php file.
We again switch to PHP in the body section to select all the data from the database, we use a while loop to continue fetching data until we reach the end of the database. We order it by the id stored in the database and it's descending (to show the latest posts first). We're also limiting the selection to 10 entries.
The retrieved data is stored in the $record and we can access the parts we need by writing $record->name_of_what_we_need
So we write out the data, first the title, than the date and finally the post itself. We format it with a little bit of HTML and that's it.
Later today I'll post the source code of the script we'll use to insert data, and set up a live example.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks

Webmaster Resources
UK Web Hosting
UK WW SEO Tools
Free site submission
Web Directory
 
Advertisement
firewall script
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
3.7 adsense ads space bollywood downloads bollywood latest buy banners cctv changing host changing server channel solutions cheap off page packages cheap seo packages cheap seo services closing coupon code boss cart jv directory announcement domain name extension domain names e brochures ecommerce flash website promotion flash websites forum free directory free directory software google google adwords host quack hostquack inline price changes introduction ipn paypal payment boss job site joomla job junglejar junglejar.com lbs. link bid script link bid script hungarian link exchange linux host moving server nokia off page seo packages picture of the day referral sale sell baners seo seo packages shared hosting sososher submit url switching host symbian templates tld today in history traffic transfering host uk shipping postcodes upgrade vbulletin web design webinare webmaster tools website wordpress

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating and running a discussion forum temi Webmaster Tips and Tricks 39 06-19-2008 08:20 AM
Tips for creating better website temi Webmaster Tips and Tricks 11 03-21-2008 02:25 AM
Creating a custom page in vBulletin melkior_inactive Forum Software 3 01-18-2008 11:14 AM
PR4 Real Estate - blog posts for sale - one year old blog stock_post Other Advertisements (Ads spaces such as banner, blogs and articles) 1 08-23-2007 09:44 AM
Creating Banners gkd_uk General Webmaster Talk 1 05-26-2007 12:36 PM


All times are GMT. The time now is 05:54 AM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20