// // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // // Author: wishcraft (S.F.C., sales@chronolabs.org.au) // // URL: http://www.chronolabs.org.au/forums/X-Forum/0,17,0,0,100,0,DESC,0 // // Project: X-Forum 4 // // ------------------------------------------------------------------------ // include 'header.php'; forum_load_lang_file("search"); $config_handler =& xoops_gethandler('config'); $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); if ($xoopsConfigSearch['enable_search'] != 1) { header('Location: '.XOOPS_URL.'/modules/xforum/index.php'); exit(); } $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; $xoopsOption['template_main']= 'xforum_search.html'; include XOOPS_ROOT_PATH.'/header.php'; include_once XOOPS_ROOT_PATH.'/modules/xforum/include/search.inc.php'; $limit = $xoopsModuleConfig['topics_per_page']; $queries = array();
function forum_formatTimestamp($time, $format = "c", $timeoffset = "") { if(strtolower($format) == "reg" || strtolower($format) == "") { $format = "c"; } if( (strtolower($format) == "custom" || strtolower($format) == "c") && !empty($GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]) ) { $format = $GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]; } load_functions("locale"); return XoopsLocal::formatTimestamp($time, $format, $timeoffset); if(class_exists("XoopsLocal") && is_callable(array("XoopsLocal", "formatTimestamp")) && defined("_TODAY")){ return XoopsLocal::formatTimestamp($time, $format, $timeoffset); } global $xoopsConfig, $xoopsUser; if(strtolower($format) == "rss" || strtolower($format) == "r"){ $TIME_ZONE = ""; if(!empty($GLOBALS['xoopsConfig']['server_TZ'])){ $server_TZ = abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0)); $prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?" -":" +"; $TIME_ZONE = $prefix.date("Hi",$server_TZ); } $date = gmdate("D, d M Y H:i:s", intval($time)).$TIME_ZONE; return $date; } $usertimestamp = xoops_getUserTimestamp($time, $timeoffset); switch (strtolower($format)) { case 's': $datestring = _SHORTDATESTRING; break; case 'm': $datestring = _MEDIUMDATESTRING; break; case 'mysql': $datestring = "Y-m-d H:i:s"; break; case 'rss': $datestring = "r"; break; case 'l': $datestring = _DATESTRING; break; case 'c': case 'custom': default: forum_load_lang_file("main", "xforum"); $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset); if(date("Ymd", $usertimestamp) == date("Ymd", $current_timestamp)){ $datestring = _MD_TODAY; }elseif(date("Ymd", $usertimestamp+24*60*60) == date("Ymd", $current_timestamp)){ $datestring = _MD_YESTERDAY; }elseif(date("Y", $usertimestamp) == date("Y", $current_timestamp)){ $datestring = _MD_MONTHDAY; }else{ $datestring = _MD_YEARMONTHDAY; } break; } return date($datestring, $usertimestamp); }