cvs: bugtracker /htdocs .htaccess /htdocs/index index.php /includes comment.php functions.php /template/generic/bug comment.php
/template/generic/user convert.php

From: Date: Fri, 25 Jul 2008 22:00:30 +0000
Subject: cvs: bugtracker /htdocs .htaccess /htdocs/index index.php /includes comment.php functions.php /template/generic/bug comment.php
/template/generic/user convert.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2206@lists.php.net to get a copy of this message
bcarlyon Fri Jul 25 22:00:30 2008 UTC Added files: /bugtracker/template/generic/bug comment.php Modified files: /bugtracker/htdocs .htaccess /bugtracker/htdocs/index index.php /bugtracker/includes comment.php functions.php /bugtracker/template/generic/user convert.php Log: Created the trace function, instead of $trace .= Prelim work comment add (into code from planning) http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/.htaccess?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/htdocs/.htaccess diff -u bugtracker/htdocs/.htaccess:1.3 bugtracker/htdocs/.htaccess:1.4 --- bugtracker/htdocs/.htaccess:1.3 Wed Jul 16 12:13:36 2008 +++ bugtracker/htdocs/.htaccess Fri Jul 25 22:00:30 2008 @@ -6,7 +6,8 @@ RewriteRule test.html test.html [L] #smaller rewrites, higher priority you know -RewriteRule bug/(.*)$ index/index.php?page=bug&bug_id=$1&%{QUERY_STRING} [L,PT] +RewriteCond %{REQUEST_URI} !=/bug/comment/ + RewriteRule bug/(.*)$ index/index.php?page=bug&bug_id=$1&%{QUERY_STRING} [L,PT] #Some shuntage RedirectPermanent /gifs http://bugs.php.net/gifs http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.8&r2=1.9&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.8 bugtracker/htdocs/index/index.php:1.9 --- bugtracker/htdocs/index/index.php:1.8 Thu Jul 17 09:48:05 2008 +++ bugtracker/htdocs/index/index.php Fri Jul 25 22:00:30 2008 @@ -210,7 +210,16 @@ //print_r($template_data); foreach ($template_data as $ref => $data) { - echo $ref . ' - ' . htmlentities($data) . "\n"; +echo $ref . ' - ' . htmlentities($data) . "\n"; +} + +echo ' +server +'; +//print_r($template_data); +foreach ($_SERVER as $ref => $data) +{ +echo $ref . ' - ' . htmlentities($data) . "\n"; } echo '</textarea>'; http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.6&r2=1.7&diff_format=u Index: bugtracker/includes/comment.php diff -u bugtracker/includes/comment.php:1.6 bugtracker/includes/comment.php:1.7 --- bugtracker/includes/comment.php:1.6 Fri Jul 18 08:31:39 2008 +++ bugtracker/includes/comment.php Fri Jul 25 22:00:30 2008 @@ -34,16 +34,33 @@ global $user,$content,$bug,$form_data; //generate a comment form - //generate template + //generate template, but reload if needed $form_data['bug_id'] = isset($form_data['bug_id']) ? $form_data['bug_id'] : ''; $form_data['comment_text'] = isset($form_data['comment_text']) ? $form_data['comment_text'] : ''; $form_data['comment_type'] = isset($form_data['comment_type']) ? $form_data['comment_type'] : ''; $form_data['handle'] = isset($form_data['handle']) ? $form_data['handle'] : ''; + if (!isset($bug->bug_id) && $form_data['bug_id']) + { + //spawn me a bug + trace('bounce from comment form, need to spawn a bug display'); + } + else if (!isset($bug->bug_id)) + { + trace('buggered'); + //arg!!! + echo 'fooked'; + exit; + } + else + { + trace('bug->bug_id is set'); + } + $form_content = ' <tr> <td style="text-align: center; border-top: 1px solid #000;">&nbsp;Add Comment</td> <td colspan="3" style="border-top: 1px solid #000;"></td> </tr> <tr> <td></td> <td colspan="3"> -<form action="/bug/comment/" method="post" name="comment" > +<form action="/bug/comment/" method="post" name="commentform" id="commentform" > <input type="hidden" name="bug_id" value="' . $bug->bug_id . ' " /> '; @@ -63,7 +80,7 @@ $form_content .= ' <label for="comment_text">Comment</label> <textarea name="comment_text" id="comment_text" rows="7" cols="55" >{COMMENT_TEXT}</textarea> - <input type="button" name="submit" value="Submit Comment" onclick="submit()" /> + <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.8&r2=1.9&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.8 bugtracker/includes/functions.php:1.9 --- bugtracker/includes/functions.php:1.8 Wed Jul 16 12:13:36 2008 +++ bugtracker/includes/functions.php Fri Jul 25 22:00:30 2008 @@ -178,3 +178,10 @@ return; } + +function trace($message) { + global $trace; + $trace .= $message . "\n"; + return; +} + http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/convert.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/user/convert.php diff -u bugtracker/template/generic/user/convert.php:1.2 bugtracker/template/generic/user/convert.php:1.3 --- bugtracker/template/generic/user/convert.php:1.2 Wed Jul 16 12:13:36 2008 +++ bugtracker/template/generic/user/convert.php Fri Jul 25 22:00:30 2008 @@ -17,20 +17,24 @@ //check valid $query = 'SELECT * FROM ' . TEMP_USER_TABLE . ' WHERE handle = \'' . $db->protect_data($temp_handle) . '\''; $db->get_data($query); -$trace .= $query . "\n" . $db->total_rows . "\n"; + + trace($query . "\n" . $db->total_rows); + $valid = $db->total_rows ? TRUE : FALSE; //if the new handle is already in the user table.... if ($user->fetch_handle($user_data['handle'])) { -$trace .= 'in here'; + trace('in here'); + $template_data['form_error'] = 'The handle you have selected is already in use, please select another'; $user->logged_in_temp = TRUE; $redirect_convert = FALSE; } else if ($valid) { -$trace .= 'have rows'; + trace('have rows'); + $query = 'DESCRIBE ' . USER_TABLE; $db->get_data($query); $past_updated = FALSE; @@ -125,7 +129,7 @@ else { $template_data['form_error'] = 'You have got somewhere you should not have'; - $trace .= 'some error'; + trace('some error'); } } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/comment.php?view=markup&rev=1.1 Index: bugtracker/template/generic/bug/comment.php +++ bugtracker/template/generic/bug/comment.php <?php //woo is comment time //most of this involves taking to the comment class $template_data['page_title'] .= ' - Comment'; $content .= '<h2>Comment</h2>'; $bug_id = loadvar('bug_id',''); $comment_type = ''; $comment_text = loadvar('comment',''); if ($user->logged_in) { //user logged in $handle = $user->handle; } else { $content .= '<p>Not Logged In</p>'; trace('not logged in'); $handle = loadvar('handle',''); $password = loadvar('password',''); if (!$handle || !$password) { $form_data['bug_id'] = $bug_id; $form_data['handle'] = $handle; $form_data['comment_type'] = $comment_type; $form_data['comment_text'] = $comment_text; $form_data['form_error'] = 'Invalid Handle and/or password'; $content .= '<table>'; $comment->spawn_form(); $content .= '</table>'; } } if (!$form_data['form_error']) $comment->add_comment();

« previous php.webmaster (#2206) next »