StickyTopicsOrder

Started by maestrosite.ru, September 19, 2012, 10:45:22 AM

Previous topic - Next topic

maestrosite.ru

Link to Mod

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
Support http://MaestroSite.ru/
Support topic http://smf2.maestrosite.ru/index.php/topic,27.0.html
E-mail [email protected]

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

PopUpSteve

Installed the mod but can't seem to figure out how to set the weight on a sticky topic.  ???

Quotea negative value attach to the end of the topic to the list.
???
Steve
"Even a broken clock is right twice a day, unless it's digital."

hcfwesker

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.

PopUpSteve

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.
Steve
"Even a broken clock is right twice a day, unless it's digital."

natasa (NT)

I really needed this mod.
Thanks a lot  :)!

steveshiver

Thanks for sharing this mod! I needed it badly!

fran-

#6
Thanks. Very useful topic !  :)

Badetuch

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?

maestrosite.ru

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

First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Badetuch

#9
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.

maestrosite.ru

Sorry, but I can't get this bug on localhost forum. Can you describe your UseCase step-by-step ?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Badetuch

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".



maestrosite.ru

#12
Yes, it is a bug. Please, insall update (v0.5)

Badetuch, thank you for bugreport!
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Badetuch


wattie

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!

FragaCampos

Nice mod.
Simple, clean and effective.

Thanks, maestrosite.ru.

Westwegoman

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.

PopUpSteve

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
Steve
"Even a broken clock is right twice a day, unless it's digital."

maestrosite.ru

Quote from: PopUpSteve on February 28, 2013, 09:08:21 AM
What table is this info being stored?

Table smf_topics, field is_sticky. Value this field - it is a "weight"
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

maestrosite.ru

Quote from: 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.

Sorry, I do not understand your question.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Westwegoman

Basically, I want to be able to rearrange all topics in one board to my preference.

PopUpSteve

Quote from: maestrosite.ru on February 28, 2013, 09:37:40 AM
Table smf_topics, field is_sticky. Value this field - it is a "weight"
Cool, thanks! ;D
Steve
"Even a broken clock is right twice a day, unless it's digital."

maestrosite.ru

Quote from: 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.

If topics  is not sticky then they ordered by timestamp by default. Or not?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Westwegoman

Yes, they are ordered by time stamp by default.

PopUpSteve

 :( 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. :'(
Steve
"Even a broken clock is right twice a day, unless it's digital."

Arantor

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)

maestrosite.ru

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
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

MaryLouW

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.

Steve

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?
DO NOT pm me for support!

MaryLouW

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!!!

Neil Bombd

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.

skb

Installed it. It's quite a handy mod. Thanks.
Quote from: 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.
I would second that, whenever possible. 

SMF 2.1.4 / TP 2.2.2

mkucuksari

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


mkucuksari

Quote from: 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

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

Here is the original codes.

$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,
)
);

sribharath

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

Steve

Yes, this sets what order your sticky topics are in.
DO NOT pm me for support!

Grammy

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?   :(

Steve

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 ... :-\
DO NOT pm me for support!

Grammy

Quote from: 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 ... :-\


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

Grammy

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. 

Grammy

Quote from: Steve on January 18, 2021, 05:04:43 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

landyvlad

Good result - i didnt know of this mod and would certainly use it if I wasn't planning to move to 2.1
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Grammy

Quote from: 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


The edits are so simple, maybe 2.1 could incorporate something like this.  It's very useful.   :)

Steve

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
DO NOT pm me for support!

Grammy

Quote from: 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

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

Steve

Can this mod be updated for 2.1.3? Obviously not by the author as he hasn't been here in 5 years.
DO NOT pm me for support!

Shades.

Quote from: Steve on December 05, 2022, 07:05:48 AMCan this mod be updated for 2.1.3? Obviously not by the author as he hasn't been here in 5 years.
I have a 2.1 version that I've been using with no problems but I can't remember where I downloaded it from. I think I got it from GitHub but I can't find it now! Its Sticky Topics Order 0.6 for SMF 2.1 but not sure If I'm allowed to share it or not! :-\

Edit: @Steve I found the link, try this... https://github.com/dragomano/Sticky-Topics-Order
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Steve

#47
Thanks my friend!
DO NOT pm me for support!

Advertisement: