![]() |
Dynamically alter $stylevar['codeblockwidth']
I have been trying to dynamically alter the width of $stylevar['codeblockwidth'] based upon a condition in php, however it's not behaving as expected. It's just stretching to the max width to fit all the contents within the code tags.
I am inserting the following code into hook group_complete PHP Code:
|
Have you checked the PHP code around the hook, it might give you clues.
Maybe the variable names are incorrect or something? Where is the hook located? (I haven't used/come across it before) |
the hook's located within group.php
I'm thinking it's something to do with bbcode being parsed at adifferent time than template output. Problem is though that template bbcode_code is cached way before any php runs at all, which might be a problem as well... |
You need to add it to global_start. That is where I am doing the same type thing.
Code:
if (is_browser('ie')) |
Boofoo, That would work for me if I just needed to modify it to the same size, all the timje, however since it's being modified based upon a conditional within the $group array, that's too soon...
But seeing your code did help me figure out the problem... the issue was that the template bbcode_code sets the width using $stylevar['codeblockwidth'] as expected, but the 'px' isn't included in the template, it is included in the var... so the following works as expected within hook group_complete PHP Code:
|
What is the minue 60 for? I set the width to auto as FF handles that fine. It is just IE that gets messed up with auto. I could have dione it with a setting variable but since I am only doing it in one skin, I hard-coded it.
|
I'm using the - 60 to make ensure that the code is less than the width of the cell, which is set using $vbulletin->options['scst_leftgblockwidth']
|
So this is part of a larger hack then and not just for the width?
|
All times are GMT. The time now is 05:09 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|