OSI-Certified logo

Source code of file search.php
from the Content Management module for Phprojekt.

<?php
// Content Management System module for PHProjekt (CMS4P).
// Copyright 2002-2005 by Mario A. Valdez-Ramirez
// http://www.mariovaldez.net/

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// 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.

// You can contact Mario A. Valdez-Ramirez by email 
// at mario@mariovaldez.org or paper mail at 
// Olmos 809, San Nicolas, NL. 66495, Mexico.

//session_start();
$path_pre="../";
include_once (
$path_pre "cm/cm_anon.inc.php");
$include_path $path_pre "lib/lib.inc.php";
include_once 
$include_path;
include_once (
$path_pre "cm/cm_lib.inc.php");
fcm_load_secdb ($cm_security);
echo 
$cm_html_header;



fcm_title_nav2 ($cm_pathfalsefalsefalsefalsefalsefalsefalse);

echo 
"<br><table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" align=\"center\"><tr><td class=\"search1body\">
<form class=\"cms\" action=\"search.php\" method=\"post\">
<span class=\"inputname\">
{$cm_text["searchterm"]}:</span>
<input class=\"cms\" type=\"text\" name=\"cm_searched_string\" size=\"25\" maxlength=\"50\" value=\"
$cm_searched_string\">
<input class=\"cms\" type=\"submit\" value=\"
{$cm_text["search"]}\">
</form><br>
</td></tr></table>
<br>
"
;


$cm_searched_string str_replace ("'"""$cm_searched_string);
$cm_searched_string str_replace ("\""""$cm_searched_string);
$cm_searched_string str_replace (","""$cm_searched_string);
$cm_searched_string str_replace ("*"""$cm_searched_string);
$cm_searched_string str_replace (";"""$cm_searched_string);
$cm_searched_string str_replace ("("""$cm_searched_string);
$cm_searched_string str_replace (")"""$cm_searched_string);
$cm_searched_string trim ($cm_searched_string);
if (
$cm_searched_string) {
  
$cm_searched_string fcm_htmlentity ($cm_searched_string);
  
$result1 db_query("select cmdb_type, cmdb_directory, cmdb_title, cmdb_viewer_group, cmdb_keywords,
                       cmdb_date_update, cmdb_abstract, cmdb_content, cmdb_logo from " 
CM_DB_PREFIX "content3 where
                       (cmdb_directory like '%
$cm_searched_string%' or 
                        cmdb_title like '%
$cm_searched_string%' or 
                        cmdb_viewer_group like '%
$cm_searched_string%' or 
                        cmdb_keywords like '%
$cm_searched_string%' or 
                        cmdb_abstract like '%
$cm_searched_string%' or 
                        cmdb_content like '%
$cm_searched_string%') 
                        and cmdb_type like '%" 
CM_HITTYPE_PAGE "%' 
                        " 
fcm_access_sqldef ($user_kurz) ) or db_die();
  
$cm_total_searchres 0;
  while ((
$row1 db_fetch_row($result1)) && ($cm_total_searchres $cm_max_searchres)) {
    
fcm_articlelist_box ($row1[1], $row1[2], $row1[6], $row1[5], falsefcm_get_totalcomments ($row1[1]), fcm_get_totalhits ($row1[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row1[1]), fcm_is_cleditable ($row1[1], $user_kurz$row1[0]), stristr ($row1[0], CM_HITTYPE_ANNOUNCE), $row1[8], true);
    
$cm_total_searchres++;
  }
  
$result1 db_query("select " CM_DB_PREFIX "content3.cmdb_type,
                              " 
CM_DB_PREFIX "content3.cmdb_directory,
                              " 
CM_DB_PREFIX "content3.cmdb_title,
                              " 
CM_DB_PREFIX "content3.cmdb_viewer_group,
                              " 
CM_DB_PREFIX "content3.cmdb_keywords,
                              " 
CM_DB_PREFIX "content3.cmdb_date_update,
                              " 
CM_DB_PREFIX "content3.cmdb_abstract,
                              " 
CM_DB_PREFIX "content3.cmdb_content,
                              " 
CM_DB_PREFIX "cmcomments3.cmdb_directory,
                              " 
CM_DB_PREFIX "cmcomments3.cmdb_title,
                              " 
CM_DB_PREFIX "cmcomments3.cmdb_comment,
                              " 
CM_DB_PREFIX "content3.cmdb_logo
                       from " 
CM_DB_PREFIX "content3, " CM_DB_PREFIX "cmcomments3 where
                             (" 
CM_DB_PREFIX "cmcomments3.cmdb_comment like '%$cm_searched_string%' or
                              " 
CM_DB_PREFIX "cmcomments3.cmdb_title like '%$cm_searched_string%') and
                              " 
CM_DB_PREFIX "cmcomments3.cmdb_directory like " CM_DB_PREFIX "content3.cmdb_directory
                          and " 
CM_DB_PREFIX "content3.cmdb_type like '%" CM_HITTYPE_PAGE "%'
                        " 
fcm_access_sqldef ($user_kurz) ) or db_die();
  while ((
$row1 db_fetch_row($result1)) && ($cm_total_searchres $cm_max_searchres)) {
    
fcm_articlelist_box ($row1[1], $row1[2], $row1[6], $row1[5], falsefcm_get_totalcomments ($row1[1]), fcm_get_totalhits ($row1[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row1[1]), fcm_is_cleditable ($row1[1], $user_kurz$row1[0]), stristr ($row1[0], CM_HITTYPE_ANNOUNCE), $row1[11], true);
    
$cm_total_searchres++;
  }
  if (
$cm_total_searchres 1) {
    
fcm_message ("{$cm_text["nosearchreswith"]} \"$cm_searched_string\"."CM_MSGSTYLE_INFORMATION);
  }
}
//else {
//  fcm_message ("{$cm_text["nosearchreswith"]} \"$cm_searched_string\".", CM_MSGSTYLE_INFORMATION);
//}



echo $cm_html_footer;
?>

 
 
NA fum/lmd: 2004.09.16
Copyright ©1994-2018 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link