Location: PHPKode > scripts > PonPublish > ponpublish/examples/postblog.php
<?php

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

define( "PUBLISH_PASSWORD", "password" );

require( "../ponpublish.php" );

if( $_GET[ "sub" ] && $_POST[ "password" ] = PUBLISH_PASSWORD )
{
    $Publish = new CPonPubisher;
    
    if( $_POST[ "personal" ] )
    {
        echo "Adding Pongles Module<br>\n";
    
        if( !$Publish->LoadModule( "personal" ) )
            die( "Unable to Load Personal Module" );
    }
    
    if( $_POST[ "myspace" ] )
    {
        echo "Adding MySpace Module<br>\n";
        
        if( !$Publish->LoadModule( "myspace" ) )
            die( "Unable to Load MySpace Module" );
    }
    
    if( $_POST[ "livejournal" ] )
    {
        echo "Adding LiveJournal Module<br>\n";
        
        if( !$Publish->LoadModule( "livejournal" ) )
            die( "Unable to Load LiveJournal Module" );        
    }
        
    echo "Publishing ...\n<br><br>\n";        
    
    $Publish->SetSubject( $_POST[ "subject" ] );
    $Publish->SetBody( $_POST[ "body" ] );
    $iReturnCode = $Publish->Publish( $rgModules );
    
    if( $iReturnCode != 0 )
    {
        echo "There was an Error - " . $iReturnCode . "\n";
    }    
    else
    {
        foreach( $rgModules as $rgModule )
        {
            echo "Failed Module - " . $rgModule[ "name" ] . "(" . ( $rgModule[ "return" ] == true ) ? "Completed" : $rgModule[ "output" ] . ")<br>\n";
        }
    }

    exit;
}

?>
<html>
<head>
</head>
<body>
<form action="postblog.php?sub=1" method="post">
<input type="input" name="subject" size="48" value="Subject">
<br><br>
<textarea name="body" cols="60" rows="40">Body</textarea>
<br><br>
<input type="input" name="password" size="48" value="Password">
<br><br>
<input type="checkbox" name="personal" value="1">Personal<br>
<input type="checkbox" name="myspace" value="1">MySapce<br>
<input type="checkbox" name="livejournal" value="1">LiveJournal<br>
<br><br>
<input type="submit" value="Submit">
</form>
Return current item: PonPublish