How do I make a new template and get it to work?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FELLO9
    Senior Member
    • Sep 2000
    • 126

    How do I make a new template and get it to work?

    I'm trying to add two templates 1) Privacy 2) abbreviation list. I see the place in the control pannel where to add new templates, but how do I get it to work? What will be the URL for that? Do I have to make some changes in the index file to get it to work?
    Please answer me! Thank you very much.

    http://www.jumpondeals.com
    http://www.jumpondeals.com/forum
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74122

    #2
    If your privacy template is called privacy and builds a standalone html file then add:
    Code:
    if ($action=="privacy") {
      eval("echo dovars(\"".gettemplate("privacy")."\");");
    }
    You can then use the URL of http://www.yourdomain.com/index.php?action=privacy to access the page.

    If it is more of a bit like the postbit template then add the following line where you need to use it:
    Code:
    eval("\$privacy = \"".gettemplate("privacy")."\";");
    And access it by the $privacy variable in the container template.
    Translations provided by Google.

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

    Comment

    • FELLO9
      Senior Member
      • Sep 2000
      • 126

      #3
      You didn't explain to me...

      You didn't explain where to add the code "if action etc." in which file does it go and exactly where in that document?
      Also I saw on Freddie's site that the url is http://www.hedgehogwheels.com/forums/privacy.php
      and it does not have any "action=" how do you do that?

      http://www.jumpondeals.com
      http://www.jumpondeals.com/forum

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 74122

        #4
        Sorry the IF state goes at the end of your index.php file just before the closing ?>

        If you want it in its own php file create a new file and copy in:
        Code:
        <?php
        require("global.php");
        eval("echo dovars(\"".gettemplate("privacy")."\");");
        ?>
        Save it as whatever you want and its ready to go.
        Translations provided by Google.

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

        Comment

        • FELLO9
          Senior Member
          • Sep 2000
          • 126

          #5
          Wluke what do you mean by "If your privacy template is called privacy and builds a standalone html file then add: "?
          This is what I did, I entered my control pannel, and added a new template which is called privacy. I added the $header and $fivelinks on top and footer on the bottom. I entered into notepad this code "<?php
          require("global.php");
          eval("echo dovars(\"".gettemplate("privacy")."\");");
          ?>" , saved it as .txt and uploaded it to the forum folder, I renamed it to .php3. IT DOES NOT WORK! WHAT AM I DOING WRONG?




          [Edited by fello9 on 11-08-2000 at 01:55 AM]

          http://www.jumpondeals.com
          http://www.jumpondeals.com/forum

          Comment

          • PeF
            Senior Member
            • Oct 2000
            • 767

            #6
            And access it by the $privacy variable in the container template.

            How would you do to make variable working in other templates?
            Example: I created a template, i added appropriate code to global.php. Now i'd like to call the variable $totalthreads ($timenow or others) from my new template but it only works in forumhome template.

            Comment

            • Wayne Luke
              vBulletin Technical Support Lead
              • Aug 2000
              • 74122

              #7
              Originally posted by FELLO9
              Wluke what do you mean by "If your privacy template is called privacy and builds a standalone html file then add: "?
              This is what I did, I entered my control pannel, and added a new template which is called privacy. I added the $header and $fivelinks on top and footer on the bottom. I entered into notepad this code "<?php
              require("global.php");
              eval("echo dovars(\"".gettemplate("privacy")."\");");
              ?>" , saved it as .txt and uploaded it to the forum folder, I renamed it to .php3. IT DOES NOT WORK! WHAT AM I DOING WRONG?




              [Edited by fello9 on 11-08-2000 at 01:55 AM]
              How does it not work? Do you get an error? How is PHP installed on your server? If it is being used as CGI then you have to chmod the file to the appropriate permissions. It must reside in the forum directory. In essence the file becomes part of the forum.
              Translations provided by Google.

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

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 74122

                #8
                Originally posted by PeF
                And access it by the $privacy variable in the container template.

                How would you do to make variable working in other templates?
                Example: I created a template, i added appropriate code to global.php. Now i'd like to call the variable $totalthreads ($timenow or others) from my new template but it only works in forumhome template.
                Probably because those variables are set in index.php not in global.php. You can either move the setting of those variables out of index.php and into global.php or copy the code where you need to use the variables at.
                Translations provided by Google.

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

                Comment

                • FELLO9
                  Senior Member
                  • Sep 2000
                  • 126

                  #9
                  Hi Wluke, thanks for taking your time to answer!
                  Yes I am getting a "fatal error" when I'm trying to do that. The error is saying something that it can't call the "global.php3 file.
                  The other question you asked "How is PHP installed on your server? If it is being used as CGI then you have to chmod the file to the appropriate permissions. It must reside in the forum directory. In essence the file becomes part of the forum." I have to admit that I don't even know what your asking cause I'm not a techie, I didn't even install the boards by myself. Vbulletin installed it for me.

                  It does work though when I am adding the code to the index file and the URL is "index.php3?action=privacy
                  BTW, you wrote that if I want to add the code to the index.php3 file than the code goes right before the colosing " ?>". Is this rule said to any kind of template that I want to add? (I wanted to add an abbreviation list, so I was wondering if it has the same rule)?.
                  Again wluke thank you so much for answering.

                  [Edited by fello9 on 11-08-2000 at 11:56 AM]

                  http://www.jumpondeals.com
                  http://www.jumpondeals.com/forum

                  Comment

                  • chrispadfield
                    Senior Member
                    • Aug 2000
                    • 5366

                    #10
                    if it is saying can't find global.php then the path to global.php is wrong. Check is is php, php3 or whatever you have set it up to be and make sure it is calling the correct folder as well.
                    Christopher Padfield
                    Web Based Helpdesk
                    DeskPRO v3.0.3 Released - Download Demo Now!

                    Comment

                    • FELLO9
                      Senior Member
                      • Sep 2000
                      • 126

                      #11
                      WOW! I'm happier now than if I would have been elected for president! Thank you so much Chrispadfield, I just corrected it and made it "php3", and every thing is working fine now!
                      Also thank you again Wluke for all your help, I appreciate it sooooooo much.

                      http://www.jumpondeals.com
                      http://www.jumpondeals.com/forum

                      Comment

                      • chrispadfield
                        Senior Member
                        • Aug 2000
                        • 5366

                        #12
                        no probs.

                        thanks also wluke, glad for that explanation of the templates, helped me out as well. Sort of thing we need in an "advanced faq" i think.
                        Christopher Padfield
                        Web Based Helpdesk
                        DeskPRO v3.0.3 Released - Download Demo Now!

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...