Announcement

Collapse
No announcement yet.

Template_safe_function

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

  • Template_safe_function

    Hi,

    I would like to add a hook in vB5.

    In vb3.8.11, I was going to Admincp/Hooks&Products System/Add New Hook. At Hook Location, I selected Template_safe_function to add the hook rand ( ) inside a template.

    Is rand() allowed inside a vB5 template? What is the equivalent of Template_safe_function under vB5?

    Regards
    .
    .
    Last edited by lange; Tue 1 Jun '21, 6:21pm.

  • #2
    vBulletin 5 hooks work on a completely different process than those in vBulletin 3.

    To insert the results of PHP code into a custom template then you should look at this example: https://forum.vbulletin.com/articles...php-in-modules.

    You would assign your custom template to the hook location where you want it to appear.
    Translations provided by Google.

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

    Comment


    • #3
      That is the problem. vB5 works differently from vB3 & vB4. To achieve the same goal, vB5 uses a complex path instead of simplicity.

      On vB3, the content of my hook is simple :
      PHP Code:
      $safe_functions[] = 'rand'
      and with this simple PHP function I can do a lot of things using conditionals : (deleted example)

      Now under vB5, I am lost because my creativity is limited by an issue which does not exist in my opinion for a simple PHP function like Rand (). So I don't care about security because my forum is totally private and the register is under invitation only.

      I'm going to have to post a paid job to vbulletin.org because I'm not a coder. I would rather have put this money on another vBulletin license. The other alternative is to swich to another forum script.

      Edit : I deleted the example because the code broke the vB5 demo forum of the designer who is working on my vB5 theme at this moment.
      Last edited by lange; Wed 2 Jun '21, 6:42am.

      Comment


      • #4
        https://www.vbulletin.org/forum/show...03#post2607103

        Comment


        • #5
          Unfortunately, the method used for plugins and hooks was considered safe and secure for its time. Over the years, we have learned that this was not always the case. Newer methods had to be developed in order to comply with modern versions of PHP, secure sites, and get PHP out of the database.
          Translations provided by Google.

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

          Comment

          Related Topics

          Collapse

          Working...
          X