1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

ragtek Add-ons Helper Framework

Discussion in 'Add-on Releases [Archive]' started by ragtek, Apr 22, 2011.

Thread Status:
Not open for further replies.
  1. ragtek

    ragtek Guest

    Because we as clean coders follow DRY (don't repeat yourself) we had to code this "add-on".
    It's not useful for the users here, BUT it will be required if you want to use any of our new add-ons! (article system, new user notification system,linklist,.....)

    ATM it includes only a very small feature, but in the next weeks / months we will refactor also all our released add-ons to "fix" the issues (& problems while updating) with the helper classes which are included in all our add-ons.

    Installation:
    • Upload everything from the "upload" directory into your forum directory
    • install ragtek FrameWork_1.0.0 Beta1_b_1.xml
    Features:
    Documentation will be soon available at http://ragtek.org/xenforo/articlecategory/ragtek-add-ons-helper-framework.38/
     

    Attached Files:

  2. Saeed

    Saeed Well-Known Member

    If it helps you, the coders, then it helps us as well, ragtek. Thank you! :)

    You may want to add the links of various addons which require this framework to be installed in the first post as well. It'll help members know what the framework is basically for.

    Going to install it now. :)
     
  3. ragtek

    ragtek Guest

    no, it helps ATM only ajnos & me for our add-ons^^

    But of cours other coders can use the framework.

    ATM it includes only some datawriter factories and 1 really new feature => the language chooser & phrase edit button & overlay box for the xenforo options page.
    option4.PNG

    our add-on phrases have a fix prefix (for example ragtek_nuns_texts_xxxx)
    to make it easier for the users to edit them, we made IMO a nice & easy workflow=> click edit => this opens the language chooser(i hope that i can remove this step soon, so it only shows the language chooser if there are >1 languages^^), after the user selected the language, it redirects the user to the phrase page and filters all the phrases beginning with our prefix (so they see only the important phrases)

    next version will include our mail queue classes and some other nice stuff, but primary it's to have less work with our add-ons^^
     
  4. Saeed

    Saeed Well-Known Member

    That's what I meant, my friend. Because the framework helps you and makes your work easier, it benefits us as well. ;)

    Can't wait for some more brilliant stuff from you guys. :)
     
    Peggy likes this.
  5. ragtek

    ragtek Guest

    Infos for version 2 (which will be available soon):

    New Sidebar Block Management Module.
    block1.PNG
    blockoptions.PNG
    Here you'll find all the settings for my sidebar block add-ons

    I've named it only (sidebar block and not "ragtek sidebar block" because i don't wanted to limit other developers using this if they want;)

    The usage is very simple:

    1. create a option (php callback: Ragtek_FW_Options_SidebarPositionChooser::renderOption )
    2. Inside your template hook, you need to get the option and to send it to Ragtek_FW_Sidebar::addBlock($contents, $output, $position);

    For example:
    PHP:

    $position 
    =  XenForo_Application::get('options')->ragtek_NPSBB_position;
    $contents Ragtek_FW_Sidebar::addBlock($contents$insertTemplate$position);
    Also a new module is my "Ragtek_FW_Latest" Class, which makes it really easy to get the newest Threads,Posts(including permission check) & Users.
    (More infos comming soon^^)
     
    yavuz likes this.
  6. bogus

    bogus Guest

    Looks good. But what if, as in my case, User, Staff and Forum Stats are not anymore in the Sidebar? Maybe to set the Positions with Numbers would be a better solution?!
     
  7. ragtek

    ragtek Guest

    I don't know because i don't know how you removed the blocks;)
     
  8. bogus

    bogus Guest

    Well. this was more a suggestion (Maybe you missunderstood me).... Anyway, just forget what i wrote :rolleyes:
     
  9. estranged

    estranged Well-Known Member

    What's up with all these frameworks? I installed xentrader, it requried me to install a framework first. I installed themesinc themes, they required me to install a style framework first, now I see your addons will also require a framework installed first.

    I'm wondering why developers choose to include a framework. Is it because you find xenforo's addon/styles system is not that good? Or another reason? I've been hearing how great xenforo's addon/style system is, so this makes me wonder why...
     
  10. ragtek

    ragtek Guest

    No.

    1. I'm not sure if they all are code libraries or frameworks(mine is a code library, but framework sounds cooler:D)

    2. XF Framework is nice, BUT there are still many lacking areas and things, which will never get it into the core.
    With our own classes & methods we are able to code the add-ons faster and the code is getting smaller, because we can use the framework components in ALL our add-ons instead of having the same 5 files IN EVERY ADD-ON
    That's against DRY (don't repeat yourself) and just includes redundancy! If we need to change something, we need to change 5 files in EVERY add-on instead of only the 5 files in the framework....
     
    Weiyan likes this.
  11. ragtek

    ragtek Guest

    Another good example for DRY are phrases.

    I'm having some phrases, which are needed for "many add-ons/areas". (for example the sidebar block manager which will get a new interface soon, or the language choose button,...)
    Should i really create the phrase for every add-on (and translate it) with the same text? NO
    It's IMHO unnecessary to have 6x "foobar" in the phrasetable, only because 6 add-ons use the same word..
     
  12. Digital Doctor

    Digital Doctor Well-Known Member

    Can an addon coded by another programmer ... access and use your code library (framework) ?
    Will multiple code libraries cause alot of overhead / slow down the forums ?
     
  13. Jaxel

    Jaxel Well-Known Member

    The model I repeat most in my mods is my Xml2Array Model...

    EWRatendo_Model_Xml2Array
    EWRhabla_Model_Xml2Array
    EWRmedio_Model_Xml2Array
    EWRporta_Model_Xml2Array

    All 4 are the exact same file... hehe. If you guys want, you can include it in your framework... I think most people will find it useful. I also use PHP_Diff (http://github.com/chrisboulton/php-diff) in my XenCarta addon.
     
    1 person likes this.
  14. ragtek

    ragtek Guest

    Yea, php diff is already included(because we use it in the article system), but it's not soo clean as we wish, so it's not in the public build.
     
  15. ragtek

    ragtek Guest

    Yes & Yes.
    Yes & NO;)

    Choose your answer!:p

    It depends on the coders.
    ATM i don't think that many coders will find this ATM useful because we have included only some small functions and most of the coders also have only 1 language on there board, so they don't need the phrase edit feature...
     
  16. Digital Doctor

    Digital Doctor Well-Known Member

    Would there be really important benefits in having a "Community" Code Library - and lots of addons use it ?
    If vBulletin.org was organized around such a premise, would it have solved some of the vB addon stability problems ?

    If the community mostly used this "Community Code Library" ... would it enable xenforo itself to give better warning that core changes were going to impact certain addons ? or where possible avoid core changes than will impact the Community Code Library ? Sort of like ... vBulletin wouldn't look through 400 addons to look for conflicts ... but if they only had to look once .... would it solve problems ?

    Maybe xenforo could have the Community Code Library Loaded in their libraries to monitor conflicts right from the start ?

    All thoughts and ideas appreciated :)
     
    giorgino likes this.
  17. ragtek

    ragtek Guest

    new changes:

    • some code modifications in last.php
    • 2 new acp pages can be found by the tools (framework version & manage ragtek add-ons)
      • since today i deliver a list of my add-ons and the newest versions from my page), on the page you can see your installed ragtek add-ons, the current version and the newest available version:)
     

    Attached Files:

    • blub.PNG
      blub.PNG
      File size:
      48.5 KB
      Views:
      110
  18. compwhizii

    compwhizii Active Member

    It would make a load of sense for you to OSS and put this on a site like github so multiple people can contribute.
     
  19. ragtek

    ragtek Guest

    It's already in a svn repo, so if anybody wants access, just contact me;)
     
  20. ragtek

    ragtek Guest

    Upcoming changes in Build 10:

    Introduction of Ragtek_FW_Userhelper

    1. method: isMemberOf
    XenForos Visitor Class have already a isMemberOf method, to check if the user is member of group XYZ, BUT it doesn't support an array of group ids (for example if you want to check if the member is in group6,7,9 or 12).

    For this, you can use now Ragtek_FW_Userhelper::isMemberOf(XenForo_Visitor $visitor, array $userGroups)
    ATTENTION:
    It doesn't check if the user is in ALL GROUPS! It returns true, as soon as one of the groupid's match to the users groups!

    2.method addSecondaryGroups($visitorId, array $addGroups)
    3.method removeSacondaryGroups($vitorId, array $removeGroups)

    This static methods allows you, to manipulate the secondary groups of the member.
     
    Saeed likes this.
Thread Status:
Not open for further replies.

Share This Page