Announcement

Collapse
No announcement yet.

How do I Display a variable?

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

  • How do I Display a variable?

    I know this may seem like a hack, but its really not (from a vbulletin staindpoint). I have created a form, and it is interpreted by a very simple php program that I wrote. The form stores the output to a variable using the ob_start function and printing the variable.

    Basically what I am asking is: Is there any way (somewhat easily) that I could get vbulletin 3 to use the contents of this variable as the message body of a new thread? I believe all I need to do is add the php file to the required section in the common templates in order for it to use the variable, but how could I display it?

    Any help is VERY much appreciated, this is the whole reason I purchased the Vbulletin license, and I am really wanting to use it. I know there is a form to thread hack for ver 2.3, but you cannot have multiple attachments, or add attachments while editing post, unless you use those hacks as well, and they are not compatible, so I am basically trying to figure it out on my own.

    Thanks,
    Ryan

  • #2
    Originally posted by retsell
    I know this may seem like a hack, but its really not (from a vbulletin staindpoint). I have created a form, and it is interpreted by a very simple php program that I wrote. The form stores the output to a variable using the ob_start function and printing the variable.

    Basically what I am asking is: Is there any way (somewhat easily) that I could get vbulletin 3 to use the contents of this variable as the message body of a new thread? I believe all I need to do is add the php file to the required section in the common templates in order for it to use the variable, but how could I display it?

    Any help is VERY much appreciated, this is the whole reason I purchased the Vbulletin license, and I am really wanting to use it. I know there is a form to thread hack for ver 2.3, but you cannot have multiple attachments, or add attachments while editing post, unless you use those hacks as well, and they are not compatible, so I am basically trying to figure it out on my own.

    Thanks,
    Ryan
    Check the templates, you should be able to add your variable there in the Editor templates

    For example, in the editor_toolbar_off you could change it to:

    <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1">$newpost[message] $_POST[yourvar]</textarea>

    in the editor_toolbar_standard:

    <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1" onkeyup="getActiveText(this);" onmouseup="getActiveText(this);" onchange="getActiveText(this);" style="width:95%">$newpost[message] $_POST[yourvar]</textarea>

    in the editor_toolbar_wysiwyg

    <div id="htmlbox" tabindex="1" class="bginput" style="width:520px; height:250px; padding:8px">$newpost[message] $_POST[yourvar]</div>



    I am not 100% that would work but it should give you something to work with. To be able to further customize it then it is a hack and you would need to wait until RC1 and ask for it in vbulletin.org

    Comment


    • #3
      I tried, it doesn't appear to work. This is what I did just to test the idea in the most simple form.

      In the phpincludestart template I have :

      // Example of how to include a seperate file:
      // ob_start();
      // require("yourheader.html");
      // $header = ob_get_contents();
      // ob_end_clean();
      $ryan = "Testing 123";

      In the editor_toolbar_off

      <!-- START NORMAL TEXT AREA -->

      <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1">$newpost[message]$_POST[ryan]</textarea>


      <!-- END NORMAL TEXT AREA -->


      Am I doing something wrong? When I post anything there is no change.

      Originally posted by Toliman
      Check the templates, you should be able to add your variable there in the Editor templates

      For example, in the editor_toolbar_off you could change it to:

      <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1">$newpost[message] $_POST[yourvar]</textarea>

      in the editor_toolbar_standard:

      <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1" onkeyup="getActiveText(this);" onmouseup="getActiveText(this);" onchange="getActiveText(this);" style="width:95%">$newpost[message] $_POST[yourvar]</textarea>

      in the editor_toolbar_wysiwyg

      <div id="htmlbox" tabindex="1" class="bginput" style="width:520px; height:250px; padding:8px">$newpost[message] $_POST[yourvar]</div>



      I am not 100% that would work but it should give you something to work with. To be able to further customize it then it is a hack and you would need to wait until RC1 and ask for it in vbulletin.org

      Comment


      • #4
        Originally posted by retsell
        I tried, it doesn't appear to work. This is what I did just to test the idea in the most simple form.

        In the phpincludestart template I have :

        // Example of how to include a seperate file:
        // ob_start();
        // require("yourheader.html");
        // $header = ob_get_contents();
        // ob_end_clean();
        $ryan = "Testing 123";

        In the editor_toolbar_off

        <!-- START NORMAL TEXT AREA -->

        <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="1">$newpost[message]$_POST[ryan]</textarea>


        <!-- END NORMAL TEXT AREA -->


        Am I doing something wrong? When I post anything there is no change.
        Works for me, but not in the phpincludestart template, everything included there doesn't seem to count for the editor_toolbar_off, I instead created another page just to test it, a simple .html with:

        <form action="newreply.php?do=newreply&p=306475" method="post">
        <input type="hidden" name="ryan" value="Hi Ryan" />
        <input type="submit" value="Send">
        </form>

        Change the red part for a correct postid for your forum. When I get to the page replying to the post 306475 I see the textarea with "Hi Ryan" inside. Of course that is with the no toolbar

        Comment

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