View Full Version : Default Font/Size/Color in a Post.
applehat
07-31-2005, 10:00 PM
Default Font/Color/Size in a Post
This hack will allow your users to set there default font that will appear in there posts from the User CP.
Yes, I know this can be done with custome user feilds, but I dont like those because they change on every persons site...this just makes more sence.
(Remember that this is a Product! Use the product manager!)
This releace does not have the plugin required to get the defaults for a user back out of the database so that users dont have to reset there defaults every time they visit the options page. If you want to write this part, be my guest. (Because I realy dont know how.)
Details
1 Product XML
2 Template Edits
History
1.0.1 Fixed some stuff and redesigned 1 template edit.
1.0.0 Initial Version
Note: Tested on RC1 only!
Template Edits:
1) Open Modify User Option Templates -> modifyoptions
FIND:
<thead>
<tr>
<td class="thead">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('uopt_thrd')"><img id="collapseimg_uopt_thrd" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_uopt_thrd].gif" alt="" border="0" /></a>
$vbphrase[thread_display_options]
</td>
</tr>
</thead>
<tbody id="collapseobj_uopt_thrd" style="$vbcollapse[collapseobj_uopt_thrd]">
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">
ADD BELOW:
<!--APPLE DEFAULT FONT HACK-->
<fieldset class="fieldset">
<legend><label for="deffont">$vbphrase[default_font_TITLE]</label></legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td>$vbphrase[default_font_DESC]</td>
</tr>
<tr>
<td>
<select name="deffont" id="sel_deffont">
<option value="Arial">Arial</option>
<option value="Verdana">Verdana</option>
<option value="Lucida Console">Lucida Console</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Times New Roman">Times New Roman</option>
</select>
<select name="defsize" id="sel_defsize">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<select name="defcolor" id="sel_defcolor">
<option value="Black">Black</option>
<option value="Blue">Blue</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Orange">Orange</option>
<option value="Yellow">Yellow</option>
<option value="Pink">Pink</option>
</select>
</td>
</tr>
</table>
</fieldset>
<!--/APPLE DEFAULT FONT HAT-->
2) Open Postbit Templates -> postbit (or postbit_legacy)
FIND:
$post[message]
There may be DIV tags around it, leave those alone!
REPLACE WITH:
<if condition="$post[deffont] || $post[defsize] || $post[defcolor]">
<font face="$post[deffont]" size="$post[defsize]" color="$post[defcolor]">$post[message]</font>
<else />
$post[message]
</if>
If you know any better way of doing what I am doing (like possibly pulling the font, size, and color options from the same place the editor pulls them) please tell me. I admit to being a n00b :)
applehat
08-01-2005, 09:10 PM
Just noticed I didn't include many colors or fonts...will fix.
MrSDavidson
08-01-2005, 09:49 PM
Edit, NM just realised
Wordplay
08-13-2005, 02:05 PM
is this the same as the personal font color in posts hack?
bgtking
08-13-2005, 04:18 PM
Hmm, this doesn't have permissions does it?
Brinnie
08-13-2005, 07:44 PM
Hmm, this doesn't have permissions does it?
Just remove the size selector from the style template. :)
FD929
08-13-2005, 11:02 PM
Just remove the size selector from the style template. :)
Yep. Had to. Good work Apple. :)
applehat
08-16-2005, 10:03 PM
Thanks. I dont even use this hack anymore. I went back to using Custome User Fields and just relocated the "others" hook into a "Color Options" table. Works fine for me :-P
Wayne Luke
08-17-2005, 03:34 AM
Can you post the one where you use custom fields or is it just a template edit?
applehat
08-18-2005, 04:00 AM
Its 2 template changes. One to the postbit and one to the user options template...forget its name.
FD929
08-18-2005, 02:38 PM
Here is the code for the full list of default fonts.
This code is minus the size option.
Changed:
<!--/APPLE DEFAULT FONT HAT-->
To:
<!--/APPLE DEFAULT FONT HACK-->
since I saw no reason why a hack should wear a hat. :ermm:
1) Open Modify User Option Templates -> modifyoptions
FIND:
<thead>
<tr>
<td class="thead">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('uopt_thrd')"><img id="collapseimg_uopt_thrd" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_uopt_thrd].gif" alt="" border="0" /></a>
$vbphrase[thread_display_options]
</td>
</tr>
</thead>
<tbody id="collapseobj_uopt_thrd" style="$vbcollapse[collapseobj_uopt_thrd]">
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">
Add below:
<!--APPLE DEFAULT FONT HACK-->
<fieldset class="fieldset">
<legend><label for="deffont">$vbphrase[default_font_TITLE]</label></legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td>$vbphrase[default_font_DESC]</td>
</tr>
<tr>
<td>
<select name="deffont" id="sel_deffont">
<option value="Arial">Arial</option>
<option value="Verdana">Verdana</option>
<option value="Lucida Console">Lucida Console</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Arial Black">Arial Black</option>
<option value="Arial Narrow">Arial Narrow</option>
<option value="Book Antiqua">Book Antiqua</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="Courier New">Courier New</option>
<option value="Fixedsys">Fixedsys</option>
<option value="Franklin Gothic Medium">Franklin Gothic Medium</option>
<option value="Garamond">Garamond</option>
<option value="Georgia">Georgia</option>
<option value="Impact">Impact</option>
<option value="Lucida Sans Unicode">Lucida Sans Unicode</option>
<option value="Microsoft Sans Serif">Microsoft Sans Serif</option>
<option value="Palatino Linotype">Palatino Linotype</option>
<option value="System">System</option>
<option value="Tahoma">Tahoma</option>
<option value="Trebuchet MS">Trebuchet MS</option>
</select>
<select name="defsize" id="sel_defsize">
<option value="2">2</option>
</select>
<select name="defcolor" id="sel_defcolor">
<option value="Black">Black</option>
<option value="Blue">Blue</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Navy">Navy</option>
<option value="Orange">Orange</option>
<option value="Yellow">Yellow</option>
<option value="Pink">Pink</option>
</select>
</td>
</tr>
</table>
</fieldset>
<!--/APPLE DEFAULT FONT HACK-->
Deimos
08-19-2005, 09:57 PM
I can get the font type and colour to change, but when I add additional font sizes, they don't seem to work?
applehat
08-31-2005, 02:54 AM
donno? Post up your template and maby someone can help :-O
Mijae
10-01-2005, 09:28 PM
Can you add an option to ignore these settings? I want my users to be able to use this, but I hate it :P
VaaKo
10-04-2005, 06:38 PM
when I try to load the xml file in the plugin manager, it gives me this:
XML Error: XML_ERR_RESERVED_XML_NAME at Line 1
eNforce
10-23-2005, 07:54 PM
Working fine for me on Gold :)
Samira
10-25-2005, 06:20 AM
This releace does not have the plugin required to get the defaults for a user back out of the database so that users dont have to reset there defaults every time they visit the options page. If you want to write this part, be my guest. (Because I realy dont know how.)
Anyone?
eNforce
10-29-2005, 05:44 PM
Anyone?
I agree, someone needs to code that. It's the only issue I'm having at the moment.
applehat
10-30-2005, 09:48 PM
Well, Im busy with work, but I could probly right it now. I know more PHP.
Anyone feel free to write this thow...
Also, if I do write it, ill probly end up doing a complete recode...
I guess look for a "version 2" sometime soon.
sully02
11-28-2005, 02:26 AM
Well, Im busy with work, but I could probly right it now. I know more PHP.
Anyone feel free to write this thow...
Also, if I do write it, ill probly end up doing a complete recode...
I guess look for a "version 2" sometime soon.
Got a bug with this one...
My users are experiencing issues with changing fonts when they don't want them to be changed, or when they weren't trying to change them in the first place.
One of my users went into Edit Options to change the style he was using to view the board, and then his font was at Arial, 1 pt., Black. Can't reset it back to normal, now.
Bubble #5
11-29-2005, 07:08 AM
I guess look for a "version 2" sometime soon.
Looking forward to it :nervous:
applehat
11-29-2005, 07:04 PM
haha...forgot about this...maby ill be cool and code it tonight...
eNforce
11-29-2005, 07:47 PM
That would be most excellent
sully02
11-30-2005, 01:05 AM
haha...forgot about this...maby ill be cool and code it tonight...
I'll definitely reinstall this should a version 2 become complete!
JayJay
11-30-2005, 01:18 PM
I look forward to it.
applehat
12-01-2005, 08:47 PM
hmm....Im gonna drop this...ITs so easy with custome user fields...
I might do a write up on how to make it look better later thow ....
sorry guys.
VaaKo
12-02-2005, 03:24 PM
is there a way to add the bold/italic option as well?
VaaKo
12-02-2005, 03:38 PM
and also is there a way to add a blank option for those who'd like to restore the default vbulletin font face?
VaaKo
12-02-2005, 06:04 PM
there is something wrong which I'd like to see fixed
when user for example selects the default font to be "verdana" and clicks submit, when the page reloads, the first color which in that case is "Arial" is shown instead of the selected font which is verdana
can you fix that?
ffevo
03-05-2006, 05:54 AM
Anyway, That my memebers could just type in a color? and it will update to the database?
rockerBOO
03-10-2006, 01:58 PM
I would suggest this to be instead of the font tag >_>
2) Open Postbit Templates -> postbit (or postbit_legacy)
FIND:
$post[message]
There may be DIV tags around it, leave those alone!
REPLACE WITH:
<if condition="$post[deffont] || $post[defsize] || $post[defcolor]">
<span style="font-family: $post[deffont]; font-size:$post[defsize]; color: $post[defcolor];">$post[message]</span>
<else />
$post[message]
</if>
also for you ffevo
<select name="defcolor" id="sel_defcolor">
<option value="Black">Black</option>
<option value="Blue">Blue</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Orange">Orange</option>
<option value="Yellow">Yellow</option>
<option value="Pink">Pink</option>
</select>
replace that in the hack with
<input type="text" size="20" name="defcolor" id="sel_defcolor" />
Nathan2006
06-10-2006, 05:17 PM
Thank you applehat
Working really well
Install :)
MissKalunji
08-05-2006, 12:43 PM
is it working with 3.6?
bchertov
09-05-2006, 05:09 PM
is it working with 3.6?Bump! (work in 3.6?)
And what's the state of this hack? Does it use custom user fields or? Support Bold/Italic? Color?
Thanks!
Barry
Zelos
09-06-2006, 09:53 PM
I'd also like to know if this works in 3.6.
I have it installed and working great with 3.6. Thanks for this! :cool:
dknelson
09-24-2006, 10:07 AM
I've just installed it on 3.6.1 and it works fine. Sure wish this hack hadn't been dropped though. There are a couple of things needed to complete it.
1. When the options are set, I wish it would retain them when you go back to view your set options.
2. I wish there was a "default" option at the top of each list so that a user could go back to default if they desire.
SnapOff Racing
02-19-2007, 12:35 PM
anyone know if this hack or one idential has a bold option?
apiasto
02-22-2007, 03:35 AM
great work been looking for it very easy to install thanx. wont mind the bold option
SnapOff Racing
02-22-2007, 03:36 AM
great work been looking for it very easy to install thanx. wont mind the bold option
TTT for bold option...all my members want the option BADLY..anyone else know how to add it?
ForeverForums
02-27-2007, 12:17 PM
yeah Bold would be nice indeed
captainron19
03-28-2007, 03:58 PM
I just installed. Where should the second code of gone? It said either Postbit or postbit_legacy
I have them both in my templates. I added code to both, installed product but nothing is appearing in user control panel to change font
captainron19
03-28-2007, 04:13 PM
I got it going had an error when i pasted into modifyoptions template but still not sure if I should of added code in postbit or postbit_legacy or both - I did both but pls let me know
SnapOff Racing
03-28-2007, 11:08 PM
Ttt For Bold
SnapOff Racing
04-20-2007, 08:34 AM
Ttt
LisaD1
05-16-2007, 10:39 PM
I got it going had an error when i pasted into modifyoptions template but still not sure if I should of added code in postbit or postbit_legacy or both - I did both but pls let me know
Both if you use both, or in just the one you use. I do both because my members can choose what postbit look they can see.
ETA ~ I am using this is the very latest vb (3.6.7) and it is working fine. I added it after the upgrade was done to the board, it wasn't installed when I did the upgrade.
intricatic
07-14-2007, 02:30 AM
It's working on 3.6.7 for me, as well, but I'd still like to figure out how to get the thing not to reset whenever you go to UserCP > Options. That gets really annoying.
tazB.ca
08-21-2007, 07:27 PM
It's working on 3.6.7 for me, as well, but I'd still like to figure out how to get the thing not to reset whenever you go to UserCP > Options. That gets really annoying.
Same here
t-roz
08-25-2007, 06:36 PM
tnx for the hack but the size wont change
and how can i add more colors???
Jhonnyf
12-08-2007, 09:58 PM
How I get the variable
deffont
defsize
defcolor
in
modifyoptions
in postbit is
$post[deffont]
$post[defsize]
$post[defcolor]
Someone can Help me pls?
Forum Lover
01-09-2008, 09:55 AM
any chance to get it for 3.7?
compact123
01-10-2008, 05:15 PM
please update to 3.7 sir.
thank you.
Jhonnyf
05-23-2008, 10:14 PM
I use this on 3.7 with any problems
captainron19
06-04-2008, 12:48 AM
I upgraded to 3.7.1 today and had to update my templates also and this feature no longer works -- I went in and re-edited all spot in template and re-imported product and still no luck - any ideas?
Jhonnyf
06-04-2008, 01:16 AM
I upgraded to 3.7.1 today and had to update my templates also and this feature no longer works -- I went in and re-edited all spot in template and re-imported product and still no luck - any ideas?
uhm.. maybe it work with me because I make a lot of modification (preview, use Bolt too)
Look here the Option with Preview (http://www.forosenperu.com/profile.php?do=editoptions)
user: example
pass: example
captainron19
06-04-2008, 10:27 AM
uhm.. maybe it work with me because I make a lot of modification (preview, use Bolt too)
Look here the Option with Preview (http://www.forosenperu.com/profile.php?do=editoptions)
user: example
pass: example
Which one are you using?
Jhonnyf
06-04-2008, 01:15 PM
Which one are you using?
this one, only that I have a modification like use Bolt too
captainron19
06-04-2008, 01:22 PM
thats odd - because I re-installed the entire thing and the choices show up fine in the User CP but they make no changes when a user chooses their font choices (like it did before0
Jhonnyf
06-04-2008, 01:30 PM
uhm... I not have that problem, for me work fine... maybe is a change that I do, I use anothe code in modifyoptions templare
alifatih
12-22-2008, 05:36 PM
3.7.4 Ok!
Thanks!
tedology
04-14-2009, 01:02 PM
I'm confused...where do I install the product-defaultfont.xml? :)
(Completely new to this, sorry!) :)
AJ CHRI
12-08-2009, 02:43 PM
Not WORK!
captainron19
01-04-2010, 02:47 PM
Do we have an update for V 4.0?
smokey
10-23-2010, 03:41 PM
Got it working on latest 3.8 with some fixes and addons for my board. Would also be pretty simple to port to version 4.
firassameer
12-29-2012, 11:02 PM
I want to unify the whole forum font, font size and color, I don't want users to have the ability to modify those options anywhere... how can I do that???
Please help..
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.