For Programmers: Free Programming Magazines  


Home > Archive > PHP Mirrors > March 2004 > php-master-web patch









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author php-master-web patch
Ken Tossell

2004-03-19, 1:04 pm

Hi,

Would any great person of karma like to commit a small patch that will
allow lazy^H^H^H^Hhard working phpdoc helpers to more easily stop bad
notes before they hit the mirrors?

Below, I've attached a patch against php-master-web/manage/user-notes.php.

Ken Tossell

Index: manage/user-notes.php
========================================
===========================
RCS file: /repository/php-master-web/manage/user-notes.php,v
retrieving revision 1.34
diff -u -r1.34 user-notes.php
--- manage/user-notes.php 15 Nov 2003 19:45:47 -0000 1.34
+++ manage/user-notes.php 2 Feb 2004 01:17:07 -0000
@@ -95,7 +95,11 @@
}

if (isset($keyword)) {
- $sql = 'SELECT *,UNIX_TIMESTAMP(ts) AS ts FROM note WHERE note LIKE
"%' . addslashes($keyword) . '%" LIMIT 20';
+ $sql = 'SELECT *,UNIX_TIMESTAMP(ts) AS ts FROM note WHERE note LIKE
"%' . addslashes($keyword) . '%"';
+ if (is_numeric($keyword)) {
+ $sql .= ' OR id = ' . (int)$keyword;
+ }
+ $sql .= ' LIMIT 20';
@mysql_connect("localhost","nobody","")
or die("unable to connect to database");
@mysql_select_db("php3")
@@ -132,7 +136,7 @@
<form method="post" action="<?php echo $PHP_SELF;?>">
<table>
<tr>
- <th align="right">Keyword :</th>
+ <th align="right">Keyword/ID :</th>
<td><input type="text" name="keyword" value="<?php echo $searched; ?>"
size="10" maxlength="32" /></td>
</tr>
<tr>

== END OF PATCH ==
Gabor Hojtsy

2004-03-19, 1:04 pm

> Would any great person of karma like to commit a small patch that will
> allow lazy^H^H^H^Hhard working phpdoc helpers to more easily stop bad
> notes before they hit the mirrors?
>
> Below, I've attached a patch against php-master-web/manage/user-notes.php.


Comitted.

Goba
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com