\n\r"; $subject="CSI SafeSites Sponsor Visit From ".$visitor_ip." (".$visitor_ip_name.")\n"; $additional_headers="From: CSI SafeSites Manager \nContent-Type: text/html\n\n"; // Use email content in inc file include("email_sponsor_of_visitor_activity.inc"); if (mail($recipient, $subject, $body_of_email, $additional_headers)) { } else { print("There was an error sending the email to $recipient. There's either a coding issues or Internet issues. Try again"); } } // endif email notify if activity is yes mysql_close($db); //echo $email_notify_if_activity; echo "Loading...

"; echo ""; exit; } //=========================================== ws condition =============================== // If ws is defined, find the site_url in the table, increment popular_rank, the redirect to the site_url if ($ws) { //Connect to the database // $db = mysql_connect("localhost", "iccs", "@1221"); // mysql_select_db("iccs",$db); $db = mysql_connect("localhost", "thetoyma_iccs", "@1221za"); mysql_select_db("thetoyma_iccs",$db); $sql="update applicants set popular_rank=popular_rank+1 where (site_url = '$ws') and (popular_rank <> '-1')"; $result = mysql_query($sql,$db); echo "Loading...

"; // echo ""; echo ""; exit; } //============================================= c condition ============================= // If c is defined, display the category results if ($c) { //print "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"; # ========================== Declare variables ===================================== #Site variables //$currcat=htmlspecialchars($c,ENT_QUOTES); $currcat=$c; #root prefix directory $rootdir="/"; # Get rest of vars from include file in the coresponding inc file // include "/home/csisafesites/www/csisafesites.inc"; include "csisafesites.inc"; //if the pagenum isn't defined, there is no page number yet, so define it as 1 if (!isset($pagenum)) $pagenum=1; # current page //Connect to the database // $db = mysql_connect("localhost", "iccs", "@1221"); // mysql_select_db("iccs",$db); $db = mysql_connect("localhost", "thetoyma_iccs", "@1221za"); mysql_select_db("thetoyma_iccs",$db); // Make start record and ending record $startrecord=($pagenum*$photosperpage)-$photosperpage; //$endrecord=($pagenum*$photosperpage)+$photosperpage; $endrecord=($startrecord)+$photosperpage; //echo $startrecord; //echo $endrecord; // Outer table print "

"; // Prepare outer loop (site_categories) //$sql="SELECT * FROM applicants where (popular_rank <> '-1') and (site_category = '$currcat') order by popular_rank desc,time_updated"; $sql="select * from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (popular_rank <> '-1') and (sponsor_categories.category = '$currcat') order by popular_rank desc,time_updated"; $result = mysql_query($sql,$db); //$resultcount = mysql_query("SELECT count(*) FROM applicants where (popular_rank <> '-1') and (site_category = '$currcat')",$db); $resultcount = mysql_query("select count(*) from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (popular_rank <> '-1') and (sponsor_categories.category = '$currcat')",$db); // ====== page header // include("/home/csisafesites/www/header.inc"); include("header.inc"); // ==== body header include("body_header.inc"); // ==== Outer table print "
"; // =-=== Make top row of logo and port sponsor logo/link echo "
"; echo ""; echo ""; echo ""; // echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "
"; echo ""; // display portal sponsors include("csisafesites_portal_sponsors.html"); echo "
"; echo "
"; // add top menu bar which includes the find safesites input box include("csisafesites_top_menu.html"); ?>
'-1') and (site_category = '$currcat') order by popular_rank desc,time_updated limit $startrecord,$endrecord "; $sql="select * from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (popular_rank <> '-1') and (sponsor_categories.category = '$currcat') order by popular_rank desc,time_updated limit $startrecord,$endrecord "; //Same as #sql excep use count(*) and remove limit part of sql command. //$sqlcount="SELECT count(*) FROM applicants where (popular_rank <> '-1') and (site_category = '$currcat')"; $sqlcount="select count(*) from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (popular_rank <> '-1') and (sponsor_categories.category = '$currcat')"; $result = mysql_query($sql,$db); //Run count query // $resultcount = mysql_query("SELECT count(*) FROM photodata where modelname=\"$modelname\" or modeltheme=\"$modeltheme\"",$db); //$resultcount = mysql_query($sqlcount,$db); //$resultcount = mysql_query("SELECT count(*) FROM applicants where (popular_rank <> '-1') and (site_category = '$currcat')",$db); $resultcount = mysql_query("select count(*) from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (popular_rank <> '-1') and (sponsor_categories.category = '$currcat')",$db); //$resultcount = mysql_query("SELECT count(*) FROM applicants ",$db); $totnummatches = mysql_result($resultcount,0,"count(*)"); // Start table row and td echo ""; // end of category matches current row echo ""; // ==== End of category header table row //Initialize pagephotonum, the page's photo number from 1 to photosperpage $pagephotonum=1; // Make rankfactor - multiplier for rank to make max = 100% $myrow = mysql_fetch_array($result); // Reset the result array $result = mysql_query($sql,$db); $rankfactor = 100 / ($myrow["popular_rank"]-0.00000001); //echo $rankfactor; // ==== Loop through each result in selected category while ($myrow = mysql_fetch_array($result)) { //echo $pagephotonum; //echo $photosperpage; //echo $myrow["tnname"]; //if number of results on page is under limit, go through display results loop if ($pagephotonum<=$photosperpage) { echo "\n\n\n"; // print portion of vertical seperator line // echo ""; // echo ""; // ==== make one big, long cell for category sponsors when pagephotonum is 1 if caategory matches if ($pagephotonum == "1") { //echo " sponsor $pagephotonum"; include("csisafesites_category_sponsors.html"); } //else { // echo ""; //} // close current row echo "\n"; //Increment page photo number $pagephotonum++; } } //endif myrow ?>
"; //Print total number of matches if total is > 0, else print no matches if ($totnummatches > 0 ) { print "Total Number of Matches: ".$totnummatches."
\n"; //Print page number information (should use ceiling function) $numofpages = (int)( mysql_result($resultcount,0,"count(*)")/ $photosperpage); if (mysql_result($resultcount,0,"count(*)")/$photosperpage <> $numofpages) { $numofpages = $numofpages+1; } // Print page # of totpages printf("Page # %s of %s\n

",$pagenum,$numofpages); // if($pagenum>1) { echo "previous "; } else { echo "previous "; } // //home button echo ""; echo "home"; echo ""; // //if($pagenum next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; // print pages: and current page number echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line before search results content echo "
"; // ==== Print Category Header print "

Categories --> ".$currcat."

"; print "

"; echo "
\n"; // echo "".urldecode($myrow["mtitle"])."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]*abs(floor($rankfactor))."%"; } else { echo "".$myrow["site_url"]."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]*abs(floor($rankfactor))."%"; } echo "
Category:  ".$myrow["site_category"].""; // Make currentdate $currdate=$myrow["time_updated"]; echo "
URL:  ".$myrow["site_url"]." - Updated: ".date('M',$currdate)." ".substr($currdate,6,2)." ".substr($currdate,0,4); //echo "$rootdir/".strtolower($modelname)."/".strtolower($modeltheme)."/".$myrow["fsname"]; // echo "\" align=\"center\" border=0>"; // echo "\n"; // echo "\n"; // echo "
"; // Add comments field // echo $myrow["comments"]; // echo "
"; // echo $myrow["photonum"]; // if ($myrow["pc"]) { // echo "  "; // } // if ($myrow["mc"]) { // echo "  "; // } echo "
"; echo "
"; echo "\n


$numofpages) { $numofpages = $numofpages+1; } printf("Page %s of %s\n

",$pagenum,$numofpages); ?> 1) { echo "previous "; } else { echo "previous "; } ?> "; echo "home"; echo ""; ?> next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line after the photos echo "
"; //Display icon legend at the bottom // echo "Symbol Legend:  =Photographer's Choice "; // echo "  =Family's Choice "; echo "
"; // endif totnummatches count > 0 } else { // Print Category Header print "

Categories --> ".$currcat."

"; print "

"; print "

No Matches Were Found

"; } // Sponsor row include("csisafesites_bottom_sponsors.html"); //Search Form c at bottom print "
"; print "
"; print ""; print " "; print "
"; print "
"; ?>

"; //printf("---Total Number of Photos: %s
\n",mysql_result($resultcount,0,"count(*)")); //End php and build page and table holding n number of images each exit; } //end if $c //========================================= s condition ================================= // If s is defined, perform the search and return the results if ($s) { # ========================== Declare variables ===================================== #Site variables // Make searchtext = s $searchtext=$s; #Models root prefix directory $rootdir="/"; #Model's name in lowercase $modelnamelc=strtolower($modelname); # Get rest of vars from respective include file include "csisafesites.inc"; //Variable unique to each look and feel //$tnwidth=500; //# image width //$tnheight=500; //# image height //$imgblank="blank.gif"; //# spacer image //$tblclr="black"; //# table border colour //$photosperpage="10"; #number of images per page //if the pagenum isn't defined, there is no page number yet, so define it as 1 if (!isset($pagenum)) $pagenum=1; # current page //Connect to the database // $db = mysql_connect("localhost", "iccs", "@1221"); // mysql_select_db("iccs",$db); $db = mysql_connect("localhost", "thetoyma_iccs", "@1221za"); mysql_select_db("thetoyma_iccs",$db); // Make start record and ending record $startrecord=($pagenum*$photosperpage)-$photosperpage; //$endrecord=($pagenum*$photosperpage)+$photosperpage; $endrecord=($startrecord)+$photosperpage; //echo $startrecord; //echo $endrecord; // $sql="SELECT * FROM applicants where (popular_rank <> '-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%')) order by popular_rank desc,time_updated "; $sql="SELECT * FROM applicants where (popular_rank <> '-1') and (iwatchdog_label1 <> '') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%')) order by popular_rank desc,time_updated "; //$xsql="SELECT * FROM applicants where (mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%') order by popular_rank desc,time_updated limit $startrecord,$endrecord "; //$xsql="SELECT * FROM applicants where ($mkeywords like \"%$searchtext%\") or ($mdescription like \"%$searchtext%\") or ($mtitle like \"%$searchtext%\") order by popular_rank,time_updated limit $startrecord,$endrecord "; //$xsql="SELECT * FROM applicants where (\"$keywords\" like \"%$searchtext%\") or (\"$mdescription\" like \"%$searchtext%\") or (\"$mtitle\" like \"%$searchtext%\") order by popular_rank,time_updated limit $startrecord,$endrecord "; //$xsql="SELECT * FROM photodata where modelname=\"$modelname\" and (modeltheme = \"$modeltheme\") and (hidephoto = \"0\") order by photonum limit $startrecord,$endrecord "; //$xsql="SELECT * FROM photodata where modelname=\"$modelname\" and (modeltheme = \"$modeltheme\") and (hidephoto = \"0\") order by photonum limit $startrecord,$endrecord "; //$xsql="SELECT * FROM photodata where modelname=\"$modelname\" and (modeltheme = \"$modeltheme\") and (hidephoto = \"0\") order by photonum "; $result = mysql_query($sql,$db); //$result = mysql_query("SELECT * FROM photodata where modelname=\"$modelname\" and modeltheme=\"$modeltheme\" and (hidephoto = \"0\") order by photonum",$db); //$result = mysql_query("SELECT * FROM photodata where ((modelname=\"$modelname\") OR (modeltheme= \"$modeltheme\"))",$db); //$result = mysql_query("SELECT * FROM photodata where (modelname=\"$modelname\") limit $startrecord,$endrecord",$db); $resultcount = mysql_query("SELECT count(*) FROM applicants where (mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%')",$db); // or (\"$mdescription\" like \"%$searchtext%\") or (\"$mtitle\" like \"%$searchtext%\")",$db); //$resultcount = mysql_query("SELECT count(*) FROM applicants where (\"$keywords\" like \"%$searchtext%\") or (\"$mdescription\" like \"%$searchtext%\") or (\"$mtitle\" like \"%$searchtext%\")",$db); //$resultcount = mysql_query("SELECT count(*) FROM photodata where modelname=\"$modelname\" and modeltheme=\"$modeltheme\" and (hidephoto = \"0\")",$db); //$result = mysql_query("SELECT * FROM photodata",$db); // ====== page header include("header.inc"); // ==== body header include("body_header.inc"); // ==== Outer table print "
"; // =-=== Make top row of logo and port sponsor logo/link echo "
"; echo ""; echo ""; echo ""; // echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "
"; echo ""; // display portal sponsors include("csisafesites_portal_sponsors.html"); echo "
"; echo "
"; // add top menu bar which includes the find safesites input box include("csisafesites_top_menu.html"); ?>
'-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%')) order by popular_rank desc,time_updated limit $startrecord,$endrecord "; //$xsql="SELECT * FROM applicants where (\"$keywords\" like \"%$searchtext%\") or (\"$mdescription\" like \"%$searchtext%\") or (\"$mtitle\" like \"%$searchtext%\") order by popular_rank,time_updated limit $startrecord,$endrecord "; //Same as #sql excep use count(*) and remove limit part of sql command. $sqlcount="SELECT count(*) FROM applicants where (popular_rank <> '-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%'))"; $result = mysql_query($sql,$db); //$result = mysql_query("SELECT * FROM photodata where modelname=\"$modelname\" or modeltheme=\"$modeltheme\"",$db); //Run count query // $resultcount = mysql_query("SELECT count(*) FROM photodata where modelname=\"$modelname\" or modeltheme=\"$modeltheme\"",$db); //$resultcount = mysql_query($sqlcount,$db); $resultcount = mysql_query("SELECT count(*) FROM applicants where (popular_rank <> '-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%'))",$db); echo ""; //====================== Make the Table of Search Results ========================== //Initialize pagephotonum, the page's photo number from 1 to photosperpage $pagephotonum=1; $myrow = mysql_fetch_array($result); // Reset the result array $result = mysql_query($sql,$db); $rankfactor = 100 / ($myrow["popular_rank"]-0.00000001); //echo $rankfactor; while ($myrow = mysql_fetch_array($result)) { //echo $pagephotonum; //echo $photosperpage; //echo $myrow["tnname"]; //if number of results on page is under limit, go through display results loop if ($pagephotonum<=$photosperpage) { echo "\n\n\n\n"; //Increment page photo number $pagephotonum++; } } //endif myrow ?>
"; //Print total number of matches printf("Total Number of Matches: %s
\n",mysql_result($resultcount,0,"count(*)")); //Print page number information (should use ceiling function) // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; // $numofpages = (( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001); // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; $numofpages = (int)( mysql_result($resultcount,0,"count(*)")/ $photosperpage); if (mysql_result($resultcount,0,"count(*)")/$photosperpage <> $numofpages) { $numofpages = $numofpages+1; } printf("Page # %s of %s\n

",$pagenum,$numofpages); // if($pagenum>1) { echo "previous "; } else { echo "previous "; } // //home button echo ""; echo "home"; echo ""; // //if($pagenum next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line before search results content echo "
"; echo "
\n"; // echo "".urldecode($myrow["mtitle"])."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]*abs(floor($rankfactor))."%"; } else { echo "".$myrow["site_url"]."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]*abs(floor($rankfactor))."%"; } echo "
Category:  ".$myrow["site_category"].""; // Make currentdate $currdate=$myrow["time_updated"]; echo "
URL:  ".$myrow["site_url"]." - Updated: ".date('M',$currdate)." ".substr($currdate,6,2)." ".substr($currdate,0,4); //echo "$rootdir/".strtolower($modelname)."/".strtolower($modeltheme)."/".$myrow["fsname"]; // echo "\" align=\"center\" border=0>"; // echo "\n"; // echo "\n"; echo "
"; // Add comments field // echo $myrow["comments"]; // echo "
"; // echo $myrow["photonum"]; // if ($myrow["pc"]) { // echo "  "; // } // if ($myrow["mc"]) { // echo "  "; // } echo "
"; echo "
"; echo "\n


$numofpages) { $numofpages = $numofpages+1; } printf("Page %s of %s\n

",$pagenum,$numofpages); ?> 1) { echo "previous "; } else { echo "previous "; } ?> "; echo "home"; echo ""; ?> next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line after the photos echo "
"; //Display icon legend at the bottom // echo "Symbol Legend:  =Photographer's Choice "; // echo "  =Family's Choice "; echo "
"; // Sponsor row include("csisafesites_bottom_sponsors.html"); //Search Form s at bottom print "
"; print "
"; print ""; print " "; print "
"; print "
"; ?>

"; // =-=== Make top row of logo and port sponsor logo/link echo "
"; echo ""; echo ""; echo ""; // echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "
"; echo ""; // display portal sponsors include("csisafesites_portal_sponsors.html"); echo "
"; echo "
"; // add top menu bar which includes the find safesites input box include("csisafesites_top_menu.html"); // ==== prepare count of categories sql $countsql="SELECT count(*) FROM site_categories"; // ==== get category count $resultcount = mysql_query($countsql,$db); //$resultcount = mysql_query("SELECT count(*) FROM site_categories)",$db); $totnummatches = mysql_result($resultcount,0,'count(*)'); // ==== Print Category Header after getting total number of categories // print "

 Portal Categories (".$totnummatches.")

"; // print "

"; // ==== Prepare sql result (site_categories) $sql="SELECT * FROM site_categories order by category"; $result = mysql_query($sql,$db); // ==== Define variables for table row management (3 columns of categories) // Calculate the number of separator bars, this is done by looping through all of the categories and counting changes $sbarcount=0; while ($myrow = mysql_fetch_array($result)) { // Make currpre = nextpre to later compare currpre with nextpre $currpre = $nextpre; // Make category name $currcat=$myrow["category"]; // Make next prefix, nextpre $nextpre=substr($currcat,0,4); // If nextpre is different than currpre, then increment count (later, display seperator line) if ($nextpre != $currpre) { // increment counter (later, Make and display separator bar) $sbarcount=$sbarcount + 1; // increment current row and currcnt since hr has added a line //$currrow = $currrow + 1; } } //echo $sbarcount; // reset result by re-running the query for result $result = mysql_query($sql,$db); // rowmax is the maximum number of rows for the category table to contain - 15 is the approximate number of seperator lines $rowmax = ($totnummatches + $sbarcount) / 3; //echo $rowmax; $currrow = 0; $currcnt = 1; // currpre is the current first four letters of the category name, used to determine where to place separator bars $currpre = ""; // nextpre is the next first four letters of the category name, used to determine where to place separator bars $nextpre = "Busi"; // ==== Start Table (2) around caegories // print "
"; // print "
"; print "
"; // print "
"; // print "
"; // print "
"; //red print "
"; //blue print "
"; print "
"; $currrow=1; if ($currcnt < $totnummatches ) { print "
"; // ==== Loop through site_categories and build/print category links with counts while ($myrow = mysql_fetch_array($result)) { // Make currpre = nextpre to later compare currpre with nextpre $currpre = $nextpre; // check exceding rowmax and then increment currrow if ($currrow > $rowmax) { print ""; } } else { $currrow = $currrow + 1; $currcnt = $currcnt + 1; } // Make category name $currcat=$myrow["category"]; // Make next prefix, nextpre $nextpre=substr($currcat,0,4); // If nextpre is different than currpre, then display seperator line // echo "n = $nextpre c = $currpre
"; if ($nextpre != $currpre) { // Make and display separator bar //print "
"; //print "
"; print "
"; print "
"; print "
"; print "
"; //print "
"; print "
"; print "
"; // increment current row and currcnt since hr has added a line $currrow = $currrow + 1; //$currcnt = $currcnt + 1; //echo $currrow; } // echo $currrow; // Get number of records in the current category $sql2="select count(*) from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (sponsor_categories.category = '$currcat') and (popular_rank <> '-1')"; //// $sql2="select count(*) from applicants,sponsor_categories where (applicants.site_url = sponsor_categories.site_url) and (sponsor_categories.category = '$currcat') and (popular_rank <> '-1')"; // $sql2="select count(*) from applicants where (applicants.site_url = sponsor_categories.site_url) and (sponsor_categories.category = '$currcat') and (popular_rank <> '-1')"; //$sql2="SELECT count(*) FROM applicants where (popular_rank <> '-1') and (site_category = '$currcat') order by popular_rank desc,time_updated"; $resultcount = mysql_query($sql2,$db); // Print category name - with link if resultcount > 0 //print "".$currcat.""; if ( mysql_result($resultcount,0,'count(*)') > 0) { print "".$currcat.""; } else { print "".$currcat.""; } // print the current category count if resultcount > 0 else just print the
if ( mysql_result($resultcount,0,'count(*)') > 0) { print " (".mysql_result($resultcount,0,'count(*)').")
\n"; } else { print "
\n"; } } // end looping through each site_categories // Close category column table print "
"; print "
"; // Close Outer Table print "
"; //printf("---Total Number of Photos: %s
\n",mysql_result($resultcount,0,"count(*)")); //End php and build page and table holding n number of images each // Sponsor row // include("csisafesites_sponsors.html"); //Search Form portal bottom print "

"; print "
"; print "
"; print ""; print " "; print "
"; print "
"; ?>
'-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%')) order by popular_rank desc,time_updated limit $startrecord,$endrecord "; //$sql="SELECT * FROM applicants where (\"$keywords\" like \"%$searchtext%\") or (\"$mdescription\" like \"%$searchtext%\") or (\"$mtitle\" like \"%$searchtext%\") order by popular_rank,time_updated limit $startrecord,$endrecord "; // $sql="SELECT * FROM photodata where modelname=\"$modelname\" and (modeltheme = \"$modeltheme\") and (hidephoto = \"0\") order by photonum limit $startrecord,$endrecord "; //Same as #sql excep use count(*) and remove limit part of sql command. $sqlcount="SELECT count(*) FROM applicants where (popular_rank <> '-1') and ((mkeywords like '%$searchtext%') or (mdescription like '%$searchtext%') or (mtitle like '%$searchtext%'))"; $result = mysql_query($sql,$db); //$result = mysql_query("SELECT * FROM photodata where modelname=\"$modelname\" or modeltheme=\"$modeltheme\"",$db); //Run count query // $resultcount = mysql_query("SELECT count(*) FROM photodata where modelname=\"$modelname\" or modeltheme=\"$modeltheme\"",$db); $resultcount = mysql_query($sqlcount,$db); echo ""; //====================== Make the Table of Search Results ========================== //Initialize pagephotonum, the page's photo number from 1 to photosperpage $pagephotonum=1; while ($myrow = mysql_fetch_array($result)) { //echo $pagephotonum; //echo $photosperpage; //echo $myrow["tnname"]; //if number of results on page is under limit, go through display results loop if ($pagephotonum<=$photosperpage) { echo "\n\n\n\n"; //Increment page photo number $pagephotonum++; } } ?>
"; //Print total number of matches printf("Total Number of Matches: %s
\n",mysql_result($resultcount,0,"count(*)")); //Print page number information (should use ceiling function) // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; // $numofpages = (( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001); // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; // $numofpages = (int)(( mysql_result($resultcount,0,"count(*)")/ $photosperpage)+0.00001)+1; $numofpages = (int)( mysql_result($resultcount,0,"count(*)")/ $photosperpage); if (mysql_result($resultcount,0,"count(*)")/$photosperpage <> $numofpages) { $numofpages = $numofpages+1; } printf("Page # %s of %s\n

",$pagenum,$numofpages); // if($pagenum>1) { echo "previous "; } else { echo "previous "; } // //home button echo ""; echo "home"; echo ""; // //if($pagenum next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line before search results content echo "
"; echo "
\n"; // echo "".urldecode($myrow["mtitle"])."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]; } else { echo "".$myrow["site_url"]."
Description: ".urldecode($myrow["mdescription"])."
Rank: ".$myrow["popular_rank"]; } echo "
Category:  ".$myrow["site_category"].""; // Make currentdate $currdate=$myrow["time_updated"]; echo "
URL:  ".$myrow["site_url"]." - Updated: ".date('M',$currdate)." ".substr($currdate,6,2)." ".substr($currdate,0,4); //echo "$rootdir/".strtolower($modelname)."/".strtolower($modeltheme)."/".$myrow["fsname"]; // echo "\" align=\"center\" border=0>"; // echo "\n"; // echo "\n"; echo "
"; // Add comments field // echo $myrow["comments"]; // echo "
"; // echo $myrow["photonum"]; // if ($myrow["pc"]) { // echo "  "; // } // if ($myrow["mc"]) { // echo "  "; // } echo "
"; echo "
"; echo "\n


$numofpages) { $numofpages = $numofpages+1; } printf("Page %s of %s\n

",$pagenum,$numofpages); ?> 1) { echo "previous "; } else { echo "previous "; } ?> "; echo "home"; echo ""; ?> next"; } else { echo " next"; } // //==== Start Select Page Options Code ==== //Add a line before page numbers echo "

"; echo "
Pages:   "; $pagenumtmp=1; //$currpagenum=$pagenum; while ($pagenumtmp <= $numofpages) { //If the page number is equal to the temp page number, then don't make it a link. if ($pagenumtmp <> $pagenum) { echo "$pagenumtmp   "; } $pagenumtmp++; //echo "-----$pagenumtmp====$pagenum==-=-="; } echo "
"; //Add a line after the photos echo "
"; //Display icon legend at the bottom //echo "Symbol Legend:  =Photographer's Choice "; //echo "  =Family's Choice "; echo "
"; */ ?>