2000-05-18 19:52:00 +00:00
< ?
2000-12-23 23:25:28 +00:00
include " includes/common.inc " ;
2000-05-18 19:52:00 +00:00
2000-06-07 08:50:12 +00:00
$theme -> header ();
2000-05-18 19:52:00 +00:00
2000-11-13 08:17:45 +00:00
$terms = check_input ( $terms );
2000-05-18 19:52:00 +00:00
2000-07-02 11:21:00 +00:00
$output .= " <TABLE WIDTH= \" 100% \" BORDER= \" 0 \" > \n " ;
$output .= " <TR VALIGN= \" center \" > \n " ;
$output .= " <TD COLSPAN=3> \n " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$output .= " <FORM ACTION= \" search.php \" METHOD= \" POST \" > \n " ;
2000-07-02 11:21:00 +00:00
$output .= " <INPUT SIZE= \" 50 \" VALUE= \" $terms\ " NAME = \ " terms \" TYPE= \" text \" ><BR> \n " ;
2000-06-07 08:50:12 +00:00
2000-12-30 11:58:14 +00:00
// category:
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$output .= " <SELECT NAME= \" category \" > \n " ;
if ( $category ) $output .= " <OPTION VALUE= \" $category\ " > $category </ OPTION > \n " ;
$output .= " <OPTION VALUE= \" \" >All categories</OPTION> \n " ;
2000-06-07 08:50:12 +00:00
for ( $i = 0 ; $i < sizeof ( $categories ); $i ++ ) {
2000-07-02 11:21:00 +00:00
$output .= " <OPTION VALUE= \" $categories[$i] \" > $categories[$i] </OPTION> \n " ;
2000-06-07 08:50:12 +00:00
}
2000-07-02 11:21:00 +00:00
$output .= " </SELECT> \n " ;
2000-06-07 08:50:12 +00:00
2000-12-30 11:58:14 +00:00
// order:
2000-07-02 11:21:00 +00:00
$output .= " <SELECT NAME= \" order \" > \n " ;
2000-06-07 08:50:12 +00:00
if ( $order == " Oldest first " ) {
2000-07-02 11:21:00 +00:00
$output .= " <OPTION VALUE= \" Oldest first \" >Oldest first</OPTION> \n " ;
$output .= " <OPTION VALUE= \" Newest first \" >Newest first</OPTION> \n " ;
2000-06-07 08:50:12 +00:00
}
else {
2000-07-02 11:21:00 +00:00
$output .= " <OPTION VALUE= \" Newest first \" >Newest first</OPTION> \n " ;
$output .= " <OPTION VALUE= \" Oldest first \" >Oldest first</OPTION> \n " ;
2000-06-07 08:50:12 +00:00
}
2000-07-02 11:21:00 +00:00
$output .= " </SELECT> \n " ;
2000-06-07 08:50:12 +00:00
2000-07-02 11:21:00 +00:00
$output .= " <INPUT TYPE= \" submit \" VALUE= \" Search \" > \n " ;
$output .= " </TD> \n " ;
$output .= " </TR> \n " ;
$output .= " <TR> \n " ;
$output .= " <TD> \n " ;
2000-06-07 08:50:12 +00:00
2000-12-30 11:58:14 +00:00
// Compose and perform query:
2001-01-20 12:20:31 +00:00
$query = " SELECT s.id, s.subject, u.userid, s.timestamp, COUNT(c.cid) AS comments FROM stories s LEFT JOIN users u ON s.author = u.id LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$query .= ( $author ) ? " AND u.userid = ' $author ' " : " " ;
$query .= ( $terms ) ? " AND (s.subject LIKE '% $terms %' OR s.abstract LIKE '% $terms %' OR s.updates LIKE '% $terms %') " : " " ;
2000-11-03 07:57:28 +00:00
$query .= ( $category ) ? " AND s.category = ' $category ' GROUP BY s.id " : " GROUP BY s.id " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$query .= ( $order == " Oldest first " ) ? " ORDER BY s.timestamp ASC " : " ORDER BY s.timestamp DESC " ;
2000-06-22 09:16:31 +00:00
$result = db_query ( " $query " );
2000-05-18 19:52:00 +00:00
2000-12-30 11:58:14 +00:00
// Display search results:
2000-07-02 11:21:00 +00:00
$output .= " <HR> \n " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
2000-06-22 09:16:31 +00:00
while ( $entry = db_fetch_object ( $result )) {
2000-06-07 08:50:12 +00:00
$num ++ ;
2001-01-20 12:20:31 +00:00
$output .= " <P> $num ) <B><A HREF= \" story.php?id= $entry->id\ " > " . check_output( $entry->subject ) . " </ A ></ B > ( " . format_plural( $entry->comments , " comment " , comments) . " ) < BR >< SMALL > by " . format_username( $entry->userid ) . " </ B > , posted on " . format_date( $entry->timestamp ) . " .</ SMALL ></ P > \n " ;
2000-06-07 08:50:12 +00:00
}
2000-05-18 19:52:00 +00:00
2000-07-02 11:21:00 +00:00
if ( $num == 0 ) $output .= " <P>Your search did <B>not</B> match any articles in our database: <UL><LI>Try using fewer words.</LI><LI>Try using more general keywords.</LI><LI>Try using different keywords.</LI></UL></P> \n " ;
else $output .= " <P><B> $num </B> results matched your search query.</P> \n " ;
2000-06-07 08:50:12 +00:00
2000-07-02 11:21:00 +00:00
$output .= " </TD> \n " ;
$output .= " </TR> \n " ;
$output .= " </TABLE> \n " ;
2000-05-18 19:52:00 +00:00
2000-06-07 08:50:12 +00:00
$theme -> box ( " Search " , $output );
2000-05-18 19:52:00 +00:00
$theme -> footer ();
2000-11-03 07:57:28 +00:00
?>