PHP
  Home arrow PHP arrow Page 3 - Polishing the Visual Presentation of a Blogger with the Code Igniter PHP Framework
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Polishing the Visual Presentation of a Blogger with the Code Igniter PHP Framework
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2009-01-06


    Table of Contents:
  • Polishing the Visual Presentation of a Blogger with the Code Igniter PHP Framework
  • The blog application’s full source code so far
  • Improving the blogger's visual presentation
  • Listing the improved version of the blogger

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Polishing the Visual Presentation of a Blogger with the Code Igniter PHP Framework - Improving the blogger's visual presentation
    ( Page 3 of 4 )

    Improving the look of the blogger is only a matter of adding a few simple CSS styles to each of the view files coded in the earlier section, since they’re the elements that actually compose the visual presentation of the application.

    Therefore, I’m going to style the first view -- the one responsible for displaying all the blog entries stored on the “blogs” MySQL table. As you’ll see in a moment, this process requires only tying a few CSS styles to the headers and links of the web document, divs and paragraphs, and some additional web page elements as well.

    So in short, here’s how this view file now looks, after including the aforementioned CSS styles:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title><?php echo $title;?></title>

    <style type="text/css">

    body{

    margin: 0;

    padding: 0;

    background: #fff;

    }

    h1{

    font: bold 16pt Arial, Helvetica, sans-serif;

    color: #003399;

    margin: 18px 0 18px 0;

    text-align: center;

    }

    h2{

    font: bold 12pt Arial, Helvetica, sans-serif;

    color: #333;

    margin: 0 0 18px 0;

    }

    p{

    font: normal 11px Verdana, Arial, Helvetica, sans-serif;

    color: #333;

    margin: 0 0 18px 0;

    }

    #container{

    width: 500px;

    background: #ccf;

    padding: 15px;

    margin-left: auto;

    margin-right: auto;

    margin-bottom: 18px;

    }

    #paginglinks{

    width: 500px;

    background: #eee;

    padding: 5px 15px 5px 15px;

    margin-left: auto;

    margin-right: auto;

    }

    a:link,a:visited{

    font: normal 11px Verdana, Arial, Helvetica, sans-serif;

    color: #00f;

    text-decoration: none;

    }

    a:hover{

    color: #f90;

    }

    </style>

    </head>

    <body>

    <h1><?php echo $title;?></h1>

    <?php foreach($result->result_array() as $blog):?>

    <div id="container">

    <h2><?php echo $blog['title'];?></h2>

    <p><?php echo $blog['text'];?></p>

    <p><?php echo anchor('blogger/comments/'.$blog['id'],'View Blog Comments &gt;&gt;');?></p>

    </div>

    <?php endforeach;?>

    <?php echo $links;?>

    </body>

    </html>


    Now the “blogs_view.php” file includes a few typical CSS styles, which come in useful for polishing the look of the web document that displays the blog entries. In this case, I encapsulated these styles within a couple of <style> tags, but naturally it’s preferable to code them in a separate file.

    Finally, to complement the previous explanation, below I included a screen capture that shows clearly the improved visual presentation of the blogger. Here it is:



    That looks much better, definitely! Of course, I decided to style the web page that displays the blog entries according to my personal tastes, but you can easily change this to suit your own preferences.

    So far, so good. At this stage, you hopefully learned how to polish the visual appearance of the blogger, at least partially. Therefore, the last thing that I’m going to show you in this tutorial will be a list of the complete source code of the blog application, this time including the CSS styles that you just learned.

    So, jump forward and read the following section. We’re almost done!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek