Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: maestrosite.ru on September 19, 2012, 10:45:22 AM

Title: StickyTopicsOrder
Post by: maestrosite.ru on September 19, 2012, 10:45:22 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3425)

Set sticky topics order.

Ability to specify the order is only available to board administrators. The order is determined by the importance (weight) of topics, a negative value attach to the end of the topic to the list.

Demo http://smf2.maestrosite.ru/index.php/board,2.0.html (http://smf2.maestrosite.ru/index.php/board,2.0.html)
Support http://MaestroSite.ru/ (http://maestrosite.ru/)
Support topic http://smf2.maestrosite.ru/index.php/topic,27.0.html (http://smf2.maestrosite.ru/index.php/topic,27.0.html)
E-mail smf@maestrosite.ru

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/).
Title: Re: StickyTopicsOrder
Post by: PopUpSteve on October 12, 2012, 03:48:37 PM
Installed the mod but can't seem to figure out how to set the weight on a sticky topic.  ???

Quote
a negative value attach to the end of the topic to the list.
   ???
Title: Re: StickyTopicsOrder
Post by: hcfwesker on October 12, 2012, 04:00:51 PM
Admin > Configuration > Misc. > StickyTopicsOrder

It will list all boards that have topics.  The number of topics shown, click that number, this will bring up all sticky topics in the board.  Input numbers in the box, highest number will show up top.  Adding a negative makes the sticky topic show at the bottom of all topic listing.

Testing this, I came across one bug.  When you set a weight to a sticky topic, you can't un-sticky the topic from the quick mod checkboxes on MessageIndex.  you have to manually goto the post and unsticky it from the Mod buttons at the bottom of the post.

This is a nice MOD, though.  Can be very useful.
Title: Re: StickyTopicsOrder
Post by: PopUpSteve on October 12, 2012, 04:53:07 PM
Thanks. I found it under Admin > Configuration > Modification Settings > StickyTopicsOrder.

Not quite sure why the number order is reversed. I.E. with two sticky topics the one on top is #2 and the second one is #1. But it works. Thanks for the mod and thanks for the help.
Title: Re: StickyTopicsOrder
Post by: natasa (NT) on October 15, 2012, 08:42:42 AM
I really needed this mod.
Thanks a lot  :)!
Title: Re: StickyTopicsOrder
Post by: steveshiver on October 16, 2012, 09:52:24 AM
Thanks for sharing this mod! I needed it badly!
Title: Re: StickyTopicsOrder
Post by: fran- on November 08, 2012, 07:02:17 PM
Thanks. Very useful topic !  :)
Title: Re: StickyTopicsOrder
Post by: Badetuch on November 17, 2012, 08:20:33 AM
I have the problem, that the topic weight (order) get lost, when someone writes a new comment in the sticky topic. :(

What can I do?
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on November 17, 2012, 09:18:51 AM
That means, you changed Post.php after install mod. This mod has only one code replaced - a specially for save current order. Please sure that modify is preset: http://custom.simplemachines.org/mods/index.php?action=parse&attach=208588&smf_version=2.0.2&mod=3425 (http://custom.simplemachines.org/mods/index.php?action=parse&attach=208588&smf_version=2.0.2&mod=3425)

Title: Re: StickyTopicsOrder
Post by: Badetuch on November 17, 2012, 11:34:49 AM
There was no change after the install. I replaced the code again, but when someone post something new in the sticky topic the "Weight" is going to "1".

Edit: Okay, there is only the change when a mod/admin post a new post... when a "normal" user writes something, there is no problem!

Edit 2: No problem via "Quick reply" but when I use the normal reply button.
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on November 18, 2012, 01:02:33 AM
Sorry, but I can't get this bug on localhost forum. Can you describe your UseCase step-by-step ?
Title: Re: StickyTopicsOrder
Post by: Badetuch on November 18, 2012, 06:51:53 AM
Okay.

1) The weight of the topics is set to "1" when one of our admins post something new.
2) There is no problem for "normal" users.
3) There is no problem when the admins reply via quick reply.

I guess that the attribute of the topic is gonna update via the normal reply and so the weight is set again to "1".


Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on November 18, 2012, 09:37:29 AM
Yes, it is a bug. Please, insall update (v0.5)

Badetuch, thank you for bugreport!
Title: Re: StickyTopicsOrder
Post by: Badetuch on November 19, 2012, 03:05:35 AM
Allright! Thank you! :)
Title: Re: StickyTopicsOrder
Post by: wattie on November 20, 2012, 06:40:41 AM
Works awesome. Thank you very much. I was making an eLearning forum where the order is very important (first lesson, second lesson, etc). This mod saved my project from migrating to other software!
Title: Re: StickyTopicsOrder
Post by: FragaCampos on January 29, 2013, 08:51:07 PM
Nice mod.
Simple, clean and effective.

Thanks, maestrosite.ru.
Title: Re: StickyTopicsOrder
Post by: Westwegoman on February 28, 2013, 08:32:09 AM
Is there a way to make this work on all post in one board? (not the stickies)

I would like to have a board where I can rearrange the post by date of the event, with latest event at top.
Title: Re: StickyTopicsOrder
Post by: PopUpSteve on February 28, 2013, 09:08:21 AM
What table is this info being stored? I ask because I'm automating the creation of boards and threads and I want to make them sticky and make them accordingly in your system.

Thanks
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on February 28, 2013, 09:37:40 AM
What table is this info being stored?

Table smf_topics, field is_sticky. Value this field - it is a "weight"
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on February 28, 2013, 09:40:52 AM
Is there a way to make this work on all post in one board? (not the stickies)

I would like to have a board where I can rearrange the post by date of the event, with latest event at top.

Sorry, I do not understand your question.
Title: Re: StickyTopicsOrder
Post by: Westwegoman on February 28, 2013, 09:48:28 AM
Basically, I want to be able to rearrange all topics in one board to my preference.
Title: Re: StickyTopicsOrder
Post by: PopUpSteve on February 28, 2013, 10:47:42 AM
Table smf_topics, field is_sticky. Value this field - it is a "weight"
Cool, thanks! ;D
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on February 28, 2013, 07:38:42 PM
Basically, I want to be able to rearrange all topics in one board to my preference.

If topics  is not sticky then they ordered by timestamp by default. Or not?
Title: Re: StickyTopicsOrder
Post by: Westwegoman on February 28, 2013, 08:12:55 PM
Yes, they are ordered by time stamp by default.
Title: Re: StickyTopicsOrder
Post by: PopUpSteve on April 20, 2013, 01:39:00 PM
 :( Found a major bug!

Love this mod but one of my forum members spotted a problem today. It looks like not only is the Sticky Topic Order ignored when viewing a forum using Tapatalk, but none of the Sticky Topics which have a sort order greater then "1" appear at all under Tapatalk.

I had to reset all my topics where "is_sticky" was greater to "1", back to "1".

I can't see Tapatalk making a change to accommodate the mod. And since so many of my members are now using Tapatalk to access the forum, I'll have to uninstall this mod. :'(
Title: Re: StickyTopicsOrder
Post by: Arantor on April 20, 2013, 01:40:20 PM
I blame Tapatalk for being naive. There are two different mods for reordering sticky topics... and both do it the same way. Says to me that Tapatalk should fix it.

(It's not hard, it just means they have to fix the logic to be in line with how SMF did it originally anyway, i.e. order by is_sticky DESC first)
Title: Re: StickyTopicsOrder
Post by: maestrosite.ru on April 22, 2013, 11:41:07 AM
Sorry, it's not a bug this mod. You can fix Tapatalk - replace select with {int:iis_sticky} in MessageIndex.php. Something like that:
Quote
... AND is_sticky ' . ($getStickyTopics ? '!=' : '=' ) . ' 0

and in mobiquo_action.php
Quote
... AND t.is_sticky = {int:is_sticky}
replace with:
Quote
... AND t.is_sticky != 0
Title: Re: StickyTopicsOrder
Post by: MaryLouW on September 13, 2014, 03:36:05 PM
In the older version of SMF, I had a mod to re-order the sticky topics. It was "attached" to each individual board and the moderators could set the order themselves.

I cannot find one like that for the 2.x versions so I am using this one.  It works nicely BUT only an admin can change it. That means, I am constantly having to make changes for the various boards.  It means a lot of trips back and forth to the Admin panel and a whole lot of work for me.

Is there one that will allow the board moderator to set the sticky order by board without having to run to the admin panel? If not, it sure would be nice to have one like that old one.  It was so convenient because if they did it wrong, they could see it immediately and make corrections and not have to PM me to do it for them.
Title: Re: StickyTopicsOrder
Post by: Steve on October 14, 2014, 04:44:59 PM
Is there a limit to the number of topics that can be stickied and ordered?

If not, one could theoretically sticky all topics and put them in whatever order you want, right?
Title: Re: StickyTopicsOrder
Post by: MaryLouW on October 24, 2014, 02:41:27 AM
I love this mod but do have one problem with it.  It shows all the html code that we use to give the titles different colors This makes it hard to find the board you're looking for.  Is there a way around this?  I'm attaching an example of what I mean.   Thanks!!!
Title: Re: StickyTopicsOrder
Post by: Neil Bombd on July 03, 2016, 01:21:16 PM
Sadly, this mod stickys negative value threads to the VERY bottom of our forum listing, so at the end of page 356 for me :-) I wanted to use it to move threads that annoy me to the bottom of the first page, is this possible?  This would leave these threads on the forum for people who still want them, but I wouldn't have to look at them all the time.
Title: Re: StickyTopicsOrder
Post by: skb on September 20, 2016, 04:42:23 AM
Installed it. It's quite a handy mod. Thanks.
Basically, I want to be able to rearrange all topics in one board to my preference.
I would second that, whenever possible. 
Title: Re: StickyTopicsOrder
Post by: mkucuksari on September 14, 2017, 07:51:31 PM
This mod is really great. I was using it for a long time.

I am not sure how it happens but I can not see this mod at admin panel. It disappears ??

I have upgrade SMF from 2.0.3 to 2.0.13 and my hosting company also upgrade PHP version to 5.5.6.

I have checked all the related files. They are still existed at right place. Any idea please

Title: Re: StickyTopicsOrder
Post by: mkucuksari on September 19, 2017, 08:12:48 AM
Sorry, it's not a bug this mod. You can fix Tapatalk - replace select with {int:iis_sticky} in MessageIndex.php. Something like that:
Quote
... AND is_sticky ' . ($getStickyTopics ? '!=' : '=' ) . ' 0

Could someone can help me exactly how I will change messageindex.php.

Here is the original codes.

Code: [Select]
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET is_sticky = CASE WHEN is_sticky = {int:is_sticky} THEN 0 ELSE 1 END
WHERE id_topic IN ({array_int:sticky_topic_ids})',
array(
'sticky_topic_ids' => $stickyCache,
'is_sticky' => 1,
)
);
Title: Re: StickyTopicsOrder
Post by: sribharath on September 23, 2017, 05:54:27 AM
Is this is the mod to set which sticky post is first and which is second ?

Sorry i dint understand as the demo is in sme other language

may be i am dumb
Title: Re: StickyTopicsOrder
Post by: Steve on September 23, 2017, 09:38:41 AM
Yes, this sets what order your sticky topics are in.
Title: Re: StickyTopicsOrder
Post by: Grammy on January 18, 2021, 04:57:52 PM
2.0.17, Default

I apologize for bumping such an old thread.  (Don't hurt me.)

Here's the thing:  I used to love this mod and I really did look for a more up-to-date version.  But once I glanced at the edits (only 2 small ones on Post.php) and saw it should pass the installation, I gave it a go.  Everything was green lights, no errors, no need to emulate to 2.0.2, easy.  I checked to make sure that all files were properly edited and placed in the correct directories, including the language files; that's all good.

Except that even though StickyTopicsOrder appears in Admin-->Configuration-->Modification Settings, there are no actual settings.  When you click it, the field below is blank.  So, I thought I'd try running the install.php in my browser.  I got a success message "Your settings have been entered into the database!".  But I'm looking at the database and I see no new tables.  I even rummaged through the databases of older forums, thinking I'd grab those tables.  Nothing there, either.

I've dumped the cache, run forum maintenance, all clean, no errors.

If YOU were going to try to get an older mod to work, and you were at this point would you chuck it in, or do you see something I've missed?   :(
Title: Re: StickyTopicsOrder
Post by: Steve on January 18, 2021, 05:04:43 PM
Silly question but I assume you have stickied topics? Did you try unstickying them then restickying them?

Did you try to install it by emulating 2.0.2 even though you got the go ahead?

Other than that, I can't imagine why it wouldn't work ... :-\
Title: Re: StickyTopicsOrder
Post by: Grammy on January 18, 2021, 05:15:16 PM
Silly question but I assume you have stickied topics? Did you try unstickying them then restickying them?

Did you try to install it by emulating 2.0.2 even though you got the go ahead?

Other than that, I can't imagine why it wouldn't work ... :-\


Well, no, I didn't have any yet... it's a new "tire kicking" forum I set up today.  Well, I did add stickys after the problem, but since I can't enable it in settings, I can't test it.
 You know, that's a thought...  I'll try uninstalling it and then running the emulator.  'Cause I'm thinking that maybe something in the source file or language file has changed since 2.0.2?  Lemme go try, I know you're just gonna sit here and wait for me to get back.   :D
Title: Re: StickyTopicsOrder
Post by: Grammy on January 18, 2021, 05:18:57 PM
No joy in Mudville.   :(

Okay, that's my next rabbit trail, then.  Comparing 2.0.2 language and source files to 2.0.17.  After that, I'm out. 
Title: Re: StickyTopicsOrder
Post by: Grammy on January 18, 2021, 05:27:18 PM
Silly question but I assume you have stickied topics?

Oh WAIT, ha!!!  So THAT'S how it works!  I mean, the mod author doesn't caution that nothing will appear in the mod settings unless you have stickys already.  You just get redirected to settings after the installation and when that field is blank, so are you!  (Uh, so am I, I mean.)

So, I made MORE THAN ONE sticky topic and I'm back in bidnezz!   :D
Title: Re: StickyTopicsOrder
Post by: landyvlad on January 19, 2021, 01:37:02 AM
Good result - i didnt know of this mod and would certainly use it if I wasn't planning to move to 2.1
Title: Re: StickyTopicsOrder
Post by: Grammy on January 19, 2021, 06:51:31 AM
Good result - i didnt know of this mod and would certainly use it if I wasn't planning to move to 2.1


The edits are so simple, maybe 2.1 could incorporate something like this.  It's very useful.   :)
Title: Re: StickyTopicsOrder
Post by: Steve on January 19, 2021, 08:16:09 AM
Glad I was able to help. Keep in mind that assigning what order the topics are in is opposite what you might think. At least, it was for me. If you have stickied topics A, B and C and want them stickied in that order you would assign them like this:

A = 3
B = 2
C = 1

You probably already figured that out but I thought I'd post it anyway. :P
Title: Re: StickyTopicsOrder
Post by: Grammy on January 19, 2021, 08:17:41 AM
Glad I was able to help. Keep in mind that assigning what order the topics are in is opposite what you might think. At least, it was for me. If you have stickied topics A, B and C and want them stickied in that order you would assign them like this:

A = 3
B = 2
C = 1

You probably already figured that out but I thought I'd post it anyway. :P

It dawned on me...... s l o w l y....    :D