Reassign $userinfo variable through a hook?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheMayhem
    Senior Member
    • Oct 2002
    • 174

    Reassign $userinfo variable through a hook?

    I posted this on vb.org 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:
    customtitle
    And I've added a column
    market_ct_color

    My conditional statement is:

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


    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.
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    This really should be discussed on vb.org. 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 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

    • rossco_2005
      Senior Member
      • Apr 2005
      • 465
      • 4.1.x

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

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

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

      http://filesharingtalk.com

      Comment

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