mark( 'afterLoad' ) : null; /** * CREATE THE APPLICATION * * NOTE : */ $mainframe =& JFactory::getApplication('administrator'); jimport( 'joomla.application.component.model' ); //global $mainframe, $option; $db =& JFactory::getDBO(); $catid=JRequest::getVar( 'catid', 0, '', 'int' ); $sectionid =JRequest::getVar( 'sectionid', 0, '', 'int' ); $search =trim(JRequest::getVar( 'title', '', '', 'string' )); // if (strpos($search, '"') !== false) { // $search = str_replace(array('=', '<'), '', $search); // } $search = JString::strtolower($search); //$showResults = JRequest::getInt('search_results'); ob_end_clean(); $where = array(); if ($search) { $where[] = 'LOWER( title ) = '.$db->Quote( $db->getEscaped( $search, true ), false ); }else{ echo('[err]标题不能为空[/err]'); exit; } if ($catid>0) { $where[] = ' catid = '.$catid; } if ($sectionid>0) { $where[] = ' sectionid = '.$sectionid; } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__content' . $where; $db->setQuery( $query ); $total = $db->loadResult(); if($total>0){ echo('[yes]'); }else{ echo('[no]'); } exit; ?>