• Dev
  • Super Sticky Posts


GitHub: https://github.com/velcis/super-sticky
Packagist http://packagist.org/packages/velcis/super-sticky

Installation

Use composer to install:

composer require velcis/super-sticky:0.1.x-dev

Update

composer update velcis/super-sticky
php flarum migrate
php flarum cache:clear

Configuration

Just activate it on Extensions page in admin panel.
It is sticking posts on the Latest Section, as the image see.

I changed some line of codes of the original flarum/sticky so the credits are all given to Toby Zerner

Feel free to report bugs.

    VelcisRibeiro Glad to see someone making this extension.

    It looks like this extension does not have a tagged version at packagist yet, so it doesn't fulfill our requirements for posting your extension. You'll need to tag the release if you want it to work with composer easily. If it's ready to be released, and not in a WIP stage, then feel free to include the other details such as direct links to Github, Packagist, installation instructions, and a screenshot if you like.

    EDIT: It also looks like you may have some migration issues you need to look into.

      A long-sought feature. Thanks from myself and the community.

      public/api/extensions/velcis-super-sticky:

      {"errors":[{"status":"405","code":"method_not_allowed"}]}

      I can't enable this plugin.

      8 days later

      When i try to install this extension get errors and i am also unable to activate it

       composer require velcis/super-sticky:0.1.x-dev
      ./composer.json has been updated
      Loading composer repositories with package information
      Updating dependencies (including require-dev)
      Package operations: 1 install, 0 updates, 0 removals
        - Installing velcis/super-sticky (dev-master b86b0c5): Cloning b86b0c5a7e
          Failed to download velcis/super-sticky from source: Failed to clone https://github.com/velcis/super-sticky.git, git was not found, check that it is installed and in your PATH env.
      
      sh: git: command not found
      
          Now trying to download from dist
        - Installing velcis/super-sticky (dev-master b86b0c5): Downloading (100%)
      Writing lock file
      Generating autoload files

      The extension is showed in the extension but cannot enable.

      Also now if i run composer remove velcis/super-sticky:0.1.x-dev the extension still be listed in my extensions.

      composer remove velcis/super-sticky:0.1.x-dev
      velcis/super-sticky:0.1.x-dev is not required in your composer.json and has not been removed
      Package "velcis/super-sticky:0.1.x-dev" listed for update is not installed. Ignoring.
      Loading composer repositories with package information
      Updating dependencies (including require-dev)
      Nothing to install or update
      Generating autoload files

        try

        composer remove velcis/super-sticky

        without the :0.1.x-dev

          Kvothe Thanks, i will try to reminder next time. For now i resumed the backup i made before install the extension. I will be happy to use a super sticky extension when will be ready for work.

          peopleinside This is because this extension is using the same variable naming scheme in its migrations as Flarum Sticky.

          VelcisRibeiro you should either change the database variable names in the migration or use the conflict method in composer.json to avoid this extension installing if Flarum Sticky is still installed.

            jordanjay29 Should exist a check that forbid install if something is wrong instead of broken things 😛 ( if is pobbile ) - suggestion -

              peopleinside That's what conflict does in composer. It tells composer "hey, these are the extensions this one doesn't work with, if those are installed, don't install me," so the dev can list flarum/sticky and composer will know not to install super sticky when Flarum Sticky is installed.

                jordanjay29 So can be a suggestion to do in composer project?

                Finally i was able to solve in Beta 8.1 just edit the line 73 of /vendor/flarum/sticky/src/Listener/PinStickiedDiscussionsToTop.php:

                from: $query->union($sticky);
                to array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']);

                  5 days later

                  Brabus453 thank you for your message and feedback! On my community I was not able to see issue about this edit. Maybe the cause can be new post added outside of the sticky post or inside the sticky post? In my community there are not other user that create topics, etc.. so for me at the moment is working. Something should have caused the sticky post to not work.. are you able to try to understand what? Unfortunately I don't understand much of code.. I just tried to read this topic on Flarum, find where the fix can be done and find the right line... I don't like how sticky are working on Flarum and with this fix I am seeing how sticky should work in my opinion.. if sticky post loose his position than my fix is not fully working...

                  EDIT: I see the issue. If a new post are created the sticky one loose his position. If the page is refreshed the sticky take again the first position. I will try to look into this but difficult I will be able to fix.

                  Unable to fix: i tried also to replace all file and folders in the sticky folder extension with the super sticky files and folders. The issue persist, sorry... without the help of someone and the collaborations of the developers i cannot do much more.

                  The issue about new post get over sticky seems to be related to sticky of Flarum. Opened an issue flarum/core1751

                    peopleinside i will test, and check if i refresh if sticky stays on top.

                    now, i must say, i installed some extentions.... and removed some.... maybe it changed something in the sticky files?