vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   CSS saved & applied when logging in... (https://vborg.vbsupport.ru/showthread.php?t=64800)

JAB Creations 05-06-2004 10:35 AM

CSS saved & applied when logging in...
 
Hello!

What I'd like to basically do is have my CSS editable on a page such as this...
http://www.porjes.com/borders/

...and have the preferences saved in a person's VB options. I want to basically make a templet page where people can click on an item and edit the attributes of that item, save their preferences and then have it applied when they log in.

I'm also interested in allowing my members to export their CSS style to a master list so they can share what they have created with others.

my site is http://www.jabcreations.com

JAB Creations 05-06-2004 10:42 AM

---------------
Here is javascript I use to switch style sheets...I'm not a javascript person unfortunitly so I do not know what I could do to mix it up with the script to follow...
---------------

var s=document.cookie.split(":");
var v=s[0],f=(s[1])?s[1]:'http:\/\/www.jabcreations.com\/themes\/css-theme-classic.css';
document.write('<link rel="stylesheet" type="text/css" href="'+f+'">\n');//.css">\n');
function switchStyle (n,s){
var x=new Date();x.setTime(x.getTime()+(60*60*24*365));
document.cookie=s+':'+n+':'+';expires='+x.toGMTStr ing()+';path=/';
history.go(0);
}

---------------
The script to follow is the code to the page I originally linked too..
---------------

bd_clr = '#FFFFFF';
br_clr = '#000000';
dv_clr = '#FFFFDD';
brdr_size = 3;

function max(i,j) { return i > j ? i : j; }
function bdSize(inx)
{
if (!document.styleSheets[0])
return;

var theRules = new Array();
if (document.styleSheets[0].rules) {
theRules = document.styleSheets[0].rules;
} else if (document.styleSheets[0].cssRules) {
theRules = document.styleSheets[0].cssRules;
}
else {
return;
}
brdr_size = max(0,brdr_size + inx);
theRules[0].style.borderWidth = brdr_size + 'px';
document.getElementById("csize").innerHTML=" " + brdr_size.toString() + "px borders";
}
function cswitch(val)
{
if (!document.styleSheets[0])
return;

var theRules = new Array();
if (document.styleSheets[0].rules) {
theRules = document.styleSheets[0].rules;
} else if (document.styleSheets[0].cssRules) {
theRules = document.styleSheets[0].cssRules;
}
else {
return;
}
var x = checkRadioControl('which');
if (x == 0)
br_clr = val;
else if (x == 1)
bd_clr = val;
else
dv_clr = val;
document.getElementById("clr").innerHTML=" " + br_clr + " borders - " +
bd_clr + " body - " + dv_clr + " divs ";
theRules[0].style.borderColor = br_clr;
theRules[1].style.backgroundColor = bd_clr;
theRules[4].style.backgroundColor = dv_clr;
}

function checkRadioControl(strFormField)
{
var objFormField = document.forms[0].elements[strFormField]
intControlLength = objFormField.length
var bolSelected = -1;
for (i=0;i<intControlLength;i++){
if(objFormField[i].checked){
bolSelected = i;
break;
}
}
if(bolSelected == -1){
alert("Please select one option!");
return 0;
}else{
return bolSelected;
}
}

---------------
Anyway, this is the script I've been looking at. Wish I could read it like English :laugh:
---------------


All times are GMT. The time now is 06:35 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
  • Page Generation 0.01493 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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