cvs: php-master-web / event.sql /manage event.php
| From: | jim winstead | Date: | Wed, 06 Mar 2002 00:49:09 +0000 |
| Subject: | cvs: php-master-web / event.sql /manage event.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8994@lists.php.net to get a copy of this message | ||
jimw Tue Mar 5 19:49:09 2002 EDT
Modified files:
/php-master-web/manage event.php
/php-master-web event.sql
Log:
hide events in the past by default (can still be found in searches)
Index: php-master-web/manage/event.php
diff -u php-master-web/manage/event.php:1.3 php-master-web/manage/event.php:1.4
--- php-master-web/manage/event.php:1.3 Tue Mar 5 19:34:04 2002
+++ php-master-web/manage/event.php Tue Mar 5 19:49:08 2002
@@ -222,7 +222,7 @@
<table width="100%">
<tr>
<td>
- <a href="<?php echo "$PHP_SELF";?>">see all events</a>
+ <a href="<?php echo "$PHP_SELF";?>">see upcoming
events</a>
| <a href="<?php echo "$PHP_SELF?unapproved=1";?>">see
unapproved events</a>
</td>
<td align="right">
@@ -241,12 +241,12 @@
$limit = "LIMIT $begin,$max";
$orderby = $order ? "ORDER BY $order" : "";
-$searchby = $search ? "WHERE (MATCH(sdesc,ldesc,email) AGAINST ('$search')" :
"";
+$searchby = $search ? " WHERE MATCH(sdesc,ldesc,email) AGAINST ('$search')" :
"";
if (!$searchby && $unapproved) {
- $searchby = 'WHERE NOT approved';
+ $searchby = ' WHERE NOT approved';
}
-elseif ($unapproved) {
- $searchby .= ' AND NOT approved';
+if (!$searchby) {
+ $searchby = ' WHERE NOT (tipo = 1 AND sdato < NOW()) AND NOT (tipo = 2 AND edato <
NOW())';
}
$query = "SELECT COUNT(id) FROM phpcal";
Index: php-master-web/event.sql
diff -u php-master-web/event.sql:1.1 php-master-web/event.sql:1.2
--- php-master-web/event.sql:1.1 Sun Mar 3 20:25:49 2002
+++ php-master-web/event.sql Tue Mar 5 19:49:09 2002
@@ -7,7 +7,7 @@
sdato DATE DEFAULT NULL,
edato DATE DEFAULT NULL,
recur VARCHAR(12) DEFAULT NULL,
- sdesc VARCHAR(16) NOT NULL DEFAULT '',
+ sdesc VARCHAR(32) NOT NULL DEFAULT '',
url VARCHAR(128) DEFAULT NULL,
email VARCHAR(128) DEFAULT NULL,
ldesc TEXT,
@@ -20,5 +20,6 @@
KEY sdato (sdato),
KEY edato (edato),
KEY country (country),
- KEY category (category)
+ KEY category (category),
+ FULLTEXT KEY sdesc (sdesc,ldesc,email)
) TYPE=MyISAM;