Please login or register.

Login with username, password and session length
Advanced search  

Poll

 version 1.6 MEMU?

using version 1.6 MEMU?
using version 1.7?
using version 1.6 MU?

Author Topic: sNews 1.6 MEMU-->how to change order of articles?  (Read 5173 times)

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
sNews 1.6 MEMU-->how to change order of articles?
« on: December 21, 2009, 12:17:22 pm »

Hello
Since a while i am following your great achievments with snews. I love it!!
I am "playing" with the version sNews 1.6 MEMU version 1.1 - "Modular Enhanced Multiple Users" Based on sNews 1.6 - Core Release date: May 16, 2007 (so it says in config.php)

In this version the user can change the order of the categories very easly
Is there a way to do the same with the articles?
I saw it was build in in the vs 1.7.
How can I "copy" this "mod" into vs 16 MEMU?

or

how to place the latest article on the top of the list (at this moment the articles are placed random in the list)?

I saw that this function exist in sNewsME 1.6 en sNewsMU 1.6 (order articles)


thank you for your great work!!

« Last Edit: December 22, 2009, 02:33:47 pm by jander »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #1 on: December 22, 2009, 06:57:14 pm »

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #2 on: December 22, 2009, 09:49:12 pm »

thank you for your fast response
I wil give a try (already trying)

sNews1.6 MEMU is build a little bit different than the "normal" sNews versions, so it looks
It has a seprate language file in a language folder, a config.php and a snewsMU.php file
Besides a folder for mods

So , as not being a expert in php but willing to learn a lot (and learning) I cannot find al the issues as mentioned
in topic http://snewscms.com/forum/index.php?topic=6990.0 (Content Re-ordering - the Ultimate Solution ) in a snews.php file
Although I read the topic and see that in this article the solution is mentioned as I was looking for

If you got more tips..

I will continue trying..

jander

thank you!!
« Last Edit: December 22, 2009, 11:07:20 pm by jander »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #3 on: December 23, 2009, 02:52:02 am »

Spend a little time reading through the comments located in the top part of the snewsMU.php (core engine) file. These notes provide some detail as to the many modifications added to the package.

Let's run through the steps (briefly) from the Mod post.

1. You can put the language variable values in your languages/english/langfile.php file.
    If you are creating your own file for another language, duplicate the folder & file, and re-name the folder to your language.

2.  With the  $l['cat_listSEF'] string (near the bottom of all language files), you don't want to replace the
     string in this case (since it includes several other mods)... you just want to add ,artorder to the end, just before the closing ';

3.  For function categories... look in the mods/category_lists.php file.
     This file contains two functions:
          - default_categories()
          - categories($num, $showhome, $start, $size)

    In the first function, locate this string:
Code: [Select]
<?php

$calc_num_query 
"SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND category = $r[id] AND published = 1";

?>


and replace the end of the string so it looks like this - AND published = '1' ORDER BY artorder ASC";
All we're doing is adding ORDER BY artorder ASC so that data being returned (in the query to the articles dbase table) will be ordered according to the order settings given to it.

Like-wise, in the second function, you want to acheive the same thing... make the end of the $calc_num_query string look like -  AND published = '1' ORDER BY artorder ASC";

4.  Function Extra - Around line 288 in the snewsMU.php file, you'll notice a note there:
     // EXTRA CONTENT moved into mods/extra_functions.php (or extra_positions.php, depending on what version)
     ... so open that file and have a look at it.

     There are three functions there... extra - second_extra and third_extra.
     All three do the same thing, in different locations in the template.
     Apply the same change to all three functions.
     Again, we're just changing the end of the $query string (in each) to be AND published = 1 ORDER BY artorder ASC";

Steps 5 to 10 are all in the snewsMU.php file.

11.  The database alteration.
       I assume you used phpMyAdmin to create and populate your database.
       We need to add an artorder row column to the articles table in your database.
       In phpMyAdmin, with your database tables listed in the center area, click the SQL tab,
       copy & paste the blue string in the text-area and click the "GO" button
             ALTER TABLE articles ADD `artorder` smallint(6) NOT NULL default '0';



 
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #4 on: December 23, 2009, 12:04:57 pm »

Thank you Keyrocks for your fast response again
There is nothing better than having a BACK-UP ( and I have!!')

I followed the steps above, all went well (although the content of articles in the categories were'nt visible halfway the inplementation)
It went "wrong" in the steps 5 to 10 (at point 8, there was an error in  reading the database and the whole website diasppeared visually just showing the error with the line number where I made the change)
Although a little window came visible under the article editor where I could put a nummer up to 100 for ordening articles
but
and it went "wrong" in the function extra_positions.php in the version I have

I will try a clean installation first of sNews1.6 MEMU end than make this chances, although I tried 2 times starting again (with a cup of coffee in between) and encountered the same problems
The sNews I am using is:
   sNews 16 MEMU Project        version 1.1 (replaces v 1.0)
   Created: October 30.07 ( Updated: Jan.13.08 )
   Based on:     sNews 1.6 MU
          Multiple User MOD Version

Is this the latest version of the sNews1.6 MEMU project?
Is this project still alive? or is it also replaced by a sNews1.7 MEMU ?

thanks again for your input!!

jander
« Last Edit: December 23, 2009, 02:11:17 pm by jander »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #5 on: December 23, 2009, 05:00:34 pm »

1 - Thank you Keyrocks for your fast response again
2 - There is nothing better than having a BACK-UP ( and I have!!')

3 - I will try a clean installation first of sNews1.6 MEMU end than make this chances, although I tried 2 times starting again (with a cup of coffee in between) and encountered the same problems

4 - Is this the latest version of the sNews1.6 MEMU project?
5 - Is this project still alive? or is it also replaced by a sNews1.7 MEMU ?

1 - You are welcome.
2 - A good habit before starting any mods.
3 - Good practice... helps you get familiar with sNews. Add comment notes as searchable references to locate your mods easier.

4 - I've been working on an updated version (version 1.2) that includes Bakercad's Switcherizer2 templates system and the re-ordering mods.
     (Switcherizer2 done, working on re-ordering now)
5 - I'm also working (slowly but steadily) on two 1.7 projects:
           1) a 1.7 SU (single user) package with Bakercad's Switcherizer2 templates system... will likely call it 'My sNews 17 SU'.
               (currently in testing & cleanup stages)
           1) a 1.7 MU using Bakercad's Switcherizer2 and 1.6.3 MU references... will likely call it 'My sNews 17 MU'.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #6 on: December 24, 2009, 10:54:18 am »

Thank you Keyrocks

Will you share your upgade of sNews16 MEMU vs 1.2?
It would be a great Xmas-present for a lot of people and certainly  for me (I hope you do!!)

I tried (still trying a clean installation) but I am stumbeling over the same error messages

The template switcher would make a website nore "alive" and easier for the backend users to play around with there website
I lookes at the demo (backend) at
http://4inchorange.com/snews_templated_2/
and read
http://snewscms.com/forum/index.php?topic=7245.0 (there is a package at http://snewscms.com/forum/index.php?topic=7245.30 with a test sNews and this templateswitcher)

sNews has many variations and is offering a good stable and easy te use base for websites!!

thanks again

jander
« Last Edit: December 24, 2009, 11:20:13 am by jander »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #7 on: December 24, 2009, 04:27:55 pm »

Will you share your upgade of sNews16 MEMU vs 1.2?
It would be a great Xmas-present for a lot of people and certainly  for me (I hope you do!!)

I will share it. I don't know if I'll be able to get it out as a Xmas present.
I did get the Re-ordering mods done yesterday and they seem to be working OK... but more testing is required.
We'll see where we are by the end of the day... might be able to release it for testing purposes.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #8 on: December 24, 2009, 04:56:35 pm »

hello Keyrocks
So!!  would be very special, i am prepared for some testing time!!

good luck!!

ps I installed the templateswitcher sNews version mentioned above, nice mod,

jander
« Last Edit: December 24, 2009, 05:35:27 pm by jander »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #9 on: December 25, 2009, 02:05:26 am »

I will share it. I don't know if I'll be able to get it out as a Xmas present.
I did get the Re-ordering mods done yesterday and they seem to be working OK... but more testing is required.
We'll see where we are by the end of the day... might be able to release it for testing purposes.

An update... Reordering testing is complete... all running OK as desired.
The package needs a good bit of tidying up... housekeeping stuff... but I'll have to leave it for the weekend since tonight is Christmas Eve it's time to don my Santa gear and get into the sleigh for the rest of the night.

HO! HO! HO! And to All... a Good Night!  8)
« Last Edit: December 25, 2009, 08:19:51 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #10 on: December 25, 2009, 07:56:00 am »

Congratulations Keyrocks,
You made me very curious but that is also part of this time of year.
Have a nice Xmas

I hope you can place a update very soon ofcourse!!
(where can I find it......)

Have a nice easy Xmas
greetings

jander
« Last Edit: December 25, 2009, 08:02:46 am by jander »
Logged

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #11 on: January 02, 2010, 10:38:17 am »

Best wishes to all for 2010!!

Hello Keyrocks
Have you been able to do some testing and housekeeping things with the switch template mod and re ordering mod?

just curious (and it would help me a lot ofcourse in using snews 1.6 MEMU)
jander


Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #12 on: January 02, 2010, 11:53:16 pm »

No, I have not been back on this project yet. I have some client (paying) work I need to take care of before I get back to it.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #13 on: February 17, 2010, 10:48:18 am »

hello Keyrocks
Have you been able to do some testing with the snewsMEMU change order of article mod?

greetings
jander
Logged

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Re: sNews 1.6 MEMU-->how to change order of articles?
« Reply #14 on: March 16, 2010, 01:10:42 pm »

hello Keyrocks
i switched to snews 1.6 ??? (which snews is that?). I saw that this version also has a article order (just by typing a number) and a category order which one can see and just bij numbering the order can change
previous work from the snews team also helps a lot
thank you

There are so many different snews with small variations!!
Very usefull if someone knows what to design and with what purpose ..
can someone make a clicable list :-)

greetings
jander
Logged