Location: PHPKode > scripts > PonPublish > ponpublish/modules/personal.php
<?php

/***************************
* PonPublish               *
* Written By: Pongles      *
* Website: pongles.com     *
* Licence: GPL             *
****************************/

// mysql connection data
define( "MYSQL_SERVER", "localhost" );
define( "MYSQL_DBUSER", "" );
define( "MYSQL_DBPASS", "" );
define( "MYSQL_DATABASE", "" );

// mysql table names
define( "MYSQL_BLOG", "blog" );

// NOTE: it would be better if you
// included the config file from your site
// instead of redefining it all!

// this code will add to a table something like:
/*CREATE TABLE `blog` (
  `id` int(5) NOT NULL auto_increment,
  `subject` varchar(128) NOT NULL,
  `date` int(32) NOT NULL default '0',
  `blog` longtext NOT NULL,
  UNIQUE KEY `id` (`id`)
) TYPE=MyISAM;*/

// purpose: adding blogs to your own site
class CPersonalPublish extends CPublishBase
{
    // purpose: publish the blog on pongles
    // returns: bool   
    function Publish( $strSubject, $iDate, $strBody )
    {
        if( !mysql_connect( MYSQL_SERVER, MYSQL_DBUSER, MYSQL_DBPASS ) )
            return "Could not Connect to Server";
            
        if( !mysql_select_db( MYSQL_DATABASE ) )
            return "Unable to Select DB";
        
        if( !mysql_query( "INSERT " . MYSQL_BLOG . " SET subject='" . $strSubject . "',date='" . $iDate . "',blog='" . $strBody . "'" ) )
            return "Insert Failed";
            
        return true;
    }
}

// create module
CreateModule( "Personal", new CPersonalPublish );

?>
Return current item: PonPublish