Support Forums

Display ALL active listings under category list

This is a discussion on Display ALL active listings under category list within the Technical Support forums, part of the Technical Support Forums category; Hi redking. That's the point. All listings are only displayed when watching the category.php. As soon as you click on ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 06-11-2009, 10:33 PM   #31
Member
 
Join Date: Mar 2009
Posts: 82
Rep Power: 11
wabugi is a glorious beacon of light wabugi is a glorious beacon of light wabugi is a glorious beacon of light
Default

Hi redking.

That's the point. All listings are only displayed when watching the category.php. As soon as you click on sub categories, no ads from their sub categories are being displayed.

I've read many threads in this forum and always when it comes to this issue anyone says "we can't do it because the server load will be too high".

Well there are other websites which CAN do it. ebay for example displays all listings from all sub categories. Ok ebay is very big and complex. They have masses of servers and nearly unlimited resources. But for a normal user this kind of displaying listings is logic and understandable.

Let's forget the server load for a moment. Is it possible to always display all listings from a category including the listings from it's sub categories (and of course again their sub categories)?

I really would like to be able to do this with my website and I want to see myself how dramatic the increase of the server load is.

Don't understand me wrong. I don't want to force people to work overtime just to get me a solution ^^
But this feature requests has been several times on this forum and maybe a more preciser answer or slution would help solving this issue.
__________________
v4.15 - Developer Edition - custom template
wabugi is offline  
Old 06-24-2009, 09:32 AM   #32
Junior Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 0
rdouglas is on a distinguished road
Default

Hi wabugi,

Did you find a solution to this?



Quote:
Originally Posted by wabugi
Hi redking.

That's the point. All listings are only displayed when watching the category.php. As soon as you click on sub categories, no ads from their sub categories are being displayed.

I've read many threads in this forum and always when it comes to this issue anyone says "we can't do it because the server load will be too high".

Well there are other websites which CAN do it. ebay for example displays all listings from all sub categories. Ok ebay is very big and complex. They have masses of servers and nearly unlimited resources. But for a normal user this kind of displaying listings is logic and understandable.

Let's forget the server load for a moment. Is it possible to always display all listings from a category including the listings from it's sub categories (and of course again their sub categories)?

I really would like to be able to do this with my website and I want to see myself how dramatic the increase of the server load is.

Don't understand me wrong. I don't want to force people to work overtime just to get me a solution ^^
But this feature requests has been several times on this forum and maybe a more preciser answer or slution would help solving this issue.
rdouglas is offline  
Old 06-24-2009, 12:09 PM   #33
Member
 
Join Date: Mar 2009
Posts: 82
Rep Power: 11
wabugi is a glorious beacon of light wabugi is a glorious beacon of light wabugi is a glorious beacon of light
Default

Hi rdouglas,

no I didn't find a solution yet. My website will go online in maybe 2 weeks from now on (if I have enough time to work on it) and I would really like to have this feature included.

I already startet a feature request but it seems like this feature is not very popular.
__________________
v4.15 - Developer Edition - custom template
wabugi is offline  
Old 06-24-2009, 01:19 PM   #34
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,306
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I just looked into this again and I remember now why it is so difficult.

Here is a test I ran.

category.php:
Find: $options['section']=$sec;
Replace with:
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['cats'] = $arr_childs;

includes/classes/kernel/Listings.php
add:
$where .= ( empty($options['cats']) ) ? '': " AND p.section In (". implode(', ', $options['cats']) .")";
inside the getAllListings method.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 06-24-2009, 03:06 PM   #35
Member
 
Join Date: Mar 2009
Posts: 82
Rep Power: 11
wabugi is a glorious beacon of light wabugi is a glorious beacon of light wabugi is a glorious beacon of light
Default

Hi Eric. I'm very happy that you follow this issue.

I did what you said. Now my complete listing database is being displayed in every category ^^

That's where I inserted the code in the listings.php:
Code:
        function getAllListings($options, $current_row, $max)
        {
                global $db, $class_tpl, $modules;
                if(defined('IN_ADMIN')) {
                $sSQL = 'SELECT * FROM '.PREFIX.'listings as p';
                }
                else
                {
                   $where .= ( empty($options['cats']) ) ? '': " AND p.section In (". implode(', ', $options['cats']) .")";
In Category.php I still have 2 old changes which you suggested some weeks ago. That was:
To show all listings open category.php and find:
$showlistings='N';

Change to:
$showlistings='Y';

Find:
$options['section']=$sec;

Change to:
if(isset($sec)) {
$options['section']=$sec;
}

Is it possible that these changes are not compatible with the new changes? Or are these changes still needed?
__________________
v4.15 - Developer Edition - custom template
wabugi is offline  
Old 06-24-2009, 03:28 PM   #36
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,306
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I knew I would open up a can of worms posting that.
The best bet is to just start doing some debugging on your own and seeing how it all ties together. With the code I posted above it was added to stock files.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 06-24-2009, 06:18 PM   #37
Member
 
Join Date: Mar 2009
Posts: 82
Rep Power: 11
wabugi is a glorious beacon of light wabugi is a glorious beacon of light wabugi is a glorious beacon of light
Default

What I've done now:

I updated my installation from v4.13 to 4.14.

In root/category.php:
Find: $showlistings='N';
ChangeTo: $showlistings='Y';

Find: $options['section']=$sec;
ChangeTo: if(isset($sec)) {
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['cats'] = $arr_childs;
}

And I added the new code to root/includes/classes/kernel/listings.php like this:
Code:
function getAllListings($options, $current_row, $max)
{
global $db, $class_tpl, $modules;
$where .= ( empty($options['cats']) ) ? '': " AND p.section In (". implode(', ', $options['cats']) .")";
That`s a combination of the old solution displaying ALL listings in the root category and your new solution for displaing ALL listings of sub categories in their parent categories.

This solution now seems to work! Until now I didn't find any errors.

Thank you again for having another look at this issue. I`m very happy with that solution now ^^

If I find any malfunctions or errors I will post them here.
__________________
v4.15 - Developer Edition - custom template

Last edited by wabugi; 06-24-2009 at 06:31 PM.
wabugi is offline  
Old 06-25-2009, 12:18 AM   #38
Junior Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 0
rdouglas is on a distinguished road
Default

Eric,

This works for me too. Thanks!

PS. make sure you have category > allow ads > YES set in the admin panel


Quote:
Originally Posted by Eric Barnes
I just looked into this again and I remember now why it is so difficult.

Here is a test I ran.

category.php:
Find: $options['section']=$sec;
Replace with:
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['cats'] = $arr_childs;

includes/classes/kernel/Listings.php
add:
$where .= ( empty($options['cats']) ) ? '': " AND p.section In (". implode(', ', $options['cats']) .")";
inside the getAllListings method.
rdouglas is offline  
Old 07-17-2009, 12:13 PM   #39
Senior Member
 
Join Date: Jun 2009
Posts: 121
Rep Power: 5
pipelin is on a distinguished road
Default

Hi,

I used this code (I had to put category > allow ads > YES set in the admin panel, in every category. I think this code needs some change. it's not right allow ads en every category):


category.php:
Find: $options['section']=$sec;
Replace with:
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['cats'] = $arr_childs;

includes/classes/kernel/Listings.php
add:
$where .= ( empty($options['cats']) ) ? '': " AND p.section In (". implode(', ', $options['cats']) .")";
inside the getAllListings method.

and it works almost perfect, except when I click the menu option "browse", I got this error:

Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 SQL: SELECT id FROM class_clacategories WHERE parent_id In () in /home/content/r/a/g/ragomez79/html/includes/classes/database/mysql.php on line 143

Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND p.price BETWEEN 0 AND 99999999999 AND p.expiration > NOW() AND p.display =' at line 1 SQL: SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.description, p.price, p.dateadded, p.expiration, p.display, p.pHighlighted, p.pBold, p.hitcount, p.url, u.username, u.state, u.city, u.country, u.extra, u.extra2, u.extra3 FROM class_clalistings AS p LEFT JOIN class_clausers AS u ON p.owner = u.id WHERE 1=1 AND p.section In () AND p.price BETWEEN 0 AND 99999999999 AND p.expiration > NOW() AND p.display = "Y" GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.dateadded, p.expiration, u.state, u.city, u.country ORDER BY featured desc in /home/content/r/a/g/ragomez79/html/includes/classes/database/mysql.php on line 143

Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND p.price BETWEEN 0 AND 99999999999 AND p.expiration > NOW() AND p.display =' at line 1 SQL: SELECT p.id, p.owner, p.title, p.featured, p.section, p.shortDescription, p.description, p.price, p.dateadded, p.expiration, p.display, p.pHighlighted, p.pBold, p.hitcount, p.url, u.username, u.state, u.city, u.country, u.extra, u.extra2, u.extra3 FROM class_clalistings AS p LEFT JOIN class_clausers AS u ON p.owner = u.id WHERE 1=1 AND p.section In () AND p.price BETWEEN 0 AND 99999999999 AND p.expiration > NOW() AND p.display = "Y" GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.dateadded, p.expiration, u.state, u.city, u.country ORDER BY featured desc LIMIT 0, 10 in /home/content/r/a/g/ragomez79/html/includes/classes/database/mysql.php on line 143

Can someone help me, please?
pipelin is offline  
Old 08-25-2009, 12:16 AM   #40
Member
 
Fatih67's Avatar
 
Join Date: Jun 2008
Location: TURKEY
Posts: 58
Rep Power: 8
Fatih67 is on a distinguished road
Cool

IS there any solution ?

I tried all code from forum but I have the same problem with other people.

also I dont want to accept ads main categories

this is very very important for me
__________________
� 2007 68 Classifieds - A division of 68 Designs, LLC - v4.0.3 Developer
Another 68C site ; ikinci el kamyonlar
Fatih67 is offline  
Closed Thread

Tags
category , hack , listings , sub cats

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listings in admin are active... but expired?? Tim_A Technical Support 1 03-03-2009 10:51 AM
Listings 'Not Active' tdisraeli Technical Support 6 10-03-2008 01:37 PM
Display Category name in Featured*listings hel68c Technical Support 0 08-06-2008 07:19 PM
Adding 'category' to 'new listings' display Chaslie v3.1 Modules & Modifications 5 01-31-2008 04:31 PM
How to display category total listings? dankellaway v3.1 Questions & Support 2 03-13-2007 02:25 PM


All times are GMT -4. The time now is 12:28 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0