![]() |
Edit StyleVars page
1 Attachment(s)
This is just a new page for showing the .css template and having all the stylevars clickable and then editable in the bottom screen. This uses iframes, so if you browser doesn't support that, then it won't work and I cannot help you with this.
You will need to open up and edit the admincp/template.php file. **edited for 4.1.11 below** Basically just add the code in red to the existing code. Find (under $_REQUEST['do'] = 'add'): Code:
print_textarea_row($vbphrase['template'] . ' Code:
$isscss = strpos($vbulletin->GPC['title'],'.css'); Code:
print_textarea_row($vbphrase['template'] . ' Code:
$isscss = strpos($template[title],'.css'); PHP Code:
PHP Code:
https://vborg.vbsupport.ru/attachmen...1&d=1297286569 If you click that, you get a new tab with the .css template in the top box (not editable on this page) and it has all the *editable* stylevars clickable (for example, in userprofile.css, they use variables, not stylevars, so you won't have clickable stylevars there). If you click on a stylevar, it will open in the bottom of the window and you may edit. https://vborg.vbsupport.ru/attachmen...1&d=1297286569 https://vborg.vbsupport.ru/attachmen...1&d=1297354009 Tested in Firefox, Safari, Chrome, and Opera on my Mac. And thank you to ForumsMods for sharing a diff file - patch.zip (for version 1.1, which works, but doesn't have css changes) 1.2 - 2011-02-11 - changed some CSS for the divs and fixed a phrase. 1.3 - 2012-03-10 - added a file with the changes needed for 4.1.11 |
Great idea.
Installed and Nominated. Can you make a diff file? |
Quote:
|
1 Attachment(s)
Quote:
Also for next vB releases. I made a diff file for vBulletin 4.1.1 (40651). Take a note that with default vB Style does not display correctly. Would be better to use style classes and change 'Phrase' to '$vbphrase['stylevar']'. |
Thank you
|
Quote:
I'm not sure what you mean about the default vB style not displaying correctly. It's showing just fine on my site. I'm using the default admincp functions to build the page (print_table_start, print_table_header, etc) instead of redoing the whole thing. And yes, I should have used a phrase. I wrote this as a quick project for myself and then decided to share it and I thought I had cleaned it up, but I did forget to look at phrases. I'll catch that if I have another release. |
1 Attachment(s)
Quote:
You are using hard-coded background and color. HTML Code:
<div class="alt2" style="border: 1px solid black; background-color: white; height: 350px; width: 99%; max-width: 800px; overflow: scroll"> Also delete border and background for iframe and add bginput class to it. |
Quote:
|
Why the hell wasn't this standard!? This is awesome!
|
This is an amazing idea. Thank you so much Lynne! Installed + nominated as soon as I get home!
|
Very good idea!
|
Thanks Lynne, that's awesome...
|
Thanks for this! Also don't understand why this isn't included as a standard feature.
|
Make this an Add-on pleeeeease!!!
|
Quote:
|
That's the best one i seen so far for the new version....at least for some of us who like to play in the styles and codes!
Great share Lynne and friends ;) Maybe it should be added as a designer series???? I also added the [vb4] Adding a stylevar from carnage and it as all the potential to write anything you want now! Cheers |
let me be stupit for so many times already. lol How do you load the diff file?
I want to try that as I get a blue box but nothing else on the stylevar box below without any options. All I did was edit the template.php file thanks this is great and much easier then hardcoding |
If you don't know what a diff file is for, then you should just do the edits in the first post.
Make sure you put the last bit of code *before* the line I tell you to look for, not after or you will just get a blank page. |
Yes that was how I did it by your directions
I use DreamWeaver to edit my files since it have the option to look and replace. lol and for the last code i added the code all the way in the bottom above these lines Quote:
|
I just went and followed the instructions to add this to my default 4.1.6 site and this works just fine on there. I would suggest double-checking what you did by starting over if it is not working correctly.
|
Very cool! Not sure why I haven't seen this one before :) Installed. Thanks Lynne :D
|
Quote:
I've done this for TMS 1.2.0 which should be ready for production soon. |
Quote:
|
OMGosh, man the more I try the more is the same. lol
Lynned there is my file can you take a look at it please if your time allow you to. Is just I think I have done everything like the book and I keep getting the same results :o |
[ot]
Quote:
What I meant is that TMS 1.2.0 has a function that does allow editing of stylevars from the modify template from without requiring file edits. [/ot] Sorry for hijacking you thread Lynne :( |
Quote:
PHP Code:
PHP Code:
|
Awesome mod, I will tag to install! Thank you!
|
thank you Lynned, another thing I have learn from PHP. great for you to share me the tip.
well I did just that and and still the same mate. |
Quote:
|
Quote:
I will check on the file correctly and fix it each one of them |
Ok reporting back. I double checked all of my edits and I found 4 of them were merged so I fixed but results still the same
|
I would suggest starting with a totally new file and redoing the file edits. Only this time, make sure you put the code on their own lines and not merge lines at all.
|
I pulled the changes out from the code it self and added it in it's correct line since a couple things changed since then..this worked up till 4.1.6 then 4.1.7 it will no longer work..
the edits where perfect.. did it 2 times to make sure , used compareit.. when you click on the style manager in the admincp you just get a blank screen :( code used .. PHP Code:
PHP Code:
PHP Code:
Code:
print_cp_footer(); any help with this would be great thanks for sharing this great mod lynne |
I just went through and modified my template.php file for 4.1.7 using the instructions in post 1 and it is working just fine on my site. I am getting no blank screens. I'd suggest you check your error_logs.
|
yep I should of though of that ..
this is the error PHP Parse error: syntax error, unexpected ';' in /public_html/testvb/admincp/template.php on line 2224, line 2224 is Code:
'template', $templateinfo['template_un'], 22, '5000" style="width:99%', true, true, 'ltr', 'code'); this line was not even touched |
my bad I see where I went wrong...
|
Glad you got it figured out. :)
|
thanks you for providing this for everyone..
should be default with vb.. I don't know what I was thinking when I was editing that file.. I been fixing so much broken stuff these past few days.. I need a break to get back on track.. once again your efforts and support are very much appreciated.. |
Sweet!
|
1 Attachment(s)
Hi Lynne
this was driving me crazy today after checking over and over my edits .. I realized this was not a edit issue it was a IE9 issue.. I checked in ff and worked like it should.. whats happening is everytime you mouse over a style var in the template the space between the 2 boxes grow I attached a couple screen shots so you can see what I mean.. thanks |
All times are GMT. The time now is 06:01 AM. |
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:
|