NukeXchange Network

          

Nuke Sites Link Directory
Nuke Fixes · NukeForums · NukeZone Hosting · NukeUnited · Nuke Sites · Nuke Skins · NukeLance
Nuke Resources
 :: Home  :: Downloads  :: Your Account  :: Forums  :: Advertise :: 
Login or Register
Main Menu
General
 Main
 AvantGo
 Banner_Clients
 cfaq
 Donations
 Downloads
 Forums
 Members_List
 Private_Messages
 Search
 Stories_Archive
 Submit_News
 Surveys
 Topics
 Web_Links
 Your_Account

Your Account
 Login
 Register
 Lost Pass

Modules
Quick Links
· CMS Focus
· Domain Names
. Game Quest
· Learning Linux
. MateMaker
· NukeFixes
· NukeForums
· NukeLance
· Nuke Sites
· Nuke Skins
· NukeZone Hosting
. SearchDevil
Other Options

Download Resources
· Nuke Downloads
· Add a Link
· New Files
· Top Rated
· Most Popular

Web Site Resources
· Nuke Sites
· Add A Site
· New Sites
· Top Rated
· Most Popular

Support
· NukeZone Hosting
· NukeSkins.com
· NukeForums.com
· phpnuke.org
· NukeFixes.com
Information
NukeForums
·Dynamic block height
·Full Path Changes Required in Several Directories
·Members Cant Logon My Site or View Forums & Member Profi
·versign and authorize.net phpauction integration...
·Approved Membership for 8.0
·I want to use full HTML content in the welcome page...
·Changed style from subsilver, folder images now dont display
·Installing the forum upadates
·PHP-Nuke SQL Injection Vulnerability Fix
·Warning: main(db/mysql.php): failed to open stream: No such

read more...
Top10 Links
· 1: Nuke Forums
· 2: PHPNukeFiles
· 3: NukeSkins
· 4: Nuke Templates
· 5: EcomJunk
· 6: MDesign
· 7: Windows Installation: PHP
· 8: FLASH-FOR-NUKE
· 9: Dezina
· 10: Global Dream News Sharing Portal!
Site Visitors
User Login:

Nickname:
Password:
Security Code: Security Code
Type Security Code Here:

Members List Membership:
Latest: companynewbie
Today: 0
Yesterday: 2
Overall: 14890

Visitation:
Guests: 542
Members: 0
Total: 542


You are Anonymous user. You can register for free by clicking here
Sponsor Links
php-Nuke Themes and Templates
php-Nuke Themes and Templates

NukeResources :: View topic - Need help on Search Engine Results
NukeResources Forum Index

NukeResources Forum Index -> Random Thoughts -> Need help on Search Engine Results
Post new topic  Reply to topic    View previous topic :: View next topic 
Need help on Search Engine Results
PostPosted: Wed Jul 12, 2006 3:04 pm Reply with quote
bbaros
Resourceful
Resourceful
 
Joined: Jul 03, 2005
Posts: 81
Location: Nashville, TN




I am working on part of a search engine and the results aren't comming back the way i want them to . I wish for it to display the banners not the catagories they are in. can any1 help me. here is the part of the code
I want the $query to look in the description of the link and when it finds a match the banner that is associated with it will be displayed.

Here is my test page I currently only have 3 banners in it at the time. an easy result for the search would be the word "ink" or "hosting" Please help

http://www.infinity-plus.com

I've created it into a module and block so its under GABASE the Banner Search Please help me be able to display the proper results.

THank you.



Code:
/////////////////////////////////////////////////////////////////SEARCH ENGINE////////////////////////////////////////
function search($query, $min, $orderby, $show) {
   global $prefix, $db, $admin, $bgcolor2, $module_name;
   include("l_config.php");
   include("header.php");
   if (!isset($min)) $min=0;
   if (!isset($max)) $max=$min+$Bannerresults;
   if(isset($orderby)) {
      $orderby = convertorderbyin($orderby);
   } else {
      $orderby ="hits DESC";
      //$orderby = "title ASC";
   }
   if ($show!="") {
      $Bannerresults = $show;
   } else {
      $show=$Bannerresults;
   }
   $query = check_html($query, html);
   $query = addslashes($query);
   if(!is_numeric($Bannerresults) AND $Bannerresults==0)
   {
   $Bannerresults=10;
   }
   $result = $db->sql_query("SELECT lid, cid, sid, title, url, imgurl, desciption, date, hits, linkratingsummary, totalvotes, totalcomments from ".$prefix."_gabase where title LIKE '%$query%' OR description LIKE '%$query%' ORDER BY $orderby LIMIT ".intval($min).",$Bannerresults");
   $fullcountresult = $db->sql_query("SELECT lid, title, imgurl, description, date, hits, linkratingsummary, totalvotes, totalcomments from ".$prefix."_gabase where title LIKE '%$query%' OR description LIKE '%$query%'");
   $totalselectedBanner = $db->sql_numrows($fullcountresult);
   $nrows = $db->sql_numrows($result);
   $x=0;
   $the_query = stripslashes($query);
   $the_query = str_replace("\'", "'", $the_query);
   menu(1);
   echo "<br>";
   OpenTable();
   if ($query != "") {
      if ($nrows>0) {
         echo "<font class=\"option\">"._SEARCHRESULTS4.": <b>$the_query</b></font><br><br>";
      //   ."<table width=\"100%\" bgcolor=\"$bgcolor2\"><tr><td><font class=\"option\"><b>"._USUBCATEGORIES."</b></font></td></tr></table>";
         $result2 = $db->sql_query("SELECT cid, title from ".$prefix."_gabase_categories where title LIKE '%$query%' ORDER BY title DESC");
         while ($row2 = $db->sql_fetchrow($result2)) {
            $cid = intval($row2['cid']);
            $stitle = stripslashes(check_html($row2['title'], "nohtml"));
            $res = $db->sql_query("SELECT * from ".$prefix."_gabase where cid='$cid'");
            $numrows = $db->sql_numrows($res);
            $row3 = $db->sql_fetchrow($db->sql_query("SELECT cid,title,parentid from ".$prefix."_gabase_categories where cid='$cid'"));
            $cid3 = intval($row3['cid']);
            $title3 = stripslashes(check_html($row3['title'], "nohtml"));
            $parentid3 = intval($row3['parentid']);
            if ($parentid3>0) $title3 = getparent($parentid3,$title3);
            $title3 = ereg_replace($query, "<b>$query</b>", $title3);
            echo "<strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&amp;l_op=viewlink&amp;cid=$cid\">$title3</a> ($numrows)<br>";
         }
         
         /////////////////////////////////////////////////////////MOD RESULTS/////////////////
         //echo "<br><table width=\"100%\" bgcolor=\"$bgcolor2\"><tr><td><font class=\"option\"><b>"._Banner."</b></font></td></tr></table>";
         $orderbyTrans = convertorderbytrans($orderby);
         //echo "<br><font class=\"content\">"._SORTBannerBY.": "
         //echo "<br><font class=\"content\">"._TITLE." (<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=titleA\">A</a>\<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=titleD\">D</a>)"
         //.""._DATE." (<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=dateA\">A</a>\<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=dateD\">D</a>)"
         //.""._RATING." (<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=ratingA\">A</a>\<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=ratingD\">D</a>)"
         //.""._POPULARITY." (<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=hitsA\">A</a>\<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;orderby=hitsD\">D</a>)"
         //."<br>"._SITESSORTED.": $orderbyTrans<br><br>";
         //echo "<br><br>";
         while($row = $db->sql_fetchrow($result)) {
            $lid = intval($row['lid']);
            $cid = intval($row['cid']);
            $sid = intval($row['sid']);
            $title = stripslashes(check_html($row['title'], "nohtml"));
            $url = stripslashes($row['url']);
            $imgurl = stripslashes($row['imgurl']);
            $description = stripslashes($row['description']);
            $time = $row['date'];
            $hits = intval($row['hits']);
            $linkratingsummary = $row['linkratingsummary'];
            $totalvotes = intval($row['totalvotes']);
            $totalcomments = $row['totalcomments'];
            $linkratingsummary = number_format($linkratingsummary, $mainvotedecimal);
            $transfertitle = str_replace (" ", "_", $title);
            $title = ereg_replace($query, "<b>$query</b>", $title);
            
            
            
            
            
            
            /////////////MOD POINT 9996//////////////
            //echo "<a href=\"modules.php?name=$module_name&amp;l_op=visit&amp;lid=$lid\" target=\"new\"><b>$title</b></a><br>";
            //echo "<img src=\"$imgurl\">   "._HITS.": $hits";
            
            
            
            
            newlinkgraphic($datetime, $time);
            popgraphic($hits);
            $description = ereg_replace($query, "<b>$query</b>", $description);
         //   echo ""._DESCRIPTION.": $description<br>";
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            setlocale (LC_TIME, $locale);
            ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
            $datetime = strftime(""._BannerDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
            $datetime = ucfirst($datetime);
            //echo ""._HITS.": $hits";
            //echo ""._ADDEDON.": $datetime "._HITS.": $hits";
            
            
            
            /* voting & comments stats */
            if ($totalvotes == 1) {
               $votestring = _VOTE;
            } else {
               $votestring = _VOTES;
            }
            if ($linkratingsummary!="0" || $linkratingsummary!="0.0") {
            //   echo " "._RATING.": $linkratingsummary ($totalvotes $votestring)";
            }
            //echo "<br><a href=\"modules.php?name=$module_name&amp;l_op=ratelink&amp;lid=$lid&amp;ttitle=$transfertitle\">"._RATESITE."</a>";
            if ($totalvotes != 0) {
            //   echo " | <a href=\"modules.php?name=$module_name&amp;l_op=viewlinkdetails&amp;lid=$lid&amp;ttitle=$transfertitle\">"._DETAILS."</a>";
            }
            if ($totalcomments != 0) {
            //   echo " | <a href=\"modules.php?name=$module_name&amp;l_op=viewlinkcomments&amp;lid=$lid&amp;ttitle=$transfertitle>"._SCOMMENTS." ($totalcomments)</a>";
            }
            detecteditorial($lid, $transfertitle);
            //echo "<br>";
            $row4 = $db->sql_fetchrow($db->sql_query("SELECT cid,title,parentid from ".$prefix."_gabase_categories where cid='$cid'"));
            $cid3 = intval($row4['cid']);
            $title3 = stripslashes(check_html($row4['title'], "nohtml"));
            $parentid3 = intval($row4['parentid']);
            if ($parentid3>0) $title3 = getparent($parentid3,$title3);
            //echo ""._CATEGORY.": $title3<br><br>";
            $x++;
         }
         //echo "</font>";
         $orderby = convertorderbyout($orderby);
      } else {
         echo "<br><br><center><font class=\"option\"><b>"._NOMATCHES."</b></font><br><br>"._GOBACK."<br></center>";
      }
      /* Calculates how many pages exist.  Which page one should be on, etc... */
      $linkpagesint = ($totalselectedBanner / $Bannerresults);
      $linkpageremainder = ($totalselectedBanner % $Bannerresults);
      if ($linkpageremainder != 0) {
         $linkpages = ceil($linkpagesint);
         if ($totalselectedBanner < $Bannerresults) {
            $linkpageremainder = 0;
         }
      } else {
         $linkpages = $linkpagesint;
      }
      /* Page Numbering */
      if ($linkpages!=1 && $linkpages!=0) {
         echo "<br><br>"
         .""._SELECTPAGE.": ";
         $prev=$min-$Bannerresults;
         if ($prev>=0) {
            echo "  <b>[ <a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;min=$prev&amp;orderby=$orderby&amp;show=$show\">"
            ." &lt;&lt; "._PREVIOUS."</a> ]</b> ";
         }
         $counter = 1;
         $currentpage = ($max / $Bannerresults);
         while ($counter<=$linkpages ) {
            $cpage = $counter;
            $mintemp = ($perpage * $counter) - $Bannerresults;
            if ($counter == $currentpage) {
               echo "<b>$counter</b> ";
            } else {
               echo "<a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;min=$mintemp&amp;orderby=$orderby&amp;show=$show\">$counter</a> ";
            }
            $counter++;
         }
         $next=$min+$Bannerresults;
         if ($x>=$perpage) {
            echo "  <b>[ <a href=\"modules.php?name=$module_name&amp;l_op=search&amp;query=$the_query&amp;min=$max&amp;orderby=$orderby&amp;show=$show\">"
            ." "._NEXT." &gt;&gt;</a> ]</b>";
         }
      }
      
   } else {
      echo "<center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
   }
   CloseTable();
   include("footer.php");
}

_________________
Brian Baros
creator of Infinity-Plus.net, .org, .info, .com
http://www.Infinity-Plus.net
Administrator@infinity-plus.net
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Need help on Search Engine Results
 NukeResources Forum Index -> Random Thoughts
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 4 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic     



Powered by phpBB © 2001-2005 phpBB Group.     Theme created by Vjacheslav Trushkin.
There have been 149 unique hit(s) in the past 24 hours.
Forums ©
Need to find your IP fast?


Best viewed with a Browser
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2001 - 2007 by NukeResources.com
You can syndicate our news using the file .backend.php or ultramode.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.30 Seconds

:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::