Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Sep 2012, 13:09
AcheronAI's Avatar
AcheronAI AcheronAI is offline
 
Join Date: Aug 2012
Add username to widget title

I am trying to get a widget to where the title changes per user, I have yet to find the right place to do this.

Any help would be very much appreciated.
Reply With Quote
  #2  
Old 23 Sep 2012, 13:35
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You could find the template associated with the widget and put a variable in for the title (the CMS templates are in the vBulletin CMS templates group). If you can't guess the template name, you can temporarily turn on "Add Template Name in HTML Comments" (in the General Settings section) and view the html source of the page, then find the widget title html and look for the comment telling you which template it in.
Reply With Quote
  #3  
Old 23 Sep 2012, 13:43
AcheronAI's Avatar
AcheronAI AcheronAI is offline
 
Join Date: Aug 2012
I tried putting welcome $vbulletin->userinfo[username] and it just shows exactly what I typed as a title.

I am using a php output widget, and yet to find a way to get this done how I wish lol
Reply With Quote
  #4  
Old 23 Sep 2012, 13:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
If you're putting it in the template, then you'd need to use {vb:raw bbuserinfo.username}. Also, if it's a php custom widget then you can set which template you want to use as a "wrapper", and if you use the default template and make changes to it, it will change all php custom widgets (assuming you have more than one).
Reply With Quote
  #5  
Old 23 Sep 2012, 14:42
AcheronAI's Avatar
AcheronAI AcheronAI is offline
 
Join Date: Aug 2012
Actually I was just trying to add to the title to be displayed by the widget to fit who is viewing. I figured it out with a bit of work.

Thanks for the help though
Reply With Quote
  #6  
Old 23 Sep 2012, 14:45
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Oh, I see (I think) - you managed to change the title variable in the php code? You should post what you did in case someone else wants to know.
Reply With Quote
  #7  
Old 23 Sep 2012, 15:07
AcheronAI's Avatar
AcheronAI AcheronAI is offline
 
Join Date: Aug 2012
Well this is not pretty , fair warning lol

First I made a new PHP Direct Execution widget and for the title put
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or what ever you wish, it just has to match up in this next part.

Create a new plugin with the hook location

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Use the following php code

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It is so simple once I finally pinned it down, but finding it was not fun
But now you can add any code you wish before hand and have $newtitle reflect what you wish to show in the php widget title area.
Reply With Quote
  #8  
Old 23 Sep 2012, 15:28
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
That looks good to me. When you're modding stuff, anything goes as long as it works, IMHO. And that solution saves having to mess with the templates.
Reply With Quote
  #9  
Old 23 Sep 2012, 15:35
AcheronAI's Avatar
AcheronAI AcheronAI is offline
 
Join Date: Aug 2012
Ya the only thing I did with templates was get rid of the ugly php icon. I tested this with putting an image in the title, and it looked nice.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mini Mods Twitter Username Widget BB code nitra1000 vBulletin 4.x Add-ons 13 15 Jan 2014 15:42



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 05:47.

Layout Options | Width: Wide Color: