_; top(); menuTop("../../mt","Links"); topGraphic(); $table = 'links'; $tblId = '3'; // index for table in message for email ?>

Search the Links

$value){ // get POST vars $$key = $value; } */ if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) { $t = $_POST[ 't']; $l = $_POST[ 'l']; } else { $t = $_GET[ 't']; $l = $_GET[ 'l']; } $fields = ' url, title, description, category, keywords '; //msg1(); // log post vars. $postString = "$t, L = $l"; $url = $_SERVER[ 'PHP_SELF' ]; $q = "INSERT INTO post ( url, var ) VALUES ( '$url', '$postString' )"; @$db->query("$q"); // execute this query search( $t, $l, $fields ); // terms, logic, fields to search showForm(); bottom2( '' ); exit; //================================================================ function msg1(){ echo <<<_

Search to find a specific link.

_; } function search( $t, $l, $fields ){ global $table, $ezr; $t = preg_replace('/(www|html|com|net|org)/', '', $t); // we're letting them check url's, so dump the obvious $t = preg_replace('/\s+/', ' ', $t); if (strlen( trim($t) ) < 2 ) { echo "

Enter a longer search phrase.

"; return; } $l = $l{ 0 }; // make sure nobody's messed with the logic $logic = $l ? ' AND ' : ' OR ' ; $t = trim( $t ); $aTERMS = explode( ' ', $t ); // split search terms $q = "SELECT id, title, url, description, q, category, keywords FROM $table WHERE q > 0 AND $l "; foreach ( $aTERMS as $term ){ $q .= "$logic CONCAT( $fields ) LIKE '%$term%'"; } $q .= ' ORDER BY q desc, title ASC'; // by quality and title $count = 11; // enough to display nav links $ezr->query_mysql("$q"); // the actual querry $ezr->set_qs_val("l", "$l"); $ezr->set_qs_val("t", "$t"); $ezr->register_function('fixCols'); $ezr->num_results_per_page = 10; $ezr->nav_bottom = $count > $ezr->num_results_per_page ? true : false ; // only diplay nav if enough results $ezr->nav_top = false; // no top nav at this point $ezr->num_browse_links = 10; $ezr->text_hover_msg_back = ' Previous NUMBER '; $ezr->text_hover_msg_next = ' Next NUMBER '; $ezr->text_hover_msg_link = ' Page NUMBER '; $ezr->show_count = false; $ezr->text_sep1 = '   '; $ezr->text_sep2 = '   '; $ezr->style_link = 'color: #93c; text-decoration: underline;'; $ezr->style_nolink = 'font-weight:bold; font-size: 133%;color: #999;vertical-align:-20%;border:1px solid #393;'; $ezr->text_next = '   -->'; $ezr->style_next = 'text-decoration: none; color: #93c;'; $ezr->style_na_next = 'color: #ccc;'; $ezr->text_back = '<--   '; $ezr->style_back = 'text-decoration: none; color: #93c;'; $ezr->style_na_back = 'color: #ccc;'; $ezr->show_num_pages = false; $ezr->show_start_page = false; $ezr->show_last_page = false; $ezr->results_open = ''; $ezr->results_close = ''; $ezr->results_heading = ''; $ezr->results_row = "

\$C2

\$C4
\$C3

"; $ezr->results_postpend = ''; $ezr->display(); return; } // helper function for ezr pagination // vars must match querry order function fixCols( $id, $title, $url, $description, $q, $category, $keywords ){ // extra function to format each col global $tblId; $title = htmlentities( $title ); $description = htmlentities( $description ); } function bottom2(){ echo 'top of page
'; menuSide("../ms","Links"); echo <<<_ _; } function showForm(){ global $PHP_SELF, $t, $l; if ( $l ){ $and = ' checked'; } else { $or = ' checked'; } echo <<<_
  any word   all words
_; } ?>