No announcement yet.

Reassign $userinfo variable through a hook?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Reassign $userinfo variable through a hook?

    I posted this on and had no luck with an answer so I'm kind of desperate and figured I'd ask here. I know in the old days and the easiest thing for me to do to get this to work would be to manually edit the postbit and postbit_legacy template's, add a condition statement and a little html and I'd be done. However, I'm trying to be a better coder then that and require no template edits because they can be...annoying.

    So here's my question, I have in the user table the default column called:
    And I've added a column

    My conditional statement is:

    PHP Code:
    [LEFT]if ($userinfo['market_ct_color']) { 
    $templater vB_Template::create('market_ct_color'); 
    } [/

    That much I know. In short, if market_ct_color has data in it I want it to fetch a template. What I'm not sure on is how I'd assign $userinfo['customtitle'] so that it equals whatever is inside that template. Then my last part is I'd like the updated customtitle variable inside userinfo to be displayed on the postbit. Basically, I am overwriting customtitle, updating the display so my data is inserted into post's instead of whatever is in the database.

    Any help is much appreciated as this is my last step to releasing this little bugger.

  • #2
    This really should be discussed on Can I have a link to your thread about it over there and I'll go see what I can do.

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


    • #3
      You want this from what I understand:
      PHP Code:
      if ($userinfo['market_ct_color'])

      $templater vB_Template::create('market_ct_color'); 
      $userinfo['customtitle'] = $templater->render();

      $userinfo['customtitle']'s value will then be your parsed market_ct_color template.


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