交易按钮

:information_source: 摘要 此插件允许在主题标题上方显示交易按钮(购买、出售、交换)。
:hammer_and_wrench: 仓库链接 https://github.com/jannolii/discourse-topic-trade-buttons
:open_book: 安装指南 如何在 Discourse 中安装插件

我创建了一个简单的插件,允许在主题标题上方显示交易按钮。它仍需要单元测试,但作为一个简单的解决方案,适用于出售/购买/交换类型的分类。

启用插件后,在分类设置中允许相应的按钮:

每个主题都会在标题上方显示这些按钮(当然,您必须是该主题的所有者):

点击按钮后,系统会提示您确认是否继续。如果确认继续,该主题将被归档,并根据您点击的按钮添加相应的前缀:

欢迎使用或分叉此插件。如果您是开发者并发现任何不正确的地方,请随时告诉我。:wink:

目前支持的翻译语言包括:

  • 中文
  • 丹麦语
  • 德语
  • 英语
  • 西班牙语
  • 芬兰语
  • 法语
  • 意大利语
  • 波兰语
  • 葡萄牙语
  • 俄语

如果您希望添加翻译,请提交拉取请求,或者如果您想提供翻译但不懂编程,请直接联系我。

43 个赞

Hi @Janno_Liivak, how it is different to using Buy, Sell and Exchange tags?

Such tags would just say that topic is about selling or purchasing or exchange and it makes topic easier to find.

My plugin is suitable for when you have trade categories… creator of topic can archive it using a button even after allowed changing time has passed.

5 个赞

So, the main feature is for the topic author to be able to archive a topic, or is there something else?

Also, can they close the topic rather than archive?

Right now it’s only archiving topics. Why would you need closing instead of archiving? Archiving freezes a topic and topic is removed from top lists and digest emails etc. but closing doesn’t.

Difference between closing and archiving…

2 个赞

Okay, I see what you mean.

In our community, closing instead of archiving makes sense:

  1. People see how active the category is and how much sales are going on. This encourages people to us our market rather than / in addition to other markets.

  2. People see examples of what was sold quickly and what was not.

  3. People can quickly skim topics and find examples of how other people describe their animals (in our case it’s a goat market, so there is only one kind of things people are selling in ot, and examples are a good thing in this case).

But how do you keep the trading category current when you have closed and active topics mixed? Why do you think people coming to your site will want to look at the closed topics and not what are current offers/requests? In my case moderators bulk-move sold/purchased topics under the archive category so that items will not show up for non-moderators but topics will be available unaltered for future reference (in case somebody does something illegal).

Anyway… if there are enough people with need for closing instead of archiving, I will add this feature.

1 个赞

Community members tell us so.

Well, we don’t need this feature, but thanks for proposing. What we do is we set topic timers automatically for all ads in the category, so that they auto-close 1 month after the last reply. We also encourage people to write in their topics piblicly when an item gets sold, or they decide not to sell it anymore. This way buyers can comment before a topic gets closed, which is also good for content, and for other potential advertisers to watch the dynamics of the market.

Why I was asking is I wanted to find out whether there are any other features than that.

Is the development still active? Plugin still supported? Anyone uses it?

1 个赞

Is there a problem with this plugin? I haven’t done any changes as it does everything I need :slight_smile:

2 个赞

I just installed this, turned it on in settings and enabled the buttons in a category, but I do not see the buttons after posting a topic…

1 个赞

You should restart the application. After that the buttons should be visible.

1 个赞

Hi @Janno_Liivak,

Many thanks for giving us the opportunity to use this plugin, for us it’s really useful. Just let me ask you out of curiosity, I don’t understand why restart the application is needed, that’s because of the loading of some components after enabling it?

By the way, not sure if it’s me, but the Cancelled button does not disappear when unchecking from Category settings, it is supposed to be always there? I think this is related to, once you enable a button, if then is disabled, the button still appears, there is no way to remove it, doesn’t it?

Cheers,
Ismael

1 个赞

I guess that it’s how Discourse plugins are “plugged” into the standard functionality. Also there may be that some category stuff get’s cached etc … so I would suggest restarting the app after making changes to category settings also … it may also wery well be that plugged functionality doesn’t get applied the same way as default functionality does.

It may also be that I just don’t know how to do it any differently :wink: I haven’t dug deeper than I had to… didn’t have time.

Right now I have no further plans for this plugin. For anything more (regarding trading functionality) I would consider implementing some sort of interface with existing online trading environment (or ERP) but as I don’t need anything more it’s going to be “as is” for Trading Buttons plugin.

Hi @Janno_Liivak,

After some investigation, I think I solved the issue about buttons that still appear even after unchecking from category settings. I’ve opened a PR on your project.

If you need more info, please let me know.

Cheers,
Ismael

Thanks, @trobiyo… but your fix didn’t work :slight_smile:
Added comment to your PR.

Yes, totally agree, I did not try it out from a clean environment, so maybe that affected the value of some variables after trying and error. I will try it again then.

Many thanks for letting me know.

Cheers,
Ismael

Thank you, @trobiyo for a fix and Spanish translation :bow: :+1:

3 个赞

How can I contribute with a Portuguese translation?

2 个赞