Advertisement:

Author Topic: [ SOLVED ] One ad shows a double  (Read 5718 times)

Abdurauf

  • Newbie
  • *
  • Posts: 4
[ SOLVED ] One ad shows a double
« on: December 05, 2011, 03:59:55 pm »
One ad shows a double
What problem?
« Last Edit: December 13, 2011, 03:02:40 pm by Juan Ramón »

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: One ad shows a double
« Reply #1 on: December 05, 2011, 05:48:03 pm »
Hi, which version of OSClass are you using ?

Abdurauf

  • Newbie
  • *
  • Posts: 4
Re: One ad shows a double
« Reply #2 on: December 05, 2011, 07:38:07 pm »
Hi, which version of OSClass are you using ?
Hi. Last version. OsClass 2.3.1

bilekas

  • Full Member
  • ***
  • Posts: 219
  • Bilekas
Re: One ad shows a double
« Reply #3 on: December 06, 2011, 05:48:05 pm »
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!

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: One ad shows a double
« Reply #4 on: December 08, 2011, 11:48:59 am »
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 to see the issue.

Regards, akapar...

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: One ad shows a double
« Reply #5 on: December 09, 2011, 11:01:52 am »
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

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: One ad shows a double
« Reply #6 on: December 09, 2011, 11:53:25 am »
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


Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: One ad shows a double
« Reply #7 on: December 09, 2011, 06:58:31 pm »
@akapar: If you give me access to your DB and FTP via PM I can try to figure out what's happening.

arabasatis

  • Newbie
  • *
  • Posts: 2
Re: One ad shows a double
« Reply #8 on: December 09, 2011, 10:09:49 pm »
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 :

Code: [Select]
$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.

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: One ad shows a double
« Reply #9 on: December 10, 2011, 06:06:55 pm »
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

Abdurauf

  • Newbie
  • *
  • Posts: 4
Re: One ad shows a double
« Reply #10 on: December 11, 2011, 02:10:39 pm »
osc_count_latest_items() value gives twice as much.
Cod

Site




arabasatis

  • Newbie
  • *
  • Posts: 2
Re: One ad shows a double
« Reply #11 on: December 11, 2011, 08:35:45 pm »
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:
Code: [Select]
$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.

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: One ad shows a double
« Reply #12 on: December 12, 2011, 07:55:44 am »
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

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: One ad shows a double
« Reply #13 on: December 12, 2011, 08:19:54 am »
Conejo, arabasatis,

Unfortunately both of the recommendations do not solve the issue, my website still shows double ads on main page.

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: One ad shows a double
« Reply #14 on: December 12, 2011, 08:26:58 am »
Hi akapar,

Are the ads that are showing more than once marked as premium?

Jay