Announcement

Collapse
No announcement yet.

Module to call php code

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

  • Module to call php code

    I'm trying to create a module that will run a php script. below is my php script. I guess I just don't know well enough how to make that run on the forums. I tried to put the raw data in a static html page, but that didn't work so I was thinking I needed to find a way to call the .php script on the server. Am I even remotely close to figuring this out?

    PHP Code:
    <?php

    if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
        
    Header("Location: index.php");
        die();
    }

    $content = <<<EOT
    <!--REPLACE BELOW THIS LINE-->

    <span id="instantventrilo"><a href="http://www.instantventrilo.com/">ventrilo</a> Hosting by InstantVentrilo.com</span><script type="text/javascript" src="http://view.light-speed.com/ventrilo.php?IP=theonetriune.typefrag.com&amp;PORT=10275&amp;STYLE=2&amp;CHANNEL_WNOUSER=YES&amp;SHOW_IP_PORT=NO&amp;HELP=YES&amp;CONLINK=YES&amp;WIDTH=200&amp;FONTSIZE=10&amp;BGCOLOR=FFFFFF&amp;SN_BGCOLOR=000000&amp;SN_COLOR=FFFFFF&amp;INFO_BGCOLOR=0ba122&amp;INFO_COLOR=FFFFFF&amp;HELP_BGCOLOR=409DE0&amp;HELP_COLOR=000000&amp;CHANNEL_BGCOLOR=CCCCCC&amp;CHANNEL_COLOR=000000&amp;UN_BG=FFFFFF&amp;UN=000000&amp;METHOD=js"></script>

    <!--REPLACE ABOVE THIS LINE-->
    EOT;
    ?>
    Thanks
    -Luke

    - - - Updated - - -

    Seems I'm blind... I found the php block, but code still not working.

  • #2
    Did you see the documentation on the PHP module here - http://www.vbulletin.com/docs/html/s...er_modules_PHP You need to echo the output, not assign it to $content.

    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 &lt;- awesome site for html/css help

    Comment


    • #3
      Thank you very much! I didn't even know the beta version had documentation. My apologies for not thinking of looking for it. I appreciate the link.

      - - - Updated - - -

      So I totally did it now! haha... I'm still trying to get this to work... for some reason the module now loads the entire site in the iframe with an error. It's stopping me from using any buttons on the page. What file can I edit on the server to manually edit the template or how can I find what page to edit to remove the item from the page.

      Comment

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