Osclass forums
Support forums => Installation / Update help => Topic started by: Abdurauf on December 05, 2011, 03:59:55 pm
-
One ad shows a double
What problem?
(http://forums.osclass.org/index.php?action=dlattach;topic=5287.0;attach=2241)
-
Hi, which version of OSClass are you using ?
-
Hi, which version of OSClass are you using ?
Hi. Last version. OsClass 2.3.1
-
You have not closed the php correctly for the if premium..
Close this if statement before the even is ++ ! This is what i would suspect!
-
I also have same issue. All ads on main page appear twice. I think this should be related to some issues with main.php. I would appreciate urgent help on this. Check 05suq.com (http://05suq.com) to see the issue.
Regards, akapar...
-
I could only see Arabic, but ... do you have any other language installed ? Even if it's disable , we're trying to reproduce this issue
-
website is only Arabic, i have both English and Arabic enabled at Admin panel. I tried also making admin panel only Arabic but it doesn't solve the issue. Attached is my main.php file, same as latest version except a small modification to hide sub-categories which was suggested by Juan Ramon at http://forums.osclass.org/index.php/topic,574.0.html (http://forums.osclass.org/index.php/topic,574.0.html)
-
@akapar: If you give me access to your DB and FTP via PM I can try to figure out what's happening.
-
I have the same issue.
When I tried whats happening behind scenes I figured that :
in /oc-includes/osclass/model/Search.php, around line 660 , there is a query like that :
$this->sql = sprintf("SELECT %st_item.*, %st_item_location.*, cd.s_name as s_category_name %s FROM %st_item, %st_item_location, %st_category, %st_category_description .....
which returns items as multiplied by language count: eg. one description from english, one from german.
I will try to solve in time but just wanted give a hint.
-
Hi arabasatis,
I think you are on the right track. My website has category descriptions maintained both in English and Arabic. Please let us know if you find a solution for the issue.
Regards.
05suq.com (http://05suq.com)
-
osc_count_latest_items() value gives twice as much.
Cod
(http://forums.osclass.org/index.php?action=dlattach;topic=5287.0;attach=2317;image)
Site
(http://forums.osclass.org/index.php?action=dlattach;topic=5287.0;attach=2319;image)
-
Here is my solution:
in /oc-includes/osclass/model/Search.php, around line 660 (the line that I mentioned in my previous post)
change the query lline as below:
$this->sql = sprintf("SELECT %st_item.*, %st_item_location.*, cd.s_name as s_category_name %s FROM %st_item, %st_item_location, %st_category, %st_category_description as cd WHERE %st_item_location.fk_i_item_id = %st_item.pk_i_id %s AND %st_item.fk_i_category_id = cd.fk_i_category_id and cd.fk_c_locale_code = '%s' ORDER BY %s %s LIMIT %d, %d", DB_TABLE_PREFIX, DB_TABLE_PREFIX, $extraFields,DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX ,DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX, $conditionsSQL, DB_TABLE_PREFIX, osc_language(), $this->order_column, $this->order_direction, $this->limit_init, $this->results_per_page);
here, we are just adding a "AND cd.fk_c_locale_code = '%s'" condition just before "ORDER BY" and we are giving osc_language() as sprintf format parameter.
-
Try using this file instead of oc-includes/osclass/model/Search.php
Download from here --> https://raw.github.com/osclass/OSClass/develop/oc-includes/osclass/model/Search.php
-
Conejo, arabasatis,
Unfortunately both of the recommendations do not solve the issue, my website still shows double ads on main page.
-
Hi akapar,
Are the ads that are showing more than once marked as premium?
Jay
-
Apologies for my mistake, arasatis's code solved the issue. Sorry for the mistake in my previous post.
Regards,
akapar
-
That is great news.
Jay
-
Moreover, it's fixed in 2.3.2 too. Sorry for the problems.
-
Hi. If the ad is doing paid it appears 2 times. So should it be?
PS Why does not see the admin IP, and can not hang a ban (blocking)
-
This is the normal behavior of the premium and organics ads. If you have only a few ads, you may get the same premium ad in the organic results.