Re: Bug linking functionality
| From: | Derick Rethans | Date: | Fri, 20 Dec 2002 11:42:40 +0000 |
| Subject: | Re: Bug linking functionality | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-7358@lists.php.net to get a copy of this message | ||
Hi,
committed with some changes, thanks for this contribution.
Derick
On Wed, 18 Dec 2002, Justin Plock wrote:
> Hi all,
> I hope this is the correct place to post this, but I added a neat
> feature to bug.php to allow users to post references to other bug posts in
> the form of #ID.
>
> For example: A user could type #123 and it would be replaced with <a
> href="bug.php?id=123">#123</a>, allowing the user to view that bug posting.
>
> I added this simple functionality in another system I was developing and
> found it useful.
>
> I've pasted the diff at the end of this email.
>
> -Justin Plock
>
> Index: bug.php
> ===================================================================
> RCS file: /repository/php-bugs-web/bug.php,v
> retrieving revision 1.40
> diff -u -r1.40 bug.php
> --- bug.php 1 Oct 2002 17:05:16 -0000 1.40
> +++ bug.php 18 Dec 2002 21:49:41 -0000
> @@ -453,7 +453,9 @@
> echo "<b>[",format_date($ts),"] ",htmlspecialchars($email),
> "</b>\n";
> echo "<pre class=\"note\">";
> - echo
>
> addlinks(preg_replace("/(\r?\n){3,}/","\n\n",wordwrap($comment,72,"\n",1)));
> + $note =
>
> addlinks(preg_replace("/(\r?\n){3,}/","\n\n",wordwrap($comment,72,"\n",1)));
> + preg_replace('/#([0-9]+)/', "<a
> href=\"$PHP_SELF?id=\\1\">#\\1</a>",
> $note);
> + echo $note;
> echo "</pre>\n";
> echo "</div>";
> }
>
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - PHP Magazine for Professionals http://php-mag.net/
-------------------------------------------------------------------------