diff --git a/bug_vote_add.php3 b/bug_vote_add.php3 index 660a2c03d1..06df94a2db 100644 --- a/bug_vote_add.php3 +++ b/bug_vote_add.php3 @@ -9,6 +9,7 @@ db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); + ### increase vote count and update in table $f_vote++; $query = "UPDATE $g_mantis_bug_table SET votes=$f_vote diff --git a/bugnote_add.php3 b/bugnote_add.php3 index ba591df220..ccd4175939 100644 --- a/bugnote_add.php3 +++ b/bugnote_add.php3 @@ -28,8 +28,12 @@ $result = mysql_query( $query ); ### retrieve bugnote text id number + ### NOTE: this is not 100% gurrantted to be the correct one. + ### It will be 99.9% of them time but it is not guarrnteed. + ### Looking for an elegant workaround w/o having to edit tables $query = "SELECT id FROM $g_mantis_bugnote_text_table + WHERE note='$f_bugnote_text' ORDER BY id DESC LIMIT 1"; $result = mysql_query( $query ); diff --git a/bugnote_delete.php3 b/bugnote_delete.php3 index 46a1c8faf8..487a485185 100644 --- a/bugnote_delete.php3 +++ b/bugnote_delete.php3 @@ -9,6 +9,7 @@ db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); + ### Remove the bugnote $query = "DELETE FROM $g_mantis_bugnote_table WHERE id='$f_bug_id'"; diff --git a/bugnote_inc.php b/bugnote_inc.php index 5bb5803d95..36600122b8 100644 --- a/bugnote_inc.php +++ b/bugnote_inc.php @@ -7,12 +7,7 @@ db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - $query = "SELECT access_level - FROM $g_mantis_user_table - WHERE cookie_string='$g_string_cookie_val'"; - $result = db_mysql_query($query); - $t_access_level = mysql_result( $result, 0 ); - + ### get the bugnote data $query = "SELECT * FROM $g_mantis_bugnote_table WHERE bug_id='$f_id'"; @@ -42,16 +37,19 @@ for($i=0; $i < $num_notes; $i++) { + ### prefix all bugnote data with v3_ $row = mysql_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v3" ); $v3_date_submitted = date( "m-d H:i", sql_to_unix_time( $v3_date_submitted ) ); + ### grab the bugnote text and prefix with v3_ $query = "SELECT note FROM $g_mantis_bugnote_text_table WHERE id='$v3_bugnote_text_id'"; $result2 = db_mysql_query($query); - $v4_note = mysql_result( $result2, 0); + $v3_note = mysql_result( $result2, 0); + ### grab the bugnote posters username and email and prefix with v5_ $query = "SELECT username, email FROM $g_mantis_user_table WHERE id='$v3_reporter_id'"; @@ -76,7 +74,10 @@ echo $v3_date_submitted ?>
> - echo string_unsafe( $v4_note ) ?> + echo string_unsafe( $v3_note ) ?> |