Sun Jun 13, 2004 4:57 pm
Sun Jun 13, 2004 9:42 pm
Wed Jun 16, 2004 3:54 pm
<?php
function buildSearchQuery($terms, $fields) {
$disallow = implode('|',explode(',','the,he,she,his,hers,it,will,has,been,where,how,when,if,had,can,may,could,not,and,why,because,no,am,is,was'));
$terms = trim($terms);
$sC = 0; //search element count
while ($terms != '') {
if (substr($terms,0,1) == '"' and substr_count($terms,'"') > 1) {
$end = strpos($terms,'"',1);
$element = substr($terms,0,$end);
$terms = substr(strstr(substr($terms,1),'"'),1);
} else {
$end = strpos($terms,' ');
if ($end === FALSE) $end = strlen($terms);
$element = substr($terms,0,$end);
if ($end == strlen($terms)) { $terms = ''; } else { $terms = substr($terms, $end); }
}
$element = trim(ereg_replace('(\?|!|\.)','',$element));
$terms = trim($terms);
if (strlen($element) == 1) {
$stat['filter'] .= ', '.$element;
} elseif (substr($element,0,1) == '-' or
substr($element,0,1) == '+' or
substr($element,0,1) == '"') {
$seat[$sC] = str_replace('"','',$element);
$sC += 1;
} else {
$insert = trim(ereg_replace(' ('.$disallow.') ','',' '.$element.' '));
if (trim($insert) != '') {
$seat[$sC] = $insert;
$sC += 1;
}
}
}
for ($i=0;$i < $sC;$i++) {
$not = '';
$el = $seat[$i];
$sChar = substr($el,0,1);
if ($sChar == '-') {
$not = 'NOT ';
$el = substr($el,1);
} elseif ($sChar == '+') {
$el = substr($el,1);
}
$el = mysql_escape_string($el);
$where .= " and ${not}(";
foreach ($fields as $field) {
$where .= ' '.$field." LIKE '%$el%' or";
}
$where = trim(substr($where,0,strlen($where)-2));
$where .= ')';
}
$where = trim(substr($where,4));
return $where;
}
?>
Wed Jun 16, 2004 4:00 pm
<script language="JavaScript">
days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear();
if (year < 2000)
year = year + 1900;
document.write ("<font size=2 face='verdana' color=000000> "+ day +
", " + month + " " + date + ", " + year + "</font>")
// -- end hiding
</script>
Wed Jul 07, 2004 11:43 pm
$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";
$imurl = "ImageUrl goes here";
$x = "X position goes here";
$y = "Y position goes here";
$maxx = "The max width goes here";
$maxy = "The max height goes here";
header("image/");
$im = @imagecreatefrom($imurl);
$tc = imagecolorallocate($im,0,0,0);
return image($im);
return imagepng($im);
$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";