exit; } //clear cache function clear_cache() { $files = glob(CACHE_PATH . '*'); // get all file names foreach ($files as $file) { // iterate files if (is_file($file)) { if (filemtime($file) < time() - CACHE_TIME * 3600) { unlink($file); } // delete file } } } // write to cache file function cache_page($content) { $f = fopen(cache_file(), 'w'); if (false !== $f) { fwrite($f, gzcompress($content)); fclose($f); } return $content; } // execution stops here if valid cache file found cache_display(); // enable output buffering and create cache file ob_start('cache_page');
<?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // $Id: index.php,v 1.2 2003/11/13 11:29:27 helix Exp $ require 'vars.php'; require 'pre.php'; require '../snippet/snippet_utils.php'; require 'cache.php'; require 'snippet_caching.php'; snippet_header(array('title' => 'Snippet Library', 'header' => 'Snippet Library')); echo cache_display('snippet_mainpage', 'snippet_mainpage()', 7200); snippet_footer(array());
<td>Graphics:</td> <td>Fun:</td> </tr> <tr> <td><font size="-1"><a href="/foundry/vectorgraphics/">Vector Graphics</a>, <a href="/foundry/3d/">3D</a></font></td> <td><font size="-1"><a href="/foundry/games/">Games</a></font></td> </tr> <tr> <td> </td><td align="right"><font size="-1"><a href="about_foundries.php">[ More ]</a></font></td> </tr> </table> <br> No Foundries supported --> <?php echo $HTML->box1_top($Language->GROUP_LONG_NEWS); echo news_show_latest($sys_news_group, 5, true, false, false, 5); echo $HTML->box1_bottom(); ?> </TD> <?php echo '<TD width="35%" VALIGN="TOP">'; echo cache_display('show_features_boxes', 'show_features_boxes()', 3600); ?> </TD></TR></TABLE> <?php $HTML->footer(array());
echo '<P> '; $HTML->box1_top('Discussion Forums'); //$sql="SELECT * FROM forum_group_list WHERE group_id='$group_id' AND is_public='1';"; $sql = "SELECT g.group_forum_id,g.forum_name, g.description, count(*) as total " . " FROM forum_group_list g, forum f" . " WHERE g.group_id='{$group_id}' AND g.is_public=1" . " AND g.group_forum_id = f.group_forum_id" . " group by g.group_forum_id, g.forum_name, g.description"; $result = db_query($sql); $rows = db_numrows($result); if (!$result || $rows < 1) { echo '<h1>No forums found for ' . $foundry->getUnixName() . '</h1>'; } else { /* Put the result set (list of forums for this group) into a column with folders */ for ($j = 0; $j < $rows; $j++) { echo ' <a href="/forum/forum.php?forum_id=' . db_result($result, $j, 'group_forum_id') . '">' . html_image("images/ic/cfolder15.png", "15", "13", array("BORDER" => "0")) . ' ' . db_result($result, $j, 'forum_name') . '</a> '; //message count echo '(' . db_result($result, $j, 'total') . ' msgs)'; echo "<br>\n"; echo db_result($result, $j, 'description') . '<p>'; } } $HTML->box1_bottom(); echo '<p> '; echo $foundry->getFreeformHTML2(); echo '</td><td valign="top" width="30%">'; echo $foundry->getSponsorHTML1() . '<p>'; echo cache_display('foundry' . $group_id . '_features_boxes', 'foundry_features_boxes()', 3600); echo '</td></tr></table>'; $HTML->footer(array());
$boxstuff = cache_display($cache_file, $back_url, $time, $entries); newsbox($boxtitle, $boxurl, $boxstuff); $boxstuff = ""; $boxtitle = "DocsWell"; $boxurl = "http://docswell.berlios.de/"; $back_url = $boxurl . "backend.php"; $cache_file = $cache_dir . "DocsWell.backend"; $boxstuff = cache_display($cache_file, $back_url, $time, $entries); newsbox($boxtitle, $boxurl, $boxstuff); $boxstuff = ""; $boxtitle = "SourceLines"; $boxurl = "http://sourcelines.berlios.de/"; $back_url = $boxurl . "backend.php"; $cache_file = $cache_dir . "SourceLines.backend"; $boxstuff = cache_display($cache_file, $back_url, $time, $entries); newsbox($boxtitle, $boxurl, $boxstuff); $entries = 12; $boxstuff = ""; $boxtitle = "DevCounter"; $boxurl = "http://devcounter.berlios.de/"; $back_url = $boxurl . "backend.php"; $cache_file = $cache_dir . "DevCounter.backend"; $boxstuff = cache_display($cache_file, $back_url, $time, $entries); newsbox($boxtitle, $boxurl, $boxstuff); $boxstuff = ""; $boxtitle = "SourceBiz"; $boxurl = "http://sourcebiz.berlios.de/"; $back_url = $boxurl . "backend.php"; $cache_file = $cache_dir . "SourceBiz.backend"; $boxstuff = cache_display($cache_file, $back_url, $time, $entries); newsbox($boxtitle, $boxurl, $boxstuff);