[Wuug-cvs] wuug config.inc.php,1.10,1.11 database.sql,1.3,1.4 install.php,1.1,1.2 wuug.class.php,1.2
Status: Inactive
Brought to you by:
loginx
From: <lo...@us...> - 2003-03-06 20:25:01
|
Update of /cvsroot/wuug/wuug In directory sc8-pr-cvs1:/tmp/cvs-serv16131 Modified Files: config.inc.php database.sql install.php wuug.class.php wuug.lib.php Log Message: Updated db script Index: config.inc.php =================================================================== RCS file: /cvsroot/wuug/wuug/config.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.inc.php 17 Feb 2003 22:22:58 -0000 1.10 --- config.inc.php 6 Mar 2003 20:24:47 -0000 1.11 *************** *** 4,7 **** --- 4,8 ---- define("ROOT", dirname(__FILE__)); + define("ENABLE_LOGGING", TRUE); // Height of the Logo *************** *** 19,23 **** // We can change the logo from here. $cf[logo_path] = "images/wuug_logo.png" ; ! $cf[top_domain] = $_SERVER[HTTP_HOST] ; $cf[logfile] = "/usr/local/php_env/wuug.log"; --- 20,24 ---- // We can change the logo from here. $cf[logo_path] = "images/wuug_logo.png" ; ! $cf[top_domain] = $_SERVER[HTTP_HOST] ; $cf[logfile] = "/usr/local/php_env/wuug.log"; *************** *** 55,59 **** // App's Top level URL (Very important) - Will soon be obsolete ; $cf[top_level_url] = "http://www.linkadmin.org/wuug" ; ! $cf[app_version] = "0.1-cvs" ; $cf[option_marker] = "<font color=\"#ff0000\"><B>*</B></font>" ; $cf[uptime_file] = "/usr/local/php_env/wuug_uptime" ; --- 56,60 ---- // App's Top level URL (Very important) - Will soon be obsolete ; $cf[top_level_url] = "http://www.linkadmin.org/wuug" ; ! $cf[app_version] = "0.1-cvs" ; $cf[option_marker] = "<font color=\"#ff0000\"><B>*</B></font>" ; $cf[uptime_file] = "/usr/local/php_env/wuug_uptime" ; Index: database.sql =================================================================== RCS file: /cvsroot/wuug/wuug/database.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** database.sql 17 Feb 2003 22:22:59 -0000 1.3 --- database.sql 6 Mar 2003 20:24:49 -0000 1.4 *************** *** 1,6 **** ! # Template ! ! # Database: COMAS # Table: 'confirmed_queue' # --- 1,11 ---- ! # Connection: Linkadmin ! # Host: 192.168.1.100 ! # Saved: 2003-03-06 15:24:25 ! # ! CREATE DATABASE IF NOT EXISTS COMAS; ! USE COMAS; ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'confirmed_queue' # *************** *** 9,15 **** `queue_id` int(11) NOT NULL default '0', PRIMARY KEY (`row`) ! ) ! # Database: COMAS # Table: 'join_queue' # --- 14,21 ---- `queue_id` int(11) NOT NULL default '0', PRIMARY KEY (`row`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'join_queue' # *************** *** 39,62 **** `phone_extension` varchar(100) default '', PRIMARY KEY (`id`) ! ) ! ! # Database: COMAS ! # Table: 'messages' ! # ! CREATE TABLE `messages` ( ! `id` int(11) NOT NULL auto_increment, ! `author` varchar(255) NOT NULL default '', ! `body` longtext NOT NULL, ! `assigned` varchar(255) default NULL, ! `title` varchar(255) default NULL, ! `ident` int(11) default NULL, ! `msg_id` int(11) default NULL, ! `ip_address` varchar(255) default NULL, ! `datetime` datetime default NULL, ! `email` varchar(55) default NULL, ! PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'news' # --- 45,52 ---- `phone_extension` varchar(100) default '', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'news' # *************** *** 71,77 **** `category` int(11) default '0', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'news_queue' # --- 61,68 ---- `category` int(11) default '0', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'news_queue' # *************** *** 84,90 **** `category` int(11) default '0', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_events' # --- 75,82 ---- `category` int(11) default '0', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_events' # *************** *** 99,105 **** `location` varchar(100) default '', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_faqs' # --- 91,98 ---- `location` varchar(100) default '', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_faqs' # *************** *** 111,117 **** `author` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_links' # --- 104,111 ---- `author` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_links' # *************** *** 123,129 **** `category` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_links_categories' # --- 117,124 ---- `category` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_links_categories' # *************** *** 132,138 **** `name` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_news_categories' # --- 127,134 ---- `name` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_news_categories' # *************** *** 141,147 **** `text` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ) ! # Database: COMAS # Table: 'wuug_polls' # --- 137,144 ---- `text` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_polls' # *************** *** 162,168 **** `c6_votes` varchar(100) default '', PRIMARY KEY (`row_id`) ! ) ! # Database: COMAS # Table: 'wuug_prefs' # --- 159,166 ---- `c6_votes` varchar(100) default '', PRIMARY KEY (`row_id`) ! ) ; ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_prefs' # *************** *** 174,180 **** `news_alert_type` varchar(100) default '', PRIMARY KEY (`row`) ! ) ! # Database: COMAS # Table: 'wuug_users' # --- 172,179 ---- `news_alert_type` varchar(100) default '', PRIMARY KEY (`row`) ! ); ! # Host: 192.168.1.100 ! # Database: wuug # Table: 'wuug_users' # *************** *** 208,210 **** `security_level` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ! ) \ No newline at end of file --- 207,210 ---- `security_level` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ! ); ! Index: install.php =================================================================== RCS file: /cvsroot/wuug/wuug/install.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.php 17 Feb 2003 22:23:00 -0000 1.1 --- install.php 6 Mar 2003 20:24:50 -0000 1.2 *************** *** 6,10 **** // Will also create the database and add the first records in it. ! if (!file_exists("config.inc.php")) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> --- 6,10 ---- // Will also create the database and add the first records in it. ! if (!file_exists("config.inc.php2")) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> *************** *** 20,24 **** <body> ! <table width="100%" height="100%" align="center" border="0"> <tr> --- 20,27 ---- <body> ! <?php ! if (!$_POST[submit]) { ! ?> ! <form method="POST" action="install.php"> <table width="100%" height="100%" align="center" border="0"> <tr> *************** *** 61,74 **** <td width="50%" bgcolor="#eeeeff" align="center"> <select class="wuug_txtbox" name="db_type"> ! <option name="mysql">MySQL</option> ! <option name="pgsql">PostGreSQL</option> ! <option name="mssql">Microsoft SQL server</option> ! <option name="ibase">InterBase</option> ! <option name="msql">Mini-SQL</option> ! <option name="oci8">Oracle 7/8/8i</option> ! <option name="sybase">Sybase</option> ! <option name="odbc">ODBC</option> ! <option name="ifx">Informix</option> ! <option name="fbsql">FrontBase</option> </select> </td> --- 64,77 ---- <td width="50%" bgcolor="#eeeeff" align="center"> <select class="wuug_txtbox" name="db_type"> ! <option value="mysql">MySQL</option> ! <option value="pgsql">PostGreSQL</option> ! <option value="mssql">Microsoft SQL server</option> ! <option value="ibase">InterBase</option> ! <option value="msql">Mini-SQL</option> ! <option value="oci8">Oracle 7/8/8i</option> ! <option value="sybase">Sybase</option> ! <option value="odbc">ODBC</option> ! <option value="ifx">Informix</option> ! <option value="fbsql">FrontBase</option> </select> </td> *************** *** 82,90 **** <td width="50%" bgcolor="#eeeeff" align="center"> <select class="wuug_txtbox" name="lang"> ! <option name="en">English</option> ! <option name="fr">French (mais oui!!)</option> ! <option name="it">Italian</option> ! <option name="jp">Japanese</option> ! <option name="redneck">Redneck</option> </select> </td> --- 85,93 ---- <td width="50%" bgcolor="#eeeeff" align="center"> <select class="wuug_txtbox" name="lang"> ! <option value="en">English</option> ! <option value="fr">French (mais oui!!)</option> ! <option value="it">Italian</option> ! <option value="jp">Japanese</option> ! <option value="redneck">Redneck</option> </select> </td> *************** *** 95,98 **** --- 98,105 ---- </tr> <tr> + <td width="50%" bgcolor="#eeeeee" align="right"><i>Enable Logging:</i></td> + <td width="50%" bgcolor="#eeeeff" align="center"><input class="wuug_txtbox" type="checkbox" name="enable_logging" checked></td> + </tr> + <tr> <td width="50%" bgcolor="#eeeeee" align="right"><i>How many news should I display at a time on the homepage?</i></td> <td width="50%" bgcolor="#eeeeff" align="center"><input class="wuug_txtbox" type="text" name="news_numb" value="5"></td> *************** *** 111,116 **** </tr> <tr> ! <td width="50%" bgcolor="#eeeeee" align="right"><i>Your abbreviated organization/website name:</i></td> ! <td width="50%" bgcolor="#eeeeff" align="center"><input class="wuug_txtbox" type="text" name="abbr_org_name" value="WUUG"></td> </tr> <tr> --- 118,123 ---- </tr> <tr> ! <td width="50%" bgcolor="#eeeeee" align="right"><i>Where should my emails come FROM:</i></td> ! <td width="50%" bgcolor="#eeeeff" align="center"><input class="wuug_txtbox" type="text" name="email_from" value="comas@<?=$_SERVER['HTTP_HOST']?>"></td> </tr> <tr> *************** *** 129,138 **** </tr> </table> ! <? ! exit(); } - ?> --- 136,186 ---- </tr> </table> ! </form> <? ! exit(); ! } else { ! require "wuug.class.php"; ! ! $flag = TRUE; ! $parser = new Parser; ! $parser->type = CONFIG; ! ! $required = array("org_name", "email_from", "abbr_org_name", "uptime_file", "top_level_url", ! "news_numb", "enable_logging", "logfile", "lang", "db_name", ! "db_type", "db_username", "db_password", "db_host", "password", "username"); ! ! foreach($required as $element) { ! if ($_POST[$element] == "") { ! $flag = FALSE; ! $errors .= "<br>$element is missing"; ! } else { ! $parser->set("$element", $_POST[$element]); ! } ! } ! ! // bool fields have to be processed individually. ! $bools = array("enable_logging"); ! ! foreach($bools as $bool) { ! if ($_POST[$bool] == "on") { ! $parser->set($bool, "TRUE"); ! } else { ! $parser->set($bool, "FALSE"); ! } ! } ! ! ! if ($flag == FALSE) { ! die("The following errors have been detected:" . $errors); ! } ! ! $parser->parse("config.tpl"); ! echo "Here is what I would output: \n<code>\n"; ! echo nl2br($parser->html); ! echo "</pre>"; ! ! } } ?> Index: wuug.class.php =================================================================== RCS file: /cvsroot/wuug/wuug/wuug.class.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wuug.class.php 17 Feb 2003 22:23:00 -0000 1.21 --- wuug.class.php 6 Mar 2003 20:24:50 -0000 1.22 *************** *** 3,7 **** // wuug.class.php ! require "config.inc.php"; define("FULL_TIME", 2); --- 3,7 ---- // wuug.class.php ! // require "config.inc.php"; define("FULL_TIME", 2); *************** *** 9,12 **** --- 9,16 ---- define("ANY" , 4); + define("HTML" , 0); + define("CONFIG" , 1); + + // This is a simple little template API // It doesn't even pretend to replace SmartY and other *************** *** 16,19 **** --- 20,24 ---- var $html; + var $type; var $template = array(); var $vars = array(); *************** *** 30,36 **** foreach ($this->template as $element) { ! if (!eregi('^#', $element)) { ! $element = preg_replace("/(\*)(.*)(\*)/", "<b>\\2</b>", $element); ! $this->html .= nl2br($element) . "\n"; } } --- 35,45 ---- foreach ($this->template as $element) { ! if (!eregi('^#', $element)) { // This is not a comment ! if (($this->type == HTML) || (!$this->type)) { ! $element = preg_replace("/(\*)(.*)(\*)/", "<b>\\2</b>", $element); ! $this->html .= nl2br($element) . "\n"; ! } else { ! $this->html .= "$element"; ! } } } *************** *** 1310,1313 **** --- 1319,1326 ---- if (!$font_size) { $font_size = 3; } imagestring($this->handle, $font_size, (($this->width/2)-(imagefontwidth($font_size))*(strlen($text)/2)), (($this->height/2)-imagefontheight($font_size)/2), "$text", $color); + } + + function filledarc($x, $y, $width, $height, $start, $end, $colour) { + imagefilledarc($this->handle, $x, $y, $width, $height, $start, $end, $colour, IMG_ARC_PIE); } } Index: wuug.lib.php =================================================================== RCS file: /cvsroot/wuug/wuug/wuug.lib.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wuug.lib.php 7 Jan 2003 02:19:09 -0000 1.1.1.1 --- wuug.lib.php 6 Mar 2003 20:24:52 -0000 1.2 *************** *** 90,99 **** require "config.inc.php"; ! if (!$logfile) { $logfile = $cf[logfile]; } ! $stamp = date("(d/m/Y: H:i:a)"); ! $file = fopen($logfile, "a+"); ! fputs($file, $stamp . " " . $string . "\n"); ! fclose($file); } /** --- 90,102 ---- require "config.inc.php"; ! if (ENABLE_LOGGING == TRUE) { ! if (!$logfile) { $logfile = $cf[logfile]; } ! ! $stamp = date("(d/m/Y: H:i:a)"); ! $file = fopen($logfile, "a+"); ! fputs($file, $stamp . " " . $string . "\n"); ! fclose($file); ! } } /** |