vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Custom CSS Definitions (https://vborg.vbsupport.ru/showthread.php?t=210921)

Andreas 04-10-2009 10:00 PM

Custom CSS Definitions
 
1 Attachment(s)
I've seen many modifications that use vBulletin settings for CSS definitions.

But there is a far better way to easily let the administrator set up CSS definitions: Create your own CSS classes!

The process is pretty straight forward:
First of all you have to create a new entry in table template:
  • templatetype = css
  • product = Your product id
  • styleid = -1
  • template
    Your serialized CSS definitions. To start with empty definitions just use
    Code:

    a:1:{s:3:"all";s:0:"";}
  • title
    Your CSS classname, for example .cssdemoclass
  • dateline
    Current UNIX timestamp
  • username
    Your username in your dev board
  • version
    The version number of your modification

I suggest to do this in phpMyAdmin, which results in a query (if you want to do it fully manually) similar to
Code:

INSERT INTO template (styleid ,title,template,templatetype,dateline,username,version,product)
VALUES (-1, '.cssdemoclass', 'a:1:{s:3:"all";s:0:"";}', 'css', 1239459129, 'Kirby', '1.0.0', 'cssdemo');

Now that you've added the new class, you should rebuild all styles.

Afterwards, you need two plugins to make the class actually editable in style manager:

css_edit
PHP Code:

print_css_row($vbphrase['css_demo_class'], $vbphrase['css_demo_class_desc'], '.cssdemoclass'1); 

css_output_build
PHP Code:

$css_write_order[] = '.cssdemoclass'

That's it, now you can edit your own class as you could edit any default class.

Princeton 04-11-2009 01:41 PM

thank you Andreas :up:

Dr.CustUmz 02-26-2016 03:16 PM

i know this is old as heck, but is there any explanation for the a:#'s and the s:#'s

say i want to add:
position:
border:
and more, is this possible?

and having no clue what the a's and s's stand for im kind of clueless.

also would i need to define multiple <template name=".cssdemoclass"... for each class I want to have options

Replicant 02-26-2016 06:25 PM

Quote:

Originally Posted by Dr.CustUmz (Post 2565651)
i know this is old as heck, but is there any explanation for the a:#'s and the s:#'s

Simply put, this is PHP serialized data. Here is a pretty detailed explanation that will help you understand it better.

Can't answer the rest, sorry.


All times are GMT. The time now is 08:18 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.01209 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete