Location: PHPKode > projects > NetLink > netlink_os/cms_images.php
<table summary='files' border='0' style='border:2px solid black;' align='center'>
  <tr>
    <td colspan='5' align='center'>
      <table summary='cms' border='0' class='cms' style="margin:0px;border:0; border-collapse: collapse;">
        <tr>
          <td align='center' class='cms_title' colspan='6'>
            <?php echo "Images for $login"; ?> (*.jpg, *.gif, *.png, *.bmp)
          </td>
        </tr>
        <tr>
          <th>
            Filename
          </th>
          <th width='300px;'>
            Last Modification
          </th>
          <th width='75x;'>
            Size
          </th>
          <th align='left' width='30px;'>
            Edit
          </th>
          <th align='left' width='30px;'>
            Rename
          </th>
          <th width='30px;'>
            Delete
          </th>
        </tr>
        <?php
            $dir = "Users/$login/"; 
            $tr="#c0c0c0";
            $flag = false;
            if (is_dir($dir))
            {
    
              if ($handle = opendir($dir))
              {
                while (false !== ($file = readdir($handle))) 
                {
                  if ($file != "." && $file != "..") 
                  {
                    $fs= File_Size($login,$file);
                    $tail=strtolower(substr($file, -3));
                    $mod="";
            
                        $mod=date ("m/d/y h:i ", filemtime("Users/$login/$file"));
                      if (date("H",filemtime("Users/$login/$file")) >= 12)
                        $mod.="PM";
                      else
                        $mod.="AM";
                    
                    if (($tail=="bmp")||($tail=="jpg")||($tail=="peg")||($tail=="png")||($tail=="gif")||($tail=="swf"))
                    {
                      echo "<tr bgcolor='$tr' onmouseover='color_on(this)' onmouseout='color_off(this, \"$tr\");'><td><a href='Users/$login/$file' target='_blank'>$file</a></td><td>$mod</td><td>$fs</td><td>";
                    
                      if ($pref=='t')
                        echo "<s>Edit</s>";
                      elseif ($pref=='i')			    
                        echo "<img src='Images/edit_g.gif' border='0'/>";
                      elseif ($pref=='ti')
                        echo "<img src='Images/edit_g.gif' border='0'/><br/><small><s>Edit</s></small>";
                      
                      echo "</td>";
                      echo "<td style='text-align: center;'><a href='?id=rename&file=$file'>";
                      if ($pref=='t')
                        echo "Rename";
                      elseif ($pref=='i')
                        echo "<img src='Images/rename.gif' border='0'/>";
                      elseif ($pref=='ti')
                        echo "<img src='Images/rename.gif' border='0'/><br/><small>Rename</small>";
                       
                      echo "</a></td>";
                      echo "<td style='text-align: center;'><a href='?id=delete&file=$file'>";
                      
                      if ($pref=='t')
                        echo "Delete";
                      elseif ($pref=='i')
                        echo "<img src='Images/delete.gif' border='0'/>";
                      elseif ($pref=='ti')
                        echo "<img src='Images/delete.gif' border='0'/><br/><small>Delete</small>";
                      
                      echo "</a></td>";
                      echo "</tr>\n";
                      //when Rotide Egami works, load <a href='rotideEgami.php?img=$file'>Edit</a> in the cell
                      if ($tr=="#c0c0c0")
                        $tr="#ffffff";
                      elseif ($tr=="#ffffff")
                        $tr="#c0c0c0";
                      $flag=true;
                    }
                  }
                }
              }
            }
            if ($flag==false)
                    echo "<tr bgcolor='$tr'><td colspan='6'><i>No Files Exist Yet!</td></tr>";
            
          ?>
      </table>
      <div class='add'>
        <b>ADD:</b> <a href='?id=upload'>Upload an Image</a>
      </div>
    </td>
  </tr>
</table>
Return current item: NetLink