Support Forums - Classified Ads Script Osclass
Osclass theme support => Sigma Osclass Theme => Topic started by: Arreff on October 10, 2022, 03:23:56 PM
-
Hi I am using the Sigma Theme and there seems to be some limitations.
Basically I am using Osclass as a sort of private library. so there are no prices, locations or any such thing.
I use the title and my own alphabetized "code" to find item's locations in the real world.
First, I want to remove "Latest Listings" and from the top page show a list of random listings.
How might I do that?
Second, there is only one sorting option for browsing the categories or search results which is "Newly Listed"
I would like to add other sorting parameters such as "sort A to Z" or "sort Z to A" how might I do that?
Cheers.
-
@Arreff
1) remove latest - edit main.php in theme folder
2) add sorting - not supported, in world of classifieds such request is irrelevant
-
@Arreff
1) remove latest - edit main.php in theme folder
2) add sorting - not supported, in world of classifieds such request is irrelevant
Hi MB Themes,
1. No such thing "latest" exists int the main.php file of the Sigma theme.
2. Isn't that a bit narrow minded? why shouldn't you be able to sort A to Z or Z to A?
In the world of classifieds, I would think it is very relevant. Would help me to find a very specific classifieds if I was looking for a particular thing alphabetically.
Is it so difficult to do?
-
1) Check also header.php for latest items
2) Isn't that a bit narrow minded? why shouldn't you be able to sort A to Z or Z to A? ---> already told you why such feature is not there.
-
For anyone who wants to know
1) After doing a word search, "Latest Listings" only exists in two places.
i. osclass\oc-content\themes\sigma\functions.php AND
ii. osclass\oc-includes\osclass\gui\main.php
But this doesn't solve my question of how to RANDOMIZE listings.
If I change the title that doesn't randomize listings. Someone talked about randomizing premium listings.
From what I read, It wasn't a success. Does anyone else have an idea how this can be done.
2) I have made a work around since MT Themes either doesn't know how to do it or just flat refuses.
I have edited dt_pub_date in the SQL to reflect the alphabetical order by changing the publish date. That's easy enough.
The sort parameters only allow for sort by Newest Listing i.e. iOrderType=desc
There is an 'asc' in the script, but it doesn't reflect in the sort parameters on the site.
Does anyone know why this is and how to fix it?
-
It does not show because order by date from oldest does not make sense in classifieds.
Randomization can be done i.e. by doing subquery to get random ids first and then show listings of these ids.
Order by rand() could work.
-
It does not show because order by date from oldest does not make sense in classifieds.
I would say it does. If you can sort by newly added then you should be able to order by oldest.
To me it seems like adding an extra option or <li> code somewhere with iOrderType=asc
Simple logic. But if you don't want to help me, then that is just who you are.
People reading this will understand that.
Randomization can be done i.e. by doing subquery to get random ids first and then show listings of these ids.
Order by rand() could work.
As I am new to coding (like just the last few days I started), could you possibly give me an example?
And also, in which file would it go?
search.php ? or somewhere else?
Help would be appreciated.
-
Can anyone give me an example code of how a subquery to get random ids to show these ids by using rand() ?
-
I have figured out how to sort things for listing searches.
The file you need is osclass\oc-includes\osclass\helpers\hSearch.php
line 46 to 60
function osc_list_orders() {
if (osc_price_enabled_at_items()) {
return osc_apply_filter('search_list_orders', array(
__('Newly listed') => array('sOrder' => 'dt_pub_date', 'iOrderType' => 'desc'),
__('Lower price first') => array('sOrder' => 'i_price', 'iOrderType' => 'asc'),
__('Higher price first') => array('sOrder' => 'i_price', 'iOrderType' => 'desc')
));
}
else {
return osc_apply_filter('search_list_orders', array(
__('Newly listed') => array('sOrder' => 'dt_pub_date', 'iOrderType' => 'desc')
));
}
}
you can add code
__('Oldest listing') => array('sOrder' => 'dt_pub_date', 'iOrderType' => 'asc')
after both
__('Newly listed') => array('sOrder' => 'dt_pub_date', 'iOrderType' => 'desc')
and you can probably add other sorting options by changing the dt_pub_date
asc is for ascending and desc is for descending.
Why MB Themes refused to suggest this is beyond me, but at least everyone knows where the sorting options are.
-
@Arreff
Because we never suggest modifications in core.
-
@MB Themes
Something you could have suggested from the beginning?