Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

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
  #12  
Old 02-07-2010, 08:17 AM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has helped me out a lot.
I'm having 2 problems, maybe you've run into it?

My tables don't have a inner border anymore. All the rows look like one cell now. Also, if I have say 4 columns, if I use thead, the first column uses as much space as possible even though it's only set to width of 5% and the other 3 are squished.

Any ideas?

EDIT:
I figured out part of the problem.
$alt1_background and $alt2_background aren't registered in the example so I wasn't getting the background colors. For the width I just set the class in the TR instead of TD. Now I just need to figure out what is making my logo image have a border
Reply With Quote
  #13  
Old 02-17-2010, 01:52 PM
Coroner Coroner is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 797
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's a think, I've fixed later (sorry, I haven't upgraded the file yet).

To fix the image border problem, just insert (into the style) the following part:
Quote:
.img {
border: 0;
}
Reply With Quote
  #14  
Old 02-17-2010, 04:40 PM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Coroner View Post
That's a think, I've fixed later (sorry, I haven't upgraded the file yet).

To fix the image border problem, just insert (into the style) the following part:
I ended up changing the

PHP Code:
$headinclude $templater->render(); 
to
PHP Code:
$headinclude .= $templater->render(); 
And it worked. I'll switch it back and try adding the img css property.
Reply With Quote
  #15  
Old 02-19-2010, 04:39 PM
Coroner Coroner is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 797
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've change the Stylebridge now for vB 4.0.2 (incl. the image patch).
Reply With Quote
  #16  
Old 03-28-2010, 04:58 PM
msnhockey msnhockey is offline
 
Join Date: Jul 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this worked great for switching a 3,8 to 4.0.2 but the only problem i had is that it made the stuff on my forum home page bigger...
any ideas on what i can do to shrink in half...

thanks
Reply With Quote
  #17  
Old 04-18-2010, 12:41 PM
Hall of Famer Hall of Famer is offline
 
Join Date: Apr 2009
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you explain this a little bit further? Does it mean that old VB3 styles can be used in VB4 with this bridge?
Reply With Quote
  #18  
Old 04-18-2010, 04:05 PM
egyptsons's Avatar
egyptsons egyptsons is offline
 
Join Date: Jan 2004
Location: Egypt
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

really the old style for VB was more good for my members and me too

I wish I can use the old blue style again with VB 4
Reply With Quote
  #19  
Old 04-18-2010, 05:49 PM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hall of Famer View Post
Can you explain this a little bit further? Does it mean that old VB3 styles can be used in VB4 with this bridge?
No, he created this as a bridge for mods, so a vb3 mod can easily be moved over to work on vb4.
Reply With Quote
  #20  
Old 04-19-2010, 06:13 AM
Hall of Famer Hall of Famer is offline
 
Join Date: Apr 2009
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see. So how about VBexperience and VBCredits, do they work well after installing this addon?
Reply With Quote
  #21  
Old 04-19-2010, 06:53 AM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, this article is geared towards developers. It doesn't help end users much trying to get a vb3 mod working on vb4. There is still work that needs to be done to get a mod to work. This just saves a ton of template recoding.
Reply With Quote
Reply


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 10:21 AM.


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.08421 seconds
  • Memory Usage 2,338KB
  • Queries Executed 26 (?)
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
  • (4)bbcode_php
  • (3)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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