Advertisement:

Author Topic: StickyTopicsOrder  (Read 23314 times)

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
StickyTopicsOrder
« on: September 19, 2012, 10:45:22 AM »
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 smf@maestrosite.ru

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
« Last Edit: November 18, 2012, 10:39:29 PM by maestrosite.ru »
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline PopUpSteve

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
    • PopUpPortal
Re: StickyTopicsOrder
« Reply #1 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.
   ???
Steve
"Even a broken clock is right twice a day, unless it's digital."

Offline hcfwesker

  • SMF Hero
  • ******
  • Posts: 2,214
  • Gender: Male
  • SMF 2.0.4
Re: StickyTopicsOrder
« Reply #2 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.

Offline PopUpSteve

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
    • PopUpPortal
Re: StickyTopicsOrder
« Reply #3 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.
Steve
"Even a broken clock is right twice a day, unless it's digital."

Offline natasa (NT)

  • Semi-Newbie
  • *
  • Posts: 66
  • Gender: Female
Re: StickyTopicsOrder
« Reply #4 on: October 15, 2012, 08:42:42 AM »
I really needed this mod.
Thanks a lot  :)!

Offline steveshiver

  • Newbie
  • *
  • Posts: 1
Re: StickyTopicsOrder
« Reply #5 on: October 16, 2012, 09:52:24 AM »
Thanks for sharing this mod! I needed it badly!

Offline fran-

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Female
    • Atelier Ajwan
Re: StickyTopicsOrder
« Reply #6 on: November 08, 2012, 07:02:17 PM »
Thanks. Very useful topic !  :)
« Last Edit: November 08, 2012, 07:48:00 PM by fran- »

Offline Badetuch

  • Newbie
  • *
  • Posts: 4
Re: StickyTopicsOrder
« Reply #7 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?

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #8 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

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

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

You can try other modifications - see demo

Offline Badetuch

  • Newbie
  • *
  • Posts: 4
Re: StickyTopicsOrder
« Reply #9 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.
« Last Edit: November 17, 2012, 12:26:12 PM by Badetuch »

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #10 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 ?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline Badetuch

  • Newbie
  • *
  • Posts: 4
Re: StickyTopicsOrder
« Reply #11 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".



Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #12 on: November 18, 2012, 09:37:29 AM »
Yes, it is a bug. Please, insall update (v0.5)

Badetuch, thank you for bugreport!
« Last Edit: November 18, 2012, 10:36:30 PM by maestrosite.ru »
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline Badetuch

  • Newbie
  • *
  • Posts: 4
Re: StickyTopicsOrder
« Reply #13 on: November 19, 2012, 03:05:35 AM »
Allright! Thank you! :)

Offline wattie

  • Semi-Newbie
  • *
  • Posts: 14
Re: StickyTopicsOrder
« Reply #14 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!

Offline FragaCampos

  • Sophist Member
  • *****
  • Posts: 1,359
  • Gender: Male
    • docsPT
Re: StickyTopicsOrder
« Reply #15 on: January 29, 2013, 08:51:07 PM »
Nice mod.
Simple, clean and effective.

Thanks, maestrosite.ru.

Offline Westwegoman

  • Jr. Member
  • **
  • Posts: 202
  • Gender: Male
    • westwegoman on Facebook
    • Westwegoman on LinkedIn
    • Bayou State Fishing
Re: StickyTopicsOrder
« Reply #16 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.

Offline PopUpSteve

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
    • PopUpPortal
Re: StickyTopicsOrder
« Reply #17 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
Steve
"Even a broken clock is right twice a day, unless it's digital."

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #18 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"
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #19 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.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline Westwegoman

  • Jr. Member
  • **
  • Posts: 202
  • Gender: Male
    • westwegoman on Facebook
    • Westwegoman on LinkedIn
    • Bayou State Fishing
Re: StickyTopicsOrder
« Reply #20 on: February 28, 2013, 09:48:28 AM »
Basically, I want to be able to rearrange all topics in one board to my preference.

Offline PopUpSteve

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
    • PopUpPortal
Re: StickyTopicsOrder
« Reply #21 on: February 28, 2013, 10:47:42 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."

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #22 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?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline Westwegoman

  • Jr. Member
  • **
  • Posts: 202
  • Gender: Male
    • westwegoman on Facebook
    • Westwegoman on LinkedIn
    • Bayou State Fishing
Re: StickyTopicsOrder
« Reply #23 on: February 28, 2013, 08:12:55 PM »
Yes, they are ordered by time stamp by default.

Offline PopUpSteve

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
    • PopUpPortal
Re: StickyTopicsOrder
« Reply #24 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. :'(
Steve
"Even a broken clock is right twice a day, unless it's digital."

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: StickyTopicsOrder
« Reply #25 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)
No good deed goes unpunished
All helpful urges should be circumvented

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: StickyTopicsOrder
« Reply #26 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
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Offline MaryLouW

  • Full Member
  • ***
  • Posts: 661
  • Gender: Female
  • Find a Need and fill it!
    • PIRC Forum
Re: StickyTopicsOrder
« Reply #27 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.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,818
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: StickyTopicsOrder
« Reply #28 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?
Please do not PM me for support.

I just ordered a life alert bracelet so
if I get a life, I'll be notified immediately.

Offline MaryLouW

  • Full Member
  • ***
  • Posts: 661
  • Gender: Female
  • Find a Need and fill it!
    • PIRC Forum
Re: StickyTopicsOrder
« Reply #29 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!!!

Offline Neil Bombd

  • Newbie
  • *
  • Posts: 1
Re: StickyTopicsOrder
« Reply #30 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.

Offline skb

  • Full Member
  • ***
  • Posts: 430
    • Metabolically Challenged
Re: StickyTopicsOrder
« Reply #31 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. 
Learning, every day.
Forum - Diabetes Forum
Because every diabetic needs help
SMF 2.1 RC3 (default theme) / TP 2.0

Offline mkucuksari

  • Semi-Newbie
  • *
  • Posts: 12
Re: StickyTopicsOrder
« Reply #32 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


Offline mkucuksari

  • Semi-Newbie
  • *
  • Posts: 12
Re: StickyTopicsOrder
« Reply #33 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,
)
);

Offline sribharath

  • Semi-Newbie
  • *
  • Posts: 83
  • Live Life King Size
    • hostwithsytes on Facebook
    • @sytesofficial on Twitter
    • Web Hosting India
Re: StickyTopicsOrder
« Reply #34 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

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,818
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: StickyTopicsOrder
« Reply #35 on: September 23, 2017, 09:38:41 AM »
Yes, this sets what order your sticky topics are in.
Please do not PM me for support.

I just ordered a life alert bracelet so
if I get a life, I'll be notified immediately.

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #36 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?   :(

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,818
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: StickyTopicsOrder
« Reply #37 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 ... :-\
Please do not PM me for support.

I just ordered a life alert bracelet so
if I get a life, I'll be notified immediately.

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #38 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

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #39 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. 

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #40 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

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 981
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: StickyTopicsOrder
« Reply #41 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
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #42 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.   :)

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,818
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: StickyTopicsOrder
« Reply #43 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
Please do not PM me for support.

I just ordered a life alert bracelet so
if I get a life, I'll be notified immediately.

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: StickyTopicsOrder
« Reply #44 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