Welcome! Log In Create A New Profile


Related Search Results ......[MOD]

Posted by wajdani 
Related Search Results ......[MOD]
April 18, 2009 11:03AM
Related Search Results.

Search for

<?php if ($domain_name==$last_domain && $merge_site_results == 1 && $domain == ""winking smiley {?>
[ <a href="<?php print 'search.php?query='.quote_replace(addmarks($query)).'&search=1&results='.$results_per_page.'&domain='.$domain_name?>">More results from <?php print $domain_name?></a> ]
</div class="idented">
<?php }?>
<?php }?>
<?php }?>

After this Add

/************Related Search System Starts Here**************/

$rel_links = "<div style=font-size:16px;>Searches related to:&nbsp;<b>".$query."</b></div>";
echo $rel_links;

$trimmed = $query; /******* we're only search for one word *****/
//We're only selecting one field
$sqql = mysql_query("SELECT keyword FROM keywords LIMIT 5"winking smiley;

while($r = mysql_fetch_array($sqql))
$tok = strtok($r["keyword"], ", "winking smiley; //parse the multi-word string returned

while($tok !== false)

//needed to strip a quote character that enclosed the string inside the field

similar_text(strtoupper($trimmed), trim(strtoupper($tok),'"'), $percentage);
$percentage = number_format($percentage, 0);
if($percentage >= 15) //define a threshold, in this case an 15 percent match
//prints the results to clearly indicated which terms meet the threshold

$results_record["<a href='search.php?query=$tok&search=1'><font color=\"#ff0000\"> " .
trim(strtoupper($tok),'"') . "</font><font color=\"#0000CC\"> " .
$r[field_name] . "</font></a>"] = $percentage;
$tok = strtok(", "winking smiley;


if (!$results_record)
echo "&nbsp;<b>oOps !! No Related Search found !</b>";
asort($results_record, SORT_NUMERIC);
//echo key pair values
foreach($results_record as $result => $percentage)
echo $result . " - " . $percentage."%<BR>" ;

/************Related Search System Ends Here**************/



If this [MOD] not work reply to this post!


Muhammad Kamran Wajdani
Muzaffargarh, Punjab, Pakistan.
Re: Related Search Results ......[MOD]
June 04, 2009 02:57PM
hi wajdani doesnt work properly bro the related result shows deferent words please fix this and there is deferent carectors in the firs word and last word of the related

Edited 1 time(s). Last edit at 06/04/2009 03:06PM by lex.
Sorry, only registered users may post in this forum.

Click here to login