Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 06:31 am EST

Geeklog Forums

Sorted Polls


cwilkins

Anonymous

Ok, dunno if this qualifies as "cool", but I wanted poll answers shown in the order I entered them, and that wasn't happening. My solution requires two steps. First, enter your poll answers with a number (or letter) in front:

  1. foo
  2. bar
  3. baz
...

That gives you something solid to sort on.

Now pull up lib-common.php in your favorite editor and search out the three occurrences of "pollanswers". These are all SQL SELECT statements, one of which already has an ORDER BY clause. Add "ORDER BY answer" to the end of the other two in similar fashion. (I'd provide an example, but bits of it get eaten by posting in Geeklog.)

Save your changes, and Poof! Provided you got it right, your poll answers are now sorted. It's just that simple!

-cw-

 Quote

All times are EST. The time is now 06:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content