How do I include php in Widget?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alkrida
    New Member
    • Nov 2009
    • 23
    • 3.8.x

    #31
    Thank you Steven

    me 2

    Comment

    • ShyGuy82
      Senior Member
      • Feb 2007
      • 438

      #32
      Does this work only with PHP??? Can I bring back ANY content from ANY site? Does the $output hold a raw php or a rendered html?
      Speed up your member list page by at least 5x (4.x.x)

      http://nicknameregister.com/files/20...0/ShyGuy82.jpg

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #33
        We are talking about a php widget here, so yes, you may only use php and the output is rendered html.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools <- awesome site for html/css help

        Comment

        • ShyGuy82
          Senior Member
          • Feb 2007
          • 438

          #34
          Lynne, thanks for your reply, if I want to create a widget for a static html? say I want to include an IFRAME (filling the rest of the browser's real estate (minus header and footer) with SRC of another page, can I do that?

          Thank you
          Speed up your member list page by at least 5x (4.x.x)

          http://nicknameregister.com/files/20...0/ShyGuy82.jpg

          Comment

          • Lynne
            Former vBulletin Support
            • Oct 2004
            • 26255

            #35
            You may create a static html widget, yes. However, you question regarding iframes I can't answer since I have never done anything with them.

            Please don't PM or VM me for support - I only help out in the threads.
            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
            Want help modifying your vbulletin forum? Head on over to vbulletin.org
            If I post CSS and you don't know where it goes, throw it into the additional.css template.

            W3Schools <- awesome site for html/css help

            Comment

            • Ashley Pietersen
              New Member
              • Dec 2009
              • 3

              #36
              Great ! I had the same issues -


              // UNTESTED
              ob_start();
              include("/packages/vbcms/rep-online.php");
              echo "<br />\n";
              $output .= ob_get_contents();
              ob_end_clean();

              the PHP code above made it happen finaly - thanks

              Comment

              • kyrgyz
                Senior Member
                • Oct 2007
                • 691

                #37
                Originally posted by steven s
                What I would is create your slide show as a standalone file on your server to ensure that it works.

                public_html/path/mod_fpslideshow.php

                Then use

                PHP Code:
                ob_start();
                include(
                "/home/pathto/mod_fpslideshow.php");
                echo 
                "<br />\n"/* optional space */
                $output .= ob_get_contents();
                ob_end_clean(); 
                I am planning to have a slideshow in forum header. Can it be done with the above code if I put it in the header include?

                Comment

                • steven s
                  Senior Member
                  • Jul 2004
                  • 3722
                  • 3.8.x

                  #38
                  Originally posted by kyrgyz
                  I am planning to have a slideshow in forum header. Can it be done with the above code if I put it in the header include?
                  I'm going to say no.
                  I use a script that changes the photo with each refresh, but not a slide show.
                  ...steven
                  www.318ti.org (vB3.8) | www.nccbmwcca.org (vB4.2)
                  bmwcca.org/forum | m135i.net
                  "I tried to clean this up but this thread is beyond redemption." - Steve Machol

                  Comment

                  • kyrgyz
                    Senior Member
                    • Oct 2007
                    • 691

                    #39
                    I want to try Webassist PowerGallery, was hoping to use it to show landscape photos in the forum header. Really like its Control Panel.
                    Below is from their site.
                    PHP Code:
                    Embed in PHP Page
                    Insert the following code within an existing PHP page, exactly where you wish this PowerGallery to display:
                     
                    <?php
                    $pg_id 
                    '6';
                    $pg_theme 'dark';
                    include(
                    '/powergallery/galleries/grid_lightbox/index.php');
                    ?>
                    Originally posted by steven s
                    I use a script that changes the photo with each refresh, but not a slide show.
                    P.S. Could you, please, share your script witn me, if it's ok? Or give me a link. Thanks

                    Comment

                    • steven s
                      Senior Member
                      • Jul 2004
                      • 3722
                      • 3.8.x

                      #40
                      Originally posted by kyrgyz
                      P.S. Could you, please, share your script witn me, if it's ok? Or give me a link. Thanks
                      I use this.

                      And in my header I use <img src="path_to/rotate.php">
                      http://forum.nccbmwcca.org uses that script.
                      ...steven
                      www.318ti.org (vB3.8) | www.nccbmwcca.org (vB4.2)
                      bmwcca.org/forum | m135i.net
                      "I tried to clean this up but this thread is beyond redemption." - Steve Machol

                      Comment

                      • kyrgyz
                        Senior Member
                        • Oct 2007
                        • 691

                        #41
                        Thank you. It looks awesome. I'll give it a try later on.

                        Comment

                        • steven s
                          Senior Member
                          • Jul 2004
                          • 3722
                          • 3.8.x

                          #42
                          Originally posted by kyrgyz
                          Thank you. It looks awesome. I'll give it a try later on.
                          Keep in mind, it's not a slideshow.
                          ...steven
                          www.318ti.org (vB3.8) | www.nccbmwcca.org (vB4.2)
                          bmwcca.org/forum | m135i.net
                          "I tried to clean this up but this thread is beyond redemption." - Steve Machol

                          Comment

                          • ZoDesigns.com
                            Senior Member
                            • Nov 2005
                            • 272
                            • 3.5.x

                            #43
                            So I updated a 3.x site to v4 Suite and implemented the same exact code from my other site where this is working (same server). I now get this error:

                            Warning: include() [function.include]: open_basedir restriction in effect. File(/home/xxx/domains/xxx.com/public_html/fpss.php) is not within the allowed path(s): (/home/xxx/:/tmp:/var/tmp:/usr/local/lib/php/) in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 2

                            Comment

                            • Steve Machol
                              Former Customer Support Manager
                              • Jul 2000
                              • 154488

                              #44
                              ZoDesigns.com, please start your own thread with all the relevant details. Thank you.
                              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

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