<?php 
  /**************************************************************************\
  * phpGroupWare - Bookmarks                                                 *
  * http://www.phpgroupware.org                                              *
  * Based on Bookmarker Copyright (C) 1998  Padraic Renaghan                 *
  *                     http://www.renaghan.com/bookmarker                   *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  /* $Id: glist.wml,v 1.3 2001/01/10 05:40:51 skeeter Exp $ */
  
  include("../header.inc.php");
  header("Content-Type: text/vnd.wap.wml");
  print("<?xml version=\"1.0\"?>");
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
  "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card>
<?php
  $query = "select subcategory.name as subcategory_name "
         . ", bookmark.name as bookmark_name, url "
         . "from bookmark, subcategory "
         . "where public_f = 'Y' "
         . "and category_id = 12 "
         . "and subcategory_id = subcategory.id "
         . "order by subcategory_name, bookmark_name ";
  $phpgw->db->query($query,__LINE__,__FILE__);
  if ($phpgw->db->Errno != 0) {
     print("<p>ERROR</p>");
  }

  while ($phpgw->db->next_record()) {
    $subcategory = $phpgw->db->f("subcategory_name");
    $name        = $phpgw->db->f("bookmark_name");
    $url         = $phpgw->db->f("url");
    printf("<p><a href=\"%s\" title=\"%s\">%s</a></p>", $url, $url, $name);
  }
?>
  </card>
</wml>
<?php $phpgw->common->phpgw_footer(); ?>
