Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2004, 10:35 AM
JAB Creations's Avatar
JAB Creations JAB Creations is offline
 
Join Date: May 2002
Location: Orlando Florida, USA
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-06-2004, 10:42 AM
JAB Creations's Avatar
JAB Creations JAB Creations is offline
 
Join Date: May 2002
Location: Orlando Florida, USA
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

---------------
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:
---------------
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 09:26 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
  • Page Generation 0.03695 seconds
  • Memory Usage 2,175KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete