New PHP direct evaluation page question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mike4x4
    New Member
    • Dec 2010
    • 27
    • 4.1.x

    [CMS] New PHP direct evaluation page question

    Just a quick question, if i create a new php direct evaluation page in the cms can is it possible to add a php code for example if $loggeduser = mike display text
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    Yes, you may add php code into the php direct evaluation page. This is the default text when you use that type of CMS content:

    HTML Code:
    /**The php code goes here. It can have as much php as you like,
    but it should end with setting the variable $output.
    e.g.
    $something = $somefunction();
    $something2 = $somefunction2();
    ...
    **/
    $output = "Hello World<br />";

    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

    • Mike4x4
      New Member
      • Dec 2010
      • 27
      • 4.1.x

      #3
      is there a such variable to output my loggedinusername in the page?

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #4
        Example:
        PHP Code:
        $x=vB::$vbulletin->userinfo['username'];
        $output .="
        Your Forum Username Is:<br>
        <b>"
        .$x."</b>"

        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

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎