Working on wrapping up a few tid-bits here & there with a site before launching it, and can hopefully get it finished soon. It's been over 2 years in the making! :O
Anyway, my question...
First of all, I'm running PostNuke version 0.7.2.3-Phoenix...
If you access the this category of web links at my site, you can see that the sub categories are all neatly alphabetized. However, click into "Councils" and you'll see the problem.
"Councils" is a sub-sub-category and the "sub-sub-subs" aren't alphabetized. :( Instead, they're ordered according to the category ID (cid).
I've not hacked these files at all, they are original. I've looked thru and can't really tell where I need to edit to make this change so that sub-sub-subs are ordered alphabetically. Any help would be much appreciated! :)
Thanks!
Login
Donate to Zikula
Core Modules & Blocks
::
Web Links alphabetization
-
-
Did some more poking about this evening and discovered...ALL of the sub-cats are ordered by cid. S'just that all the others were inputted alphabetically already.
So, that puts me back at square one, really. But, I did try some things this evening, and here's what I got...
/modules/Web_Links/wl-viewlink.php
Lines 101, 102, 103:
Code
$subresult=$dbconn->Execute("SELECT $column[cat_id], $column[title]
FROM $pntable[links_categories] WHERE $column[parent_id]=".(int)pnVarPrepForStore($cid)."ORDER BY $column[title] ASC");
$numrows = $subresult->PO_RecordCount();
The above code, I added the ."ORDER BY bit at the end of the SELECT statement...
And when I do, I get the following error on the page:
Quote
Fatal error: Call to a member function on a non-object in /home/mickey/public_html/site/modules/Web_Links/wl-viewlink.php on line 103
Most of the page loads fine, but instead of the web links loading or the sub-cats or anything as far as "content", I get the above error. I feel like I'm getting close, but still unsure of where to go? -
Code
$column[parent_id]=".(int)pnVarPrepForStore($cid)."ORDER BY
..too close.
Code
$column[parent_id]=".(int)pnVarPrepForStore($cid)." ORDER BY
..notice the space before ORDER BY :D
..i meant to answer this one earlier.. sorry
-IR
--
http://www.invalidresponse.com -
*slaps forehead*
Thanks.
Just a stooooopid little mistake, too.
Thanks for the help! Works like a dream, now!
-
For Adding Links:
I was wondering if something similar could be contrived to list the pull down category list in alphabetical order. Probably at or around line 64 in file wl-addlink.php where:
Code
Because I list a number of soccer teams as categories and find when I add new teams at the end of a season the cat list adds them to the bottom, which is not desirable.
TIA -
Funny, I just ran into the same thing today. LoL
S'not on that line, that. You have to do the alpha when you pull the data from the database.
Am on the prowl for it at the moment...
Will post back if I find it.
-
Found it.
/modules/Web_Links/wl-categories.php
Lines 48 & 49 were previously...
Code
$result=$dbconn->Execute("SELECT $column[cat_id] FROM $pntable[links_categories]
WHERE $column[parent_id]=".(int)pnVarPrepForStore($scat)."");
You need to change them to...
Code
$result=$dbconn->Execute("SELECT $column[cat_id], $column[title] FROM $pntable[links_categories]
WHERE $column[parent_id]=".(int)pnVarPrepForStore($scat)." ORDER BY $column[title] ASC");
Note, you need to add one thing on each line...First, you're going to alos SELECT $column[title] from the database on line 48. (Don't forget the comma) Second, you're going to ORDER BY $column[title] on line 49. ASC is set by default, but it doesn't hurt to include it. This says you want your list to be ASCENDING. Be sure to include the ORDER BY statement BETWEEN the quotes at the end of the original line.
There you go.
-
