wcddl replace the + with a - in the searchtags

Status
Not open for further replies.

frizurd

Member
7
2011
0
0
hey guys
i would like to change the + in the searchtag into a -

here's an example
i want to change search-download-the+fighter+2010/ into search-download-the-fighter-2010/
so i want to replace the + with a -

but if i do this the search results get bugged, because + counts as a space and - doesnt, so it wont display any results
can anyone help me out?
thanks!
 
17 comments
Came here to ask exactly the same question :)
Any abstract guidelines which could help resolve this issue would be appreciated too.
I tried .htaccess rewrite, but as word count varies in different search phrases, it doesn't work corretcly.
 
I've talking about WCDDL2. Also using spaces is NOT very good for seo as googlebot will see link like this: best%20downloads.html. so keywords will be recognized as best and 20downloads instead of best downloads :)
 
I thought it used a - anyway as standard?? I had issues with the - sign so use a real space on my search.
true, the search url contains the -, but so does the search query which doesnt bring up the right search results
looking for a way to get the - in the urls but making them count as spaces in the search query itself
so the-fighter-2010 counts as the fighter 2010
 
true, the search url contains the -, but so does the search query which doesnt bring up the right search results
looking for a way to get the - in the urls but making them count as spaces in the search query itself
so the-fighter-2010 counts as the fighter 2010
Ah I see what you mean. Infact I would also like to know this.
 
Try this, i havent tested it though


Find
PHP:
  $recentsRow['queryURL'] = $core->processURL($recentsRow['query']);

Replace
PHP:
  $recentsRow['queryURL'] = str_replace("+", "-", $core->processURL($recentsRow['query']));
 
Yes, this code replaces - with + and this request <? echo $q?> brings up variable without + or -, but list of downloads is still not showing up. Example:
Im searching for ?q=windows-7-ultimate, then <? echo $q?> will show windows 7 ultimate, but it gives 0 search results. Searhing for ?q=windows+7+ultimate <? echo $q?> will still show windows 7 ultimate, and seach brings many results too :)
EDIT: Code above changes + to - in search query url, but it doesnt works at all :) It seems i had
$q = str_replace("-", " ", $q); in my index.php code, so thats why <? echo $q?> was displayed without - or + :) I removed it, and with above suggested code changes <? echo $q?> brings up windows-7-ultimate.
Suggestion below doesnt works either as it was 1st thing i tried to change, in fact it does exactly the same thing as code above, but it stil ldoesnt brings up search results :)
 
Last edited:
public function processURL($var,$sep='-') {

$var = variavel
$sep = separatore

public function processURL($var,$sep='+') {
 
Found solution:
open funcs.php
Find:
PHP:
if($this->search_type == "narrow") {
                $sqlWhere = " WHERE title LIKE '%".mysql_real_escape_string(str_replace(" ","%",$this->q))."%'";
Replace with:
PHP:
if($this->search_type == "narrow") {
                $sqlWhere = " WHERE title LIKE '%".mysql_real_escape_string(str_replace("-","%",$this->q))."%'";
;)
 
Status
Not open for further replies.
Back
Top