Announcement

Collapse
No announcement yet.

PHP In my XML style template file...

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

  • PHP In my XML style template file...

    How do I add PHP to the XML style files from a template I bought from templatestyles.com ?

    I've tried but the code doesn't execute properly because it's in the XML file... I really need help and would appreciate it.

    Thank you

  • #2
    PHP can only be added to the phpinclude template.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Thank you, Steve. I am new to vBulletin, where might I find this in my directories ? I bought the style from http://www.vbulletinstyles.com and it came in an xml file... is there something I am missing ?

      I appreciate it.

      this is the one I bought...

      Comment


      • #4
        you import the xml file into the admincp and it will create the style on your board. You may also have to upload some images.
        Scott MacVicar

        My Blog | Twitter

        Comment


        • #5
          Right, I have the style working properly, and did have to upload some images but where does it create php files for the style so I can add in my code ? I can't seem to find where the files are created.

          Sorry for being a newb...
          Last edited by abstrakt; Tue 26 Aug '03, 5:12am.

          Comment


          • #6
            the templates are held in the database. You'll need to add your PHP to the actual vBulletin files.
            Scott MacVicar

            My Blog | Twitter

            Comment


            • #7
              Hmm, this is whacky. I'm not sure I understand. For instance in my case I need to add a banner script under the buttons of my template. If the template is held in the database how do I modify/customize my layout then ? The way it appears to be setup would suggest I couldn't edit it accordingly - that's not cool.

              Comment


              • #8
                Click on Style Manager and then click on the expand button ("<< >>") to show all the templates. You can edit them right in the admin control panel.
                Translations provided by Google.

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

                Comment


                • #9
                  Originally posted by abstrakt
                  Right, I have the style working properly, and did have to upload some images but where does it create php files for the style so I can add in my code ? I can't seem to find where the files are created.

                  Sorry for being a newb...
                  as i also bought a script they are NOT "php" they are if and /if statments...

                  if use is then else ...

                  different
                  .. . / GFXstyles certain amount of common sense is necessary to survive in this world !
                  insanity leaves you no restrictions

                  Comment


                  • #10
                    Originally posted by kennethj
                    as i also bought a script they are NOT "php" they are if and /if statments...

                    if use is then else ...

                    different
                    Code:
                    <if condition="$bbuserinfo[userid] == 0">
                    went and got an example ... they are used in forum home templts...
                    .. . / GFXstyles certain amount of common sense is necessary to survive in this world !
                    insanity leaves you no restrictions

                    Comment


                    • #11
                      Hmm, I am really starting to become frustrated with this. Something so simple is becoming a task and a half to complete. Someone please spell it out for me...

                      All I need to do is add this code under my buttons:

                      Code:
                      <p>
                      <? require("phpadmentor/phpadmentor_config.php"); ?>
                      <? echo(PhpAdMentor_GetAd("", 2, 0) ); ?>
                      <p>
                      I tried the way suggested above using the editor in my admincp, and nothing shows up, so instead I took away the PHP tags, and then the script text itself shows up where the banner should be echoing. Why is this so hard !?!?!

                      Comment


                      • #12
                        Please...

                        Comment


                        • #13
                          PHP has never executed in the templates since this would be a huge security hole.

                          Can you call the advert another way say by an image tag?

                          or you could edit global.php

                          require_once("./phpadmentor/phpadmentor_config.php");
                          $advert = PhpAdMentor_GetAd("", 2, 0);

                          and then use $advert where you want the advert to appear.
                          Scott MacVicar

                          My Blog | Twitter

                          Comment


                          • #14
                            Okay, I added what you said in the end of global.php and then put this in the template editor via the admincp in my header...

                            <p>
                            $advert
                            <p>

                            all I get is blank space in the forum still... I wish this were'nt so complicated. VBulletin Rules, but in phpBB this would'a been said and done with a long time ago.



                            I know the admentor script works...

                            Comment


                            • #15
                              did you put the code above where the header code is executed?

                              PHP is not allowed in the code for purely the reason you've demonstrated above. People buy styles. If the owner was to put say a little bit of extra PHP code in one of the templates he could fetch all the emails of your user and sell them to a spam list etc.

                              PHP Code:
                              // parse headinclude, header & footer
                              eval('$headinclude = "' fetch_template('headinclude') . '";');
                              eval(
                              '$header = "' fetch_template('header') . '";');
                              eval(
                              '$footer = "' fetch_template('footer') . '";'); 
                              your code has to go above that.
                              Scott MacVicar

                              My Blog | Twitter

                              Comment

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