cvs: bugtracker /htdocs/elements screen.css screen.php /htdocs/index index.php /includes comment.php functions.php /template/generic header.html
login.php /template/generic/bug comment.php index.php /template/generic/report index.php report.php /template/generic/user convert.php login.php
/template/php home.html
| From: | Barry Carlyon | Date: | Sat, 26 Jul 2008 02:33:44 +0000 |
| Subject: | cvs: bugtracker /htdocs/elements screen.css screen.php /htdocs/index index.php /includes comment.php functions.php /template/generic header.html login.php /template/generic/bug comment.php index.php /template/generic/report index.php report.php /template/generic/user convert.php login.php /template/php home.html |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2207@lists.php.net to get a copy of this message | ||
bcarlyon Sat Jul 26 02:33:44 2008 UTC
Added files:
/bugtracker/htdocs/elements screen.php
Modified files:
/bugtracker/htdocs/elements screen.css
/bugtracker/htdocs/index index.php
/bugtracker/includes comment.php functions.php
/bugtracker/template/generic header.html login.php
/bugtracker/template/generic/bug comment.php index.php
/bugtracker/template/generic/report index.php report.php
/bugtracker/template/generic/user convert.php login.php
/bugtracker/template/php home.html
Log:
Redid the entire template engine
Still some minor work to do
Fixed a weird segfault, when you pass a array to htmlentities
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/screen.css?r1=1.7&r2=1.8&diff_format=u Index: bugtracker/htdocs/elements/screen.css diff -u bugtracker/htdocs/elements/screen.css:1.7 bugtracker/htdocs/elements/screen.css:1.8 --- bugtracker/htdocs/elements/screen.css:1.7 Fri Jul 18 08:31:38 2008 +++ bugtracker/htdocs/elements/screen.css Sat Jul 26 02:33:43 2008 @@ -4,8 +4,13 @@ font-family: verdana, arial, helvetica, sans-serif; font-size: 95%; } +body { + background: #FFFFFF; + color: #000000; +} p, a, li, body { font-family: verdana, arial, helvetica, sans-serif; + color: #000000; } img { border: 0px; @@ -102,6 +107,10 @@ float: left; font-weight: 700; cursor: pointer; +/* + display: block; + clear: both; + width: 100%;/* shiee hack */ } .slim { /*width: 550px;*/ @@ -207,3 +216,7 @@ color: #006600; } +.blocker { + clear: both; + display: block; +} http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.9&r2=1.10&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.9 bugtracker/htdocs/index/index.php:1.10 --- bugtracker/htdocs/index/index.php:1.9 Fri Jul 25 22:00:30 2008 +++ bugtracker/htdocs/index/index.php Sat Jul 26 02:33:43 2008 @@ -72,13 +72,14 @@ $form_data = array();//array for holding the data in forms $template_data = array_merge($template_data, array( 'page_title' => 'PHP Bugs', + 'content_title' => '', 'year' => date('Y',time()), 'url' => ($_REQUEST['page']) ? $_REQUEST['page'] : 'home', 'alternative_stylesheet' => '', 'login' => '<li><a href="/account-request.php">Register</a></li>' . "\n" . '<li><a href="/login.php?redirect=">Login</a></li>', 'login' => "\n" . '<li><a href="/login/">Login</a></li>', 'favicon' => '', - 'form_error' => '', + 'system_error' => '', ) ); //$template_data['cvs_version'] = substr( $php_version[sizeof($php_version)] ,0,4); @@ -104,14 +105,6 @@ $content = ''; -/* -$content .= '<textarea style="width: 95%; height: 50px; border: 1px solid #000;" rows="4" cols="50">debug: ' . "\n"; -$content .= $bugtracker . ' - ' .$template; -$content .= "\n"; -$content .= 'page: ' . $_REQUEST['page']; -$content .= '</textarea>'; -*/ - //next job is to determine which file we need to load template/content wise $page = ($_REQUEST['page']) ? $_REQUEST['page'] : 'home'; if (substr($page,-1,1) == '/') @@ -120,9 +113,12 @@ //lop off the / at the end } +//switched to ALWAYS tpl_process + if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '.html')) { - $content .= tpl_process($template . '/' . $page . '.html'); +// $content .= tpl_process($template . '/' . $page . '.html'); + $content .= $template . '/' . $page . '.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '.php')) { @@ -131,7 +127,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '/index.html')) { - $content .= tpl_process($template . '/' . $page . '/index.html'); +// $content .= tpl_process($template . '/' . $page . '/index.html'); + $content .= $template . '/' . $page . '/index.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '/index.php')) { @@ -140,7 +137,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '.html')) { - $content .= tpl_process('generic/' . $page . '.html'); +// $content .= tpl_process('generic/' . $page . '.html'); + $content .= 'generic/' . $page . '.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '.php')) { @@ -149,7 +147,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '/index.html.')) { - $content .= tpl_process('generic/' . $page . '/index.html'); +// $content .= tpl_process('generic/' . $page . '/index.html'); + $content .= 'generic/' . $page . '/index.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '/index.php')) { @@ -160,23 +159,21 @@ { header("HTTP/1.0 404 Not Found"); $page = '404'; - $template_data['page_title'] .= ' | 404 File Not Found'; - $content .= tpl_process('/generic/404.html'); +// $template_data['page_title'] .= ' | 404 File Not Found'; + $content .= '<h2>404 File Not Found</h2>'; +// $content .= tpl_process('/generic/404.html'); +// $content .= '/generic/404.html'; + $template_data['system_error'] = 'I am sorry the file (<strong>{URL}</strong>) you have requested could not be found'; } $template_data['queries'] = $db->query_count; -$content = tpl_process('generic/header.html', TRUE, $jsscripts, $meta_refresh) . $content . '<br />' . tpl_process('generic/footer.html'); +$content = create_title($content); +$content = tpl_process('generic/header.html', $jsscripts, $meta_refresh) . tpl_process($content) . '<br />' . tpl_process('generic/footer.html'); +//lets cheat in the world of table fixing for display $content = str_replace('<table','<table cellspacing="0" cellpadding="0"',$content); -/* -$content .= '<textarea style="width: 100%; height: 250px; border: 1px solid #000;">debug: ' . "\n"; -foreach ($_SERVER as $ref => $data) - $content .= $ref . ' = ' . $data . "\n"; -$content .= '</textarea>'; -*/ - echo $content; //penultimate task @@ -191,6 +188,7 @@ $db->close(); unset($db); +// COMMENCE TRACE echo '<textarea style="width: 95%; height: 200px; border: 1px solid #000;" rows="10" cols="50">debug: ' . "\n"; echo ' @@ -214,6 +212,24 @@ } echo ' +form_data +'; +//print_r($template_data); +foreach ($form_data as $ref => $data) +{ + if (is_array($data)) + { + foreach ($data as $aref => $adata) + echo $aref . ' - ' . htmlentities($adata) . "\n"; + } + else + { + echo $ref . ' - ' . htmlentities($data) . "\n"; + } +} + + +echo ' server '; //print_r($template_data); http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.7&r2=1.8&diff_format=u Index: bugtracker/includes/comment.php diff -u bugtracker/includes/comment.php:1.7 bugtracker/includes/comment.php:1.8 --- bugtracker/includes/comment.php:1.7 Fri Jul 25 22:00:30 2008 +++ bugtracker/includes/comment.php Sat Jul 26 02:33:43 2008 @@ -44,6 +44,7 @@ { //spawn me a bug trace('bounce from comment form, need to spawn a bug display'); + $bug->bug_id = $form_data['bug_id']; } else if (!isset($bug->bug_id)) { @@ -60,6 +61,7 @@ $form_content = ' <tr> <td style="text-align: center; border-top: 1px solid #000;"> Add Comment</td> <td colspan="3" style="border-top: 1px solid #000;"></td> </tr> <tr> <td></td> <td colspan="3"> +{FORM_ERROR} <form action="/bug/comment/" method="post" name="commentform" id="commentform" > <input type="hidden" name="bug_id" value="' . $bug->bug_id . ' " /> '; @@ -80,6 +82,7 @@ $form_content .= ' <label for="comment_text">Comment</label> <textarea name="comment_text" id="comment_text" rows="7" cols="55" >{COMMENT_TEXT}</textarea> + <div class="blocker" ></div> <input type="button" value="Submit Comment" onclick="document.getElementById(\'commentform\').submit()" /> </form> </td></tr> http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.9&r2=1.10&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.9 bugtracker/includes/functions.php:1.10 --- bugtracker/includes/functions.php:1.9 Fri Jul 25 22:00:30 2008 +++ bugtracker/includes/functions.php Sat Jul 26 02:33:43 2008 @@ -10,20 +10,62 @@ return $newstring; } -function tpl_process($file,$text = TRUE,$jsscripts = FALSE,$meta_refresh = FALSE) { +function create_title($html) { + //function to handle backtrace content_title system&form_error page_title + global $template_data; + //set some stuff + //all files start <h2> + $data = explode('</h2>',$html); + if (!$template_data['content_title']) + { + $template_data['content_title'] = str_replace('<h2>','',$data[0]); + } + if ($template_data['page_title'] == 'PHP Bugs') + { + $template_data['page_title'] .= ' - ' . str_replace('<h2>','',$data[0]); + } + //lop off the h2 title from the start of the html + $html = substr($html,4 + 5 + strlen($template_data['content_title']) ); + + return $html; +} + +//function tpl_process($file, $text, $jsscripts = FALSE, $meta_refresh = FALSE) { +function tpl_process($file, $jsscripts = FALSE, $meta_refresh = FALSE) { + $ext = explode(".",$file); + //base it on the file extension + trace('I am tpl_processing '); + global $template_data,$form_data; - if ($text) +// if ($text) + $ext = isset($ext[1]) ? $ext[1] : ''; + if ($ext == 'html') { + trace('file_get_contents ' . $file); $html = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '../template/' . $file); } else { + trace('file is html'); $html = $file; } + +//check for key stuff +if ($template_data['page_title'] == 'PHP Bugs') + trace('No page_title'); +if (empty($template_data['content_title'])) + trace('No Content title'); +if (!empty($template_data['system_error'])) + trace('system error'); +if (!empty($template_data['form_error'])) + trace('form error where there should be nonw'); + foreach ($template_data as $ref => $replace) { - if ($ref == 'form_error' && $replace) + trace('tpl ' . $ref); + if ($ref == 'system_error' && $replace) { + trace('system error detected ' . $replace); if (!strpos('class="error"',$replace)) { $replace = '<div id="error">' . $replace . '</div>'; @@ -33,17 +75,19 @@ } foreach ($form_data as $ref => $replace) { + trace('tpl ' . $ref); if (is_array($replace)) { foreach ($replace as $aref => $areplace) { //2nd layer stuff will always be error! + //such as input field specific errors $html = str_replace('{' . strtoupper($ref) . '_' . strtoupper($aref) . '}','<span class="error">' . $areplace . ' </span>',$html); } } else { - if ($ref == 'form_error') + if ($ref == 'form_error' && !empty($replace)) { //check for div if (!strpos('class="error"',$replace)) @@ -180,6 +224,7 @@ } function trace($message) { +return; global $trace; $trace .= $message . "\n"; return; http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/header.html?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/template/generic/header.html diff -u bugtracker/template/generic/header.html:1.3 bugtracker/template/generic/header.html:1.4 --- bugtracker/template/generic/header.html:1.3 Thu Jul 24 21:59:58 2008 +++ bugtracker/template/generic/header.html Sat Jul 26 02:33:43 2008 @@ -17,7 +17,7 @@ <link rel="stylesheet" type="text/css" href="/elements/reset.css" media="screen" /> <link rel="stylesheet" type="text/css" href="/style.css" media="screen" /> -<link rel="stylesheet" type="text/css" href="/elements/screen.css" media="screen" /> +<link rel="stylesheet" type="text/css" href="/elements/screen.php" media="screen" /> {ALTERNATIVE_STYLESHEET} <!-- css files go here @@ -62,3 +62,8 @@ {BACKTRACE} +<a name="content"></a><h2>{CONTENT_TITLE}</h2> + +{SYSTEM_ERROR} +{FORM_ERROR} + http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/login.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/login.php diff -u bugtracker/template/generic/login.php:1.2 bugtracker/template/generic/login.php:1.3 --- bugtracker/template/generic/login.php:1.2 Thu Jul 10 20:56:41 2008 +++ bugtracker/template/generic/login.php Sat Jul 26 02:33:43 2008 @@ -57,5 +57,3 @@ } } -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/comment.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/template/generic/bug/comment.php diff -u bugtracker/template/generic/bug/comment.php:1.1 bugtracker/template/generic/bug/comment.php:1.2 --- bugtracker/template/generic/bug/comment.php:1.1 Fri Jul 25 22:00:30 2008 +++ bugtracker/template/generic/bug/comment.php Sat Jul 26 02:33:43 2008 @@ -30,7 +30,9 @@ $form_data['comment_text'] = $comment_text; $form_data['form_error'] = 'Invalid Handle and/or password'; - $content .= '<table>'; + trace('no handle or password'); + trace('calling teh bug display?? not'); + $content .= '<table id="bug">'; $comment->spawn_form(); $content .= '</table>'; } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.12&r2=1.13&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.12 bugtracker/template/generic/bug/index.php:1.13 --- bugtracker/template/generic/bug/index.php:1.12 Thu Jul 24 21:59:58 2008 +++ bugtracker/template/generic/bug/index.php Sat Jul 26 02:33:43 2008 @@ -22,7 +22,8 @@ } else { - $content .= '<h2>Invalid Bug Id or no Reproduce Code to download</h2>'; + $content .= '<h2>Bug Error</h2>'; + $template_data['system_error'] = 'Invalid Bug Id or no Reproduce Code to download'; } } @@ -34,10 +35,8 @@ if (!$db->total_rows) { - $content .= '<h2>Bug Display</h2>'; - $template_data['form_error'] = 'The ID you supplied is invalid, the bug does not exist.'; - $content .= '{FORM_ERROR}'; - $content = tpl_process($content,FALSE); + $content .= '<h2>Bug Error</h2>'; + $template_data['system_error'] = 'The ID you supplied is invalid, the bug does not exist.<br /><a href="/bug/" title="Bug Listings">Back to the Bug Listings</a>'; } else { @@ -187,7 +186,7 @@ while ($row = $db->fetch_row()) { $content .= '<tr>'; - $content .= '<td style="text-align: center;">' . $row['bug_id'] . '</td><td>' . $row['summary'] . '</td>'; + $content .= '<td style="text-align: center;"><a href="' . $row['bug_id'] . '" title="View Bug">#' . $row['bug_id'] . '</a></td><td>' . $row['summary'] . '</td>'; $content .= '<td>' . $row['reported_by'] . '</td>'; $content .= '<td>' . $status[$row['status']] . '</td>'; if ($row['status']) @@ -205,7 +204,8 @@ } else { - $content .= '<p>There does not appear to be any bugs, perhaps one needs to be <a href="/report/" title="Report a bug">reported</a>.</p><br />'; + $content .= '<h2>No Bugs</h2>'; + $template_data['system_error'] = 'There does not appear to be any bugs, perhaps one needs to be <a href="/report/" title="Report a bug">reported</a>.'; } } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/index.php?r1=1.5&r2=1.6&diff_format=u Index: bugtracker/template/generic/report/index.php diff -u bugtracker/template/generic/report/index.php:1.5 bugtracker/template/generic/report/index.php:1.6 --- bugtracker/template/generic/report/index.php:1.5 Thu Jul 17 09:48:05 2008 +++ bugtracker/template/generic/report/index.php Sat Jul 26 02:33:43 2008 @@ -4,6 +4,9 @@ require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php'); +$template_data['page_title'] .= ' - Reporting a bug'; +$template_data['content_title'] = 'Reporting a bug'; + $form_data['email'] = isset($form_data['email']) ? $form_data['email'] : ''; $form_data['php_version'] = isset($form_data['php_version']) ? $form_data['php_version'] : ''; $form_data['bug_type'] = isset($form_data['bug_type']) ? $form_data['bug_type'] : ''; @@ -29,7 +32,7 @@ { if ($iref == 'email') { - $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format or No MX Record' : ''; + $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format/MX Record' : ''; } else { @@ -45,10 +48,7 @@ $form_data['php_versions'] .= '<option value="na">Irrelevant</option><option value="early">Earlier? Upgrade First</option>'; -$template_data['page_title'] .= ': Reporting a Bug'; -$content .= ' -<h2>Reporting a Bug</h2> - +$content = ' <p> Before you report a bug, make sure to search for similar bugs using the form at the top of the page or our <a href="/search.php">advanced search page</a>. <br /><br /> @@ -74,7 +74,7 @@ {IF LOGGED_IN} You are Logged In {ELSE LOGGED_IN} - <label for="email">Your Email Address: {ERROR_EMAIL}</label> <input type="text" name="email" id="email" value="{EMAIL}" /> + <label for="email">Email Address: {ERROR_EMAIL} </label> <input type="text" name="email" id="email" value="{EMAIL}" /> <br /><br /> {ENDIF LOGGED_IN} <label for="php_version">PHP version: {ERROR_PHP_VERSION}</label> <select name="php_version" id="php_version"><option value="">--Please Select--</option>{PHP_VERSIONS}</select> @@ -84,9 +84,6 @@ <label for="os_version">Operating System: {ERROR_OS_VERSION}</label> <select name="os_version" id="os_version"><option value="">--Please Select--</option>{OS_VERSIONS}</select> <br /><br /> <label for="summary">Summary: AKA title{ERROR_SUMMARY}</label> -<!-- -<input type="text" name="summary" id="summary" value="{SUMMARY}" maxlength="30" onkeypress="update(\'summary_left\')" onblur="document.getElementById(\'summary_left\').style.display = \'none\'"/><div id="summary_left" style="float: right; margin-right: 5px; display: none;" >20 Characters Left</div> ---> <input type="text" name="summary" id="summary" value="{SUMMARY}" maxlength="30" onkeypress="update(this);" onkeyup="update(this)" onblur="endupdate(this)" onfocus="update(this)" /><div id="summary_left" style="float: right; margin-right: 5px; display: none;" >30 Characters Left</div> <br /><br /> {IF LOGGED_IN} @@ -97,9 +94,7 @@ <br /><br /> <!-- Here be captcha --> '; -//$content .= recaptcha_get_html($recaptcha_key,$form_data['captcha_error']); $content .= '<label for="captcha">Captcha: {ERROR_CAPTCHA}</label><div id="captcha">' . recaptcha_get_html($recaptcha_key,$form_data['recap_error']) . '</div><hr />'; -// <br /><br /> $content .= ' <!-- Here end captcha --> {ENDIF LOGGED_IN} @@ -117,26 +112,27 @@ <br /><br /> <label for="description">Description: {ERROR_DESCRIPTION}</label> <textarea rows="10" cols="50" name="description" id="description">{DESCRIPTION}</textarea> - <br />Please <strong>do not</strong> insert any huge text here. Keep the description as short as possible. If we want to get a strace, we will ask for it separately. -<hr /> + <br /><br />Please <strong>do not</strong> insert any huge text here. Keep the description as short as possible. If we want to get a strace, we will ask for it separately. +<div class="blocker"></div> + <br /> <label for="reproduce">Reproduce: {ERROR_REPRODUCE}</label> <textarea rows="10" cols="50" name="reproduce" id="reproduce">{REPRODUCE}</textarea> - <br />Please do not post more than 20 lines of source code. + <br /><br />Please do not post more than 20 lines of source code. <br />If the code is longer then 20 lines, provide an URL to the source code that will reproduce the bug. <br />You could use <a href="http://pastebin.com">Pastebin</a> -<hr /> +<div class="blocker"></div> + <br /> <label for="expected">Expected: {ERROR_EXPECTED}</label> <textarea rows="10" cols="50" name="expected" id="expected">{EXPECTED}</textarea> - <br />What do you expect to happen or see when you run the code above? -<hr /> + <br /><br />What do you expect to happen or see when you run the code above? +<div class="blocker"></div> + <br /> <label for="actual">Actual result: {ERROR_ACTUAL}</label> <textarea rows="10" cols="50" name="actual" id="actual">{ACTUAL}</textarea> - <br />This could be a <a href="/bugs-generating-backtrace.php">backtrace</a> for example. + <br /><br />This could be a <a href="/bugs-generating-backtrace.php">backtrace</a> for example. <br />Try to keep it as short as possible without leaving anything relevant out. -<hr /> +<div class="blocker"></div> <input type="submit" value="Send Bug Report" style="margin-right: 200px;" /> </form> '; -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/report.php?r1=1.4&r2=1.5&diff_format=u Index: bugtracker/template/generic/report/report.php diff -u bugtracker/template/generic/report/report.php:1.4 bugtracker/template/generic/report/report.php:1.5 --- bugtracker/template/generic/report/report.php:1.4 Wed Jul 16 12:13:36 2008 +++ bugtracker/template/generic/report/report.php Sat Jul 26 02:33:43 2008 @@ -1,17 +1,19 @@ <?php -$form_data['email'] = isset($_POST['email']) ? $_POST['email'] : ''; -$form_data['php_version'] = isset($_POST['php_version']) ? $_POST['php_version'] : ''; -$form_data['bug_type'] = isset($_POST['bug_type']) ? $_POST['bug_type'] : ''; -$form_data['os_version'] = isset($_POST['os_version']) ? $_POST['os_version'] : ''; -$form_data['summary'] = isset($_POST['summary']) ? $_POST['summary'] : ''; -$form_data['password'] = isset($_POST['password']) ? $_POST['password'] : ''; -$form_data['description'] = isset($_POST['description']) ? $_POST['description'] : ''; -$form_data['reproduce'] = isset($_POST['reproduce']) ? $_POST['reproduce'] : ''; -$form_data['expected'] = isset($_POST['expected']) ? $_POST['expected'] : ''; -$form_data['actual'] = isset($_POST['actual']) ? $_POST['actual'] : ''; -$_POST['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : ''; -$_POST['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : ''; +$form_data['email'] = loadvar('email'); +$form_data['php_version'] = loadvar('php_version'); +$form_data['bug_type'] = loadvar('bug_type'); +$form_data['os_version'] = loadvar('os_version'); +$form_data['summary'] = loadvar('summary'); +$form_data['password'] = loadvar('password'); +$form_data['description'] = loadvar('description'); +$form_data['reproduce'] = loadvar('reproduce'); +$form_data['expected'] = loadvar('expected'); +$form_data['actual'] = loadvar('actual'); +//$_POST['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : ''; +//$_POST['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : ''; +$form_data['recaptcha_challenge_field'] = loadvar('recaptcha_challenge_field'); +$form_data['recaptcha_response_field'] = loadvar('recaptcha_response_field'); //lazy mans method foreach($form_data as $ref => $data) @@ -46,7 +48,8 @@ if (!$user->logged_in) { //check captcha require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php'); - $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']); + $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$form_data['recaptcha_challenge_field'],$form_data['recaptcha_response_field']); +// $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']); if ($recap_resp->is_valid) { //all is well @@ -70,15 +73,23 @@ } foreach ($form_data['invalid'] as $ref => $invalid) { - if ($invalid) + if ($invalid == TRUE) { $errors = TRUE; } } +/* +echo '<h1>' . $errors .'</h1>'; +print_r($form_data['error']); +echo '<br />'; +print_r($form_data['invalid']); +*/ + if ($errors) { - include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php'); + $content .= '<h2>Errors</h2>'; + include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php'); } else { @@ -90,7 +101,7 @@ $bug_data = $form_data; unset($bug_data['invalid'],$bug_data['error']); - unset($bug_data['actual'],$bug_data['expected'],$bug_data['reproduce'],$bug_data['description']); + unset($bug_data['actual'],$bug_data['expected'],$bug_data['reproduce'],$bug_data['description'],$bug_data['recaptcha_challenge_field'],$bug_data['recaptcha_response_field']); $bug->report(); //comment time @@ -110,23 +121,12 @@ $meta_refresh['url'] = '/bug/' . $bug->bug_id; $meta_refresh['time'] = 10; + $content .= '<h2>Bug Reported</h2>'; $content .= '<div id="success">'; $content .= '<p>Your Bug has been added successfully.</p>'; $content .= '<p>You should recieve an email confirming this.</p>'; $content .= '<p>You will be redirected to your bug in ' . $meta_refresh['time'] . ' seconds or you can <a href="' . $meta_refresh['url'] .'">click here to go there</a>.</p>'; $content .= '</div>'; -// $content .= '<p>This be where some db-ness happens</p>'; } -/* - $content .= '<table>'; - $content .= '<tr><td>Check auth</td><td>Based on if user logged in so working ok</td></tr>'; - $content .= '<tr><td>If not loggedin create account</td><td>Temp account ok</td></tr>'; - $content .= '<tr><td>Add Bug</td><td>Working</td></tr>'; - $content .= '<tr><td>Other field processing (comment)</td></tr>'; - $content .= '<tr><td>Send Email to user with bug_id, est. queue, +/- password</td><td>email systems operable, via smtp</td></tr>'; - $content .= '<tr><td>Send email to 'lists'</td></tr>'; - $content .= '</table>'; -*/ - $content = tpl_process($content,FALSE); http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/convert.php?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/template/generic/user/convert.php diff -u bugtracker/template/generic/user/convert.php:1.3 bugtracker/template/generic/user/convert.php:1.4 --- bugtracker/template/generic/user/convert.php:1.3 Fri Jul 25 22:00:30 2008 +++ bugtracker/template/generic/user/convert.php Sat Jul 26 02:33:44 2008 @@ -93,7 +93,7 @@ if ($user->fetch_handle($user_data['handle'])) { //already reigstered - $template_data['form_error'] = '<div id="error">The handle you have selected is already in use, please pick another</div>'; + $template_data['form_error'] = 'The handle you have selected is already in use, please pick another'; $user->logged_in_temp = TRUE; $user->handle = $user_data['temp_handle']; } @@ -116,11 +116,11 @@ { if (!$user_data['email']) { - $template_data['form_error'] = '<div id="error">For some reason you email address is missing</div>'; + $template_data['form_error'] = 'For some reason you email address is missing'; } else { - $template_data['form_error'] = '<div id="error">You must supply a handle, password</div>'; + $template_data['form_error'] = 'You must supply a handle, password'; } $user->logged_in_temp = TRUE; $user->handle = $user_data['temp_handle']; @@ -157,7 +157,6 @@ $temp_user = $db->fetch_row(); $content .= ' -{FORM_ERROR} <label for="handle">Handle:</label><input type="text" name="handle" id="handle" value="' . $temp_handle . '" /> <br /><br /> <label for="password">Password:</label><input type="text" name="password" id="password" /> @@ -199,7 +198,6 @@ { $content .= '<p>However, you have specified an Invalide Handle</p>'; } - $content = tpl_process($content,FALSE); } else if ($redirect_convert) { http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/login.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/template/generic/user/login.php diff -u bugtracker/template/generic/user/login.php:1.1 bugtracker/template/generic/user/login.php:1.2 --- bugtracker/template/generic/user/login.php:1.1 Wed Jul 16 04:19:21 2008 +++ bugtracker/template/generic/user/login.php Sat Jul 26 02:33:44 2008 @@ -57,5 +57,3 @@ } } -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/php/home.html?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/php/home.html diff -u bugtracker/template/php/home.html:1.2 bugtracker/template/php/home.html:1.3 --- bugtracker/template/php/home.html:1.2 Wed Jul 16 12:13:36 2008 +++ bugtracker/template/php/home.html Sat Jul 26 02:33:44 2008 @@ -5,7 +5,7 @@ <p>Once you've double-checked that the bug you've found hasn't already been reported, and that you have collected all the information you need to file an excellent bug report, you can do so on our <a href="/report/" title="Report a Bug">bug reporting page</a>.</p> <h2>Search the Bug System</h2> -<p>You can view the current <a href="/bug/" title="View Bugs">bug listings</a> +<p>You can view the current <a href="/bug/" title="View Bugs">bug listings</a></p> <div id="error"> Current Test: http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/screen.php?view=markup&rev=1.1 Index: bugtracker/htdocs/elements/screen.php +++ bugtracker/htdocs/elements/screen.php <?php header('Content-Type: text/css'); $file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . 'elements/screen.css'); $now = date('H',time()); if ( ($now <= 9 || $now >= 18) && ($_SERVER['REMOTE_ADDR'] == '81.107.31.128') ) { $file = str_replace('#FFFFFF','white',$file); $file = str_replace('#000000','#FFFFFF',$file); $file = str_replace('white','#000000',$file); } echo $file;
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/screen.css?r1=1.7&r2=1.8&diff_format=u Index: bugtracker/htdocs/elements/screen.css diff -u bugtracker/htdocs/elements/screen.css:1.7 bugtracker/htdocs/elements/screen.css:1.8 --- bugtracker/htdocs/elements/screen.css:1.7 Fri Jul 18 08:31:38 2008 +++ bugtracker/htdocs/elements/screen.css Sat Jul 26 02:33:43 2008 @@ -4,8 +4,13 @@ font-family: verdana, arial, helvetica, sans-serif; font-size: 95%; } +body { + background: #FFFFFF; + color: #000000; +} p, a, li, body { font-family: verdana, arial, helvetica, sans-serif; + color: #000000; } img { border: 0px; @@ -102,6 +107,10 @@ float: left; font-weight: 700; cursor: pointer; +/* + display: block; + clear: both; + width: 100%;/* shiee hack */ } .slim { /*width: 550px;*/ @@ -207,3 +216,7 @@ color: #006600; } +.blocker { + clear: both; + display: block; +} http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.9&r2=1.10&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.9 bugtracker/htdocs/index/index.php:1.10 --- bugtracker/htdocs/index/index.php:1.9 Fri Jul 25 22:00:30 2008 +++ bugtracker/htdocs/index/index.php Sat Jul 26 02:33:43 2008 @@ -72,13 +72,14 @@ $form_data = array();//array for holding the data in forms $template_data = array_merge($template_data, array( 'page_title' => 'PHP Bugs', + 'content_title' => '', 'year' => date('Y',time()), 'url' => ($_REQUEST['page']) ? $_REQUEST['page'] : 'home', 'alternative_stylesheet' => '', 'login' => '<li><a href="/account-request.php">Register</a></li>' . "\n" . '<li><a href="/login.php?redirect=">Login</a></li>', 'login' => "\n" . '<li><a href="/login/">Login</a></li>', 'favicon' => '', - 'form_error' => '', + 'system_error' => '', ) ); //$template_data['cvs_version'] = substr( $php_version[sizeof($php_version)] ,0,4); @@ -104,14 +105,6 @@ $content = ''; -/* -$content .= '<textarea style="width: 95%; height: 50px; border: 1px solid #000;" rows="4" cols="50">debug: ' . "\n"; -$content .= $bugtracker . ' - ' .$template; -$content .= "\n"; -$content .= 'page: ' . $_REQUEST['page']; -$content .= '</textarea>'; -*/ - //next job is to determine which file we need to load template/content wise $page = ($_REQUEST['page']) ? $_REQUEST['page'] : 'home'; if (substr($page,-1,1) == '/') @@ -120,9 +113,12 @@ //lop off the / at the end } +//switched to ALWAYS tpl_process + if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '.html')) { - $content .= tpl_process($template . '/' . $page . '.html'); +// $content .= tpl_process($template . '/' . $page . '.html'); + $content .= $template . '/' . $page . '.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '.php')) { @@ -131,7 +127,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '/index.html')) { - $content .= tpl_process($template . '/' . $page . '/index.html'); +// $content .= tpl_process($template . '/' . $page . '/index.html'); + $content .= $template . '/' . $page . '/index.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/' . $template . '/' . $page . '/index.php')) { @@ -140,7 +137,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '.html')) { - $content .= tpl_process('generic/' . $page . '.html'); +// $content .= tpl_process('generic/' . $page . '.html'); + $content .= 'generic/' . $page . '.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '.php')) { @@ -149,7 +147,8 @@ else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '/index.html.')) { - $content .= tpl_process('generic/' . $page . '/index.html'); +// $content .= tpl_process('generic/' . $page . '/index.html'); + $content .= 'generic/' . $page . '/index.html'; } else if (is_file($_SERVER['DOCUMENT_ROOT'] . '../template/generic/' . $page . '/index.php')) { @@ -160,23 +159,21 @@ { header("HTTP/1.0 404 Not Found"); $page = '404'; - $template_data['page_title'] .= ' | 404 File Not Found'; - $content .= tpl_process('/generic/404.html'); +// $template_data['page_title'] .= ' | 404 File Not Found'; + $content .= '<h2>404 File Not Found</h2>'; +// $content .= tpl_process('/generic/404.html'); +// $content .= '/generic/404.html'; + $template_data['system_error'] = 'I am sorry the file (<strong>{URL}</strong>) you have requested could not be found'; } $template_data['queries'] = $db->query_count; -$content = tpl_process('generic/header.html', TRUE, $jsscripts, $meta_refresh) . $content . '<br />' . tpl_process('generic/footer.html'); +$content = create_title($content); +$content = tpl_process('generic/header.html', $jsscripts, $meta_refresh) . tpl_process($content) . '<br />' . tpl_process('generic/footer.html'); +//lets cheat in the world of table fixing for display $content = str_replace('<table','<table cellspacing="0" cellpadding="0"',$content); -/* -$content .= '<textarea style="width: 100%; height: 250px; border: 1px solid #000;">debug: ' . "\n"; -foreach ($_SERVER as $ref => $data) - $content .= $ref . ' = ' . $data . "\n"; -$content .= '</textarea>'; -*/ - echo $content; //penultimate task @@ -191,6 +188,7 @@ $db->close(); unset($db); +// COMMENCE TRACE echo '<textarea style="width: 95%; height: 200px; border: 1px solid #000;" rows="10" cols="50">debug: ' . "\n"; echo ' @@ -214,6 +212,24 @@ } echo ' +form_data +'; +//print_r($template_data); +foreach ($form_data as $ref => $data) +{ + if (is_array($data)) + { + foreach ($data as $aref => $adata) + echo $aref . ' - ' . htmlentities($adata) . "\n"; + } + else + { + echo $ref . ' - ' . htmlentities($data) . "\n"; + } +} + + +echo ' server '; //print_r($template_data); http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.7&r2=1.8&diff_format=u Index: bugtracker/includes/comment.php diff -u bugtracker/includes/comment.php:1.7 bugtracker/includes/comment.php:1.8 --- bugtracker/includes/comment.php:1.7 Fri Jul 25 22:00:30 2008 +++ bugtracker/includes/comment.php Sat Jul 26 02:33:43 2008 @@ -44,6 +44,7 @@ { //spawn me a bug trace('bounce from comment form, need to spawn a bug display'); + $bug->bug_id = $form_data['bug_id']; } else if (!isset($bug->bug_id)) { @@ -60,6 +61,7 @@ $form_content = ' <tr> <td style="text-align: center; border-top: 1px solid #000;"> Add Comment</td> <td colspan="3" style="border-top: 1px solid #000;"></td> </tr> <tr> <td></td> <td colspan="3"> +{FORM_ERROR} <form action="/bug/comment/" method="post" name="commentform" id="commentform" > <input type="hidden" name="bug_id" value="' . $bug->bug_id . ' " /> '; @@ -80,6 +82,7 @@ $form_content .= ' <label for="comment_text">Comment</label> <textarea name="comment_text" id="comment_text" rows="7" cols="55" >{COMMENT_TEXT}</textarea> + <div class="blocker" ></div> <input type="button" value="Submit Comment" onclick="document.getElementById(\'commentform\').submit()" /> </form> </td></tr> http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.9&r2=1.10&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.9 bugtracker/includes/functions.php:1.10 --- bugtracker/includes/functions.php:1.9 Fri Jul 25 22:00:30 2008 +++ bugtracker/includes/functions.php Sat Jul 26 02:33:43 2008 @@ -10,20 +10,62 @@ return $newstring; } -function tpl_process($file,$text = TRUE,$jsscripts = FALSE,$meta_refresh = FALSE) { +function create_title($html) { + //function to handle backtrace content_title system&form_error page_title + global $template_data; + //set some stuff + //all files start <h2> + $data = explode('</h2>',$html); + if (!$template_data['content_title']) + { + $template_data['content_title'] = str_replace('<h2>','',$data[0]); + } + if ($template_data['page_title'] == 'PHP Bugs') + { + $template_data['page_title'] .= ' - ' . str_replace('<h2>','',$data[0]); + } + //lop off the h2 title from the start of the html + $html = substr($html,4 + 5 + strlen($template_data['content_title']) ); + + return $html; +} + +//function tpl_process($file, $text, $jsscripts = FALSE, $meta_refresh = FALSE) { +function tpl_process($file, $jsscripts = FALSE, $meta_refresh = FALSE) { + $ext = explode(".",$file); + //base it on the file extension + trace('I am tpl_processing '); + global $template_data,$form_data; - if ($text) +// if ($text) + $ext = isset($ext[1]) ? $ext[1] : ''; + if ($ext == 'html') { + trace('file_get_contents ' . $file); $html = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '../template/' . $file); } else { + trace('file is html'); $html = $file; } + +//check for key stuff +if ($template_data['page_title'] == 'PHP Bugs') + trace('No page_title'); +if (empty($template_data['content_title'])) + trace('No Content title'); +if (!empty($template_data['system_error'])) + trace('system error'); +if (!empty($template_data['form_error'])) + trace('form error where there should be nonw'); + foreach ($template_data as $ref => $replace) { - if ($ref == 'form_error' && $replace) + trace('tpl ' . $ref); + if ($ref == 'system_error' && $replace) { + trace('system error detected ' . $replace); if (!strpos('class="error"',$replace)) { $replace = '<div id="error">' . $replace . '</div>'; @@ -33,17 +75,19 @@ } foreach ($form_data as $ref => $replace) { + trace('tpl ' . $ref); if (is_array($replace)) { foreach ($replace as $aref => $areplace) { //2nd layer stuff will always be error! + //such as input field specific errors $html = str_replace('{' . strtoupper($ref) . '_' . strtoupper($aref) . '}','<span class="error">' . $areplace . ' </span>',$html); } } else { - if ($ref == 'form_error') + if ($ref == 'form_error' && !empty($replace)) { //check for div if (!strpos('class="error"',$replace)) @@ -180,6 +224,7 @@ } function trace($message) { +return; global $trace; $trace .= $message . "\n"; return; http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/header.html?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/template/generic/header.html diff -u bugtracker/template/generic/header.html:1.3 bugtracker/template/generic/header.html:1.4 --- bugtracker/template/generic/header.html:1.3 Thu Jul 24 21:59:58 2008 +++ bugtracker/template/generic/header.html Sat Jul 26 02:33:43 2008 @@ -17,7 +17,7 @@ <link rel="stylesheet" type="text/css" href="/elements/reset.css" media="screen" /> <link rel="stylesheet" type="text/css" href="/style.css" media="screen" /> -<link rel="stylesheet" type="text/css" href="/elements/screen.css" media="screen" /> +<link rel="stylesheet" type="text/css" href="/elements/screen.php" media="screen" /> {ALTERNATIVE_STYLESHEET} <!-- css files go here @@ -62,3 +62,8 @@ {BACKTRACE} +<a name="content"></a><h2>{CONTENT_TITLE}</h2> + +{SYSTEM_ERROR} +{FORM_ERROR} + http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/login.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/login.php diff -u bugtracker/template/generic/login.php:1.2 bugtracker/template/generic/login.php:1.3 --- bugtracker/template/generic/login.php:1.2 Thu Jul 10 20:56:41 2008 +++ bugtracker/template/generic/login.php Sat Jul 26 02:33:43 2008 @@ -57,5 +57,3 @@ } } -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/comment.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/template/generic/bug/comment.php diff -u bugtracker/template/generic/bug/comment.php:1.1 bugtracker/template/generic/bug/comment.php:1.2 --- bugtracker/template/generic/bug/comment.php:1.1 Fri Jul 25 22:00:30 2008 +++ bugtracker/template/generic/bug/comment.php Sat Jul 26 02:33:43 2008 @@ -30,7 +30,9 @@ $form_data['comment_text'] = $comment_text; $form_data['form_error'] = 'Invalid Handle and/or password'; - $content .= '<table>'; + trace('no handle or password'); + trace('calling teh bug display?? not'); + $content .= '<table id="bug">'; $comment->spawn_form(); $content .= '</table>'; } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.12&r2=1.13&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.12 bugtracker/template/generic/bug/index.php:1.13 --- bugtracker/template/generic/bug/index.php:1.12 Thu Jul 24 21:59:58 2008 +++ bugtracker/template/generic/bug/index.php Sat Jul 26 02:33:43 2008 @@ -22,7 +22,8 @@ } else { - $content .= '<h2>Invalid Bug Id or no Reproduce Code to download</h2>'; + $content .= '<h2>Bug Error</h2>'; + $template_data['system_error'] = 'Invalid Bug Id or no Reproduce Code to download'; } } @@ -34,10 +35,8 @@ if (!$db->total_rows) { - $content .= '<h2>Bug Display</h2>'; - $template_data['form_error'] = 'The ID you supplied is invalid, the bug does not exist.'; - $content .= '{FORM_ERROR}'; - $content = tpl_process($content,FALSE); + $content .= '<h2>Bug Error</h2>'; + $template_data['system_error'] = 'The ID you supplied is invalid, the bug does not exist.<br /><a href="/bug/" title="Bug Listings">Back to the Bug Listings</a>'; } else { @@ -187,7 +186,7 @@ while ($row = $db->fetch_row()) { $content .= '<tr>'; - $content .= '<td style="text-align: center;">' . $row['bug_id'] . '</td><td>' . $row['summary'] . '</td>'; + $content .= '<td style="text-align: center;"><a href="' . $row['bug_id'] . '" title="View Bug">#' . $row['bug_id'] . '</a></td><td>' . $row['summary'] . '</td>'; $content .= '<td>' . $row['reported_by'] . '</td>'; $content .= '<td>' . $status[$row['status']] . '</td>'; if ($row['status']) @@ -205,7 +204,8 @@ } else { - $content .= '<p>There does not appear to be any bugs, perhaps one needs to be <a href="/report/" title="Report a bug">reported</a>.</p><br />'; + $content .= '<h2>No Bugs</h2>'; + $template_data['system_error'] = 'There does not appear to be any bugs, perhaps one needs to be <a href="/report/" title="Report a bug">reported</a>.'; } } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/index.php?r1=1.5&r2=1.6&diff_format=u Index: bugtracker/template/generic/report/index.php diff -u bugtracker/template/generic/report/index.php:1.5 bugtracker/template/generic/report/index.php:1.6 --- bugtracker/template/generic/report/index.php:1.5 Thu Jul 17 09:48:05 2008 +++ bugtracker/template/generic/report/index.php Sat Jul 26 02:33:43 2008 @@ -4,6 +4,9 @@ require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php'); +$template_data['page_title'] .= ' - Reporting a bug'; +$template_data['content_title'] = 'Reporting a bug'; + $form_data['email'] = isset($form_data['email']) ? $form_data['email'] : ''; $form_data['php_version'] = isset($form_data['php_version']) ? $form_data['php_version'] : ''; $form_data['bug_type'] = isset($form_data['bug_type']) ? $form_data['bug_type'] : ''; @@ -29,7 +32,7 @@ { if ($iref == 'email') { - $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format or No MX Record' : ''; + $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format/MX Record' : ''; } else { @@ -45,10 +48,7 @@ $form_data['php_versions'] .= '<option value="na">Irrelevant</option><option value="early">Earlier? Upgrade First</option>'; -$template_data['page_title'] .= ': Reporting a Bug'; -$content .= ' -<h2>Reporting a Bug</h2> - +$content = ' <p> Before you report a bug, make sure to search for similar bugs using the form at the top of the page or our <a href="/search.php">advanced search page</a>. <br /><br /> @@ -74,7 +74,7 @@ {IF LOGGED_IN} You are Logged In {ELSE LOGGED_IN} - <label for="email">Your Email Address: {ERROR_EMAIL}</label> <input type="text" name="email" id="email" value="{EMAIL}" /> + <label for="email">Email Address: {ERROR_EMAIL} </label> <input type="text" name="email" id="email" value="{EMAIL}" /> <br /><br /> {ENDIF LOGGED_IN} <label for="php_version">PHP version: {ERROR_PHP_VERSION}</label> <select name="php_version" id="php_version"><option value="">--Please Select--</option>{PHP_VERSIONS}</select> @@ -84,9 +84,6 @@ <label for="os_version">Operating System: {ERROR_OS_VERSION}</label> <select name="os_version" id="os_version"><option value="">--Please Select--</option>{OS_VERSIONS}</select> <br /><br /> <label for="summary">Summary: AKA title{ERROR_SUMMARY}</label> -<!-- -<input type="text" name="summary" id="summary" value="{SUMMARY}" maxlength="30" onkeypress="update(\'summary_left\')" onblur="document.getElementById(\'summary_left\').style.display = \'none\'"/><div id="summary_left" style="float: right; margin-right: 5px; display: none;" >20 Characters Left</div> ---> <input type="text" name="summary" id="summary" value="{SUMMARY}" maxlength="30" onkeypress="update(this);" onkeyup="update(this)" onblur="endupdate(this)" onfocus="update(this)" /><div id="summary_left" style="float: right; margin-right: 5px; display: none;" >30 Characters Left</div> <br /><br /> {IF LOGGED_IN} @@ -97,9 +94,7 @@ <br /><br /> <!-- Here be captcha --> '; -//$content .= recaptcha_get_html($recaptcha_key,$form_data['captcha_error']); $content .= '<label for="captcha">Captcha: {ERROR_CAPTCHA}</label><div id="captcha">' . recaptcha_get_html($recaptcha_key,$form_data['recap_error']) . '</div><hr />'; -// <br /><br /> $content .= ' <!-- Here end captcha --> {ENDIF LOGGED_IN} @@ -117,26 +112,27 @@ <br /><br /> <label for="description">Description: {ERROR_DESCRIPTION}</label> <textarea rows="10" cols="50" name="description" id="description">{DESCRIPTION}</textarea> - <br />Please <strong>do not</strong> insert any huge text here. Keep the description as short as possible. If we want to get a strace, we will ask for it separately. -<hr /> + <br /><br />Please <strong>do not</strong> insert any huge text here. Keep the description as short as possible. If we want to get a strace, we will ask for it separately. +<div class="blocker"></div> + <br /> <label for="reproduce">Reproduce: {ERROR_REPRODUCE}</label> <textarea rows="10" cols="50" name="reproduce" id="reproduce">{REPRODUCE}</textarea> - <br />Please do not post more than 20 lines of source code. + <br /><br />Please do not post more than 20 lines of source code. <br />If the code is longer then 20 lines, provide an URL to the source code that will reproduce the bug. <br />You could use <a href="http://pastebin.com">Pastebin</a> -<hr /> +<div class="blocker"></div> + <br /> <label for="expected">Expected: {ERROR_EXPECTED}</label> <textarea rows="10" cols="50" name="expected" id="expected">{EXPECTED}</textarea> - <br />What do you expect to happen or see when you run the code above? -<hr /> + <br /><br />What do you expect to happen or see when you run the code above? +<div class="blocker"></div> + <br /> <label for="actual">Actual result: {ERROR_ACTUAL}</label> <textarea rows="10" cols="50" name="actual" id="actual">{ACTUAL}</textarea> - <br />This could be a <a href="/bugs-generating-backtrace.php">backtrace</a> for example. + <br /><br />This could be a <a href="/bugs-generating-backtrace.php">backtrace</a> for example. <br />Try to keep it as short as possible without leaving anything relevant out. -<hr /> +<div class="blocker"></div> <input type="submit" value="Send Bug Report" style="margin-right: 200px;" /> </form> '; -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/report.php?r1=1.4&r2=1.5&diff_format=u Index: bugtracker/template/generic/report/report.php diff -u bugtracker/template/generic/report/report.php:1.4 bugtracker/template/generic/report/report.php:1.5 --- bugtracker/template/generic/report/report.php:1.4 Wed Jul 16 12:13:36 2008 +++ bugtracker/template/generic/report/report.php Sat Jul 26 02:33:43 2008 @@ -1,17 +1,19 @@ <?php -$form_data['email'] = isset($_POST['email']) ? $_POST['email'] : ''; -$form_data['php_version'] = isset($_POST['php_version']) ? $_POST['php_version'] : ''; -$form_data['bug_type'] = isset($_POST['bug_type']) ? $_POST['bug_type'] : ''; -$form_data['os_version'] = isset($_POST['os_version']) ? $_POST['os_version'] : ''; -$form_data['summary'] = isset($_POST['summary']) ? $_POST['summary'] : ''; -$form_data['password'] = isset($_POST['password']) ? $_POST['password'] : ''; -$form_data['description'] = isset($_POST['description']) ? $_POST['description'] : ''; -$form_data['reproduce'] = isset($_POST['reproduce']) ? $_POST['reproduce'] : ''; -$form_data['expected'] = isset($_POST['expected']) ? $_POST['expected'] : ''; -$form_data['actual'] = isset($_POST['actual']) ? $_POST['actual'] : ''; -$_POST['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : ''; -$_POST['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : ''; +$form_data['email'] = loadvar('email'); +$form_data['php_version'] = loadvar('php_version'); +$form_data['bug_type'] = loadvar('bug_type'); +$form_data['os_version'] = loadvar('os_version'); +$form_data['summary'] = loadvar('summary'); +$form_data['password'] = loadvar('password'); +$form_data['description'] = loadvar('description'); +$form_data['reproduce'] = loadvar('reproduce'); +$form_data['expected'] = loadvar('expected'); +$form_data['actual'] = loadvar('actual'); +//$_POST['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : ''; +//$_POST['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : ''; +$form_data['recaptcha_challenge_field'] = loadvar('recaptcha_challenge_field'); +$form_data['recaptcha_response_field'] = loadvar('recaptcha_response_field'); //lazy mans method foreach($form_data as $ref => $data) @@ -46,7 +48,8 @@ if (!$user->logged_in) { //check captcha require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php'); - $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']); + $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$form_data['recaptcha_challenge_field'],$form_data['recaptcha_response_field']); +// $recap_resp = recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']); if ($recap_resp->is_valid) { //all is well @@ -70,15 +73,23 @@ } foreach ($form_data['invalid'] as $ref => $invalid) { - if ($invalid) + if ($invalid == TRUE) { $errors = TRUE; } } +/* +echo '<h1>' . $errors .'</h1>'; +print_r($form_data['error']); +echo '<br />'; +print_r($form_data['invalid']); +*/ + if ($errors) { - include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php'); + $content .= '<h2>Errors</h2>'; + include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php'); } else { @@ -90,7 +101,7 @@ $bug_data = $form_data; unset($bug_data['invalid'],$bug_data['error']); - unset($bug_data['actual'],$bug_data['expected'],$bug_data['reproduce'],$bug_data['description']); + unset($bug_data['actual'],$bug_data['expected'],$bug_data['reproduce'],$bug_data['description'],$bug_data['recaptcha_challenge_field'],$bug_data['recaptcha_response_field']); $bug->report(); //comment time @@ -110,23 +121,12 @@ $meta_refresh['url'] = '/bug/' . $bug->bug_id; $meta_refresh['time'] = 10; + $content .= '<h2>Bug Reported</h2>'; $content .= '<div id="success">'; $content .= '<p>Your Bug has been added successfully.</p>'; $content .= '<p>You should recieve an email confirming this.</p>'; $content .= '<p>You will be redirected to your bug in ' . $meta_refresh['time'] . ' seconds or you can <a href="' . $meta_refresh['url'] .'">click here to go there</a>.</p>'; $content .= '</div>'; -// $content .= '<p>This be where some db-ness happens</p>'; } -/* - $content .= '<table>'; - $content .= '<tr><td>Check auth</td><td>Based on if user logged in so working ok</td></tr>'; - $content .= '<tr><td>If not loggedin create account</td><td>Temp account ok</td></tr>'; - $content .= '<tr><td>Add Bug</td><td>Working</td></tr>'; - $content .= '<tr><td>Other field processing (comment)</td></tr>'; - $content .= '<tr><td>Send Email to user with bug_id, est. queue, +/- password</td><td>email systems operable, via smtp</td></tr>'; - $content .= '<tr><td>Send email to 'lists'</td></tr>'; - $content .= '</table>'; -*/ - $content = tpl_process($content,FALSE); http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/convert.php?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/template/generic/user/convert.php diff -u bugtracker/template/generic/user/convert.php:1.3 bugtracker/template/generic/user/convert.php:1.4 --- bugtracker/template/generic/user/convert.php:1.3 Fri Jul 25 22:00:30 2008 +++ bugtracker/template/generic/user/convert.php Sat Jul 26 02:33:44 2008 @@ -93,7 +93,7 @@ if ($user->fetch_handle($user_data['handle'])) { //already reigstered - $template_data['form_error'] = '<div id="error">The handle you have selected is already in use, please pick another</div>'; + $template_data['form_error'] = 'The handle you have selected is already in use, please pick another'; $user->logged_in_temp = TRUE; $user->handle = $user_data['temp_handle']; } @@ -116,11 +116,11 @@ { if (!$user_data['email']) { - $template_data['form_error'] = '<div id="error">For some reason you email address is missing</div>'; + $template_data['form_error'] = 'For some reason you email address is missing'; } else { - $template_data['form_error'] = '<div id="error">You must supply a handle, password</div>'; + $template_data['form_error'] = 'You must supply a handle, password'; } $user->logged_in_temp = TRUE; $user->handle = $user_data['temp_handle']; @@ -157,7 +157,6 @@ $temp_user = $db->fetch_row(); $content .= ' -{FORM_ERROR} <label for="handle">Handle:</label><input type="text" name="handle" id="handle" value="' . $temp_handle . '" /> <br /><br /> <label for="password">Password:</label><input type="text" name="password" id="password" /> @@ -199,7 +198,6 @@ { $content .= '<p>However, you have specified an Invalide Handle</p>'; } - $content = tpl_process($content,FALSE); } else if ($redirect_convert) { http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/login.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/template/generic/user/login.php diff -u bugtracker/template/generic/user/login.php:1.1 bugtracker/template/generic/user/login.php:1.2 --- bugtracker/template/generic/user/login.php:1.1 Wed Jul 16 04:19:21 2008 +++ bugtracker/template/generic/user/login.php Sat Jul 26 02:33:44 2008 @@ -57,5 +57,3 @@ } } -$content = tpl_process($content,FALSE); - http://cvs.php.net/viewvc.cgi/bugtracker/template/php/home.html?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/php/home.html diff -u bugtracker/template/php/home.html:1.2 bugtracker/template/php/home.html:1.3 --- bugtracker/template/php/home.html:1.2 Wed Jul 16 12:13:36 2008 +++ bugtracker/template/php/home.html Sat Jul 26 02:33:44 2008 @@ -5,7 +5,7 @@ <p>Once you've double-checked that the bug you've found hasn't already been reported, and that you have collected all the information you need to file an excellent bug report, you can do so on our <a href="/report/" title="Report a Bug">bug reporting page</a>.</p> <h2>Search the Bug System</h2> -<p>You can view the current <a href="/bug/" title="View Bugs">bug listings</a> +<p>You can view the current <a href="/bug/" title="View Bugs">bug listings</a></p> <div id="error"> Current Test: http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/screen.php?view=markup&rev=1.1 Index: bugtracker/htdocs/elements/screen.php +++ bugtracker/htdocs/elements/screen.php <?php header('Content-Type: text/css'); $file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . 'elements/screen.css'); $now = date('H',time()); if ( ($now <= 9 || $now >= 18) && ($_SERVER['REMOTE_ADDR'] == '81.107.31.128') ) { $file = str_replace('#FFFFFF','white',$file); $file = str_replace('#000000','#FFFFFF',$file); $file = str_replace('white','#000000',$file); } echo $file;