Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Web Links alphabetization
  • Posted: 16.05.2004, 03:35
     
    MrJL
    rank:
    Softmore Softmore
    registered:
     April 2003
    Status:
    offline
    last visit:
    11.06.06
    Posts:
    87
    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!
  • Posted: 16.05.2004, 09:05
     
    MrJL
    rank:
    Softmore Softmore
    registered:
     April 2003
    Status:
    offline
    last visit:
    11.06.06
    Posts:
    87
    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?
  • Posted: 16.05.2004, 09:27
     
    InvalidResponse
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    21.10.07
    Posts:
    2423

    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 icon_rolleyes

    -IR

    --
    http://www.invalidresponse.com
  • Posted: 16.05.2004, 19:45
     
    MrJL
    rank:
    Softmore Softmore
    registered:
     April 2003
    Status:
    offline
    last visit:
    11.06.06
    Posts:
    87
    *slaps forehead*

    Thanks. icon_smile Just a stooooopid little mistake, too.

    Thanks for the help! Works like a dream, now! icon_smile
  • Posted: 19.05.2004, 00:12
     
    Wroenco
    rank:
    Freshman Freshman
    registered:
     September 2003
    Status:
    offline
    last visit:
    12.12.06
    Posts:
    27
    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

    echo CatList(0, 0);


    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
  • Posted: 19.05.2004, 03:43
     
    MrJL
    rank:
    Softmore Softmore
    registered:
     April 2003
    Status:
    offline
    last visit:
    11.06.06
    Posts:
    87
    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... icon_smile Will post back if I find it. icon_smile
  • Posted: 19.05.2004, 04:01
     
    MrJL
    rank:
    Softmore Softmore
    registered:
     April 2003
    Status:
    offline
    last visit:
    11.06.06
    Posts:
    87
    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. icon_smile

    There you go. icon_smile
  • Posted: 19.05.2004, 11:56
     
    Wroenco
    rank:
    Freshman Freshman
    registered:
     September 2003
    Status:
    offline
    last visit:
    12.12.06
    Posts:
    27
    Thanks a lot. That works a treat.

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula