Author: dgoette Date: Mon May 4 17:25:30 2009 New Revision: 401
URL: http://svn.reactos.org/svn/reactos?rev=401&view=rev Log: * some cleanup * changes in the db layout * more things implemented in the app listing
Added: branches/compat/lib/view/HTML_Entry.class.php - copied, changed from r395, branches/compat/lib/view/HTML_Version.class.php Removed: branches/compat/lib/om/Star.class.php branches/compat/lib/view/HTML_Version.class.php branches/compat/rsdb_config.php Modified: branches/compat/config.php branches/compat/convert1to2.sql branches/compat/index.php branches/compat/js/submit.js branches/compat/lib/HTML.class.php branches/compat/lib/get/List_Suggestions.class.php branches/compat/lib/om/Category.class.php branches/compat/lib/om/Entry.class.php branches/compat/lib/view/Breadcrumb.class.php branches/compat/lib/view/HTML_Home.class.php branches/compat/lib/view/HTML_List.class.php branches/compat/lib/view/HTML_Submit.class.php
Modified: branches/compat/config.php URL: http://svn.reactos.org/svn/reactos/branches/compat/config.php?rev=401&r1... ============================================================================== --- branches/compat/config.php [iso-8859-1] (original) +++ branches/compat/config.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -1,4 +1,23 @@ <?php + /* + RSDB - ReactOS Support Database + Copyright (C) 2005-2006 Klemens Friedl frik85@reactos.org + 2009 Danny Götte dangerground@web.de + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */
define('CDBT_ATTACHMENTS', 'cdb_attachments'); define('CDBT_CATEGORIES' , 'cdb_categories'); @@ -7,7 +26,47 @@ define('CDBT_REPORTS' , 'cdb_entries_reports'); define('CDBT_LANGUAGES' , 'cdb_languages'); define('CDBT_LOGS' , 'cdb_logs'); +define('CDBT_TAGGED' , 'cdb_rel_entries_tags'); define('CDBT_TAGS' , 'cdb_tags'); -define('CDBT_VERSIONS' , 'cdb_entries_tags'); +define('CDBT_VERTAGS' , 'cdb_entries_tags'); +define('CDBT_VERSIONS' , 'cdb_entries_versions');
+ + + + // Config: (please sync this with the database) + $RSDB_intern_version = "RSDB 0.1 - http://www.reactos.org/"; // RSDB version info + $RSDB_intern_path_server = "/reactos/"; // complete server path + $RSDB_intern_path = "compat/"; // the dirs after http://www.reactos.org + + // script file fix (for Safari browser) + $RSDB_intern_index_php = $RSDB_intern_path_server.$RSDB_intern_path."index.php"; + + // Global Login System + $RSDB_intern_loginsystem_path = "roscms/"; // RosCMS dir + $RSDB_intern_loginsystem_fullpath = $RSDB_intern_path_server.$RSDB_intern_loginsystem_path; // RosCMS dir + + // Items per Page + $RSDB_intern_items_per_page = 25; + + // User ID + require_once(ROSCMS_PATH.'lib/RosCMS_Autoloader.class.php'); + $RSDB_intern_user_id = Subsystem::in(Login::OPTIONAL, '/'.$RSDB_intern_path); + + if($RSDB_intern_user_id !== false) { + + // Name + $RSDB_USER_name = Subsystem::getUserName($RSDB_intern_user_id); + + + // RSDB user settings + + // Items per page + $RSDB_USER_setting_itemsperpage = 30; //$result_roscms_user['user_setting_itemsperpage']; + $RSDB_intern_items_per_page = $RSDB_USER_setting_itemsperpage; + + } + else { + $RSDB_USER_name = "Anonymous"; + } ?>
Modified: branches/compat/convert1to2.sql URL: http://svn.reactos.org/svn/reactos/branches/compat/convert1to2.sql?rev=401&a... ============================================================================== --- branches/compat/convert1to2.sql [iso-8859-1] (original) +++ branches/compat/convert1to2.sql [iso-8859-1] Mon May 4 17:25:30 2009 @@ -3,7 +3,7 @@ -- ----------------------------------------------------------------- -- Drop obsolete tables -- ----------------------------------------------------------------- -DROP TABLE rsdb_item_devnet; +/*DROP TABLE rsdb_item_devnet; DROP TABLE rsdb_item_pack; DROP TABLE rsdb_urls; DROP TABLE _rsdb_users; @@ -12,7 +12,7 @@ DROP TABLE _rsdb_item_comp_votes; DROP TABLE rsdb_object_description; DROP TABLE rsdb_group_bundles; - +*/
-- ----------------------------------------------------------------- @@ -40,8 +40,8 @@ WHERE cat_visible = '1' AND cat_comp = '1';
ALTER TABLE cdb_categories ORDER BY id; -DROP TABLE rsdb_categories; - +/*DROP TABLE rsdb_categories; +*/
-- ----------------------------------------------------------------- -- Convert comments @@ -58,57 +58,19 @@ ) ENGINE = MYISAM COMMENT = 'parent xor entry_id has to be NULL';
INSERT INTO cdb_comments - SELECT - fmsg_id, - NULL, - fmsg_parent, - fmsg_user_id, - fmsg_subject, - fmsg_body, - fmsg_date, - TRUE - FROM rsdb_item_comp_forum - WHERE fmsg_visible='1' AND fmsg_parent > 0 -UNION - SELECT - fmsg_id, - NULL, - fmsg_parent, - fmsg_user_id, - fmsg_subject, - fmsg_body, - fmsg_date, - FALSE - FROM rsdb_item_comp_forum - WHERE fmsg_visible='0' AND fmsg_parent > 0 -UNION - SELECT - fmsg_id, - fmsg_comp_id, - NULL, - fmsg_user_id, - fmsg_subject, - fmsg_body, - fmsg_date, - TRUE - FROM rsdb_item_comp_forum - WHERE fmsg_visible='1' AND fmsg_parent = 0 -UNION - SELECT - fmsg_id, - fmsg_comp_id, - NULL, - fmsg_user_id, - fmsg_subject, - fmsg_body, - fmsg_date, - FALSE - FROM rsdb_item_comp_forum - WHERE fmsg_visible='0' AND fmsg_parent = 0; - -ALTER TABLE cdb_comments ORDER BY id; -DROP TABLE rsdb_item_comp_forum; - +SELECT + fmsg_id, + fmsg_comp_id, + fmsg_parent, + fmsg_user_id, + fmsg_subject, + fmsg_body, + fmsg_date, + TRUE + FROM rsdb_item_comp_forum; + +/*DROP TABLE rsdb_item_comp_forum; +*/
INSERT INTO cdb_comments SELECT @@ -121,21 +83,21 @@
What works:
-',test_whatworks,' + ',test_whatworks,'
What doesn''t work
-',test_whatdoesntwork,' + ',test_whatdoesntwork,'
What I''ve not tested
-',test_whatnottested,' + ',test_whatnottested,'
Conclusion
-',test_conclusion), + ',test_conclusion), test_date, TRUE FROM rsdb_item_comp_testresults; -DROP TABLE rsdb_item_comp_testresults; - +/*DROP TABLE rsdb_item_comp_testresults; +*/
@@ -179,8 +141,8 @@ WHERE media_visible = '0';
ALTER TABLE cdb_attachments ORDER BY id; -DROP TABLE rsdb_object_media; - +/*DROP TABLE rsdb_object_media; +*/
@@ -202,8 +164,8 @@ '' FROM rsdb_languages;
-DROP TABLE rsdb_languages; - +/*DROP TABLE rsdb_languages; +*/
-- ----------------------------------------------------------------- @@ -212,12 +174,13 @@ CREATE TABLE cdb_entries_reports ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, entry_id BIGINT UNSIGNED NOT NULL COMMENT '->entries(id)', + version_id BIGINT UNSIGNED NOT NULL Comment '->version', revision BIGINT UNSIGNED NOT NULL, old_name VARCHAR( 100 ) NOT NULL, old_version VARCHAR( 100 ) NOT NULL, old_description TEXT NOT NULL, user_id BIGINT UNSIGNED NOT NULL COMMENT '->roscms.users(id)', - works BOOL DEFAULT FALSE, + works ENUM( 'full', 'part', 'not' ) NULL, checked BOOL NOT NULL DEFAULT FALSE, created DATETIME NOT NULL, visible BOOL NOT NULL DEFAULT FALSE, @@ -229,6 +192,7 @@ INSERT INTO cdb_entries_reports SELECT DISTINCT comp_id, + 0, 0, 0, comp_name, @@ -245,6 +209,11 @@ FROM rsdb_item_comp WHERE comp_date != '0000-00-00 00:00:00';
+UPDATE cdb_entries_reports r +SET works = IF((SELECT SUM(test_result_function)/COUNT(*) FROM rsdb_item_comp_testresults WHERE test_comp_id=r.id) = 5, 'full', IF((SELECT SUM(test_result_function)/COUNT(*) FROM rsdb_item_comp_testresults WHERE test_comp_id=r.id) = 1, 'not', 'part')); + +ALTER TABLE cdb_entries_reports CHANGE works works ENUM( 'full', 'part', 'not' ) NOT NULL DEFAULT 'not'; +
@@ -254,43 +223,36 @@ CREATE TABLE cdb_entries ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR( 100 ) NOT NULL, - version VARCHAR( 100 ) NOT NULL, category_id BIGINT NOT NULL, description TEXT NOT NULL, created DATETIME NOT NULL, modified DATETIME NOT NULL, visible BOOL NOT NULL DEFAULT FALSE, + old_version VARCHAR( 100 ) NOT NULL, old_groupid BIGINT NOT NULL DEFAULT '0', old_vendorid BIGINT NOT NULL DEFAULT '0', - UNIQUE KEY(name, version) + old_name varchar(100) NOT NULL ) ENGINE = MyISAM;
INSERT INTO cdb_entries SELECT DISTINCT NULL, - old_name, - old_version, - 0, - old_description, - created, - modified, + grpentr_name, + g.grpentr_category, + (SELECT i.old_description FROM cdb_entries_reports i WHERE i.old_groupid=o.old_groupid ORDER BY i.created ASC LIMIT 1) AS old_description, + (SELECT i.created FROM cdb_entries_reports i WHERE i.old_groupid=o.old_groupid ORDER BY i.created ASC LIMIT 1) AS created, + (SELECT i.created FROM cdb_entries_reports i WHERE i.old_groupid=o.old_groupid ORDER BY i.created DESC LIMIT 1) AS modified, TRUE, - old_groupid, - grpentr_vendor -FROM ( - SELECT DISTINCT - o.old_name, - o.old_version, - (SELECT i.old_description FROM cdb_entries_reports i WHERE i.old_name=o.old_name AND i.old_version=o.old_version ORDER BY i.created ASC LIMIT 1) AS old_description, - (SELECT i.created FROM cdb_entries_reports i WHERE i.old_name=o.old_name AND i.old_version=o.old_version ORDER BY i.created ASC LIMIT 1) AS created, - (SELECT i.created FROM cdb_entries_reports i WHERE i.old_name=o.old_name AND i.old_version=o.old_version ORDER BY i.created DESC LIMIT 1) AS modified, - o.old_groupid, - g.grpentr_vendor - FROM cdb_entries_reports o - JOIN rsdb_groups g ON g.grpentr_id=o.old_groupid) k; + TRIM(REPLACE(old_name, grpentr_name, '')), + o.old_groupid, + g.grpentr_vendor, + old_name +FROM cdb_entries_reports o +JOIN rsdb_groups g ON g.grpentr_id=o.old_groupid; +
UPDATE cdb_entries_reports r -SET entry_id = (SELECT e.id FROM cdb_entries e WHERE r.old_name=e.name LIMIT 1); +SET entry_id = (SELECT e.id FROM cdb_entries e WHERE r.old_name=e.old_name LIMIT 1);
ALTER TABLE cdb_entries_reports DROP old_name, @@ -298,8 +260,34 @@ DROP old_groupid, DROP old_version;
-DROP TABLE rsdb_item_comp; - + +-- ----------------------------------------------------------------- +-- Convert versions +-- ----------------------------------------------------------------- +CREATE TABLE cdb_entries_versions ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , + entry_id BIGINT UNSIGNED NOT NULL COMMENT '->entry', + version VARCHAR( 20 ) NOT NULL, + UNIQUE KEY(entry_id, version) +) ENGINE = MYISAM; + +INSERT INTO cdb_entries_versions +SELECT + NULL, + id, + old_version +FROM cdb_entries; + +UPDATE cdb_entries_reports r +SET version_id = (SELECT v.id FROM cdb_entries_versions v WHERE v.entry_id=r.entry_id LIMIT 1); + +ALTER TABLE cdb_entries + DROP old_name, + DROP old_version; + + +/*DROP TABLE rsdb_item_comp; +*/
-- ----------------------------------------------------------------- @@ -321,7 +309,6 @@ INSERT INTO cdb_tags SELECT DISTINCT NULL, - NULL, vendor_name, CONCAT(vendor_fullname,'
@@ -334,9 +321,9 @@ NULL FROM rsdb_item_vendor;
-DROP TABLE rsdb_groups; +/*DROP TABLE rsdb_groups; DROP TABLE rsdb_item_vendor; - +*/
-- ----------------------------------------------------------------- @@ -359,8 +346,8 @@ log_date FROM rsdb_logs;
-DROP TABLE rsdb_logs; - +/*DROP TABLE rsdb_logs; +*/
-- ----------------------------------------------------------------- @@ -383,6 +370,34 @@ ALTER TABLE cdb_entries DROP old_vendorid; ALTER TABLE cdb_tags DROP old_groupid; ALTER TABLE cdb_tags DROP old_vendor; + + + +-- ----------------------------------------------------------------- +-- remove double entries +-- ----------------------------------------------------------------- +CREATE TABLE cdb_entries2 SELECT * FROM cdb_entries; +TRUNCATE TABLE cdb_entries2; +INSERT INTO cdb_entries2 +SELECT DISTINCT + (SELECT id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), + name, + (SELECT category_id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), + (SELECT description FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), + (SELECT created FROM cdb_entries WHERE name = g.name ORDER BY created ASC LIMIT 1), + (SELECT modified FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), + TRUE +FROM cdb_entries g; + +UPDATE cdb_entries_reports r +SET entry_id=(SELECT e.id FROM cdb_entries2 e JOIN cdb_entries x ON x.name=e.name WHERE x.id=r.entry_id); + +UPDATE cdb_entries_versions v +SET entry_id=(SELECT e.id FROM cdb_entries2 e JOIN cdb_entries x ON x.name=e.name WHERE x.id=v.entry_id); + + +DROP TABLE cdb_entries; +RENAME TABLE cdb_entries2 TO cdb_entries;
Modified: branches/compat/index.php URL: http://svn.reactos.org/svn/reactos/branches/compat/index.php?rev=401&r1=... ============================================================================== --- branches/compat/index.php [iso-8859-1] (original) +++ branches/compat/index.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -25,36 +25,18 @@ die("ERROR: Disable 'magic quotes' in php.ini (=Off)"); }
+define('ROSCMS_PATH', '../roscms/'); define('CDB_PATH', ''); require_once("lib/Compat_Autoloader.class.php"); require_once('config.php'); - +$RSDB_intern_link_db_sec = 'index.php?page=';
if ( !defined('RSDB') ) { define ("RSDB", "rossupportdb"); // to prevent hacking activity } - define('ROSCMS_PATH', '../roscms/'); - - - - // Environment Vars: - $RSDB_intern_selected=""; - - - // Forum bar settings: - if (isset($_POST['forumsave']) && $_POST['forumsave'] == 1) { - Cookie::write('rsdb_threshold', (isset($_POST['threshold']) ? htmlspecialchars($_POST['threshold']) : '?'), time() + 24 * 3600 * 30 * 5, '/'); - Cookie::write('rsdb_fstyle', (isset($_POST['fstyle']) ? htmlspecialchars($_POST['fstyle']) : '?'), time() + 24 * 3600 * 30 * 5, '/'); - Cookie::write('rsdb_order', (isset($_POST['order']) ? htmlspecialchars($_POST['order']) : '?'), time() + 24 * 3600 * 30 * 5, '/'); - } - - // Test report bar settings: - if (isset($_POST['testsave']) && $_POST['testsave'] == 1) { - Cookie::write('rsdb_threshold', (isset($_POST['threshold']) ? htmlspecialchars($_POST['threshold']) : '?'), time() + 24 * 3600 * 30 * 5, '/'); - Cookie::write('rsdb_order', (isset($_POST['order']) ? htmlspecialchars($_POST['order']) : '?'), time() + 24 * 3600 * 30 * 5, '/'); - } +
@@ -62,22 +44,10 @@ $RSDB_SET_letter=""; // Browse by Name: Letter: All, A, B, C, ..., X, Y, Z $RSDB_SET_group=""; // Group ID - - $RSDB_SET_threshold="3"; - $RSDB_SET_fstyle="nested"; - $RSDB_SET_order="new"; - $RSDB_SET_save=""; - $RSDB_SET_msg=""; - $RSDB_SET_filter="cur"; - $RSDB_SET_filter2=""; - $rpm_lang="";
- if (isset($_COOKIE['rsdb_threshold'])) { - $RSDB_SET_threshold = $_COOKIE['rsdb_threshold']; - } if (isset($_COOKIE['rsdb_fstyle'])) { $RSDB_SET_fstyle = $_COOKIE['rsdb_fstyle']; } @@ -86,26 +56,7 @@ }
if (array_key_exists("letter", $_GET)) $RSDB_SET_letter=htmlspecialchars($_GET["letter"]); - if (array_key_exists("group", $_GET)) $RSDB_SET_group=htmlspecialchars($_GET["group"]); - - if (array_key_exists("threshold", $_GET)) $RSDB_SET_threshold=htmlspecialchars($_GET["threshold"]); - if (array_key_exists("fstyle", $_GET)) $RSDB_SET_fstyle=htmlspecialchars($_GET["fstyle"]); - if (array_key_exists("order", $_GET)) $RSDB_SET_order=htmlspecialchars($_GET["order"]); - if (array_key_exists("save", $_GET)) $RSDB_SET_save=htmlspecialchars($_GET["save"]); - if (array_key_exists("msg", $_GET)) $RSDB_SET_msg=htmlspecialchars($_GET["msg"]); - if (array_key_exists("filter", $_GET)) $RSDB_SET_filter=htmlspecialchars($_GET["filter"]); - if (array_key_exists("filter2", $_GET)) $RSDB_SET_filter2=htmlspecialchars($_GET["filter2"]); - - if (array_key_exists("threshold", $_POST)) $RSDB_SET_threshold=htmlspecialchars($_POST["threshold"]); - if (array_key_exists("fstyle", $_POST)) $RSDB_SET_fstyle=htmlspecialchars($_POST["fstyle"]); - if (array_key_exists("order", $_POST)) $RSDB_SET_order=htmlspecialchars($_POST["order"]); - if (array_key_exists("save", $_POST)) $RSDB_SET_save=htmlspecialchars($_POST["save"]); - if (array_key_exists("msg", $_POST)) $RSDB_SET_msg=htmlspecialchars($_POST["msg"]); - if (array_key_exists("filter", $_POST)) $RSDB_SET_filter=htmlspecialchars($_POST["filter"]); - if (array_key_exists("filter2", $_POST)) $RSDB_SET_filter2=htmlspecialchars($_POST["filter2"]);
- - session_start(); if(isset($_COOKIE['roscms_usrset_lang'])) { $roscms_usrsetting_lang=$_COOKIE["roscms_usrset_lang"]; @@ -117,17 +68,27 @@ require_once('lang.php');
- // Config - require_once('rsdb_setting.php'); - - // URI building - require_once('rsdb_config.php'); - switch (@$_GET['page']) {
- // Frontpage + default: + // AJAX requests + if (isset($_GET['get']) && $_SERVER['QUERY_STRING'] != '') { + switch (@$_GET['get']) { + + // Suggestions + case 'suggestions': + new List_Suggestions(); + break; + + } // end switch get + break; + } + case 'home': new HTML_Home(); + break; + + // Frontpage break;
// RSDB About Page @@ -143,12 +104,19 @@ // Browse by name case 'list': $filter = ''; - if (isset($_GET['letter'])) { + if (isset($_GET['letter']) && $_GET['letter'] != '*') { $filter .= 's_w_'.$_GET['letter']; } if (isset($_GET['cat'])) { if ($filter !== '') $filter .= '|'; $filter .= 'c_is_'.$_GET['cat']; + } + if (isset($_GET['tag']) && $_GET['tag'] != '*') { + if ($filter !== '') $filter .= '|'; + $filter .= 't_is_'.$_GET['tag']; + } + if (isset($_GET['filter']) && $_GET['filter'] != '') { + $filter = $_GET['filter']; } new HTML_List($filter); break; @@ -180,7 +148,7 @@ // Details case 'details': default: - new HTML_Version(); + new HTML_Entry(); break;
// Screenshots @@ -207,20 +175,6 @@ new Help(); break;
- default: - // just show 404, if no request for 'get=' is given - if (!isset($_GET['get'])) { - echo '404'; - } - break; } // end switch page
-switch (@$_GET['get']) { - - // Suggestions - case 'suggestions': - new List_Suggestions(); - break; - -} // end switch get ?>
Modified: branches/compat/js/submit.js URL: http://svn.reactos.org/svn/reactos/branches/compat/js/submit.js?rev=401&... ============================================================================== --- branches/compat/js/submit.js [iso-8859-1] (original) +++ branches/compat/js/submit.js [iso-8859-1] Mon May 4 17:25:30 2009 @@ -124,6 +124,17 @@
document.getElementById('suggestedVersions').style.display='block'; document.getElementById('suggestedVersions').innerHTML='<ul>'+show+'</ul>'; + + var tags = entries[index].getElementsByTagName('tag'); + show = ''; + for (var i=0; i < tags.length; i++) { + if (show != '') show += ','; + show += tags[i].firstChild.nodeValue; + } + document.getElementById('tags').value=show; + + document.getElementById('description').value=entries[index].getAttribute('description'); + document.getElementById('cat').value=entries[index].getAttribute('category'); } else if (type == 'version') { id = 'version';
Modified: branches/compat/lib/HTML.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/HTML.class.php?rev=40... ============================================================================== --- branches/compat/lib/HTML.class.php [iso-8859-1] (original) +++ branches/compat/lib/HTML.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -141,10 +141,10 @@ */ protected function navigation( ) { - include('rsdb_setting.php'); - include('rsdb_config.php');
global $RSDB_intern_link_db_sec; + global $RSDB_intern_path_server; + global $RSDB_intern_link_language;
echo ' <table style="border: none; width:100%;" cellpadding="0" cellspacing="0"> @@ -162,10 +162,10 @@
<div class="navTitle">Browse Database</div> <ol> - <li><a href="'.$RSDB_intern_link_db_sec.'list">By Name</a></li> + <li><a href="'.$RSDB_intern_link_db_sec.'list&letter=*">By Name</a></li> <li><a href="'.$RSDB_intern_link_db_sec.'list&cat=0">By Category</a></li> - <li><a href="'.$RSDB_intern_link_db_sec.'list">By Tag</a></li> - <li><a href="'.$RSDB_intern_link_db_sec.'list">By Rank</a></li> + <li><a href="'.$RSDB_intern_link_db_sec.'list&tag=*">By Tag</a></li> + <li><a href="'.$RSDB_intern_link_db_sec.'list&filter=">Custom</a></li> </ol> <br />
@@ -208,7 +208,7 @@ $language_name = $stmt->fetchColumn();
echo ' - <select id="select" size="1" name="select" class="selectbox" style="width:140px" onchange="'."window.open(this.options[this.selectedIndex].value,'_main');".'"> + <select id="select" size="1" name="select" class="selectbox" style="width:140px" onchange="'."window.open('".$RSDB_intern_link_language."'+this.options[this.selectedIndex].value,'_main');".'"> <optgroup label="current language"> <option value="#">'.$language_name.'</option> </optgroup> @@ -218,7 +218,7 @@ $stmt->execute(); while ($language=$stmt->fetch(PDO::FETCH_ASSOC)) { echo ' - <option value="'.$RSDB_intern_link_language.$language['short'].'">'.$language['name'].'</option>'; + <option value="'.$language['short'].'">'.$language['name'].'</option>'; }
echo '
Modified: branches/compat/lib/get/List_Suggestions.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/get/List_Suggestions.... ============================================================================== --- branches/compat/lib/get/List_Suggestions.class.php [iso-8859-1] (original) +++ branches/compat/lib/get/List_Suggestions.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -30,35 +30,39 @@ switch (@$_GET['for']) { case 'name': default: - $stmt=CDBConnection::getInstance()->prepare("SELECT name, version FROM ".CDBT_ENTRIES." WHERE name LIKE :search ORDER BY name ASC, version DESC"); + $stmt=CDBConnection::getInstance()->prepare("SELECT name, id, description, category_id FROM ".CDBT_ENTRIES." WHERE name LIKE :search ORDER BY name ASC");
} $stmt->bindValue('search',@$_GET['search'].'%',PDO::PARAM_STR); $stmt->execute(); - $oldname = null; - + + // prepare for usage in loop + $stmt_ver=CDBConnection::getInstance()->prepare("SELECT version FROM ".CDBT_VERSIONS." WHERE entry_id=:entry_id ORDER BY version DESC"); + $stmt_tag=CDBConnection::getInstance()->prepare("SELECT t.name FROM ".CDBT_TAGS." t JOIN ".CDBT_TAGGED." r ON r.tag_id=t.id WHERE r.entry_id=:entry_id ORDER BY name ASC"); + // build list of entries and their versions while ($entry=$stmt->fetch(PDO::FETCH_ASSOC)) { - - // open / close entry - if ($oldname === null || $oldname != $entry['name']) { - if ($oldname !== null) { - echo '</entry>'; - } - echo '<entry name="'.htmlspecialchars($entry['name']).'">'; + + echo '<entry name="'.htmlspecialchars($entry['name']).'" description="'.htmlspecialchars($entry['description']).'" category="'.$entry['category_id'].'">'; + + // versions + $stmt_ver->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); + $stmt_ver->execute(); + while ($version=$stmt_ver->fetch(PDO::FETCH_ASSOC)) { + // version + echo '<version>'.htmlspecialchars($version['version']).'</version>'; } - - // version - echo '<version>'.htmlspecialchars($entry['version']).'</version>'; - - // update last entry name - $oldname = $entry['name']; + + // tags + $stmt_tag->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); + $stmt_tag->execute(); + while ($tag=$stmt_tag->fetch(PDO::FETCH_ASSOC)) { + // version + echo '<tag>'.htmlspecialchars($tag['name']).'</tag>'; + } + + echo '</entry>'; } // end while entry - - // close entry - if ($oldname !== null) { - echo '</entry>'; - }
echo '</root>'; } // end of constructor
Modified: branches/compat/lib/om/Category.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Category.class.php... ============================================================================== --- branches/compat/lib/om/Category.class.php [iso-8859-1] (original) +++ branches/compat/lib/om/Category.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -66,132 +66,6 @@ }
- /** - * @FILLME - * - * @access public - */ - public static function showLeafAsOption($RSDB_TEMP_entry_id, $RSDB_TEMP_cat_level_newmain) - { - global $RSDB_intern_selected; - - global $cellcolor2; - $cellcolor=$cellcolor2; - - - - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM ".CDBT_CATEGORIES." WHERE id = :cat_id AND visible IS TRUE"); - $stmt->bindParam('cat_id',$RSDB_TEMP_entry_id,PDO::PARAM_STR); - $stmt->execute(); - - $result_create_tree_entry=$stmt->fetchOnce(PDO::FETCH_ASSOC); - - - - - $RSDB_TEMP_cat_current_id_guess = $result_create_tree_entry['id']; - - for ($guesslevel=1; ; $guesslevel++) { - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM ".CDBT_CATEGORIES." WHERE id = :cat_id AND visible IS TRUE"); - $stmt->bindParam('cat_id',$RSDB_TEMP_cat_current_id_guess,PDO::PARAM_STR); - $stmt->execute(); - $result_category_tree_guesslevel=$stmt->fetchOnce(PDO::FETCH_ASSOC); - $RSDB_TEMP_cat_current_id_guess = $result_category_tree_guesslevel['parent']; - - if (!$result_category_tree_guesslevel['name']) { - $RSDB_intern_catlevel = ($guesslevel-1); - break; - } - } - - echo "<option value="". $result_create_tree_entry['id']. """; - if ($RSDB_intern_selected != "" && $RSDB_intern_selected == $result_create_tree_entry['id']) { - echo " selected "; - } - echo ">\n\n"; - - for ($n=$RSDB_TEMP_cat_level_newmain;$n<$RSDB_intern_catlevel;$n++) { - echo " "; - } - - echo $result_create_tree_entry['name']; - - //echo " (".$result_create_tree_entry['cat_description'] .")"; - - echo "</option>"; - } // end of member function showLeafAsOption - - - - /** - * @FILLME - * - * @access public - */ - public static function showLeafAsRow($RSDB_TEMP_entry_id, $RSDB_TEMP_cat_level_newmain) - { - - global $RSDB_intern_link_category_cat; - global $cellcolor2; - $cellcolor=$cellcolor2; - -// global $RSDB_TEMP_cat_icon; - - - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM ".CDBT_CATEGORIES." WHERE id = :cat_id AND visible IS TRUE"); - $stmt->bindParam('cat_id',$RSDB_TEMP_entry_id,PDO::PARAM_STR); - $stmt->execute(); - - $result_create_tree_entry=$stmt->fetch(PDO::FETCH_ASSOC); - -/* if ($result_create_tree_entry['cat_icon'] != "") { - $RSDB_TEMP_cat_icon = $result_create_tree_entry['cat_icon']; - } -*/ - - echo "<tr><td width='45%' valign='top' bgcolor='".$cellcolor."'>"; - echo "<div align='left'><font size='2' face='Arial, Helvetica, sans-serif'> "; - - - $RSDB_TEMP_cat_current_id_guess = $result_create_tree_entry['id']; - - // count the levels -> current category level - for ($guesslevel=1; ; $guesslevel++) { -// echo $guesslevel."#"; - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM ".CDBT_CATEGORIES." WHERE id = :cat_id AND visible IS TRUE"); - $stmt->bindParam('cat_id',$RSDB_TEMP_cat_current_id_guess,PDO::PARAM_STR); - $stmt->execute(); - $result_category_tree_guesslevel=$stmt->fetch(PDO::FETCH_ASSOC); -// echo $result_category_tree_guesslevel['cat_name']; - $RSDB_TEMP_cat_current_id_guess = $result_category_tree_guesslevel['parent']; - - if (!$result_category_tree_guesslevel['name']) { -// echo "ENDE:".($guesslevel-1); - $RSDB_intern_catlevel = ($guesslevel-1); - break; - } - } - - - - for ($n=$RSDB_TEMP_cat_level_newmain;$n<$RSDB_intern_catlevel;$n++) { - echo " "; - } - -// echo "<img src='media/icons/categories/".$RSDB_TEMP_cat_icon."' width='16' height='16'> "; - - echo "<a href='".$RSDB_intern_link_category_cat.$result_create_tree_entry['id']."'>".$result_create_tree_entry['name']."</a>"; - - echo "</font></div></td>"; - echo "<td width='45%' valign='top' bgcolor='".$cellcolor."'>"; - echo "<div align='left'><font face='Arial, Helvetica, sans-serif'>"; - - echo "<font size='2' face='Arial, Helvetica, sans-serif'>".$result_create_tree_entry['description']."</font>"; - - echo "</font></div></td><td width='10%' valign='top' bgcolor='".$cellcolor."'><font size='2'>".Count::entriesInGroup($result_create_tree_entry['id'])."</font></td></tr>"; - - } // end of member function showLeafAsRow -
} // end of Category
Modified: branches/compat/lib/om/Entry.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Entry.class.php?re... ============================================================================== --- branches/compat/lib/om/Entry.class.php [iso-8859-1] (original) +++ branches/compat/lib/om/Entry.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -96,7 +96,7 @@ $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT); $stmt->bindParam('user_id',$RSDB_intern_user_id,PDO::PARAM_INT); $stmt->bindParam('revision',$revision,PDO::PARAM_INT); - $stmt->bindParam('status',$status,PDO::PARAM_BOOL); + $stmt->bindParam('status',$status,PDO::PARAM_STR); return $stmt->execute(); } // end of member function addReport
@@ -122,7 +122,7 @@ $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT); $stmt->bindParam('user_id',$RSDB_intern_user_id,PDO::PARAM_INT); $stmt->bindParam('title',$title,PDO::PARAM_STR); - $stmt->bindParam('status',$content,PDO::PARAM_STR); + $stmt->bindParam('content',$content,PDO::PARAM_STR); return $stmt->execute(); } // end of member function add
Removed: branches/compat/lib/om/Star.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Star.class.php?rev... ============================================================================== --- branches/compat/lib/om/Star.class.php [iso-8859-1] (original) +++ branches/compat/lib/om/Star.class.php (removed) @@ -1,284 +1,0 @@ -<?php - /* - CompatDB - ReactOS Compatability Database - Copyright (C) 2005-2006 Klemens Friedl <frik85@reactos.org> - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/** - * class Star - * - */ -class Star -{ - - - - /** - * @FILLME - * - * @access public - */ - private static function draw($number, $user, $mask, $votetext, $votelink, $iconsize) { // intern function, don't call this function directly - $draw_stars_result = ''; - - - /* - if ($user < 7 && $user != 1) { - $result_stars = 0; - } - else { - $result_stars = @($number / $user); - } - */ - - $result_stars = @($number / $user); - - $result_round_stars = round($result_stars, 0); - - if ($iconsize == "default") { - $iconsize_ext = ""; - $iconsize_height = "15"; - $iconsize_width = "15"; - } - elseif ($iconsize == "small") { - $iconsize_ext = "_small"; - $iconsize_height = "13"; - $iconsize_width = "13"; - } - - if ($result_round_stars <= $mask) { - - for ($goldstar=0; $goldstar < $result_round_stars; $goldstar++) { - if ($votelink != "") { - $draw_stars_result .= '<a href="'.$votelink.($goldstar+1).'">'; - } - $draw_stars_result .= '<img src="media/icons/stars/star_gold'.$iconsize_ext.'.gif" width="'.$iconsize_width.'" height="'.$iconsize_height.'" '; - if ($votelink != "") { - if (($goldstar+1) == "1") { - $draw_stars_result .= 'alt="Click here to vote '.($goldstar+1).' star!" '; - } - else { - $draw_stars_result .= 'alt="Click here to vote '.($goldstar+1).' stars!" '; - } - } - else { - $draw_stars_result .= 'alt="*" '; - } - $draw_stars_result .= 'border="0" />'; - if ($votelink != "") { - $draw_stars_result .= '</a>'; - } - } - - for ($graystar=0; $graystar < ($mask-$result_round_stars); $graystar++) { - if ($votelink != "") { - $draw_stars_result .= '<a href="'.$votelink.($result_round_stars+$graystar+1).'">'; - } - $draw_stars_result .= '<img src="media/icons/stars/star_gray'.$iconsize_ext.'.gif" width="'.$iconsize_width.'" height="'.$iconsize_height.'" '; - if ($votelink != "") { - if (($result_round_stars+$graystar+1) == "1") { - $draw_stars_result .= 'alt="Click here to vote '.($result_round_stars+$graystar+1).' star!" '; - } - else { - $draw_stars_result .= 'alt="Click here to vote '.($result_round_stars+$graystar+1).' stars!" '; - } - } - else { - $draw_stars_result .= 'alt="_" '; - } - $draw_stars_result .= 'border="0" />'; - if ($votelink != "") { - $draw_stars_result .= '</a>'; - } - } - - $draw_stars_result .= ' '.round($result_stars, 2).'/'.$mask; - - if ($votetext) { - $draw_stars_result .= ' ('.$user.' '.$votetext.')'; - } - /*if ($user < 7 && $user != "") { - $draw_stars_result .= ' (rating is hidden)'; - }*/ - } - else { - $draw_stars_result .= $votetext.' data corrupted :-('; - } - - return $draw_stars_result; -} // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function drawNormal($number, $user, $mask, $votetext) { // draw the stars; "vote"/"test" text is optional - return self::draw($number, $user, $mask, $votetext, "", "default"); - } // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function drawSmall($number, $user, $mask, $votetext) { // draw the stars; "vote"/"test" text is optional - return self::draw($number, $user, $mask, $votetext, "", "small"); - } // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function drawVoteable($number, $user, $mask, $votetext, $votelink) { // for voting only - return self::draw($number, $user, $mask, $votetext, $votelink, "default"); - - } // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function addVote($entry_id, $star_nr, $tblname, $fieldname) { // for voting only - global $RSDB_intern_user_id; - - if ($entry_id != "" && $star_nr != "" && ($star_nr >= 1 && $star_nr <= 5)) { - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM ".$tblname." WHERE ".$fieldname."_id = :entry_id"); - $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_STR); - $stmt->execute(); - $result_star_vote1=$stmt->fetchOnce(PDO::FETCH_ASSOC); - - $RSDB_TEMP_voting_history1 = strchr($result_star_vote1[$fieldname.'_useful_vote_user_history'],("|".$RSDB_intern_user_id."=")); - - if ($RSDB_TEMP_voting_history1 == false) { - $RSDB_TEMP_voting_history2 = $result_star_vote1[$fieldname.'_useful_vote_user_history']."|". $RSDB_intern_user_id ."=". $star_nr; - $stmt=CDBConnection::getInstance()->prepare("UPDATE ".$tblname." SET ".$fieldname."_useful_vote_value = ".$fieldname."_useful_vote_value+:star_nr, ".$fieldname."_useful_vote_user = ".$fieldname."_useful_vote_user+1, ".$fieldname."_useful_vote_user_history = :history WHERE ".$fieldname."_id = :entry_id"); - $stmt->bindParam('star_nr',$star_nr,PDO::PARAM_INT); - $stmt->bindParam('history',$RSDB_TEMP_voting_history2,PDO::PARAM_STR); - $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_STR); - $stmt->execute(); - - Message::show("<b>Your rating/vote has been casted!</b>"); - echo "<br />"; - - } - else { - Message::show("<b>You have already rated/voted this entry!</b>"); - echo "<br />"; - } - } - else { - Message::show("<b>Invalid rating/vote!</b>"); - echo "<br />"; - } - - } // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function thresholdForum($RSDB_TEMP_msgid, $RSDB_TEMP_threshold, $RSDB_TEMP_threshold_new, $RSDB_TEMP_tablename, $RSDB_TEMP_fieldname) { - global $RSDB_TEMP_order; - global $RSDB_intern_link_item_item2_forum_msg; - global $RSDB_SET_fstyle; - global $RSDB_intern_user_id; - global $RSDB_intern_link_item_item2_vote; - global $RSDB_TEMP_counter_threshold; - - if ($RSDB_TEMP_threshold_new == true) { - $RSDB_TEMP_counter_threshold = 0; - } - - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM rsdb_item_comp_".$RSDB_TEMP_tablename." WHERE ".$RSDB_TEMP_fieldname."_visible = '1' AND ".$RSDB_TEMP_fieldname."_comp_id = :item_id AND ".$RSDB_TEMP_fieldname."_parent = :parent ORDER BY ".$RSDB_TEMP_fieldname."_date ".$RSDB_TEMP_order.""); - $stmt->bindParam('item_id',@$_GET['item'],PDO::PARAM_STR); - $stmt->bindParam('parent',$RSDB_TEMP_msgid,PDO::PARAM_STR); - $stmt->execute(); - - while($result_fmsgreports = $stmt->fetch(PDO::FETCH_ASSOC)) { - - $number = $result_fmsgreports[$RSDB_TEMP_fieldname.'_useful_vote_value']; - $user = $result_fmsgreports[$RSDB_TEMP_fieldname.'_useful_vote_user']; - $result_stars = @($number / $user); - $result_round_stars = round($result_stars, 0); - - if ($result_round_stars >= $RSDB_TEMP_threshold) { - $RSDB_TEMP_counter_threshold++; - } - calc_threshold_stars_forum($result_fmsgreports[$RSDB_TEMP_fieldname.'_id'], $RSDB_TEMP_threshold, "", $RSDB_TEMP_tablename, $RSDB_TEMP_fieldname); - } - return $RSDB_TEMP_counter_threshold; - - } // end of member function icon - - - - /** - * @FILLME - * - * @access public - */ - public static function thresholdTests($RSDB_TEMP_msgid, $RSDB_TEMP_threshold, $RSDB_TEMP_threshold_new, $RSDB_TEMP_tablename, $RSDB_TEMP_fieldname) { - global $RSDB_TEMP_order; - global $RSDB_intern_link_item_item2_forum_msg; - global $RSDB_SET_fstyle; - global $RSDB_intern_user_id; - global $RSDB_intern_link_item_item2_vote; - global $RSDB_TEMP_counter_threshold; - - if ($RSDB_TEMP_threshold_new == true) { - $RSDB_TEMP_counter_threshold = 0; - } - - $stmt=CDBConnection::getInstance()->prepare("SELECT * FROM rsdb_item_comp_".$RSDB_TEMP_tablename." WHERE ".$RSDB_TEMP_fieldname."_visible = '1' AND ".$RSDB_TEMP_fieldname."_comp_id = :item_id ORDER BY ".$RSDB_TEMP_fieldname."_date " . $RSDB_TEMP_order . ""); - $stmt->bindParam('item_id',@$_GET['item'],PDO::PARAM_STR); - $stmt->execute(); - - while($result_fmsgreports = $stmt->fetch(PDO::FETCH_ASSOC)) { - - $number = $result_fmsgreports[$RSDB_TEMP_fieldname.'_useful_vote_value']; - $user = $result_fmsgreports[$RSDB_TEMP_fieldname.'_useful_vote_user']; - $result_stars = @($number / $user); - $result_round_stars = round($result_stars, 0); - - if ($result_round_stars >= $RSDB_TEMP_threshold) { - $RSDB_TEMP_counter_threshold++; - } - - } - return $RSDB_TEMP_counter_threshold; - - } // end of member function icon - - - -} // end of Award -?>
Modified: branches/compat/lib/view/Breadcrumb.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/Breadcrumb.class... ============================================================================== --- branches/compat/lib/view/Breadcrumb.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/Breadcrumb.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -169,107 +169,6 @@
- private static function vendor( $param, $param_type ) - { - - if ($param > 0 && $param_type === self::PARAM_ENTRY) { - $stmt=CDBConnection::getInstance()->prepare("SELECT grpentr_vendor, grpentr_name FROM rsdb_groups WHERE grpentr_visible = '1' AND grpentr_id = :group_id") ; - $stmt->bindParam('group_id',$param,PDO::PARAM_INT); - $stmt->execute(); - $vendor_id = $stmt->fetchColumn(); - - if ($vendor_id === false) { - echo 'Unknown Group'; - return; - } - } - - // check if entry version exists and is visible - elseif ($param > 0 && $param_type === self::PARAM_VERSION) { - //@TODO - } - - // no valid params - else { - echo 'Unknown parameter'; - return; - } - - if ($vendor_id) { - $stmt=CDBConnection::getInstance()->prepare("SELECT vendor_name FROM rsdb_item_vendor WHERE vendor_id = :vendor_id ORDER BY vendor_name ASC"); - $stmt->bindParam('vendor_id',$_GET['vendor'],PDO::PARAM_STR); - $stmt->execute(); - $vendor_name = $stmt->fetchColumn(); - if ($vendor === false) { - echo 'Unknown Vendor'; - return; - } - } - else { - echo 'Can't find Vendor'; - } - - echo '<li>'.$vendor_name.'</li>'; - } // end of member function vendor - - - - private static function initial( $param, $param_type ) - { - global $RSDB_intern_link_db_sec; - - // get entry by version - if ($param > 0 && $param_type === self::PARAM_VERSION) { - $stmt=CDBConnection::getInstance()->prepare("SELECT comp_groupid FROM rsdb_item_comp WHERE comp_visible = '1' AND comp_id = :item_id") ; - $stmt->bindParam('item_id',$_GET['item'],PDO::PARAM_INT); - $stmt->execute(); - $group_id = $stmt->fetchColumn(); - - if ($group_id === false) { - echo 'Unknown Item'; - return; - } - $group_id = $result_itempid['comp_groupid']; - } - - // get first letter by entry - elseif ($param > 0 && $param_type === self::PARAM_ENTRY) { - $group_id = $param; - } - - // we need an entry to get the first char - if (isset($group_id)) { - $stmt=CDBConnection::getInstance()->prepare("SELECT UPPER(SUBSTRING(LTRIM(grpentr_name), 1, 1)) AS letter, grpentr_name FROM rsdb_groups WHERE grpentr_visible = '1' AND grpentr_id = :group_id"); - $stmt->bindParam('group_id',$group_id,PDO::PARAM_INT); - $stmt->execute(); - $group = $stmt->fetchOnce(PDO::FETCH_ASSOC); - $letter = $group['letter']; - } - else { - echo 'Unknown Entry'; - return; - } - - // number - if ($letter > 0) { - echo ' - <li style="float: left;"><a href="'.$RSDB_intern_link_db_sec.'name&letter='.strtolower($letter).'">#</a></li>'; - } - - // letter - elseif ($letter != '') { - echo ' - <li style="float: left;"><a href="'.$RSDB_intern_link_db_sec.'name&letter='.strtolower($letter).'">'.$letter.'</a></li>'; - } - - // Unknown letter - else { - echo ' - <li style="float: left;">Unknown</li>'; - } - } // end of member function initial - -
} // end of Breadcrumb
Copied: branches/compat/lib/view/HTML_Entry.class.php (from r395, branches/compat/lib/view/HTML_Version.class.php) URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Entry.class... ============================================================================== --- branches/compat/lib/view/HTML_Version.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_Entry.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -19,7 +19,7 @@ */
-class Entry_Details extends HTML +class HTML_Entry extends HTML {
const MODE_NORMAL = 1; @@ -29,14 +29,21 @@ { $mode = self::MODE_NORMAL;
- $stmt=CDBConnection::getInstance()->prepare("SELECT e.id, e.name, e.version, e.description, c.name AS category, e.category_id FROM ".CDBT_ENTRIES." e LEFT JOIN ".CDBT_CATEGORIES." c ON c.id=e.category_id WHERE e.id=:entry_id"); - $stmt->bindParam('entry_id',$_GET['item'],PDO::PARAM_INT); + // version info + $stmt=CDBConnection::getInstance()->prepare("SELECT version, entry_id FROM ".CDBT_VERSIONS." WHERE id=:version_id"); + $stmt->bindParam('version_id',$_GET['ver'],PDO::PARAM_INT); + $stmt->execute(); + $version = $stmt->fetchOnce(PDO::FETCH_ASSOC); + + // entry info + $stmt=CDBConnection::getInstance()->prepare("SELECT e.id, e.name, e.description, c.name AS category, e.category_id FROM ".CDBT_ENTRIES." e LEFT JOIN ".CDBT_CATEGORIES." c ON c.id=e.category_id WHERE e.id=:entry_id"); + $stmt->bindParam('entry_id',$version['entry_id'],PDO::PARAM_INT); $stmt->execute(); $entry = $stmt->fetchOnce(PDO::FETCH_ASSOC);
// tagged versions if ($mode == self::MODE_NORMAL) { - $stmt=CDBConnection::getInstance()->prepare("SELECT r.revision, v.name FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERSIONS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND works IS TRUE ORDER BY v.revision DESC"); + $stmt=CDBConnection::getInstance()->prepare("SELECT r.revision, v.name FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERTAGS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND works IS TRUE ORDER BY v.revision DESC"); $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); $stmt->execute(); $report = $stmt->fetchOnce(PDO::FETCH_ASSOC); @@ -44,7 +51,7 @@
// untagged revisions elseif ($mode == self::MODE_DEV) { - $stmt=CDBConnection::getInstance()->prepare("SELECT r.works, r.revision FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERSIONS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND v.revision IS NULL ORDER BY r.revision DESC"); + $stmt=CDBConnection::getInstance()->prepare("SELECT r.works, r.revision FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERTAGS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND v.revision IS NULL ORDER BY r.revision DESC"); $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); $stmt->execute(); $reports = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -60,7 +67,7 @@ <th style="width:100px;">Name</th> <td style="width:200px;"><a href="">'.htmlspecialchars($entry['name']).'</a></td> <th style="width:100px;">Version</th> - <td style="width:200px;">'.($entry['version'] != '0' ? htmlspecialchars($entry['version']) : '').'</td> + <td style="width:200px;">'.htmlspecialchars($version['version']).'</td> </tr> <tr> <th style="width:100px;">Category</th> @@ -119,5 +126,7 @@ echo '</div>'; } } // end of member function body -} + + +} // end of HTML_Entry ?>
Modified: branches/compat/lib/view/HTML_Home.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Home.class.... ============================================================================== --- branches/compat/lib/view/HTML_Home.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_Home.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -55,7 +55,18 @@ <tbody>';
// show latest tests - $stmt=CDBConnection::getInstance()->prepare("SELECT e.name, r.created, r.works, e.id FROM ".CDBT_REPORTS." r JOIN ".CDBT_ENTRIES." e ON e.id=r.entry_id JOIN ".CDBT_VERSIONS." v ON v.revision=r.revision ORDER BY v.revision DESC, r.created DESC LIMIT 10"); + if (1) { + $stmt=CDBConnection::getInstance()->prepare("SELECT revision FROM ".CDBT_VERTAGS." t WHERE visible IS TRUE AND 5<(SELECT COUNT(*) FROM ".CDBT_REPORTS." WHERE revision=t.revision) ORDER BY revision DESC LIMIT 1"); + $stmt->execute(); + $latest_version = $stmt->fetchColumn(); + + $stmt=CDBConnection::getInstance()->prepare("SELECT e.name, r.created, r.works, e.id FROM ".CDBT_REPORTS." r JOIN ".CDBT_ENTRIES." e ON e.id=r.entry_id WHERE r.revision = :revision ORDER BY r.created DESC LIMIT 10"); + $stmt->bindParam('revision',$latest_version,PDO::PARAM_INT); + } + else { + $stmt=CDBConnection::getInstance()->prepare("SELECT e.name, r.created, r.works, e.id FROM ".CDBT_REPORTS." r JOIN ".CDBT_ENTRIES." e ON e.id=r.entry_id ORDER BY r.created DESC LIMIT 10"); + + } $stmt->execute(); $x=0; while ($entry = $stmt->fetch(PDO::FETCH_ASSOC)) { @@ -63,8 +74,8 @@
echo ' <tr class="row'.($x%2+1).'"> - <td><a href="'.$RSDB_intern_link_item_comp.$entry['id'].'">'.$entry['name'].'</a></td> - <td>'.($entry['works']?'yep':'doesn't').'</td> + <td><a href="?page=item&item='.$entry['id'].'">'.$entry['name'].'</a></td> + <td>'.$entry['works'].'</td> <td style="text-align: center;">'.$entry['created'].'</td> </tr>'; }
Modified: branches/compat/lib/view/HTML_List.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_List.class.... ============================================================================== --- branches/compat/lib/view/HTML_List.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_List.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -44,86 +44,210 @@ else { $offset = 0; } + + echo ' + <h1>Compatability Database > browse by name</h1>'; +
- if (isset($_GET['letter']) && $_GET['letter'] != 'all') { - $letter = $_GET['letter']; - } - - echo ' - <h1>Compatability Database > browse by name</h1>'; + if (isset($_GET['letter'])) { + $this->naviLetter($_GET['letter']); + } + elseif (isset($_GET['cat'])) { + $this->naviCategory($_GET['cat']); + } + elseif (isset($_GET['tag']) && $_GET['tag'] == '*') { + $this->naviTags(); + } + + elseif (isset($_GET['filter'])) { + $this->naviCustom(); + } + + if (!isset($_GET['tag']) || $_GET['tag'] != '*') { + + $stmt=CDBConnection::getInstance()->prepare("SELECT COUNT(*) FROM ".CDBT_ENTRIES." e ".$this->from." WHERE e.visible IS TRUE ".$this->where); + foreach ($this->params as $param) { + $stmt->bindValue($param[0],$param[1],$param[2]); + } + $stmt->execute(); + $entries_count = $stmt->fetchColumn(); + + if ($entries_count > $limit) { + echo '<div>Navigation:'; + $to = ceil($entries_count/(float)$limit); + for ($i=1; $i <= $to ; ++$i) { + if ($offset==($i-1)*$limit) { + echo '<strong>['.$i.']</strong>'; + } + else { + echo '<a href="?page=list'.(isset($_GET['letter']) ? '&letter='.$_GET['letter']:'').'&offset='.(($i-1)*$limit).'">'.$i.'</a>'; + } + } + echo '</div>'; + }
- echo '<div>Letters:'; - for ($i=ord('a'); $i <= ord('z') ; ++$i) { - if (isset($letter) && chr($i)==$letter) { - echo '<strong>['.chr($i).']</strong>'; + + echo ' + <table class="rtable"> + <thead> + <tr> + <th>Application</th> + <th>Works?</th> + <th>Last modified</th> + </tr> + </thead> + <tbody>'; + + reset($this->params); + $stmt=CDBConnection::getInstance()->prepare("SELECT e.id, e.name, e.modified, (SELECT works FROM ".CDBT_REPORTS." WHERE entry_id=e.id ORDER BY created DESC LIMIT 1) AS works FROM ".CDBT_ENTRIES." e ".$this->from." WHERE e.visible IS TRUE ".$this->where." ORDER BY e.name ASC LIMIT :limit OFFSET :offset"); + foreach ($this->params as $param) { + $stmt->bindValue($param[0],$param[1],$param[2]); + } + $stmt->bindParam('limit', $limit, PDO::PARAM_INT); + $stmt->bindParam('offset', $offset, PDO::PARAM_INT); + $stmt->execute(); + $x=0; + while ($entry=$stmt->fetch(PDO::FETCH_ASSOC)) { + ++$x; + + $stmt_ver=CDBConnection::getInstance()->prepare("SELECT id, version FROM ".CDBT_VERSIONS." WHERE entry_id=:entry_id ORDER BY version DESC"); + $stmt_ver->bindParam('entry_id',$entry['id'],PDO::PARAM_STR); + $stmt_ver->execute(); + $versions = $stmt_ver->fetchAll(PDO::FETCH_ASSOC); + + // display entry only if it has also at least one version information + if (count($versions) > 0) { + echo ' + <tr class="row'.($x%2+1).'"> + <td>'; + + if (count($versions) == 1) { + echo ' + <a href="?page=item&ver='.$versions[0]['id'].'">'.htmlspecialchars($entry['name']).' '.$versions[0]['version'].'</a>'; + } + else { + echo ' + <a href="?page=item&item='.$entry['id'].'">'.htmlspecialchars($entry['name']).'</a> + <ul style="display:none;">'; + + + foreach ($versions as $version) { + echo ' + <li><a href="item&ver='.$entry['id'].'">'.htmlspecialchars($entry['name']).' '.$version['version'].'</a></li>'; + } + + echo ' + </ul>'; + } + + + echo ' + </td> + <td>'.$entry['works'].'</td> + <td>'.$entry['modified'].'</td> + </tr>'; } - else { - echo '<a href="?page=list&letter='.chr($i).'">'.strtoupper(chr($i)).'</a>'; - } - } - echo '</div>'; - - $stmt=CDBConnection::getInstance()->prepare("SELECT COUNT(*) FROM ".CDBT_ENTRIES." e ".$this->from." WHERE e.visible IS TRUE ".$this->where); - foreach ($this->params as $param) { - $stmt->bindValue($param[0],$param[1],$param[2]); - } - $stmt->execute(); - $entries_count = $stmt->fetchColumn(); - - if ($entries_count > $limit) { - echo '<div>Navigation:'; - $to = ceil($entries_count/(float)$limit); - for ($i=1; $i <= $to ; ++$i) { - if ($offset==($i-1)*$limit) { - echo '<strong>['.$i.']</strong>'; - } - else { - echo '<a href="?page=list'.(isset($letter) ? '&letter='.$letter:'').'&offset='.(($i-1)*$limit).'">'.$i.'</a>'; - } - } - echo '</div>'; - } - - echo ' - <table class="rtable"> - <thead> - <tr> - <th>Application</th> - <th>Works?</th> - <th>Last modified</th> - </tr> - </thead> - <tbody>'; - - reset($this->params); - $stmt=CDBConnection::getInstance()->prepare("SELECT e.id, e.name, e.modified FROM ".CDBT_ENTRIES." e ".$this->from." WHERE e.visible IS TRUE ".$this->where." ORDER BY e.name ASC LIMIT :limit OFFSET :offset"); - foreach ($this->params as $param) { - $stmt->bindValue($param[0],$param[1],$param[2]); - } - $stmt->bindParam('limit', $limit, PDO::PARAM_INT); - $stmt->bindParam('offset', $offset, PDO::PARAM_INT); + } + + echo ' + </tbody> + </table>'; + } + } // end of member function body + + + + private function naviLetter( $letter ) + { + echo '<div>Letters:'; + for ($i=ord('a'); $i <= ord('z') ; ++$i) { + if (isset($letter) && chr($i)==$letter) { + echo '<strong>['.chr($i).']</strong>'; + } + else { + echo '<a href="?page=list&letter='.chr($i).'">'.strtoupper(chr($i)).'</a>'; + } + } + echo '</div>'; + } + + + + private function naviCategory( $category_id ) + { + echo ' + <div style="margin-bottom: 3em;">Categories + <table class="rtable"> + <thead> + <tr> + <th>Name</th> + <th>Subcategories</th> + <th>direct entries</th> + </tr> + </thead> + <tbody>'; + + $stmt=CDBConnection::getInstance()->prepare("SELECT id, name, (SELECT COUNT(*) FROM ".CDBT_CATEGORIES." WHERE parent=p.id) AS subcategories, (SELECT COUNT(*) FROM ".CDBT_ENTRIES." WHERE category_id=p.id) AS entries FROM ".CDBT_CATEGORIES." p WHERE parent=:category_id ORDER BY name ASC"); + $stmt->bindParam('category_id',$category_id,PDO::PARAM_STR); $stmt->execute(); $x=0; - while ($entry=$stmt->fetch(PDO::FETCH_ASSOC)) { + while ($category=$stmt->fetch(PDO::FETCH_ASSOC)) { ++$x;
echo ' <tr class="row'.($x%2+1).'"> - <td><a href="?page=item&item='.$entry['id'].'">'.htmlspecialchars($entry['name']).'</a></td> - <td>???</td> - <td>'.$entry['modified'].'</td> + <td><a href="?page=list&cat='.$category['id'].'">'.$category['name'].'</a></td> + <td>'.$category['subcategories'].'</td> + <td>'.$category['entries'].'</td> </tr>'; }
echo ' - </tbody> - </table>'; - } // end of member function body - - - - private function buildQuery ($filter) - { + </tbody> + </table> + </div>'; + } + + + + + private function naviTags( ) + { + $stmt=CDBConnection::getInstance()->prepare("SELECT MAX((SELECT COUNT(*) FROM ".CDBT_TAGGED." WHERE tag_id=t.id)) AS max FROM ".CDBT_TAGS." t"); + $stmt->execute(); + $max = $stmt->fetchColumn(); + echo $max; + + echo ' + <div style="margin-bottom: 3em;">'; + + $stmt=CDBConnection::getInstance()->prepare("SELECT id, name, (SELECT COUNT(*) FROM ".CDBT_TAGGED." WHERE tag_id=t.id) AS count FROM ".CDBT_TAGS." t ORDER BY name ASC"); + $stmt->execute(); + while ($tag=$stmt->fetch(PDO::FETCH_ASSOC)) { + echo '<span style="float: left; margin-right: 20px; font-size: '.((floor($tag['count']/(float)$max)*12.0)+8).'px;"><a href="?page=list&tag='.htmlspecialchars($tag['name']).'">'.htmlspecialchars($tag['name']).'</a></span>'; + } + echo ' + </div>'; + } + + + + + private function naviCustom( ) + { + echo '<div>Not yet implemented</div>'; + } + + + private function buildQuery($filter) + { + if ($filter == '') { + return false; + } + elseif (!strstr($filter, '_')) { + return false; + } + $filters = explode('|',$filter); foreach ($filters as $filter) { $part = explode('_',$filter); @@ -150,6 +274,14 @@ $this->params[] = array('ends_with','%'.$part[2],PDO::PARAM_STR); break;
+ // tagged with + case 't': + $this->where .= " t.name = :tagname "; + $this->from .= " JOIN ".CDBT_TAGGED." tr ON tr.entry_id=e.id "; + $this->from .= " JOIN ".CDBT_TAGS." t ON t.id=tr.tag_id "; + $this->params[] = array('tagname',$part[2],PDO::PARAM_STR); + break; + // category case 'c': if ($part[1] == 'is') {
Modified: branches/compat/lib/view/HTML_Submit.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Submit.clas... ============================================================================== --- branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] Mon May 4 17:25:30 2009 @@ -53,7 +53,7 @@ }
// try to insert a new entry - if (isset($_POST['cat']) && isset($_POST['description'])) { + if (isset($_POST['title']) && $_POST['title'] != '' && isset($_POST['tags']) && isset($_POST['cat']) && isset($_POST['description']) && isset($_POST['version']) && $_POST['version'] != '') { $entry_id = Entry::add($_POST['title'], $_POST['version'], $_POST['cat'], $_POST['description'], $_POST['tags'], (isset($_POST['iCheck']) && $_POST['iCheck'] == 'yes')); }
@@ -64,7 +64,8 @@
// insert new report/comment if ($entry_id !== false) { - Entry::addReport($entry_id, $revision, ($_POST['status']=='yes')); + if (isset($_POST['status']) && ($_POST['status'] == 'works' || $_POST['status'] == 'part' ||$_POST['status'] == 'not')) + Entry::addReport($entry_id, $revision, $_POST['status']);
// insert new comment if (isset($_POST['comment']) && $_POST['comment'] != '') { @@ -115,9 +116,9 @@ <input type="text" name="description" id="description" /> </li>
- <li style="display:none;"> - <label for="tags">Tags: (seperate them by <em>,</em>)</label><br /> - <input type="text" name="tags" id="tags" /> + <li> + <label for="tags">Tags: (e.g. vendor)</label><br /> + <input type="text" name="tags" id="tags" /> (seperate them by <em>,</em>) </li> </ul> </li> @@ -130,20 +131,23 @@ <ul style="list-style-type: none;"> <li> Status:<br /> - <input type="radio" name="status" id="noworks" value="no" /> + <input type="radio" name="status" id="noworks" value="not" /> <label for="noworks" style="color: red;">Doesn't Work</label> - <br /> - <input type="radio" name="status" id="doesn\'t work" value="yes" /> + + <input type="radio" name="status" id="partworks" value="part" /> + <label for="partworks" style="color: orange;">Works partly</label> + + <input type="radio" name="status" id="works" value="works" /> <label for="works" style="color: green;">Works</label> <br /> <br /> </li> <li> <label for="ver">Tested Version</label><br /> - <select name="ver" id="ver"> + <select name="ver" id="ver" onchange="'."javascript:document.getElementById('directRev').style.display=(this.value=='R' ? 'block' : 'none' );".'"> <option value="R"'.(($used_again && $_POST['ver'] == 'R') ? ' selected="selected"' : '').'>Use Revision</option>';
- $stmt=CDBConnection::getInstance()->prepare("SELECT revision, name FROM ".CDBT_VERSIONS." WHERE VISIBLE IS TRUE ORDER BY revision DESC"); + $stmt=CDBConnection::getInstance()->prepare("SELECT revision, name FROM ".CDBT_VERTAGS." WHERE VISIBLE IS TRUE ORDER BY revision DESC"); $stmt->execute(); $x = 0; while ($version = $stmt->fetch(PDO::FETCH_ASSOC) ) { @@ -155,11 +159,21 @@ </select> </li>
- <li> + <li id="directRev"> <label for="rev">Tested Revision (only trunk revisions are allowed, please don't enter revisions of tags or branches)</label><br /> <input type="text" name="rev" id="rev"'.(($used_again && $_POST['ver'] == 'R') ? ' value="'.htmlspecialchars($_POST['revision']).'"' : '').' /> </li> - </ul> + </ul>'; + + if (!$used_again || $_POST['ver'] != 'R') { + echo ' + <script type="text/javascript"> + //<!-- + document.getElementById("directRev").style.display="none"; + //--> + </script>'; + } + echo ' </fieldset>
<fieldset> @@ -173,6 +187,9 @@ next action:<br /> <input type="radio" name="next" id="again" value="again" '.($used_again ? 'checked="checked"' : '').' /> <label for="again">Insert another entry/report</label> + <br /> + <input type="radio" name="next" id="more" value="more" /> + <label for="more">Add more information to that entry.</label> <br /> <input type="radio" name="next" id="entry" value="entry" '.(!$used_again ? 'checked="checked"' : '').' /> <label for="entry">Jump to inserted entry/report</label>
Removed: branches/compat/lib/view/HTML_Version.class.php URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Version.cla... ============================================================================== --- branches/compat/lib/view/HTML_Version.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_Version.class.php (removed) @@ -1,123 +1,0 @@ -<?php - /* - RSDB - ReactOS Support Database - Copyright (C) 2009 Danny Götte <dangerground@web.de> - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -class Entry_Details extends HTML -{ - - const MODE_NORMAL = 1; - const MODE_DEV = 2; - - protected function body() - { - $mode = self::MODE_NORMAL; - - $stmt=CDBConnection::getInstance()->prepare("SELECT e.id, e.name, e.version, e.description, c.name AS category, e.category_id FROM ".CDBT_ENTRIES." e LEFT JOIN ".CDBT_CATEGORIES." c ON c.id=e.category_id WHERE e.id=:entry_id"); - $stmt->bindParam('entry_id',$_GET['item'],PDO::PARAM_INT); - $stmt->execute(); - $entry = $stmt->fetchOnce(PDO::FETCH_ASSOC); - - // tagged versions - if ($mode == self::MODE_NORMAL) { - $stmt=CDBConnection::getInstance()->prepare("SELECT r.revision, v.name FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERSIONS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND works IS TRUE ORDER BY v.revision DESC"); - $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); - $stmt->execute(); - $report = $stmt->fetchOnce(PDO::FETCH_ASSOC); - } - - // untagged revisions - elseif ($mode == self::MODE_DEV) { - $stmt=CDBConnection::getInstance()->prepare("SELECT r.works, r.revision FROM ".CDBT_REPORTS." r LEFT JOIN ".CDBT_VERSIONS." v ON r.revision=v.revision WHERE r.entry_id=:entry_id AND v.revision IS NULL ORDER BY r.revision DESC"); - $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); - $stmt->execute(); - $reports = $stmt->fetchAll(PDO::FETCH_ASSOC); - } - - echo ' - <h1>Compatability Database > Entry Details</h1> - - <div> - <h2>Details</h2> - <table style="width: 600px;"> - <tr> - <th style="width:100px;">Name</th> - <td style="width:200px;"><a href="">'.htmlspecialchars($entry['name']).'</a></td> - <th style="width:100px;">Version</th> - <td style="width:200px;">'.($entry['version'] != '0' ? htmlspecialchars($entry['version']) : '').'</td> - </tr> - <tr> - <th style="width:100px;">Category</th> - <td style="width:200px;" colspan="3"><a href="">'.htmlspecialchars($entry['category']).'</a></td> - </tr> - <tr> - <th style="width:100px;">Description</th> - <td style="width:200px;" colspan="3">'.htmlspecialchars($entry['description']).'</td> - </tr>'; - if ($mode == self::MODE_NORMAL) { - echo ' - <tr> - <th style="width:100px;">Works in</th> - <td style="width:200px;" colspan="3">'.(($report['name']) ? htmlspecialchars($report['name']) : (($report['revision'] > 0) ? 'r'.$report['revision'].' (trunk)' : 'no working version known')).'</td> - </tr>'; - } - echo ' - </table> - </div>'; - - if (isset($reports) && count($reports) > 0) { - echo ' - <div> - <h2>Tests</h2> - <ul>'; - foreach($reports as $report) { - echo '<li>'.($report['works'] ? 'works' : 'doesn\'t').' — r'.$report['revision'].'</li>'; - } - echo ' - </ul> - </div>'; - } - - - $stmt=CDBConnection::getInstance()->prepare("SELECT title, content, created, user_id FROM ".CDBT_COMMENTS." WHERE entry_id=:entry_id AND parent IS NULL ORDER BY created DESC"); - $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_STR); - $stmt->execute(); - $comments=$stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($comments) > 0) { - echo ' - <div> - <h2>Comments</h2>'; - - foreach ($comments as $comment) { - echo ' - <div> - <div> - <h3>'.htmlspecialchars($comment['title']).'</h3> - <span>by '.Subsystem::getUserName($comment['user_id']).' on '.$comment['created'].'</span> - </div> - '.nl2br(htmlspecialchars($comment['content'])).' - </div>'; - } - - echo '</div>'; - } - } // end of member function body -} -?>
Removed: branches/compat/rsdb_config.php URL: http://svn.reactos.org/svn/reactos/branches/compat/rsdb_config.php?rev=400&a... ============================================================================== --- branches/compat/rsdb_config.php [iso-8859-1] (original) +++ branches/compat/rsdb_config.php (removed) @@ -1,134 +1,0 @@ -<?php - /* - RSDB - ReactOS Support Database - Copyright (C) 2005-2006 Klemens Friedl <frik85@reactos.org> - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * ReactOS Support Database System - RSDB - * - * (c) by Klemens Friedl <frik85> - * - * 2005 - 2006 - */ - - - // To prevent hacking activity: - if ( !defined('RSDB') ) - { - die(" "); - } - - global $RSDB_SET_letter; - global $RSDB_SET_group; - global $RSDB_vote; - global $RSDB_vote2; - - global $RSDB_SET_threshold; - global $RSDB_SET_fstyle; - global $RSDB_SET_order; - global $RSDB_SET_save; - global $RSDB_SET_msg; - global $RSDB_SET_filter; - global $RSDB_SET_filter2; - global $rpm_lang; - - - - // Settings: - // ********* - - $RSDB_setting_stars_threshold = 6; - - // Links: - // ****** - - // RosCMS - $RSDB_intern_link_roscms = $RSDB_intern_path_server.$RSDB_intern_loginsystem_path."index.php"; - $RSDB_intern_link_roscms_page = $RSDB_intern_link_roscms."?page="; - - // Section - $RSDB_intern_link_db_sec = $RSDB_intern_index_php."?page="; - $RSDB_intern_link_db_sec_javascript = $RSDB_intern_index_php."?page="; - $RSDB_intern_link_db_sec_javascript2 = $RSDB_intern_index_php."?page=".htmlspecialchars(@$_GET['page']); - - // Category - $RSDB_intern_link_category_all = $RSDB_intern_link_db_sec.htmlspecialchars(@$_GET['page'])."&cat=".htmlspecialchars(@$_GET['cat']); - - $RSDB_intern_link_category_cat = $RSDB_intern_link_db_sec.htmlspecialchars(@$_GET['page'])."&cat="; - - - // Name - $RSDB_intern_link_name_letter = $RSDB_intern_link_db_sec.htmlspecialchars(@$_GET['page'])."&letter="; - $RSDB_intern_link_name_letter2 = $RSDB_intern_link_db_sec.htmlspecialchars(@$_GET['page'])."&letter=".$RSDB_SET_letter; - $RSDB_intern_link_name_curpos = $RSDB_intern_link_db_sec.htmlspecialchars(@$_GET['page'])."&letter=".$RSDB_SET_letter."&curpos="; - - // Group - $RSDB_intern_link_group = $RSDB_intern_link_db_sec."group&group="; - $RSDB_intern_link_group_group2 = $RSDB_intern_link_group.$RSDB_SET_group."&group2="; - $RSDB_intern_link_group_group2_both = $RSDB_intern_link_group_group2.htmlspecialchars(@$_GET['group2']); - $RSDB_intern_link_group_group2_both_javascript = $RSDB_intern_link_db_sec_javascript."group&group=".$RSDB_SET_group."&group2=".htmlspecialchars(@$_GET['group2']); - $RSDB_intern_link_group_sort = $RSDB_intern_link_group.$RSDB_SET_group."&group2=".htmlspecialchars(@$_GET['group2'])."&sort="; - $RSDB_intern_link_group_comp = $RSDB_intern_index_php."?page=group&group="; - $RSDB_intern_link_group_comp_javascript = $RSDB_intern_index_php."?page=group&group="; - - // Item - $RSDB_intern_link_item = $RSDB_intern_link_db_sec."item&item="; - $RSDB_intern_link_item_javascript = $RSDB_intern_index_php."?page=item&item="; - $RSDB_intern_link_item_item2 = $RSDB_intern_link_item.htmlspecialchars(@$_GET['item'])."&item2="; - $RSDB_intern_link_item_item2_both = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2']); - $RSDB_intern_link_item_item2_both_javascript = $RSDB_intern_link_db_sec_javascript."item&item=".htmlspecialchars(@$_GET['item'])."&item2=".htmlspecialchars(@$_GET['item2']); - - $RSDB_intern_link_item_comp = $RSDB_intern_index_php."?page=item&item="; - - $RSDB_intern_link_item_item2_vote = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&vote="; - $RSDB_intern_link_item_item2_forum_bar = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2']); - $RSDB_intern_link_item_item2_forum_msg = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&threshold=".$RSDB_SET_threshold."&fstyle=".$RSDB_SET_fstyle."&order=".$RSDB_SET_order."&filter=".$RSDB_SET_filter."&msg="; - - // Vendor - $RSDB_intern_link_vendor = $RSDB_intern_link_db_sec."vendor_info&vendor="; - $RSDB_intern_link_vendor_both_javascript = $RSDB_intern_link_db_sec_javascript."vendor_info&vendor=".htmlspecialchars(@$_GET['vendor']); - $RSDB_intern_link_vendor2_group = $RSDB_intern_link_db_sec."group&group="; - $RSDB_intern_link_vendor_sec = $RSDB_intern_link_db_sec."vendor_info&vendor="; - $RSDB_intern_link_vendor_sec_comp = $RSDB_intern_index_php."?page=vendor_info&vendor="; - - // Rank - $RSDB_intern_link_rank = $RSDB_intern_link_db_sec."rank"; - $RSDB_intern_link_rank_rank2 = $RSDB_intern_link_rank."&rank2="; - $RSDB_intern_link_rank2_group = $RSDB_intern_link_db_sec."group&group="; - $RSDB_intern_link_rank2_item = $RSDB_intern_link_db_sec."item&item="; - $RSDB_intern_link_rank_sec = $RSDB_intern_link_db_sec."rank&rank="; - $RSDB_intern_link_rank_sec_comp = $RSDB_intern_index_php."?page=vendor_info&vendor="; - $RSDB_intern_link_rank_curpos = $RSDB_intern_link_rank_rank2.htmlspecialchars(@$_GET['rank2'])."&curpos="; - $RSDB_intern_link_rank_filter = $RSDB_intern_link_rank_curpos.htmlspecialchars(@$_GET['curpos'])."&filter="; - - // Submit - // Compatibility Test Report - $RSDB_intern_link_submit_comp_test = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&addbox="; - // Compatibility Screenshot - $RSDB_intern_link_submit_comp_screenshot = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&addbox="; - // Forum Post - $RSDB_intern_link_submit_forum_post = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&addbox=reply&entry="; - // Application Version - $RSDB_intern_link_submit_appver = $RSDB_intern_link_item_item2.htmlspecialchars(@$_GET['item2'])."&group=".$RSDB_SET_group."&addbox=submit"; - $RSDB_intern_link_submit_appver_javascript = $RSDB_intern_link_item_javascript.htmlspecialchars(@$_GET['item'])."&item2=".htmlspecialchars(@$_GET['item2'])."&group=".$RSDB_SET_group."&addbox=submit"; - - - // Language - $RSDB_intern_link_language = $RSDB_intern_index_php."?page=".htmlspecialchars(@$_GET['page'])."&sec=".htmlspecialchars(@$_GET['page'])."&cat=".htmlspecialchars(@$_GET['cat'])."&letter=".$RSDB_SET_letter."&group=".$RSDB_SET_group."&item=".htmlspecialchars(@$_GET['item'])."&order=".$RSDB_SET_order."&filter=".$RSDB_SET_filter."&vendor=".htmlspecialchars(@$_GET['vendor'])."&lang="; - -?>