Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: 青山 素子 on April 04, 2007, 02:24:12 AM

Title: Order News
Post by: 青山 素子 on April 04, 2007, 02:24:12 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=745)

When using the news fader in SMF, items are displayed in the order they are entered. There has been expressed a desire to have an easy way to re-order items without tedious re-entry.

Order News adds a feature to the news administation page that lets an administrator re-order their news items as they like.


Update:

Version 1.0.1 has been released to fix a few typos in the install script. These should be non-critical so updating a working install is not needed.

Version 1.0.2 has been released to allow installs on SMF 1.1.3.
Title: Re: Order News
Post by: shadow82x on April 04, 2007, 03:30:42 PM
Very nice mod I have been waiting for a mod like this too :)  
Title: Re: Order News
Post by: dDOTr2 on April 08, 2007, 06:31:15 AM
great mod. thanks a lot for coding this.
Title: Re: Order News
Post by: Azashub on April 16, 2007, 09:51:41 AM
Exactly what I was looking for ... sad it's not support on 1.1 RC2 :(
Title: Re: Order News
Post by: 青山 素子 on April 16, 2007, 11:09:24 AM
Sorry, I won't support pre-release versions of the 1.1 branch. I highly encourage you to update SMF as soon as convenient as RC2 had some bad bugs in it.
Title: Re: Order News
Post by: SpelingMistakes on May 27, 2007, 11:46:49 AM
Is it possible to upgrade this mod this way

Simply put numbers in some box and than save it – Now when I have 12 news and I want to add another one in the “middle” I must click and save 6 times till I move desired news in the middle.

That is first thing – next is

Is it possible to add another category of news which will be special in a way that those has special order of displaying – like this

I create one news and I want it display every third change of a news – that will “reorder” my first 12 and I will have another special which will show every 3 times news has change. After that news start to show from beginning.

That will work in all occasions – for instance – I have 5 news and my special news will show in 3 place and in 6 etc which etc …..

I hope so I explained how this works and what I am in need for :)
Title: Re: Order News
Post by: 青山 素子 on May 27, 2007, 12:19:12 PM
The first item works the way it does because of how news is stored in the database. The data is stored so that the entries are saved in the order they are in the form.

The second one would require a complete overhaul of the news system, and I unfortunately don't have the time right now to code something that big. You are welcome to make a request for it in the mod requests board.

Do note that the news line displays a random entry each time the page is refreshed. The only thing affected by the order of the entries is the news fader.
Title: Re: Order News
Post by: Iron IC on June 06, 2007, 09:04:04 AM
Hello there!

Great mod you made here. It works as it should, but unfortunately I get error messages in admin area  under Maintainance -> Logged errors.

I run version 1.1.2. Any chance for at fix for this problem? That would be great. Thank you!

Regards Iron IC

Title: Re: Order News
Post by: 青山 素子 on June 06, 2007, 10:53:17 AM
It would help greatly if you could provide the content of the errors.
Title: Re: Order News
Post by: Iron IC on June 06, 2007, 12:08:42 PM
Okey, here are a few i didn`t delete yet. Currently I have uninstalled it, but I am going to activate it again if I get a solution to the problem. Thanks

8: Undefined index: quick_theme_changer
Fil: /usr/home/web/webx/byggmuskler.no/forum/Themes/default/Errors.template.php (eval?)
Linje: 368

8: Undefined index: news_move_up
Fil: /usr/home/web/x/byggmuskler.no/forum/Themes/default/ManageNews.template.php (eval?)
Linje: 61

8: Undefined index: news_move_down
Fil: /usr/home/web/webx/byggmuskler.no/forum/Themes/default/ManageNews.template.php (eval?)
Linje: 63

8: Undefined index: news_warn_body
Fil: /usr/home/web/webx/byggmuskler.no/forum/Themes/default/ManageNews.template.php (eval?)
Linje: 43

8: Undefined index: news_warn_header
Fil: /usr/home/web/webx/byggmuskler.no/forum/Themes/default/ManageNews.template.php (eval?)
Linje: 41
Title: Re: Order News
Post by: 青山 素子 on June 07, 2007, 12:06:07 AM
Do you happen to be using UTF-8? If so, you'll want to copy the contents from Themes/default/languages/Modifications.english.php to Themes/default/languages/Modifications.english-utf8.php
Title: Re: Order News
Post by: Iron IC on June 07, 2007, 11:49:22 AM
I guess mean copy to modifications.norwegian-utf8.php? It worked! Thank you :)
Title: Re: Order News
Post by: 青山 素子 on June 07, 2007, 07:17:41 PM
Glad to hear it worked. If you would like to contribute localized strings for this mod, PM me with the translation and the language file name (I'll forget if you don't) and I'll add them to the next version.
Title: Re: Order News
Post by: OZSlayer on June 16, 2007, 11:15:43 PM
Hi guys,
I get the following text show up at the top of my forums and i can seem to find where it is comming from. I thinki it has something to do with the order news mod.
 
//Order News $txt['news_move_up'] = 'Move Up'; $txt['news_move_down'] = 'Move Down'; $txt['news_warn_header'] = 'Alert:'; $txt['news_warn_body'] = 'You have changed the order of the news items. You must save for the changes to apply.';

See Forum here http://www.randomas.com/smf/index.php

Thanks OZSlayer
Title: Re: Order News
Post by: 青山 素子 on June 17, 2007, 04:14:40 AM
Sometimes mods will break the language file.

Make sure Modifications.english.php has the <?php and the ?> at the beginning and end of the file respectively, and that they each have the whole line to themselves.
Title: Re: Order News
Post by: OZSlayer on June 17, 2007, 09:08:27 PM
Hi, yes it was the >?  The mod had installed it self after the >?

Thanks OZSlayer
Title: Re: Order News
Post by: kill3r on July 07, 2007, 08:16:11 AM
This is really a great feature. i tried installing this on 1.1.3 but its incompatible. can i edit the package info file or need to wait for any update ?
thanks
Title: Re: Order News
Post by: TrueSatan on July 07, 2007, 10:36:06 AM
@ kill3r

A quick compatibility update version for you
Title: Re: Order News
Post by: 青山 素子 on July 07, 2007, 01:23:59 PM
Please do not post unauthorized copies of the mod without asking permission. I have removed the attachment.


Update: Added a 1.1.3-compatible version to the downloads.
Title: Re: Order News
Post by: kill3r on July 08, 2007, 12:59:19 PM
thanks both of you ppl.
Title: Re: Order News
Post by: kamili34 on July 14, 2007, 09:19:01 PM
Thanks work great :)
Title: Re: Order News
Post by: Bigguy on March 29, 2008, 06:40:16 PM
I downloaded this and it says it is corrupt or not compatible with my version. (SMF 2.0 beta3 public)
Title: Re: Order News
Post by: 青山 素子 on March 30, 2008, 04:32:22 PM
Tested 1.0.4 and it looks to work okay. Are you sure you got the latest version?
Title: Re: Order News
Post by: Bigguy on March 30, 2008, 06:23:33 PM
I will try it again. I installed Boardhover mod right after this mod so I know the forum is working correctly. Hold on; will try it now.
Title: Re: Order News
Post by: Bigguy on March 30, 2008, 06:24:54 PM
I tried it again and this si what I got:

The package you tried to upload either is not a valid package or has become corrupted.
Title: Re: Order News
Post by: 青山 素子 on March 30, 2008, 06:40:15 PM
Odd. Can you open the archive?

To test, I used the download URL option in SMF 2.0b3p.
Title: Re: Order News
Post by: Bigguy on March 30, 2008, 06:44:24 PM
It opens fine...whats the .kpf file in there. ??? (smf-ordernews.kpf) All the .xml files open ok as well.
Title: Re: Order News
Post by: 青山 素子 on March 30, 2008, 07:15:25 PM
The kpf is a project file for Komodo. It shouldn't cause a problem. Try re-compressing as a zip and seeing if it works for you then.
Title: Re: Order News
Post by: Bigguy on March 31, 2008, 12:34:44 AM
Ok I will try this when I get back on my main computer, thanks. :)
Title: Re: Order News
Post by: Bigguy on March 31, 2008, 01:33:47 AM
Re-compressing as a zip file worked, thanks. :)
Title: Re: Order News
Post by: 青山 素子 on March 31, 2008, 02:20:45 AM
I'm trying to recall if SMF makes system calls to uncompress or built-in zlib...

Perhaps there is an old version of zlib or whatnot that doesn't like my archive.
Title: Re: Order News
Post by: Exsharaen on September 08, 2008, 09:28:38 AM
Hi, could you possibly update this mod to support SMF 1.1.6? When I try to install, it says the package doesn't appear to support my SMF version.

Thank you.
Title: Re: Order News
Post by: 青山 素子 on September 08, 2008, 11:05:46 AM
This mod should work just fine on 1.1.6, just use the emulate_version trick.
Title: Re: Order News
Post by: Dret on September 11, 2008, 06:18:59 PM
This mod should work just fine on 1.1.6, just use the emulate_version trick.

emulate_version trick...?

Can You explain better... please?

Your Mod is an  essential tool for me...!!! ;)

Thanks...!!
Bye.
Dret
Title: Re: Order News
Post by: 青山 素子 on September 11, 2008, 06:53:30 PM
Can You explain better... please?

Search for "version_emulate trick" (http://www.simplemachines.org/community/index.php?action=search2;search=version_emulate+trick)!
Title: Re: Order News
Post by: Dret on September 12, 2008, 12:51:34 AM
Thanks a lot!
Bye.

Dret.
Title: Re: Order News
Post by: Exsharaen on October 28, 2008, 03:28:39 PM
EDIT:

Sorry, I didn't notice that there was an update for this mod. I had one version late (1.0.5) and that's the one I tried  to install. The latest one works just fine.

Thanks for your reply.
Title: Re: Order News
Post by: islam2hamy on July 05, 2009, 10:58:21 AM
nice mod,

Arabic translation attached .
Title: Re: Order News
Post by: TurtleKicker on November 12, 2009, 04:23:58 PM
Any chance on updating for SMF2 RC2?
Title: Re: Order News
Post by: 青山 素子 on November 12, 2009, 05:57:57 PM
When I get time. I'm awfully busy right now.
Title: Re: Order News
Post by: C4G-TK on December 15, 2009, 11:34:45 PM
This is another one of those mods that should be standard in SMF.  In fact, most ALL of the re-ordering mods should be standard.  (News, Stickied Topics, Profile Fields)  Can't wait for you to update.  It really does make things easier for Admins. :)
Title: Re: Order News
Post by: PalmBeachPreps on December 23, 2009, 10:55:49 PM
Any chance that this will be updated for RC2?
Title: Re: Order News
Post by: gbsothere on December 28, 2009, 04:47:14 PM
Motoko-chan, I have a question (and no hurry on the answer; just when you find time):

My main forum is 1.1.11, Default theme and I would like, very much, to be able to use your mod to change the order of the news, since we use the news fader probably more than most features.  Here is my problem:

I wanted to be able to incorporate some BBC drop down menus (as one finds in the posting area) in the news area and finally was able to achieve that here:

http://www.simplemachines.org/community/index.php?topic=337912.msg2276542#msg2276542 (http://www.simplemachines.org/community/index.php?topic=337912.msg2276542#msg2276542)

I find that your mod uses some of the same blocks of code I use in the ManageNews.template.php.  The main one I'd like to ask you about is here:

Code: [Select]
<td align="center">
<a href="#" onclick="newsMove(\'newsarticle', $admin_news['id'], '\', \'newsarticle' , $admin_news['id'] - 1 , '\'); return false;"><img src="', $settings['images_url'], '/sort_up.gif" alt="', $txt['news_move_up'], '" /></a>
</td><td align="center">
<a href="#" onclick="newsMove(\'newsarticle', $admin_news['id'], '\', \'newsarticle' , $admin_news['id'] + 1 , '\'); return false;"><img src="', $settings['images_url'], '/sort_down.gif" alt="', $txt['news_move_down'], '" /></a>
</td><td align="center">
<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="news[]" id="newsarticle', $admin_news['id'], '" style="width: 85%;">', $admin_news['unparsed'], '</textarea></div>

The id="newsarticle"

In my BBC drop down code, in that particular block of code, id must be id="box'.$count.'".  Am I right in thinking that, since that's the case, I cannot use this mod, if I want to keep my BBC drop down menus functioning as they should?  There is no way for two mods (mine really isn't a mod) to have their own id in the same block of code?

Here's a sample of what I'm trying to preserve:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwhereitestmystuff.com%2Fimages%2Fnewsbbcsample.jpg&hash=e85237b51f9cf720db4da931364503c8)


Thank you for any insight and, again, absolutely no hurry.   :)
Title: Re: Order News
Post by: C4G-TK on January 02, 2010, 06:10:45 PM
Tried to install the lastest update on my RC2 forum and got the following error.
I understand when it says TEST FAILED< but what is a MODIFICATION PARSE ERROR?

Image below:
Title: Re: Order News
Post by: 青山 素子 on January 02, 2010, 07:24:01 PM
It means it didn't understand the modification instructions, possibly due to some formatting problem. I've seen issues in some cases with bad extraction of mods. Try manually extracting the modification to its own folder in the Packages directory and see if it works properly.
Title: Re: Order News
Post by: C4G-TK on January 03, 2010, 01:15:13 AM
I tried to take another look at it and parsed it to do it manually.

There is only one edit showing to do when I parse and I did it which is the Modifications.english file edit.

What happened to the ManageNews.template.php edit?  Look at the package when you parse it in on the mod site.  There is only the above edit showing to do that is required.  All the rest are simply language edits that are not needed.  It says nothing to do currently as ManageNews.template.php like it did previously.

Your XML file shows to do the ManageNews.template.php edit though.  I don't think it is in my end or else the package would parse correctly on this site.
Title: Re: Order News
Post by: 青山 素子 on January 03, 2010, 02:28:15 AM
Odd. I'll look into it. I confirmed it applied cleanly on my test environment.
Title: Re: Order News
Post by: C4G-TK on January 03, 2010, 09:36:17 AM
I parsed it here by selecting RC2 and it doesn't show the ManageNews.template edit.

http://custom.simplemachines.org/mods/index.php?mod=745
Title: Re: Order News
Post by: C4G-TK on February 21, 2010, 03:08:20 AM
Tried to install the lastest update on my RC2 forum and got the following error.
I understand when it says TEST FAILED< but what is a MODIFICATION PARSE ERROR?

Ok, I tried this on a second forum on a different server and I still get the same error.
Has anyone gotten this to install on an RC2 forum?
Title: Re: Order News
Post by: 青山 素子 on February 21, 2010, 02:48:30 PM
I haven't been able to reproduce the issue. It might be an issue with gzip handling on some servers.
Title: Re: Order News
Post by: [unplugged] on February 21, 2010, 02:58:30 PM
I tried to install it on my test site and get the same error as above. I have a screenshot here if it helps at all:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg28.imageshack.us%2Fimg28%2F4678%2Fscreenshotlt.png&hash=3833598f392226ac025c0045e63bc925) (http://img28.imageshack.us/i/screenshotlt.png/)
Title: Re: Order News
Post by: 青山 素子 on February 21, 2010, 03:37:05 PM
I tried to install it on my test site and get the same error as above. I have a screenshot here if it helps at all:

Specs on that please. Also, x86_64 or i3/4/5/686? Oh, and platform (since you can run PHP on Windows).
Title: Re: Order News
Post by: [unplugged] on February 21, 2010, 03:58:16 PM
It's calling install-20.xml from the package-info.xml, but that file is not in the package, only the install.xml is, resulting in that error.
Title: Re: Order News
Post by: 青山 素子 on February 22, 2010, 11:06:07 AM
Hmmm. I do have install-20.xml in my source tree, but it seems I forgot to check it in to version control (I'm at my desktop for a few minutes this morning). I'll try and get a patch release out tomorrow (Tuesday) when I'm home.

Edit: For those really itching to get something done today, I'm attaching install-20.xml. Extract the mod to an empty directory, then place into the same directory as install.xml and archive the mess back up.

Edit: Released 1.0.9, removed attachment.
Title: Re: Order News
Post by: C4G-TK on February 22, 2010, 04:37:04 PM
Thanks for taking a look at it, Motoko-chan!

After you get the updated version done, nudge them to make this standard in SMF.  This really is a great tool that should be standard!
Title: Re: Order News
Post by: 青山 素子 on March 02, 2010, 08:02:06 PM
1.0.9 has been released with the missing file for SMF 2.0.
Title: Re: Order News
Post by: C4G-TK on March 03, 2010, 12:25:09 AM
Cool deal!  I would update my site now, but the connection sucks here in Aruba.  Luckily, the drinks, beach, weather, water, and everything else is FANTASTIC though!  Was just signing in to check on things at SMF before going to bed.  This was a cool bit of good news to see.  Thanks MOTOKO!!
Title: Re: Order News
Post by: Bugo on March 04, 2010, 02:11:46 PM
Russian text:

Code: [Select]
//Order News
$txt['news_move_up'] = 'Переместить вверх';
$txt['news_move_down'] = 'Переместить вниз';
$txt['news_warn_header'] = 'Предупреждение:';
$txt['news_warn_body'] = 'Вы изменили порядок новостей. Для принятия изменений нажмите кнопку "Сохранить".';

Title: Re: Order News
Post by: TurtleKicker on March 12, 2010, 11:50:45 AM
Thanks for updating this for RC3, Motoko. One of those "duh" cricial features that should be in SMF by default.
Title: Re: Order News
Post by: FireDitto on November 06, 2010, 07:40:41 PM
Will this be updated for RC4?
Title: Re: Order News
Post by: 青山 素子 on November 06, 2010, 10:11:24 PM
Yes, as soon as i can find the time. Today I was out at the doctor. We'll see how tomorrow goes.
Title: Re: Order News
Post by: TurtleKicker on July 06, 2011, 11:07:00 AM
Any chance of this being update for 2.0 final? I use it a lot on 1.x :)

Thanks, buddy.
Title: Re: Order News
Post by: 青山 素子 on July 07, 2011, 01:01:16 PM
As soon as I can get to it. I've been trying to enjoy a bit of a vacation from work activities.
Title: Re: Order News
Post by: TurtleKicker on September 01, 2011, 04:09:25 PM
Hope you enjoyed your vacation. :) Any updates? Am needing this more and more as I've started another live site using SMF 2.0. Thanks!
Title: Re: Order News
Post by: 青山 素子 on September 01, 2011, 07:29:25 PM
As soon as I can get to it. Work's been crazy.