Register  It's Free! Monday,   September  6,   2010
User Name Password
  Downloads   Modules

Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
9 user(s) are online (6 user(s) are browsing Forum)

Members: 0
Guests: 9

more...
Please Read This
All my modules require users to be registered to add listings or to reply to a listing.
There are parts that NEED a user ID. to work properly.

All reputable websites DO NOT allow anonymous users to add anything, even on the
Xoops site you need to be registered, there are many reasons for this.

You may be able to hack the module to work with non registered users, it will probably not be easy, and I do not support this. I'm sorry but thats the way it is.

Browsing this Thread:   1 Anonymous Users





Manual sorting is not working
Not too shy to talk
Joined:
3/23 8:20
Posts: 35
Offline
Hi,
when I try to sort the categories manually, does not work. Classifieds 2.5 Sort only alphabetically, in the settings I changed, though, it does not work.

You can help ? Thanks

Posted on: 7/8 6:09
Transfer the post to other applications Transfer


Re: Manual sorting is not working
Webmaster
Joined:
2004/10/6 16:13
Posts: 927
Offline
host2,

Go to index.php around line 131 find this line:

$sql = 'SELECT cid, title, img FROM '.$xoopsDB->prefix("".$mydirname."_categories").' WHERE pid = 0 ';

change it to:

$sql = 'SELECT cid, title, img, ordre FROM '.$xoopsDB->prefix("".$mydirname."_categories").' WHERE pid = 0 ';


Then Before that line add this line:

$cat_sort = $xoopsModuleConfig["".$mydirname."_csortorder"];



Then around line 141 find this line:

$sql .= 'ORDER BY title';

change it to this:

$sql .= 'ORDER BY '.$cat_sort.'';



go to about line 174 and find this line:

$arr = $mytree->getFirstChild($myrow['cid'], 'title');

change to this:

$arr = $mytree->getFirstChild($myrow['cid'], $cat_sort);


Save and close index.php



Then go to catview.php around line 111 and 112 anf find these lines:

$result = $xoopsDB->query("select cid, pid, title, cat_desc from ".$xoopsDB->prefix("".$mydirname."_categories")." where cid=".mysql_real_escape_string($cid)." $cat_perms");
list($cid, $pid, $title, $cat_desc) = $xoopsDB->fetchRow($result);


change them to this:


$result = $xoopsDB->query("select cid, pid, title, cat_desc, ordre from ".$xoopsDB->prefix("".$mydirname."_categories")." where cid=".mysql_real_escape_string($cid)." $cat_perms ORDER BY ".$cat_sort."");
list($cid, $pid, $title, $cat_desc, $ordre) = $xoopsDB->fetchRow($result);



then BEFORE those lines add this line:

$cat_sort = $xoopsModuleConfig["".$mydirname."_csortorder"];



Then go down to about line 136 find this line:

$arr = $mytree->getFirstChild($cid, "title");

change it to this:

$arr = $mytree->getFirstChild($cid, $cat_sort);



then go down to about line 142 and find this line:

$sub_arr = $mytree->getFirstChild($ele['cid'], 'title');

change it to:

$sub_arr = $mytree->getFirstChild($ele['cid'], $cat_sort);


Save and close catview.php

I think that will do it. Let me know what happens.



Thanks,

John

Posted on: 7/13 14:09
Transfer the post to other applications Transfer


Re: Manual sorting is not working
Not too shy to talk
Joined:
3/23 8:20
Posts: 35
Offline
Hello John,

you are a genius This works perfect.

Yery Yery Thanks for you help

You can this please update in the RC 2.5 Final Thanks

He is my Website, You can he see your Classifieds .

http://www.gothaer-anzeigenmarkt.de/modules/classifieds/

Have a nice Day


greet host2

Posted on: 7/13 15:46
Transfer the post to other applications Transfer






You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Donat-O-Meter
Make donations with PayPal!

Donations
Waiting Contents Ext
System Downloads Forum Alumni Job Listings Garages classifieds
Weather
Southington
Conditions as of
20 minutes ago


partly cloudy
Temp: 79 °F ↑
Feels like: 78 °F ↑
Rel hum: 28 % ↓
Wind increasing
SW at 11.5 mph
Gusts 19.6 mph
view forecast
jlmzone © 2010
Powered by XOOPS 2.4.4