Osclass forums
Support forums => Themes => Topic started by: makmortifera on July 05, 2017, 04:10:36 pm
-
Theme: Osclass Wizards
Hello everyone, I have a problem in the custom fields, when creating a field I activate the "Tick to allow searches by this field" option, but when trying to perform a search it does not select by this field.
Example: I have a field called "Room(Quarto)" and it already comes with the numbers that can be selected.
(http://i.imgur.com/9iVR0K7.png)
When you create an ad, you define a number.
Example:
(http://i.imgur.com/ilvpqF6.png)
But at the time of searching for "Room(Quarto)", I choose the number 1
(http://i.imgur.com/odEKzHc.png)
it shows me all the ads, even what I set the number "Room(Quarto) = 4"
Any help?
-
Try replacing 9+ with
9 or more
and make sure the indentifier is unique.
If you added this custom field and an add was already posted on your website, it receives the first value of your dropdown.
All the ads in that category must be edited in order for this to work.
-
Try replacing 9+ with
9 or more
and make sure the indentifier is unique.
If you added this custom field and an add was already posted on your website, it receives the first value of your dropdown.
All the ads in that category must be edited in order for this to work.
Thx for reply marius, but didn't work...
-
I noticed a detail, when I do a search on "Room(Quarto)", it changes the link to:
http://localhost.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc
But, when i try to search for a min price... Ex: 13000, it shows
http://localhost.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&sPriceMax=13000 <- And Work
Maybe, something is missing at the end of link
-
I don't have this issue with 3.7.1. and bender theme.
And I don't use plugins.
Some of the guis here said that the standard procedure is to swich to bender theme and disable all plugins, then test it. If it works, you can enable the plugins one by one and see if either of them is the cause. And then check the theme you are using if it is not bender.
-
I did a clean install of "osclass.3.7.3" script and DB in my webhost, the script I downloaded directly from the site and made the install step by step from installation page.
And it still did not work
I tested inside the panel that the osclass itself offers, and it works normally, you can see at the link below
https://imoveisteste.osclass.org/houses-apartments-for-sale
The version that they use is 3.6.1, that is a joke...
They are releasing the script with problem, i think... i will try to found the script 3.6.1 or 3.7.1 to test
-
Very strange, I did another clean installation of version 3.7.1 and it also does not work.
Can you zip and make it available for download?
-
I don't have this issue with 3.7.1. and bender theme.
And I don't use plugins.
Some of the guis here said that the standard procedure is to swich to bender theme and disable all plugins, then test it. If it works, you can enable the plugins one by one and see if either of them is the cause. And then check the theme you are using if it is not bender.
I do not know how, but I found the problem... I do not know how in your version 3.7.1 works, because I tested it here and it did not work, version 3.6.1 works correctly.
I will post the problem soon
-
Well it works.... I just tried it just to be shure.
EDIT.
I use identifier the same as the name, in your example quartos
EDIT2
And my options are not made from 1 character.
These are the differences.
EDIT 3.
I just remembered I have a custom field like yours 1,2,3,4,5.....
it works for 1 as I have only ads with 1 as the field's value.
Edit 4
I just modified one of the ads with value 6 and tried the filter. It filters ok.
-
Regarding the zip file:
Osclass 3.7.1 has 6.4 mb and the limit is 2 mb here.
I could send it to you via email.
EDIT:
Teseo said something about allow_url_fopen here:
https://forums.osclass.org/espanol-8/no-aparece-el-website-de-mi-usuarios/msg152163/#msg152163
Just to be sure, is your's open?
-
Just to be sure, is your's open?
What?
-
As I said, the file that is coming from the download is either a problem or does not work specifically on my server.
This error was occurring when I searched with a custom field:
[Wed Jul 05 20:07:03 2017] [error] [client 177.143.236.173] PHP Warning: urldecode() expects parameter 1 to be string, array given in /home/folder/oscalss.domain.com/oc-includes/osclass/classes/Rewrite.php on line 192, referer: http://oscalss.domain.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&sCategory=96
The problem is in the: /oc-includes/osclass/classes/Rewrite.php from version 3.7.3
When i change the code from version 3.7.3:
public function extractParams($uri = '')
{
$uri_array = explode('?', $uri);
$length_i = count($uri_array);
for($var_i = 1;$var_i<$length_i;$var_i++) {
parse_str($uri_array[$var_i], $parsedVars);
foreach($parsedVars as $k => $v) {
Params::setParam($k, urldecode($v));
}
}
}
To code from 3.6.1:
public function extractParams($uri = '')
{
$uri_array = explode('?', $uri);
$length_i = count($uri_array);
for($var_i = 1;$var_i<$length_i;$var_i++) {
if(preg_match_all('|&([^=]+)=([^&]*)|', '&'.$uri_array[$var_i].'&', $matches)) {
$length = count($matches[1]);
for($var_k = 0;$var_k<$length;$var_k++) {
Params::setParam($matches[1][$var_k], $matches[2][$var_k]);
}
}
}
}
Now everything works normally.
-
I was just saying about that fopen thing...
Regarding the filter..... I made some modifications to the functions.php file with the help of Teseo for improving the search results and other things. Maybe those hooks are the difference in 3.7.1 that makes my website work ok in the filter's regard.
I don't know more.... maybe someone with more experience than me could figure out the problem.
(I checked the code you wrote. In 3.7.1 is the same as the one you wrote for 3.7.3)
-
Regarding the filter..... I made some modifications to the functions.php file with the help of Teseo for improving the search results and other things. Maybe those hooks are the difference in 3.7.1 that makes my website work ok in the filter's regard.
I don't know more.... maybe someone with more experience than me could figure out the problem.
(I checked the code you wrote. In 3.7.1 is the same as the one you wrote for 3.7.3)
I do not know what that can be, I just know that by changing this code I posted, it worked normally.
I was just saying about that fopen thing...
Now I understand, I'm going to test this fopen later.... Thx
-
Hello everybody,
The change made solves the problem but creates another. when you search with spaces or special characters, the url is badly coded and the search does not work. The code must be corrected as follows (see last line ):
public function extractParams($uri = '')
{
$uri_array = explode('?', $uri);
$length_i = count($uri_array);
for($var_i = 1;$var_i<$length_i;$var_i++) {
if(preg_match_all('|&([^=]+)=([^&]*)|', '&'.$uri_array[$var_i].'&', $matches)) {
$length = count($matches[1]);
for($var_k = 0;$var_k<$length;$var_k++) {
Params::setParam($matches[1][$var_k], urldecode($matches[2][$var_k]));
}
}
}
}
-
Hi,
There's an official fix here:
https://forums.osclass.org/general-help/custom-fields-can-not-search-by-filters!!!/msg162800/#msg162800
Regards