art-web r530 - in branches/art-hub: controllers views



Author: thos
Date: Mon Jun 16 23:12:32 2008
New Revision: 530
URL: http://svn.gnome.org/viewvc/art-web?rev=530&view=rev

Log:
* Update backgrounds view to match themes


Modified:
   branches/art-hub/controllers/backgrounds.php
   branches/art-hub/views/backgrounds.php

Modified: branches/art-hub/controllers/backgrounds.php
==============================================================================
--- branches/art-hub/controllers/backgrounds.php	(original)
+++ branches/art-hub/controllers/backgrounds.php	Mon Jun 16 23:12:32 2008
@@ -1,4 +1,7 @@
 <?php
+
+require ('config.inc.php');
+
 /* load model */
 require ("models/backgrounds.php");
 

Modified: branches/art-hub/views/backgrounds.php
==============================================================================
--- branches/art-hub/views/backgrounds.php	(original)
+++ branches/art-hub/views/backgrounds.php	Mon Jun 16 23:12:32 2008
@@ -7,10 +7,10 @@
 
 $t->print_header();
 
+/* if no data is available, print out a category list */
 if (!$view_data)
 {
-  print ('
-
+  ?>
   <a href="/">GNOME Art</a> &gt; Backgrounds
   <br><br>
   Choose a category:
@@ -19,9 +19,10 @@
   <li><a href="/backgrounds/nature">Nature</a></li>
   <li><a href="/backgrounds/abstract">Abstract</a></li>
   <li><a href="/backgrounds/other">Other</a></li>
-  </ul>');
+  </ul>
+  <?php
   $t->print_footer ();
-  exit;
+  exit (0);
 }
 
 /* get the current page and ensure a default value is set */
@@ -39,25 +40,36 @@
 ?>
 <a href="/">GNOME Art</a> &gt; <a href="/backgrounds">Backgrounds</a>
 &gt; <?php echo $d_category ?>
-<br/><br/>
-<center><?php $p->print_pagination (); ?></center>
-<br/>
-<table>
-
-<?php
-  foreach ($view_data as $row)
-  {
-    print ("<tr><td colspan='3'><b>{$row['name']}</b></td></tr>");
-    print ("<tr><td colspan='3'><a href=\"mailto:{$row['email']}\">{$row['realname']}</a></td></tr>");
-    print ("<tr><td rowspan='2'><img width=96' src='/images/thumbnails/backgrounds/{$row['backgroundID']}.jpg'/></td>");
-    print ("<td colspan='2'>{$row['description']}</td></tr>");
-    print ("<tr><td>{$row['release_date']}</td><td width='75%'>{$row['license']}</td></tr>");
-    print ("<tr><td colspan='3'>&nbsp;</td></tr>");
-  }
-?>
-
+<br><br>
+<div style="text-align:center"><?php $p->print_pagination (); ?></div>
+<br>
+
+<?php foreach ($view_data as $row): ?>
+<div style="border: 1px solid #ccc; padding: 4px;">
+<table cellpadding="4" width="100%">
+  <tr>
+    <td colspan='4'><b><?php echo $row['name']?></b> by
+      <a href="mailto:<?php echo $row['email']?>"><?php echo $row['realname']?></a>
+    </td>
+  </tr>
+  <tr>
+    <td rowspan="3">
+      <img width="96" alt="Preview" src='/images/thumbnails/backgrounds/<?php echo $row['backgroundID']?>.jpg'>
+    </td>
+    <td colspan="3" style="width:100%"><?php echo $row['description']?></td>
+  </tr>
+  <tr>
+    <td><?php $tm = strtotime ($row['release_date']); echo date ("d M Y", $tm); ?></td>
+    <td><span style="color: gray">License:</span> <?php echo $license_config_array[$row['license']]?></td>
+    <td><a href="#">Download</a></td>
+  </tr>
 </table>
-<br/>
-<center><?php $p->print_pagination (); ?></center>
+</div>
+<br>
+<?php endforeach ?>
+
+
+<br>
+<div style="text-align:center"><?php $p->print_pagination (); ?></div>
 
 <?php $t->print_footer() ?>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]