PDA

View Full Version : where should I change postbitlegacy_userinfo_width?


DragonBlade
02-05-2010, 04:54 PM
I'm making a minor modification for a Valentines Day Event on my forum, in which I am doubling the width of my userinfo block to fit in an extra avatar (the avatar of the person they are "dating," heh, it was a big hit last year).

Last year, I forced a stomach-churning pink V-Day skin on my users for the Event, but this year I didn't want to make an entirely new skin--instead, I was going to just make a few Plugins and edit the Avatar bit of the posbit_legacy template.

I've got two options--one is to change $stylevar['postbitlegacy_userinfo_width'], and the other is to edit a few HTML elements (<div class="postdetails"> and <div class="userinfo">) with inline CSS in the postbit_legacy template while I muck around with the Avatar bit. I would LIKE to go with the former option, as it seems a lot simpler, but I'm not quite sure which hook I should place it on. I tried postbit_display_start, but it seems to not work. XP

Advice?

Lynne
02-05-2010, 05:29 PM
Is this a new style? If so, you would just change the stylevar in the StyleVars dropdown. Otherwise, you will have to just add the new width for those two classes into the additional.css template like so:
.postdetails {width: 300px;}

DragonBlade
02-05-2010, 08:50 PM
Hmm. Well, I guess I cannot do it just by changing postdetails and userinfo classes. THere's other parts of the postbit that determine their width by postbitlegacy_userinfo_width's value. I'd -have- to either change the value in $stylevar['postbitlegacy_userinfo_width'] before postbit.css is called but after any final changes to $stylevar occur, or I would have to make a bunch of new styles. :< I'd much rather find a hook to change the $stylevar value.


@Lynne, naw, it's something I want to apply to all of my existing styles.

See, I keep a "Master" template as a parent of all my styles and make modifications to the templates in that one (specifically here, the postbit_legacy template) and let the rest of my styles inherit the changes. I -could- find all the classes affected by postbitlegacy_userinfo_width's value and change them accordingly, but it would be a pain if I could just do it by being able to globally change $stylevar['postbitlegacy_userinfo_width'] before postbit.css is processed.

--------------- Added 1265413944 at 1265413944 ---------------

Well, let's see.

global $vbulletin;
if ($vbulletin->userinfo['userid'] == 15010)
{
$vbulletin->stylevars['postbitlegacy_userinfo_width']['size'] = '350';
}
I have that as a plugin, which is what I need to change... But, erm, I just don't knwo WHERE to place it. (Like what hook.)

Lynne
02-06-2010, 02:30 AM
If you want to change this for all styles, I really don't understand why you don't just change the stylevar in the stylevars list. It seems to me that is the easiest method - click, change number, apply, all done.

DragonBlade
02-06-2010, 03:58 AM
I've got quite a few skins. :<


ANd I do want it done for all styles, but I also want to be able to impose conditions on it.

As in, "

if (is_member_of($vbulletin->userinfo, $development_group_id))
{
/// Display new width for the Development Team to screw around with
}
else {/** Leave As Is so regular users are not affected **/}


See what I mean, heh?

Lynne
02-06-2010, 09:30 PM
You are going to have to write a plugin that does the if statement for you and then set the width in the classes then. You can not set a stylevar like you are trying to do. When a a stylevar is changed via the stylevar editor, it creates all new css files. Changing a stylevar in a plugin does not do that. So, you need to actually change the css at that point which means modifying the classes.