[Openfirst-cvscommit] sidebars index.php,1.1.1.1,1.2 sidebar.php,1.2,1.3
Brought to you by:
xtimg
From: <xt...@us...> - 2003-09-07 14:04:09
|
Update of /cvsroot/openfirst/sidebars In directory sc8-pr-cvs1:/tmp/cvs-serv8576 Modified Files: index.php sidebar.php Log Message: Add some error checking to make sure modules exist before offering their content as a sidebar. Index: index.php =================================================================== RCS file: /cvsroot/openfirst/sidebars/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.php 14 Aug 2003 02:38:52 -0000 1.1.1.1 --- index.php 7 Sep 2003 14:04:05 -0000 1.2 *************** *** 38,41 **** --- 38,42 ---- <ul> + <?php if(is_readable("../guestbook/")) { ?> <li>Guestbook (<a href="preview.php?sidebar=guestbook">preview</a>) *************** *** 43,46 **** --- 44,49 ---- <a href="sidebar.php?sidebar=guestbook&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../messenger/")) { ?> <li>Messenger (<a href="preview.php?sidebar=messenger">preview</a>) *************** *** 48,51 **** --- 51,56 ---- <a href="sidebar.php?sidebar=messenger&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../projects/")) { ?> <li>Projects (<a href="preview.php?sidebar=projects">preview</a>) *************** *** 53,56 **** --- 58,63 ---- <a href="sidebar.php?sidebar=projects&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../news/")) { ?> <li>News (<a href="preview.php?sidebar=news">preview</a>) *************** *** 58,61 **** --- 65,70 ---- <a href="sidebar.php?sidebar=news&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../manual/")) { ?> <li>Manual (<a href="preview.php?sidebar=manual">preview</a>) *************** *** 63,66 **** --- 72,77 ---- <a href="sidebar.php?sidebar=manual&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../emoticon/")) { ?> <li>Emoticon (<a href="preview.php?sidebar=emoticon">preview</a>) *************** *** 68,71 **** --- 79,84 ---- <a href="sidebar.php?sidebar=emoticon&cdf=true">Add as Active Desktop item</a>) </li> + <?php } + if(is_readable("../awards/")) { ?> <li>Awards (<a href="preview.php?sidebar=awards">preview</a>) *************** *** 73,76 **** --- 86,90 ---- <a href="sidebar.php?sidebar=awards&cdf=true">Add as Active Desktop item</a>) </li> + <?php } ?> </ul> <?php Index: sidebar.php =================================================================== RCS file: /cvsroot/openfirst/sidebars/sidebar.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sidebar.php 23 Aug 2003 20:26:36 -0000 1.2 --- sidebar.php 7 Sep 2003 14:04:05 -0000 1.3 *************** *** 76,95 **** <div style="background-color: #2998c7; top: 50px; color: #ffffff;"> <?php ! if ($sidebar == "GUESTBOOK") { $qu = ofirst_dbquery("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br>$q->date</sub><br>"); } ! } elseif ($sidebar == "NEWS") { $qu = ofirst_dbquery("SELECT title, poster, date FROM ofirst_news ORDER BY ID desc LIMIT 5;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='$home$basepath/news' target='_content' >$q->title</a></strong> - $q->poster<br>$q->date</sub><br>"); } ! } elseif ($sidebar == "MANUAL") { $qu = ofirst_dbquery("SELECT document, title FROM ofirst_manual GROUP BY document;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><a href='$home$basepath/manual' target='_content'>$q->document</a> - $q->title</sub><br>"); } ! } elseif ($sidebar == "EMOTICON") { if(function_exists("emoticon_preview") == true) { emoticon_preview(); --- 76,95 ---- <div style="background-color: #2998c7; top: 50px; color: #ffffff;"> <?php ! if ($sidebar == "GUESTBOOK" && is_readable("../guestbook/")) { $qu = ofirst_dbquery("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br>$q->date</sub><br>"); } ! } elseif ($sidebar == "NEWS" && is_readable("../news/")) { $qu = ofirst_dbquery("SELECT title, poster, date FROM ofirst_news ORDER BY ID desc LIMIT 5;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='$home$basepath/news' target='_content' >$q->title</a></strong> - $q->poster<br>$q->date</sub><br>"); } ! } elseif ($sidebar == "MANUAL" && is_readable("../manual/")) { $qu = ofirst_dbquery("SELECT document, title FROM ofirst_manual GROUP BY document;"); while($q = ofirst_dbfetch_object($qu)) { echo("<sub><a href='$home$basepath/manual' target='_content'>$q->document</a> - $q->title</sub><br>"); } ! } elseif ($sidebar == "EMOTICON" && is_readable("../guestbook/")) { if(function_exists("emoticon_preview") == true) { emoticon_preview(); *************** *** 97,101 **** echo("Emoticons have not been enabled."); } ! } elseif ($sidebar == "AWARDS") { $qu = ofirst_dbquery("SELECT AwardName FROM ofirst_awards;"); while($q = ofirst_dbfetch_object($qu)) { --- 97,101 ---- echo("Emoticons have not been enabled."); } ! } elseif ($sidebar == "AWARDS" && is_readable("../awards/")) { $qu = ofirst_dbquery("SELECT AwardName FROM ofirst_awards;"); while($q = ofirst_dbfetch_object($qu)) { |