Announcement

Collapse
No announcement yet.

How do I include php in Widget?

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

  • #31
    Thank you Steven

    me 2

    Comment


    • #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


      • #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


        • #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


          • #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


            • #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


              • #37
                Originally posted by steven s View Post
                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


                • #38
                  Originally posted by kyrgyz View Post
                  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


                  • #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 View Post
                    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


                    • #40
                      Originally posted by kyrgyz View Post
                      P.S. Could you, please, share your script witn me, if it's ok? Or give me a link. Thanks
                      I use this.
                      http://www.dreamincode.net/code/snippet428.htm
                      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


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

                        Comment


                        • #42
                          Originally posted by kyrgyz View Post
                          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


                          • #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


                            • #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...
                              X