<?php 
require_once $_SERVER['DOCUMENT_ROOT'].'/includes/common-header.php'
require_once 
$_SERVER['DOCUMENT_ROOT'].'/includes/config.php'// my config.php & common-functions.php
?> 


<!-- above is all kiev -->


        <div class="documentActions">
         <a id="documentContent"/>
<!-- a href="javascript:this.print();"><img alt="Print" src="<?php echo $image_path?>icon-print.gif" class="icon-print" title="Print this page"/></a -->
         <a href="../contact.php" title="Add or update your tutorial."><img src="../images/icon-add.gif" height="13" width="13" alt="add"/>Submit Article</a>
<?php if (! $id) { ?>
         &#160;&#160;<a href="index.xml" title="RSS" onmouseover="parent.location='index-xml.php';"><img src="../images/icon-xml.gif" class="icon-xml" alt="RSS"/></a>
<?php // endif ?>
        </div>


<?php
      
// second time round to mysql so the second [while ($row = mysql_fetch_row($result))] will works on tutorial page.
      // have to, else index page wont be ordered by date.
      
if (! $id) { // if isset NOT true.
          
$sql "SELECT * FROM news WHERE category='$category' ORDER BY date DESC";
      
//} else { // still have that first one loaded from top of page.
      //    $sql = "SELECT * FROM news WHERE id='$id'";                      // on the auto-increment primary key.
      
}    
      
$result mysql_query($sql$conn) or die('Could not execute query.'); // Execute the query. // set in config.php
      
mysql_close($conn);
?>
<!-- google_ad_section_start -->
<?php if (! $id) { // index page ?> 
        <h1><?php echo strtoupper($category); ?></h1>
        <div class="description"><cite>We picked out the best scripts you should choose to build your site with.</cite>&trade;</div>
 <?php while ($row mysql_fetch_array($resultMYSQL_BOTH)) { // loop thru the data, showing the info. ?>
        <p class="p_no_margin">
         <strong><a href="?id=<?php echo $row[0]; ?>"><?php echo $row[2]; ?></a></strong><br/>
         <?php echo $row[3]; ?>
        </p>
 <?php // endwhile ?> 

<?php } else { // tutorial page 
           
$row mysql_fetch_array($resultMYSQL_BOTH// fetch result again showing the info. // no while needed.
?>
<script type="text/javascript" src="http://programmabilities.com/scripts/shCore.js"        ></script>
<script type="text/javascript" src="http://programmabilities.com/scripts/shBrushPhp.js"    ></script>
<script type="text/javascript" src="http://programmabilities.com/scripts/shBrushSql.js"    ></script>
<script type="text/javascript" src="http://programmabilities.com/scripts/shBrushXml.js"    ></script>
<script type="text/javascript" src="http://programmabilities.com/scripts/shBrushJScript.js"></script>
<!-- script type="text/javascript" src="http://programmabilities.com/scripts/shBrushVb.js"     ></script -->
<!-- script type="text/javascript" src="http://programmabilities.com/scripts/shBrushCSharp.js" ></script -->
<!-- script type="text/javascript" src="http://programmabilities.com/scripts/shBrushPython.js" ></script -->
         <!-- BEGIN tutorial cut & paste: -->
         <h1><?php echo $row[2]; ?></h1>
         By <a href="http://programmabilities.com/members/?username=<?php echo $row[6]; ?>"><cite><?php echo $row['first_name']. ' ' .$row['last_name']; ?></cite></a> at <a href="<?php echo $row['url']; ?>" title="<?php echo $row['url']; ?>"><cite><?php echo $row['url']; ?></cite></a>. <?php echo date('Y-M-d'strtotime($row['date'])); ?>
         <blockquote style="background-color:#ffffdd;" cite="http://programmabilities.com<?php echo $PHP_SELF?>?id=<?php echo $row[0]; ?>">
          <p><strong>Summary:</strong><br/><?php echo $row[3]; ?></p>
         </blockquote>
         <?php echo $row[4]; ?>
         <!-- END tutorial cut & paste. -->
<script type="text/javascript">
dp.SyntaxHighlighter.HighlightAll('code', true, true);
dp.SyntaxHighlighter.HighlightAll('code2', false, false);
</script>
<?php // endifelse. ENDs index || tutorial page  ?>  
<!-- google_ad_section_end -->

<?php if ($id) { ?>
        <!-- Comments: -->
        <div class="documentActions2"><small>[<a href="comment-admin.php" title="Admin">Admin</a>]</small></div>
        <h2>Comments</h2>
        <br/>
        <?php $hide_comments=false; include_once 'comment.php'?>
        <!-- END Comments. -->
<?php // endif ?>

       </div>
       </div>
</div><!-- END center -->
<div id="content-right">
<?php if ($id) { ?>
 <?php include_once $_SERVER['DOCUMENT_ROOT'].'/includes/box-google.php'         ;
       include_once 
$_SERVER['DOCUMENT_ROOT'].'/includes/box-links.php'          
       include_once 
$_SERVER['DOCUMENT_ROOT'].'/includes/box-ads.php'            ;
 
?>
<?php 
} else { ?>
 <?php include_once $_SERVER['DOCUMENT_ROOT'].'/includes/box-google.php'         ;
       include_once 
$_SERVER['DOCUMENT_ROOT'].'/includes/box-links.php'          
       include_once 
$_SERVER['DOCUMENT_ROOT'].'/includes/box-google-ad-links.php';
 
?>
<?php 
// endifelse ?>
</div><!-- END right -->

<?php require_once $_SERVER['DOCUMENT_ROOT'].'/includes/common-footer.php'?>

Hide Source