Announcement

Collapse
No announcement yet.

VB5 modding tutorials / resources?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB5 modding tutorials / resources?

    Hi there,

    I have to plunge into vb5 modding in a quite fast fashion. My former modding experience (s)topped somewhere around vb368. I had to move and update my old big board to 5.6.2 recently, and need to update my mods as well.

    My aim is to recreate my site's full functionality with the use of most fresh vb5 backend engine.

    From what I see here - there is not very much documentation about vb5 modding. I am aware that many people abandoned vb in favor of other software, but I still feel good with vb.

    at Vbulletin.org there is sadly very little about vb5.

    Here at vbulletin.com I found a nice starting point, published by Joe-D:
    https://forum.vbulletin.com/blogs/joe-d/3932614-


    Is there any other read worthy material on that topic?
    Any existing more advanced vb5 mods that could be used as a learning material?

    Will post here other relevant information when I find it.
    Last edited by Turtullo; Sun 9 Aug '20, 2:47am.
    What's brewing in Poland? Find out on www.Browar.biz (in Polish)
    PL: Modyfikacje vB: www.pub.net.pl

  • #2
    vBulletin 5 Connect Template Syntax
    https://www.vbulletin.com/docs/html/...emplate_syntax
    What's brewing in Poland? Find out on www.Browar.biz (in Polish)
    PL: Modyfikacje vB: www.pub.net.pl

    Comment


    • delicjous
      delicjous commented
      Editing a comment
      You could take a look into do_not _upload folder. There are some example-mods

  • #3
    The do_not_upload folder and the /core/Packages directory are your best resources.

    I've personally published the API on a site I own at http://vb5support.com/resources/api. Though it is a little out of date, it should still be useful.

    For your development server, you will probably want to download vBulletin 5.6.2+ without the PHAR file compression. You can do this under the Other Download Options on the download page.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #4
      Thanks Wayne. The complexity of the new vb5 system is driving me insane, I am trying to shell out all the needed info from mentioned files, but I am geting overwhelmed. Still have not found a step by step introduction to vb5 modding.

      Before I make a full fledged product using all the whistles like Settings, Stylevars, Templates, Hooks, Custom PHP, and Auto Install can You guide me how to create some very simple standalone page for starters that:

      - resides in html root directory (while the vb5 is deeper in /forum subfolder)

      [initializes vbulletin engine and keeps up the user session]
      [uses a given style]
      [gets the currently logged in userid/username]
      [calls a template that would be used to display at least just the logged user's username]
      [renders the header-, the above and footer template]
      [spits all out]

      I'd like to encourage also other people to help me Wayne can't do this all alone
      What's brewing in Poland? Find out on www.Browar.biz (in Polish)
      PL: Modyfikacje vB: www.pub.net.pl

      Comment


      • #5
        Off the top of my head, I can think of at least half a dozen ways to modify vBulletin 5.X.
        1. Custom API Extensions
        2. PHP Hooks
        3. Template Hooks
        4. Custom Javascript
        5. Custom CSS
        6. Style Variables,
        7. Template Modification
        8. Replacement Variables
        9. Local Server Code.
        10. Site Builder Page Modifications.
        These are all methods to modify the software. What are you specifically trying to do? That is the best place to start. From there I can tell you how to do it.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #6
          - resides in html root directory (while the vb5 is deeper in /forum subfolder)

          [initializes vbulletin engine and keeps up the user session]
          [uses a given style]
          [gets the currently logged in userid/username]
          [calls a template that would be used to display at least just the logged user's username]
          [renders the header-, the above and footer template]
          [spits all out]
          Why? That is my first question. vBulletin already does all of this and you can use Site Builder to create a custom page to act as your Home Page.

          You can show the username in a module by adding a Static HTML Module to the page and entering <p>{username}</p> as the HTML code.

          Then when you save it, you mark it as the homepage.

          Finally, go to the Navigation Bar and edit the Forum link. Change it from / to /forum/.
          Last edited by Wayne Luke; Sat 15 Aug '20, 9:23am.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment


          • #7
            I actually don't need a page displaying me a username I need an example php page doing the above to help me getting started with more complex things.

            this is my shop in our community with underlying vb3 engine
            https://www.browar.biz/centrumpiwowarstwa

            I have to quickly rewrite the shop's code to get it working with vb5. It utilizes the vb engine for sessionhandling, shares same usertable, uses custom vb style and templates, and languages, and also utilises vb emailing system, new payment processors, shipping handling, underlying warehouse-, production-, customer-, supply- and accountant management etc.

            in vb3 it was simple as that (simplyfied):

            PHP Code:

            <?php

            (...)
            // pre-cache templates used by all actions
            $globaltemplates = array('mytemplate');

            // ######################### REQUIRE BACK-END ############################
            require_once('global.php');

            // for example: get permissions to view
            if ($vbulletin->userinfo[userid]!=2) {
            print_no_permission();
            }

            [
            my tons of code here]

            eval(
            'print_output("' fetch_template('mytemplate') . '");');

            ?>
            Last edited by Turtullo; Sun 16 Aug '20, 11:14am.
            What's brewing in Poland? Find out on www.Browar.biz (in Polish)
            PL: Modyfikacje vB: www.pub.net.pl

            Comment


            • #8
              Creating new pages in vBulletin 5 is different and you don't need all the cruft of recreating the page. Make data retrieval into functions within a custom API class. See:
              https://forum.vbulletin.com/articles...php-in-modules

              Your custom API would call the database, pull the data, and put it into arrays after any internal processing and sorting that it needs.

              The article also shows you how to get data into a template using the vb:data tag. In this example, put your product information into an array. Templates also allow you to do loops within them in vBulletin 5. So you can do your template like:

              {vb:data products localapiroducts, getproducts}
              <vb:each from="products" key="productid">
              .... output html code ....
              </vb:each>

              https://www.vbulletin.com/docs/html/...mplates_syntax

              vb:data paramaters are return array, API to call, and the function within the api.

              If there was example code, I could provide better integration methods.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment


              • #9
                Thanks for new resources, will look deeper into those articles and definitely come back with some questions
                Last edited by Turtullo; Wed 19 Aug '20, 7:26am.
                What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                PL: Modyfikacje vB: www.pub.net.pl

                Comment


                • #10
                  Originally posted by Wayne Luke View Post
                  Creating new pages in vBulletin 5 is different and you don't need all the cruft of recreating the page. Make data retrieval into functions within a custom API class. See:
                  https://forum.vbulletin.com/articles...php-in-modules
                  Ok used that one just for fun - below my screenshot with the effects.
                  As You can see the outcome is that there was some container added (browarbiz testpage on the screenshot) that is visible on every page).

                  How should I proceed if I wanted to create a custom page with header and footer and just the browarbiz testpage between them?

                  Attached Files
                  What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                  PL: Modyfikacje vB: www.pub.net.pl

                  Comment


                • #11
                  Ok, Delicjous example mod gave me some basic insight to what has changed and what and how it works now without overwhelming me (I am just a holiday coder ).

                  I will now recreate a standalone section of the site using a new channel with a custom nonchoosebale by the user style attached to it. I will have some questions along the way.
                  What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                  PL: Modyfikacje vB: www.pub.net.pl

                  Comment


                  • #12
                    After trying this and that, I think my way to accomplish my tasks will be the API way.

                    So I am starting with point 1.

                    [initializes vbulletin and keeps up the user session]

                    PHP Code:
                    // Path to your vBulletin installation
                    $vbpath 'xxx';

                    // Start login script
                    define('CSRF_PROTECTION'false);
                    require_once(
                    $vbpath '/includes/vb5/autoloader.php');
                    vB5_Autoloader::register($vbpath);
                    vB5_Frontend_Application::init('config.php');

                    $userid vB::getCurrentSession()->get('userid');
                    $user_info vB_User::fetchUserinfo($userid0falsefalse); 
                    Ok, I am connected to the API, can get the current logged in user. Session is also updated. Whoa, that wasn't that hard.

                    now move on to:
                    [uses a given style]

                    I inserted a new custom template in Masterstyle and then a created a new style (ID=50).
                    Now I wil try to assign this style to this particular page and get needed templates from this style
                    What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                    PL: Modyfikacje vB: www.pub.net.pl

                    Comment


                    • #13
                      While I have not yet figured out how to force a given style to be used, the use of the newly created template proved to be not so hard to accomplish.
                      The error message template and the script behind it helped me figuring out how to do it:

                      my new_custom_template goes like this:

                      Code:
                      {vb:template header, page={vb:raw page}}
                      {vb:raw my_tons_of_code_output}
                      {vb:template footer, page={vb:raw page}}
                      it is pretty selfexplanatory. didn't check all the vb:template syntax yet, though,

                      ok, the standalone php page goes on like this:

                      PHP Code:

                      $my_tons_of_code_output 
                      = (...);

                      $templater = new vB5_Template('new_custom_template');
                      $templater->registerGlobal('page'$page);
                      $templater->registerGlobal('my_tons_of_code_output'$my_tons_of_code_output);
                      $output vB5_ApplicationAbstract::getPreheader() . $templater->render();

                      echo 
                      $output
                      By now I have done most of the stuff, I get the header and footer around the output from my my_tons_of_code.

                      Any hints how to force the use of concrete style before the template?
                      What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                      PL: Modyfikacje vB: www.pub.net.pl

                      Comment


                      • #14
                        Originally posted by Turtullo View Post
                        Any hints how to force the use of concrete style before the template?
                        I created a new channel with
                        assigned Custom Style for this Channel that Override Users' Style Choice

                        now I have to instruct the API that my page should pull all the style elements assigned to the above channel and not the default style chosen by the user.
                        Some guidance would be highly appreciated
                        What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                        PL: Modyfikacje vB: www.pub.net.pl

                        Comment


                        • delicjous
                          delicjous commented
                          Editing a comment
                          There is a style-option in each channel when you edit it by channelmanager. So you could give each channel a other style... don't know if new toplevel is possible.

                        • Turtullo
                          Turtullo commented
                          Editing a comment
                          Hi Delicjous, With that im mind i created a new channel (under the forums channel). Although not a top level, as somewhere else I think Wayne, told me that it is not possible.

                          The thing which concerns me, is how to tell the API that the calling script "is now within" that channel, so the custom style would be automatically set and the API would pull the right templates from the DB.

                          Right now I am receiving the templates from default forum style.

                        • delicjous
                          delicjous commented
                          Editing a comment
                          You shout use an addon to create your template (so each style get that template), use template-hooks or widgets (both exampled in my linked membermap addon) to display the template. Better use your own api to get your code into the template... template-api is not working if templates are files. Example: https://vbulletin.org/forum/showthread.php?t=323006

                      • #15
                        Change of plan (?) I believe I just have to update the user's styleid to the new Custom Style ID in his session data through the API. But how?

                        Code:
                        vB::getCurrentSession()->set('styleid', MYCUSTOMSTYLE_ID);
                        does not work.

                        Maybe because the styleid is still in the users cookie (?).
                        What's brewing in Poland? Find out on www.Browar.biz (in Polish)
                        PL: Modyfikacje vB: www.pub.net.pl

                        Comment

                        Related Topics

                        Collapse

                        Working...
                        X