Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: [MOD] Article sorting v0.1b (sNews 1.5RC1)  (Read 16446 times)

celebro

  • Guest
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #15 on: October 10, 2006, 06:44:58 AM »

Quote from: heathrowintl
notes while implementing...
change 7 which is on 740...for me was 720
You are right, it should be 720 I have updated the mod.

Quote from: heathrowintl
perhaps i misunderstood what the mod would achieve...but i had 8 pages of articles and the very first one i wrote became the newest article...and the very most recentest article was at the bottom of the last page
First thanks for trying it,...

I am going to assume the issues you have mentioned are the following

- When you first created your new article did you give it a value? If you dont give it a value the default would be 0 or none meaning the first article, still ordered by the date created newest to oldest.  

- Second when you created your second article I assume you gave it the order "1" all your previous articles do not have an order value so The first one you created becomes the newest article followed by every other article which does not have a order value (sorted by date created). Then 1 becomes the last article. This is how it is supposed to work.

You would have to give all your articles a order value to get to order them as you want them. So you have to edit all your articles to the order you want them in.

Quote from: heathrowintl
the implementation in itself went fine and the instructions were very good! (they are a pain to write!) any ideas...sorry if this i not useful
Your are right, I personally do not like how the forum does the whole code thing, I will re-write this to be plain text and also include an external link to a text file.
Logged

heathrowintl

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #16 on: October 10, 2006, 07:37:41 AM »

you've done a good job! im going to give it another try soon...would perhaps a useful way of using it be to set every article i currently have to say a value of 10...and have it also as the default value...but when i want to have an article higher up give it a 9...or something.

if they all have the same priority (eg 0)...does it not sort by newest article by date?
Logged

celebro

  • Guest
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #17 on: October 10, 2006, 07:59:23 AM »

Quote from: heathrowintl
you've done a good job! im going to give it another try soon...would perhaps a useful way of using it be to set every article i currently have to say a value of 10...and have it also as the default value...but when i want to have an article higher up give it a 9...or something.

if they all have the same priority (eg 0)...does it not sort by newest article by date?
I never assumed someone would have 8 pages of articles more like 10-20 so they could easily sort out the articles. 1,...,20 etc.

I dont know how to go about implementing something that will grab all the articles you previously had and assign them a value. If I come up with something I will surely post it here.

My only idea right now is if you have access to phpmyadmin, which would be faster I believe and add a value of maybe 10 to your previous articles or go in them one by one in the administration section and assign them a value of 10 manually.

And to answer your final question yes, it sorts them by date, not really though!, it actually sorts them by the order which they were created in the database which is still by date kinda. :)
Logged

heathrowintl

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #18 on: October 10, 2006, 08:59:44 AM »

i used php myadmin to originally alter the database and modify the articles table...i am testing it on my live blog...but i dont care!

i think its a real simple sql command to change a value for all records...dont you stress about that!!
Logged

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #19 on: October 10, 2006, 10:10:30 AM »

Manual sorting is done on categories part: there are usually just a few of them so I think that is a good approach. however, that way of sorting cannot be applied to articles because someone might have 8 pages of them or even more. I surely plan to have lots of articles :) in the near future, and that behaviour is time consuming.

I've been thinking of this problem: what's the most logical way of sorting web contents? What are the user's expectations? The date is the most probable solution because our lives and actions in general are somewhat time determined (ok, this is just my personal yada-yada :D but you get the picture). Other examples are: alphabetical order, size, type etc... Right now I don't see how manual 'randomization' could solve this problem. Or am I missing the bigger picture?

There's another way, applied as comments sorting feature in 1.5: time is used (table "date") as an anchor and asc/desc as ordering behaviour. That course of action can be expanded for articles sorting -> user could choose data type (id, date, alphabet...) and asc/desc rule to set the articles order.
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

celebro

  • Guest
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #20 on: October 10, 2006, 01:43:37 PM »

If article sorting is introduced in the begining I don't really see a problem from what you mentioned above.

In my notes for this modification I originally had the idea of having "up and down" buttons during the administrative article listing inside the (article - > "view") section next to each article. Or maybe within a table where you can easily see the articles and move them up or down, Ill see what I can do in implementing this once the 1.5 stable is release.  

Regardless of the approach when you have 8 pages of articles lets say a tutorial, and you write 10 articles and all of the sudden you have to insert one article in between those...

You have to redo/retype/recopy every single article in the order you want them, which is how this modification came about :( it will save you an extreme amount of time.
Logged

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #21 on: October 10, 2006, 03:17:07 PM »

you have a site with tutorials? what are you waiting for, mate? give us a link :)

ontopic:
i see your point now, sorry that took me so long... on the other hand, why not open up an additional field in the article form to edit 'misplaced' article's id and then set ordering by id? I suppose that way you'll get less code, smaller db and more control over ordering... or not? :D
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #22 on: May 13, 2007, 06:56:13 PM »

There hasn't been any action on this topic for some time.
I applied this MOD to a 1.5.31 project today in the hope that it would help me re-arrange articles within each category... which would be the ideal way of doing it when you use categories as drop-down menus (as this particular project does). It was not possible in its current form (above) but some additional tweaking brought it to life.

Here's the project:
---------------------------------
I have several test articles in five categories. The category-names are displayed in a horizontal nav bar... and mousing over each category-name causes the article link-list for that category to open vertically below it. Clicking on an article-link then takes you to the article.

Yes! Yes! Yes!
With some tweaking... this MOD DOES work well in conjuction with Onlip's Drop-down Menu Mod which works with Philmoz's Categories Mod
in 1.5.31. I assume it will work (with some tweaking) in 1.6 due to be out in a few days.

Results:
-----------------
The assigned article order is stored in the new artorder column in the articles table in the dbase. By default, every article is assigned an order of "0", which then causes all articles to be listed by the default method... which is by the order of the date they were originally posted on.

1. All articles that were posted before adding this mod can now be assigned an order number from the Article Admin Panel.

2. If you plan to have lots of articles per category, then you would use number blocks for each category that won't overlap into the number block for the next category. Let's say you want to stick with a limit of 30 articles for each of 5 categories, then you would use 1 to 30 for the first category... 31 to 60 for the second... 61 to 90 for the third... and 91 to 120 for the 4th... and 121 to 150 for the 5th. I have tested positioning numbers with five digits (such as 11223) so you could... in theory... have more than 10,000 articles and (I suppose) up to 99,999 articles on an sNews site... and be able to sort them using this method... though I can't imagine having that many articles listed in a drop-down menu! :)

The full, updated mod is now available here.
« Last Edit: October 26, 2007, 02:49:02 AM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] Article sorting v0.1b (sNews 1.5RC1)
« Reply #23 on: August 23, 2007, 11:47:11 PM »

Has anyone managed to get this mod working in 1.6? Tried it today and, for some reason, it stops new content from being saved to the database tables. (I may have missed a 1.6 change along the way... needs more exploration).
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: 1 [2]