Ejemplo n.º 1
0
<?php

include "ctdlheader.php";
bbs_page_header();
?>

<H1>Known rooms</H1>

This is a sample page to demonstrate how to generate a room list.

<UL>

<?php 
list($num_rooms, $roomlist) = ctdl_knrooms();
if ($num_rooms > 0) {
    foreach ($roomlist as $x) {
        echo '<LI>';
        if ($x["hasnewmsgs"]) {
            echo '<B>';
        }
        echo '<A HREF="goto.php?towhere=' . urlencode($x["name"]) . '">' . htmlspecialchars($x["name"]) . "</A>";
        if ($x["hasnewmsgs"]) {
            echo '</B>';
        }
        echo "</LI>\n";
    }
}
?>

</UL>
Ejemplo n.º 2
0
 function GetFolderList()
 {
     $folders = array();
     debugLog("GetFolderList");
     $ret = ctdl_knrooms();
     /// TODO: should we just get the rooms with new messages in them? No.
     if ($ret[0]) {
         $fldr = $ret[1];
         foreach ($fldr as $folder) {
             // hide contacts and calendar here... TODO: do we realy need to?
             if ($folder['name'] != 'Calendar' && $folder['name'] != 'Contacts') {
                 $folders[] = array("id" => $folder['name'], "parent" => $folder['floor'], "mod" => "Inbox");
             }
         }
         return $folders;
     } else {
         return false;
     }
     ///        $inbox = array();
     ///        $inbox["id"] = "root";
     ///        $inbox["parent"] = "0";
     ///        $inbox["mod"] = "Inbox";
     ///
     ///        $folders[]=$inbox;
     ///
     ///        $sub = array();
     ///        $sub["id"] = "sub";
     ///        $sub["parent"] = "root";
     ///        $sub["mod"] = "Sub";
     ///
     /////        $folders[]=$sub;
     ///
     ///        return $folders;
 }