Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

PLUGIN : Animated forum "tour".

2»

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Okay, I'll install your plugin and try to help with real code.

    Could you just give me some information of what is needed in config.php?
    a) Here is what I see (and what I guess would be the best form element)
    ForumTour.Title (string in TextBox)
    ForumTour.Description (string in TextArea)
    ForumTour.Xposition (integer in TextBox)
    ForumTour.Yposition (integer in TextBox)
    ForumTour.TooltipPosition (string: t('top,right,bottom,left') in DropDown)
    ForumTour.XpositionType (string: px/% in DropDown)
    ForumTour.YpositionType (string: px/% in DropDown)

    Is that correct and are all those and only those information needed?

    Given that you have two entries, would you need all of the informations mentioned above for each entry or should XPositionType be px or % for every entry?
    Here's an example. Should it be like that

    array(
      array(
        'Title' => 'One Title',
        'Description' => 'Some Description',
        'XPosition' => '2',
        'YPosition' => '50',
        'TooltipPosition => 'right',
        'XPositionType' => 'px',
        'YPositionType' => '%'
      ),
      array(
        'Title' => 'Second Title',
        'Description' => 'Another Description',
        'XPosition' => '97',
        'YPosition' => '3',
        'TooltipPosition => 'left',
        'XPositionType' => '%',
        'YPositionType' => '%'
      )
    );
    

    or like that:

    array(
      array(
        'Title' => 'One Title',
        'Description' => 'Some Description',
        'XPosition' => '2',
        'YPosition' => '50',
        'XPositionType' => 'px',
        'YPositionType' => '%'
      ),
      array(
        'Title' => 'Second Title',
        'Description' => 'Another Description',
        'XPosition' => '97',
        'YPosition' => '3',
        'XPositionType' => '%',
        'YPositionType' => '%'
      ),
      'TooltipPosition => 'left'
    );
    
  • @R_J thanks a lot for all the time you spend helping me ^^ ! The information needed is all and only what you mentionned, and it needs to be step specific (like your first example).

    In order to make things clear :
    title -> step title (pretty obvious)
    description -> step description
    xPosition -> value used to define the position of the step indicator on the screen (x=0 is on the left side)
    xPositionType -> sometimes it's better to use % than px, so I'd like to give users a choice. For example, if xPosition is set to 50 and xPositionType to %, the step indicator will have a CSS style : left : 50%;
    TooltipPosition -> the position of the text relative to the step indicator. It's useful in order to improve layout/ease of use.

  • hgtonighthgtonight ∞ · New Moderator
    edited September 2015

    It would be great if you would fire some event. Then plugins could handle the event and register their own walkthroughs.

    If the user doesn't have the tour plugin, no harm, no foul.

    This wouldn't require a front-end either, assuming your registration function is nice.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • R_JR_J Ex-Fanboy Munich Admin

    Sorry, I also have problems to store the desired information and now I do not have any more time to look at it. I attach what I have done so far. it doesn't solve your save problems, though... :-(

  • R_JR_J Ex-Fanboy Munich Admin

    This is much better than the first try! Look through the code and just ask if you have questions.

  • @R_J Wow ! This is by far much better than what I've done ! I'll look into the code right away ! Thank you so much !

  • @R_J : I made some modification to my old code, and it's now shorter and easier to understand, using your method ! I'm now trying to make a delete function based on the code I found on "Pockets" plugin.

  • R_JR_J Ex-Fanboy Munich Admin

    That would be quite easy. You would have to create function that loops through the config values and unsets the array value. You would have to create such a link like the link to the add/edit page so that the title is passed to the function.

    [spoiler]

      public function SettingsController_ForumTourDelete_Create($sender, $args) {
        $sender->Permission('Garden.Settings.Manage');
    
        $ForumTour = array();
    
        $title = $sender->Request->get('title');
        if ($title != '') {
            // First, we fetch _all_ steps from the config.
            $ForumTourConfig = c('ForumTour', array());
            // Then we walk through the steps one by one
            foreach ($ForumTourConfig as $key => $value) {
                // Check if one title matches the title we wanted to change
                if ($value['Title'] == $title) {
                    unset($ForumTourConfig[$key]);
                }
            }
            // Write back the new values to the config
            saveToConfig('ForumTour', $ForumTourConfig);
    
            // "Redirect" to the list view to show the short and cleaned list
            redirect(Gdn::request()->url('settings/forumtour'));
        }
    

    [/spoiler]

    By now it is not possible to use the same title for more than one step. I hope that is no show stopper...

  • @R_J Everything is working just fine now (add/suppress/edit) ! I think I can release a stable version of the tool :D ! Would you like to be credited as one of the authors, because you did all the hard stuff after all ^^

  • R_JR_J Ex-Fanboy Munich Admin

    Congratulations!

    I would suggest you do a massive code cleanup before you publish it. You can find the coding standard here: http://docs.vanillaforums.com/developers/contributing/coding-standard/

    And no, no need for credits. I just helped with the settings. It was your idea and you did the hardest part (the presentation layer) all alone!

    If you like to, you could point to this discussion so that interested people could see how it did grow, but I do not think that anyone is really interested in that, so I guess you even skip that ;)

  • Thx for the tips ! I'll clean my code asap, I've added some new features which I hope you guys will like ! What is the process required for a plugin to be "approved" ?

  • R_JR_J Ex-Fanboy Munich Admin

    @MrVlad said:
    What is the process required for a plugin to be "approved" ?

    Get employed by Vanilla Inc. ;)

  • MrVladMrVlad New
    edited September 2015

    Yeepee !

    This is the first stable iteration I'm able to release :D ! I hope you guys enjoy it ! Please tell me if anything goes wrong for you, I'll try to fix it ! Same thing if you have ideas for new functionnalities/improvements !

    I cleaned up my code, using PSR-2 instead of vanilla standard because PHP codesniffer crashed everytime I try to load this standard :/ ...

    @R_J thanks again (a lot) !!!

Sign In or Register to comment.