For a simple blog, start from scratch?

#1
[eluser]vrillusions[/eluser]
I have been spending a while now pondering how I want to do the main page to my website. I have used wordpress for a personal journal type site for a while now, so I'm comfortable with it. Also expressionengine is good as well but I've never tried it. The problem I've been trying to figure out at least with wordpress is how to integrate into my site:

Quote:/ - last 10 or so entries
/blog/2007/12/the-permalink-uri
/articles/permalink-for-article-uri
/another_ci_module
/another_ci_module2
...

My website is just a personal website. I'll be the only one that ever posts stuff, there are no other editors, I use the plain html markup version in wordpress (not the fancy editor). I designed a database consisting of 5 tables or so and were all pretty small. Only thing I would really miss as far as plugins is akismet, which there are php classes available and easy to use, and some minor ones I added because I could, like a feedburner plugin and such.

So, my question, given the above needs, how would you make it? I'm leaning towards just making my own since it is so basic. Then I don't have to worry about how to get wordpress or EE to see all my existing configs, adding features are easy, since it's not complex with a need for multiple editors with different permissions in different areas. With some other script I'd have to figure out how to get all the urls to work correctly and make sure various parts can see other parts and then hope that an update doesn't break everything.

#2
[eluser]Developer13[/eluser]
Hi vrillusions,

You can always try downloading InkType (link in my signature). InkType is a CodeIgniter based blogging application that I'm building based on input and suggestions from the CI Community. It's in alpha version right now, but the basic features are there. If you decide to download it and give it a try, *please* let me know if you have any questions or problems using it. Feel free to email me at [email protected] or PM me through this board.

#3
[eluser]ejangi[/eluser]
Wordpress has an XML-RPC server at http://yoursite.com/xmlrpc.php, so you can use the CI XML-RPC library to access the available API methods.

An example library for just this sort of thing:
Code:
class Wordpress_remote {
    
    var $url = null;
    var $user = null;
    var $pass = null;
    var $port = null;
    
    
    
    /**
     * Constructor
     *
     * @access public
     * @return void
     */
    function Wordpress_remote()
    {
        $this->CI =& get_instance();
        $this->CI->load->library('xmlrpc');
        $this->CI->load->config('wordpress');
        $this->_auto_setup();
    } // Wordpress_remote()
    
    
    
    /**
     * Setup the XML-RPC configuration information
     *
     * @access public
     * @return void
     */
    function setup($url, $user, $pass, $port = 80)
    {
        $this->CI->xmlrpc->server($url, $port);
        $this->user = $user;
        $this->pass = $pass;
    } // setup()
    
    
    
    /**
     * Get the most recent post(s)
     *
     * @access public
     * @param int $num The number of posts to get.
     * @return array
     */
    function get_recent($num)
    {
        $this->CI->xmlrpc->method('metaWeblog.getRecentPosts');
        $request = array(1, $this->user, $this->pass, (int) $num);
        $this->CI->xmlrpc->request($request);
        
        if (!$this->CI->xmlrpc->send_request()) {
            return $this->display_error();
        } else {
            return $this->display_response();
        }
    } // get_recent()
    
    
    
    /**
     * Automatically handle the setup if setup() is not called explicitely
     *
     * @access protected
     * @return void
     */
    function _auto_setup()
    {
        if (!$this->url) {
            $this->url = $this->CI->config->item('wordpress_url');
        }
        
        if (!$this->user) {
            $this->user = $this->CI->config->item('wordpress_user');    
        }
        
        if (!$this->pass) {
            $this->pass = $this->CI->config->item('wordpress_pass');    
        }
        
        if (!$this->port) {
            $this->port = $this->CI->config->item('wordpress_port');
            if (!$this->port) {
                $this->port = 80;    
            }
        }

        $this->CI->xmlrpc->server($this->url, $this->port);
    } // _auto_setup()
    
    
    
} // END CLASS - Wordpress_remote

You then have a file in config/wordpress.php which contains:
Code:
$config['wordpress_link'] = 'http://mywordpressinstall.com/';
$config['wordpress_url'] = 'http://mywordpressinstall.com/xmlrpc.php';
$config['wordpress_user'] = '';
$config['wordpress_pass'] = '';

[EDIT:] The user and pass should be associated with a valid admin user in your wordpress install. In otherwords, use the login details YOU use to login to the backend. ;-)

And finally from your controller method you can do the following:
Code:
$this->load->library('wordpress_remote');
echo '<pre>'.print_r($this->wordpress_remote->get_recent(1), true).'</pre>';

#4
[eluser]vrillusions[/eluser]
Thanks for the replies. I knew about the xml-rpc interface and figured there would be some way to tie into that and WPs xml-rpc stuff. And I'll give InkType a try to. Hopefully I'll figure out something soon the "this site is under construction" page that's there now is so 90's, just need an animated gif of a construction worker with a shovel Wink


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.