updating code only
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 15 Feb 2010 16:26:43 +0000 (16:26 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 15 Feb 2010 16:26:43 +0000 (16:26 +0000)
admin/Photos/edit_photo_category.phtml
admin/Photos/export-images-is0.php
admin/Photos/list_photo.phtml
admin/Photos/list_photo_category.phtml

index 8092102..6283ab7 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
-require_once("../../setup.phtml");
-require_once("photo-setup.inc");
+require_once "../../setup.phtml";
+require_once "photo-setup.inc";
 
 GLM_TOOLBOX::top("Photo Albums (Add Album)", HELP_BASE."photocat.phtml?key=edit");
 $lnav["List Albums"] = "list_photo_category.phtml";
index cae3c46..ea8ac3b 100755 (executable)
@@ -19,7 +19,6 @@ try {
 } catch(PDOException $e) {
     die($e->getMessage());
 }
-//$db->beginTransaction();
 $IServer = new Toolkit_Image_Server();
 if (is_array($data)) {
     $prep2 = "
@@ -52,6 +51,4 @@ if (is_array($data)) {
         }
     }
 }
-//$db->commit();
-//$db->rollBack();
 ?>
index 4b9d14a..b295116 100755 (executable)
@@ -3,10 +3,10 @@ require_once "../../setup.phtml";
 require_once "photo-setup.inc";
 GLM_TOOLBOX::top("Photo Albums (List Photos)", HELP_BASE."photo.phtml?key=list");
 $lnav = array(
-                       "Add A New Photo"       => "edit_photo.phtml?catid=$catid",
-                       "List Photos"           => "list_photo.phtml?catid=$catid",
-                       "List Albums"   => "list_photo_category.phtml"
-               );
+    "Add A New Photo" => "edit_photo.phtml?catid=$catid",
+    "List Photos"     => "list_photo.phtml?catid=$catid",
+    "List Albums"     => "list_photo_category.phtml"
+);
 GLM_TOOLBOX::html_nav_table($lnav, 5);
 $query = "select * from photo_category_bus;";
 if ($res2 = $DB->db_exec($query)) {
@@ -14,10 +14,11 @@ if ($res2 = $DB->db_exec($query)) {
                $data2[$row2['photocat_id']] = $row2['buscat_id'];
        }
 }
-$qs2 = "SELECT         id,title,pos 
-               FROM    photo
-               WHERE   catid = $catid
-               ORDER BY pos";
+$qs2 = "
+  SELECT id,title,pos 
+    FROM photo
+   WHERE catid = $catid
+ORDER BY pos";
 $res = $DB->db_exec($qs2);
 if (!$res) {
        GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
@@ -32,29 +33,25 @@ echo ' <form action="update_photo.phtml" method="POST">
   <th> Function </th>
   <th> Title </th>
 </tr>
-<?
-for($i = 0; $i < $DB->db_numrows($res); $i++) 
-{
-       $row = $DB->db_fetch_array($res,$i, PGSQL_ASSOC); 
-       if(!$row[id])
-       {
-               GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
+<?php
+for ($i = 0; $i < $DB->db_numrows($res); $i++) {
+       $row = $DB->db_fetch_array($res, $i, PGSQL_ASSOC); 
+       if (!$row['id']) {
+               GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
        }
-       if(!$row[id])
-       {
-               GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
+       if (!$row['id']) {
+               GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
        }
        ?>
 <tr>
        <td align="left" nowrap="nowrap">
-               <a href="edit_photo.phtml?id=<?echo $row[id]?>&catid=<?echo $catid?>">[Edit/Delete]</a>
-       <?
+               <a href="edit_photo.phtml?id=<?echo $row[id]?>&catid=<?php echo $catid;?>">[Edit/Delete]</a>
+       <?php
        $qs = "SELECT   MAX(pos) as maxpos
                   FROM         photo
                   WHERE        catid = $catid";
 
-       if(!$maxresult = $DB->db_exec($qs)) 
-       {
+       if (!$maxresult = $DB->db_exec($qs)) {
                GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
        }
        $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
@@ -62,12 +59,10 @@ for($i = 0; $i < $DB->db_numrows($res); $i++)
        $pos = "<font size=-4><select name=pos 
                onChange=location.href=this[this.selectedIndex].value;
                size=1>";
-       for($newpos=1;$newpos<=$maxpos;$newpos++) 
-       {
+       for ($newpos=1;$newpos<=$maxpos;$newpos++) {
                $string = "Command=Move&id=$row[id]&catid=$catid&newpos=$newpos";
                $pos .= "<option value=\"update_photo.phtml?$string\"";
-               if($newpos == $row[pos]) 
-               {
+               if ($newpos == $row[pos]) {
                        $pos .= " selected";
                }
                $pos .= ">$newpos\n";
@@ -76,9 +71,9 @@ for($i = 0; $i < $DB->db_numrows($res); $i++)
        echo $pos;
        ?>
        </td>
-       <td align=left> <b><?echo $row[title]?></b> </td>
+    <td align=left> <b><?php echo $row['title'];?></b> </td>
 </tr>
-       <?
+       <?php
 }
 echo '</table>
        </form>
index a1e1cd6..560b284 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 require_once "../../setup.phtml";
 require_once "photo-setup.inc";
-$query = "select * from photo_category_bus order by buscat_id;";
 $sql = "
   SELECT pcb.buscat_id,pcb.photocat_id
     FROM photo_category pc 
@@ -15,8 +14,6 @@ if ($res2 = $DB->db_exec($sql)) {
 }
 GLM_TOOLBOX::top("Photo Albums (List Categories)", HELP_BASE."photocat.phtml?key=list");
 $lnav["Add A New Album"]       = "edit_photo_category.phtml";
-//$lnav["Default Text"]        = "edit-default.php";
-//$lnav["List Albums"] = "list_photo_category.phtml";
 GLM_TOOLBOX::html_nav_table($lnav, 7);
 echo ' <form action="update_photo_category.phtml" method="POST">
 <table id="admin-list-table" style="width:500px;">';
@@ -42,7 +39,7 @@ if (is_array($data2)) {
             from photo_category pc left outer join photo_category_bus pcb on (pcb.photocat_id = pc.id) 
             where pcb.buscat_id = ".$buscat." order by pcb.pos;";
         if (!$res = $DB->db_exec($qs)) {
-            GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
+            GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
         }
         echo '<tr>
             <td colspan="2" style="background-color:#003366;color:#fff;text-align:left;">