Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles

Reply
 
Thread Tools
[HOW TO - vB4] Stylebridge vB3.8 -> vB 4.0
Coroner
Join Date: Feb 2008
Posts: 797

I start for about 25 years with an TI and learned Basic. Next was an Commodere 64, Amiga. On Amiga I learned Assembler and wrote some Games. Many years later again, I learned myself (without book ...) php,html and javascript. Then I wrote some small

Germany
Show Printable Version Email this Page Subscription
Coroner Coroner is offline 01-21-2010, 10:00 PM

This article is for all coders, who want's a quick port of the mods into vB4.

What does this means ?
You can use you vB 3.8 templates in a vB 4.0 include the stylevars.
You need to change ALL the conditions and ALL vars.
This bridge is only for the style !

What must I do before starting ?
You need to create 2 new templates. I call 'em stylebridge.css and stylebridge_headinclude.



You can do this simply by importing the attached product (it will only create those two new templates).
  • stylebridge.css
    this templates contais the new style for the templates (tcat, thead, alt1, alt2 ....)
  • stylebridge_headinclude
    this is the original vB4 headinclude templates without reset-fonts.css and vbulletin.css and some other .css.
How to modify my mod (PHP) ?
Somewhere in you mod, you will find this line
PHP Code:
require ("./global.php"); 
The trick is now, to change the "headinclude".
Simply add below:
PHP Code:
$alt1_color $alt2_color substr (vB_Template_Runtime::fetchStyleVar('body_color'), 07);
$alt1_background substr (vB_Template_Runtime::fetchStyleVar('threadbit_background'), 07);
$alt2_background substr (vB_Template_Runtime::fetchStyleVar('threadbit_alt_background'), 07);
 
$templater vB_Template::create('stylebridge.css');
    
$templater->register('alt1_color'$alt1_color);
    
$templater->register('alt2_color'$alt2_color);
    
$templater->register('alt1_background'$alt1_background);
    
$templater->register('alt2_background'$alt2_background);
$stylebridge $templater->render();
 
$templater vB_Template::create('stylebridge_headinclude');
    
$templater->register_page_templates();
    
$templater->register('stylebridge'$stylebridge);
    
$templater->register('custom_global_css_reference'$custom_global_css_reference);
$headinclude $templater->render(); 
some Differencec/changes
If you are using class="page" inside a template, you should change it to: class="body_wrapper".
Also, there are two border classes: One for tcat and the other for thead.
Here comes an example:
Code:
<table class="tborder" cellpadding="{vb:raw padding}" cellspacing="{vb:math {vb:raw padding}/2}" border="0">
<tr>
<td class="tcat">enter your text here</td>
</tr>
</table>
<table class="tborder2" cellpadding="{vb:raw padding}" cellspacing="{vb:math {vb:raw padding}/2}" border="0">
<tr>
<td class="thead">enter your text here</td>
</tr>
</table>
Footnote:
Remember that this won't work for ALL mods.



This could be while:
  • you're mod doesn't use "global.php"
  • you are using vb3 and vb4 styles at the same time
  • ... anything else
I've tested it with only one of my mods on a vB4 containing 4 different styles.

If you have any excitations, please let me know.
It would also be greatfully, if you gave me feedback how it works.

Regards
Coroner

EDIT: Fixed the Style when the CSS is stored as files
Attached Files
File Type: xml stylebridge.xml (34.6 KB, 68 views)
Reply With Quote
  #2  
Old 01-23-2010, 06:36 AM
Coroner Coroner is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 797
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another hint to get a great vb4 look is:
in the template stylebridge.css under:
.tborder, .tborder2, .tcat,. thead

add this:
Quote:
moz-box-shadow: -2px 2px 2px {vb:stylevar forumbits_shadow_color};
-webkit-box-shadow: -2px 2px 2px {vb:stylevar forumbits_shadow_color};
-moz-border-radius-top{vb:stylevar right}: {vb:stylevar border_radius};
-moz-border-radius-top{vb:stylevar left}: {vb:stylevar border_radius};
-webkit-border-top-{vb:stylevar right}-radius: {vb:stylevar border_radius};
-webkit-border-top-{vb:stylevar left}-radius: {vb:stylevar border_radius};
and in a table set cellspacing to zero - like:
Quote:
cellspacing="0"
See image what you get.
Attached Images
File Type: png Bild 1.png (22.6 KB, 0 views)
Reply With Quote
  #3  
Old 01-23-2010, 09:56 AM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's great !!
Thank you
Reply With Quote
  #4  
Old 01-23-2010, 04:27 PM
MARCO1's Avatar
MARCO1 MARCO1 is offline
 
Join Date: Jun 2008
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice, I will try it in my new Mod. Rated 5 stars.
Reply With Quote
  #5  
Old 01-23-2010, 07:12 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, voted 5 stars !
Reply With Quote
  #6  
Old 01-25-2010, 05:52 PM
doraj doraj is offline
 
Join Date: Nov 2005
Location: Italy
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Coroner, congratulations for your article.
I am trying use it to update my style from 3.8 to 4.0 but I have problems with any parts of the forum, forumhome, forumdisplay, showthread..etc
I am testing it online here

Can you suggest me how to risolve these mistakes?

Thanks
Reply With Quote
  #7  
Old 01-25-2010, 07:44 PM
daveaite's Avatar
daveaite daveaite is offline
 
Join Date: Jul 2009
Location: Florida
Posts: 1,890
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

interesting. informational as well. good job
Reply With Quote
  #8  
Old 01-27-2010, 03:30 PM
Mukashi's Avatar
Mukashi Mukashi is offline
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very interesting Coroner....seems like you've basically matched variables from the old vB3 CCS to the vB4 Stylevars, so that a mod relying on the old variables would instead be able to pull the correct ones from the new style system. Is that correct?

If so...is there any way you (or anyone else here for that matter) might be able to take this a step further, and make something that would allow us to automatically convert over our colour schemes from vB3 styles to the stylevars of vB4 styles? Looks like one might be able to do that simply using what you've got here, reading down stylebridge.xml as if it was a checklist, but it'd be a great relief to a low of us who have no coding skills to speak of whatever if that process could be automated. ^^;
Reply With Quote
  #9  
Old 01-27-2010, 06:52 PM
RollaJedi's Avatar
RollaJedi RollaJedi is offline
 
Join Date: Apr 2007
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so, what i'm getting from reading this description, is that you can take a mod made for vb 3.8, do the steps found above, and your mod will now be able to work on vb 4.0?

If thats true, could i get the gxboxlive mod to work on my vb 4.0.1 site? The author of that mod is saying he very likely wont be making the gxboxlive mod to work on the vb 4. ????

Thanks!!!!
Reply With Quote
  #10  
Old 01-29-2010, 09:45 AM
Coroner Coroner is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 797
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@RollaJedi
Nope. You have to change the vars and phrases inside the templates. Also you need to change all the php scripts to vb4.

This is only the style. You can leave the 99 percent of templates (without vars and phrases).

@Mukashi:
Yes, thats absolutely correct.
You also need to implement - the two templates and the php script inside the mod.
Reply With Quote
Reply

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

Forum Jump


All times are GMT. The time now is 03:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04807 seconds
  • Memory Usage 2,327KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete