vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   End-User Options - Custom User Style (https://vborg.vbsupport.ru/showthread.php?t=138793)

da420 02-07-2007 10:00 PM

Custom User Style
 
Custom User Style 1.02

Description.

Allow your users to create their own custom style to use on the forum using CSS, which can be generated using a built in generator.

This is just something I whipped up in my spare time just playing around... :P If you can use it, then, great... I will probably be adding more to it as time goes on, such as usergroup permissions, and maybe I'll try and make it a bit more user friendly, but it's as it stands now.

Oh, and I will definitely cache the template... once I figure out how... :cool:

DEMO: http://www.mindifidoaj.com/dev/forum/misc.php?do=gencss

Details:

1 product upload
1 template edit (there may be the need to do more customization if you have custom CSS)
1 new profile field

Install:

1. Product Upload:

ACP > Product Manager > Add/Import Product > Upload product-userstyle.xml with over write set to 'Yes.'

2. Create User Options:

ACP > User Profile Fields > Add New User Profile Field

Add a Multiple-Line Text Box...

Title: Custom Style

Description: Design your own color scheme using CSS, use the <a href="misc.php?do=gencss" rel="nofollow">CSS Generator</a> to aid you in creating this code.

Increase the max length to your liking, you may want it to be longer for them to be able to include background images.

I put 75 for the field length, and 20 for the text area heighth.

Field Required --> NO
Field Edited by User --> YES
Private Field --> YES
Field Searchable on Members List --> NO

Display Page: 'Options:Other'


3. Template Edit:

In headinclude...

Find:

HTML Code:

$style[css]
Replace with:

HTML Code:

<if condition="$bbuserinfo[fieldxx]">
<style type="text/css">$bbuserinfo[fieldxx]</style>
<else />
$style[css]
</if>

*** Replace 'fieldxx' with the field id of the custom profile field we created.

Now have your users, if they wish, go to edit options in user cp, and use the CSS generator to customize thier style. The default that is in the text boxes is default vBulletin.

*** You may have to edit the code if you require custom CSS definitions.

update history:
*1.0.2 - fixed a phrase

Thank you and Enjoy.

If you use this please click Install!

da420 02-08-2007 07:59 AM

Reserved...

My apologies, demo url has been updated...

Capt. GannA 02-08-2007 08:10 AM

Interesting. I'm gonna give this a try in a while.

Cyricx 02-08-2007 11:40 AM

What a brilliant idea :)

I'll definately have to test this out! :)

UncoderMom 02-08-2007 11:41 AM

Good God! *insert fainting smilie*

MThornback 02-08-2007 12:18 PM

I've been asking for this for AGES, your brilliant! :D

Lizard King 02-08-2007 12:29 PM

How do you prevent people to enter malicius scripts ?

MThornback 02-08-2007 03:15 PM

That occurred to me today too....but if its pulling info from the user profile fields and that field is part of the if condition, it can only call from that persons profile thats logged in the only thing I could think to change is making a member check part of the conditional.

da420 02-08-2007 05:06 PM

Quote:

Originally Posted by Lizard King (Post 1177514)
How do you prevent people to enter malicius scripts ?

The only person that will be using this custom CSS is the user that set it in their profile, nobody else, and I can't imagine why they would want to use malicious scripts on themselves. But, I could be missing something. Are there scripts that I am not aware of that I should consider?

Thank you for your comments everyone.

da420 02-08-2007 05:19 PM

I tried entering in a meta redirect into the mix, also tried to embed a video, and no go... so Im doubting this can be used maliciously.

vB already does a good job at preventing malicious scripts from being entered in as profile fields as the meta redirect I put in when I looked at the page source shown this:

Code:

&lt;meta http-equiv=&quot;refresh&quot; content=&quot;2;url=http://www.google.com&quot;&gt
So I think there is nothing to worry about here, again, unless I am missing something...


All times are GMT. The time now is 07:30 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.01138 seconds
  • Memory Usage 1,739KB
  • 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)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete