Retrofitted $_SP_CONF['includesearch'] option (had to take it out to get Tom's patch integrated) HEAD
authorDirk Haun <dirk@haun-online.de>
Fri Oct 30 12:00:15 2009 +0100 (4 months ago)
branchHEAD
changeset 74037a15ec67da80
parent 7402f7706912e8be
child 74043dde94a085fe
Retrofitted $_SP_CONF['includesearch'] option (had to take it out to get Tom's patch integrated)
plugins/staticpages/functions.inc
     1.1 --- a/plugins/staticpages/functions.inc	Thu Oct 15 13:05:28 2009 -0400
     1.2 +++ b/plugins/staticpages/functions.inc	Fri Oct 30 12:00:15 2009 +0100
     1.3 @@ -600,7 +600,11 @@
     1.4  */
     1.5  function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic, $type, $author, $keyType, $page, $perpage)
     1.6  {
     1.7 -    global $_TABLES, $_DB_dbms, $LANG_STATIC, $LANG09;
     1.8 +    global $_TABLES, $_DB_dbms, $LANG_STATIC, $LANG09, $_SP_CONF;
     1.9 +
    1.10 +    if ($_SP_CONF['includesearch'] != 1) {
    1.11 +        return;
    1.12 +    }
    1.13  
    1.14      // Make sure the query is SQL safe
    1.15      $query = trim(addslashes($query));
    1.16 @@ -1298,7 +1302,7 @@
    1.17      
    1.18      $sql = "SELECT sp_id, sp_title 
    1.19          FROM {$_TABLES['staticpage']} 
    1.20 -        WHERE NOT ISNULL(sp_content) AND (sp_date >= (date_sub(NOW(), INTERVAL {$_SP_CONF['newstaticpagesinterval']} SECOND))) 
    1.21 +        WHERE NOT ISNULL(sp_content) AND (sp_date >= (DATE_SUB(NOW(), INTERVAL {$_SP_CONF['newstaticpagesinterval']} SECOND))) 
    1.22          {$extra_sql} 
    1.23          " . COM_getPermSQL( 'AND' ) . " 
    1.24          ORDER BY sp_date DESC LIMIT 15";