1
Ro5SM
Alphabetical listing in Sections?
  • 2005/1/29 12:41

  • Ro5SM

  • Just popping in

  • Posts: 38

  • Since: 2003/12/14


As I get more and more articles in my sections module, I could really do with the articles being listed alphabetically as this would allow for easier use, and I could also group my articles together. (So I'm talking about pages such as this).

Can anyone help me out with this?

2
Catzwolf
Re: Alphabetical listing in Sections?
  • 2005/1/29 12:48

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Edit Xoops_root/modules/sections/index.php and around about line 93 you should see this line:

$xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("seccont")." SET counter=counter+1 WHERE artid=$artid");

edit this to:

$result = $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE artid=$artid ORDER BY title ASC");

I would also suggest using another sections type module as this one is rather dated now.

ATB

Catz

3
Ro5SM
Re: Alphabetical listing in Sections?
  • 2005/1/29 13:11

  • Ro5SM

  • Just popping in

  • Posts: 38

  • Since: 2003/12/14


Hmmm that doesn't seem to have worked. I tried deleting a few of the articles before putting them back in but still no joy.

4
Catzwolf
Re: Alphabetical listing in Sections?
  • 2005/1/29 13:16

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Whoops, my mistook!! lol

Should have been line 72:

$result = $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE secid=$secid");

to:

$result = $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE secid=$secid ORDER BY title ASC");

Sorry lol

5
Ro5SM
Re: Alphabetical listing in Sections?
  • 2005/1/29 13:38

  • Ro5SM

  • Just popping in

  • Posts: 38

  • Since: 2003/12/14


No worries, I really appreciate your help. There is one last thing though, I'd simply like to get rid of the 'times read' text and the print icon on the same page, if you could help me out there. I've tried code cutting myself but can't seem to get it quite right.

6
Catzwolf
Re: Alphabetical listing in Sections?
  • 2005/1/29 13:43

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I this deleting this line: (around line 80) printf(" (read: %s times)",$counter); should do the trick.

7
bassyard
Re: Alphabetical listing in Sections?
  • 2005/5/9 20:45

  • bassyard

  • Not too shy to talk

  • Posts: 157

  • Since: 2003/10/5


Hi
I want to do a similar thing, and have been playing around with the code, but couldn't get it to do what I want:

I just want my articles to be sorted on the date they where added, newest on top.

Any idea how I would get this to work?

Login

Who's Online

204 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits