Log in

View Full Version : Default Posting Font


JJR512
10-03-2005, 10:00 PM
This is a very simple hack. In fact it's almost embarrassing to call it a hack. :)

In a nutshell, this gives your members the ability to select a font face in which all of their messages will appear. This includes not only new messages after they select the font, but also any of their old messages, too, because the font they select is applied to their messages in the postbit template at the time they are viewed.

Installing involves creating a new custom profile field and a modification to the postbit and/or postbit_legacy template(s).

NOTE: If anyone would like to show me how to auto-populate the font selection list with the currently installed fonts, I'd be glad for the tutorial. (As it is now, you have to copy the list of fonts from the style editor into the custom profile field, which works but is not elegant.)

Daniel
10-04-2005, 05:48 PM
Hm... doesnt seem to work :\

Snake
10-04-2005, 06:00 PM
Screenshots please?

Daniel
10-04-2005, 06:23 PM
Screenshots of what? It would be the same thing as someone posting in a different type of font anywhere.

VaaKo
10-04-2005, 06:25 PM
here's a screenshot
but it doesn't work one bit
and this isn't a modification lol

Daniel
10-04-2005, 06:28 PM
Doesnt work for me either :\

Snake
10-04-2005, 06:54 PM
Nice hack.

Nevermind. It's working fine now. :)

Snake
10-04-2005, 07:07 PM
How about making a hack for Font Color too? That would be cool.

JJR512
10-04-2005, 07:45 PM
Lebanese Forces: Not sure what the screenshot is meant to show me, because there's nothing wrong with anything in it.

If anyone is having a problem, please do the following: Install the modification, select a font for yourself (or another member of your board), and give me a URL to a page that has a post from you (or that other member).

JJR512
10-04-2005, 07:47 PM
You know what: I bet I know what the problem is.

In Step 8, in both in instances of "$post[field8]", change the 8 to whatever number you noted in Step 6. I hope that's all the problem is, because this is a very simple modification.

VaaKo
10-04-2005, 08:05 PM
I did change that
I had field5 and it's still not working for me
and how about you add a color too

JJR512
10-04-2005, 09:09 PM
The only other reason I can think of for it to not work is if you select a font that you don't actually have on your computer. That's why I asked for a URL to a message post by a user that has a default font selected.

Adding color and size are easy enough, but I'd like to make sure it's actually working first before extending it. :)

Again, the only reasons why it wouldn't work can possibly be are: 1. The field number in the code inserted into the template doesn't match the actual field number for the profile field; 2. You don't have the font installed on your computer, so although it's actually working, you can't see any difference; 3. My instructions aren't clear enough and a mistake was made installing it.

It could be #3... But please give me a URL to a thread on your board where someone has posted and that someone has a default font set, tell me who it is (so I know where to look), and I'll see what's up.

VaaKo
10-04-2005, 09:15 PM
I didn't install it yet on my boards, I tested it on my localhost
let's hear from the others, if it worked with others, i'll install it again!

The Wise One
10-04-2005, 10:20 PM
this functions as intended on my test boards...3.5.0 final.

doesnt work in quotes though. i set my font to georgia (making sure i had that font in my fonts folder), made a post, the text came out as intended, then quoted that post. the quote did not retain the font choice i made.

other than that...works great. the color options would be great :)

The Wise One
10-04-2005, 11:22 PM
i got the color option working based on the colors available in the editor.

if the mod creator doesnt mind...ill post it up here.

Daniel
10-05-2005, 12:52 AM
If he doesn't allow you to, just make a new thread, because I could really use it.

JJR512
10-05-2005, 01:15 AM
I'll have something with color and size posted here in this thread tomorrow.

Snake
10-05-2005, 03:04 PM
Yeah that's cool. What about effects too like bold, italic, underline and stroke? This would be cool.

Snake
10-07-2005, 06:54 PM
Well you said you're going to release it tomorrow and nothing is up so far.

NuclioN
10-07-2005, 08:02 PM
I wonder if it is possible to post with fonts that are on the server and not on a member's computer, so it doesn't matter what they choose.

Snake
10-08-2005, 11:54 AM
I can't say that's possible but it's a good idea.

The Wise One
10-08-2005, 09:27 PM
i sent him what i did for the color. if he doesnt post it by monday morning (1030 am eastern) then ill put up my color mod addition.

The Wise One
10-10-2005, 02:20 PM
this is what i did to get the color options. the file is attached.

*Note: this is an add on to the original mod. all i did was replicate the instructions from the original mod and modified where appropriate.

JJR512
10-10-2005, 05:56 PM
I wonder if it is possible to post with fonts that are on the server and not on a member's computer, so it doesn't matter what they choose.
Not really. The problem is that different platforms (Windows, Macintosh, Linux, etc.) have their own sets of fonts. The other part of the problem is that the website tells the member's internet browser what font to use, so the font has to be on the member's computer.

From the point of view of your question, the only way to guarantee font compatibility would be to make each of the fonts that are optional on your message board be downloadable from your site. However, you then have to deal with legal and licensing issues, as they are not all free. My preferred font, for example, is Palatino Linotype, which is part of the standard font options available in vBulletin. This font is copyright Microsoft and has been included with Windows since either ME or 2000. I don't think you can legally distribute it.

akanevsky
10-12-2005, 08:20 PM
In this list of yours, there shouldn't be any fonts that are not universal and that cannot be found on some of the computers out there...

JJR512
10-13-2005, 03:07 PM
In this list of yours, there shouldn't be any fonts that are not universal and that cannot be found on some of the computers out there...
I understand that. But please remember that this list is not "mine"; rather, it is the list provided by vBulletin itself. My instructions say to copy the list of fonts from the style settings. This is the list of fonts that a user can select from the message editor when posting a message.

Anyone installing this hack is free to modify the list of fonts available to the user to select in his/her usercp. You can remove some names, you can add other names. Just remember that there are very few truly universal fonts, and not everything in the list may be available to everyone. But that same warning applies to the fonts you have available to users to select from the message editor when they're composing a message. If there's a font you don't want to be available to be in a post, you should remove that font name from your style settings; therefore, when you copy that list into this hack, that font won't be available there, either.

Snake
10-13-2005, 08:09 PM
Any update on this one so far?

akanevsky
10-13-2005, 08:18 PM
it is the list provided by vBulletin itself.

Oh.. Sorry.
* akanevsky goes to file a complaint with Jelsoft :)

JJR512
10-13-2005, 09:44 PM
Any update on this one so far?
If you're referring to the colors request, see post #23 above. :)

JJR512
10-13-2005, 09:47 PM
Oh.. Sorry.
* Dark Visor goes to file a complaint with Jelsoft :)
...On the other hand, if you can show me how to get the font selection list part of my hack to automatically polulate with the same list of installed fonts for the style, I'd be very interested to see that. This way, when installing the hack, one wouldn't have to copy the list, one would only have to install the hack. Also if the font list was ever changed, the font selection list part of the hack would also change, too. As it is now, if you remove fonts or add fonts to the board itself, you'd have to make those same changes to the settings for the custom profile field.

Snake
10-14-2005, 11:10 AM
If you're referring to the colors request, see post #23 above. :)

Thanks but I was looking for a better version for the color hack... :)

JJR512
10-14-2005, 12:14 PM
I haven't had the chance to actually install the version with the color selector, because I don't plan on using it myself. So I haven't really seen it in action. But I had assumed it was just another drop-down selector box, like the font name.

What, exactly, is it that you would like to see; how can it be made better?

Colejo
10-15-2005, 02:24 AM
Is this not the same as this https://vborg.vbsupport.ru/showthread.php?t=93127&highlight=user+font ?

I only ask because I want something like this but I want the one that works the best.

Snake
10-15-2005, 07:16 PM
I haven't had the chance to actually install the version with the color selector, because I don't plan on using it myself. So I haven't really seen it in action. But I had assumed it was just another drop-down selector box, like the font name.

What, exactly, is it that you would like to see; how can it be made better?

Well I am hoping to see it exactly like the way you've done for default font hack, with the drop-down list and all that kind of stuff.

Snake
10-15-2005, 07:20 PM
Here's what I mean. If you could do something similar like the below image, that would be cooL!

http://img153.imageshack.us/img153/9567/postcolor5sa.jpg

Colejo
10-18-2005, 09:04 AM
this is what i did to get the color options. the file is attached.

*Note: this is an add on to the original mod. all i did was replicate the instructions from the original mod and modified where appropriate.

I added font size in the Profile Field also but I'm messing something up in the code to add to the postbit I'm probably missing an if or > when I tried to add the extra condition for the size. I'm sure if I try a few times I can get it but I was wondering if you can put in that 3rd condition?

The Wise One
10-18-2005, 09:25 AM
I added font size in the Profile Field also but I'm messing something up in the code to add to the postbit I'm probably missing an if or > when I tried to add the extra condition for the size. I'm sure if I try a few times I can get it but I was wondering if you can put in that 3rd condition?
this should work for the conditional in postbit:

<div id="post_message_$post[postid]"><if condition="$post[fieldX]"><font face="$post[fieldX]"<if condition="$post[fieldX]"> color="$post[fieldX]"</if><if condition="$post[fieldX]"> size="$post[fieldX]"</if>>$post[message]</font><else />$post[message]</if></div>
remember to change X to the field ID # of the field you created for size.

Colejo
10-18-2005, 09:31 AM
this should work for the conditional in postbit:

<div id="post_message_$post[postid]"><if condition="$post[fieldX]"><font face="$post[fieldX]"<if condition="$post[fieldX]"> color="$post[fieldX]"</if><if condition="$post[fieldX]"> size="$post[fieldX]"</if>>$post[message]</font><else />$post[message]</if></div>
remember to change X to the field ID # of the field you created for size.

That did it thanks.

TechDawgFan
10-18-2005, 02:27 PM
I got a question here. I've set up my custom fields for font face and size (not going to do color) and edited the postbit and postbit_legacy templates as described in post #37 (The Wise One). I noticed three things.

1. Not only do my new posts show up with my default font and size, but all of my previous posts do as well. Why? What if I don't WANT my old posts to have the new defaults applied?

2. If the default size, but NOT font is selected in my options, the post uses the board default with no change to size.

3. If I log out and view my new post with a default font and size applied, I see the board default, NOT the default, so I am the only one able to see my defaults. Why? Will guests and other members be able to see the formatted text or not?

TDF

JJR512
10-18-2005, 03:46 PM
1. The font is applied to a message when it is displayed, that's why you make changes to the postbit and postbit_legacy templates. This is by design. The only other way I could think of to use a default font would be to put the font tags inside the message that gets stored in the database, which because of the permanence of that, I didn't want to do.

2. I don't know about this, I haven't actually used the version with the size option myself.

3. I'll look into that...

TechDawgFan
10-18-2005, 05:17 PM
1. The font is applied to a message when it is displayed, that's why you make changes to the postbit and postbit_legacy templates. This is by design. The only other way I could think of to use a default font would be to put the font tags inside the message that gets stored in the database, which because of the permanence of that, I didn't want to do.

2. I don't know about this, I haven't actually used the version with the size option myself.

3. I'll look into that...

Somebody correct me if I'm wrong here, and it IS entirely possible. But all the mods and tweaks I've seen relating to users being able to set their own default fonts, sizes, and colors have revolved around using the custom profile fields and then editing the postbit and postbit_legacy templates. But unless the font and size tag are actually saved in the message, all it is doing is changing the way the user sees his or her own posts. It doesn't affect what other people see because they don't hit the other person's custom fields. I THINK the only way to do this and do it RIGHT is to have the tags written to the message the same way the editor does when you select a different font when typing your message.

Now I don't personally know how to do this, but I KNOW SOMEBODY on here has got to.

TDF

Snake
10-18-2005, 06:32 PM
Here's what I mean. If you could do something similar like the below image, that would be cooL!

http://img153.imageshack.us/img153/9567/postcolor5sa.jpg

Or entering a HEX code would be a great idea too! ;)

weaver
10-18-2005, 07:22 PM
Is there a way to have the font color list show the color choices in their color? I know it was possible in the 3.0x version.

JJR512
10-18-2005, 08:31 PM
Somebody correct me if I'm wrong here, and it IS entirely possible. But all the mods and tweaks I've seen relating to users being able to set their own default fonts, sizes, and colors have revolved around using the custom profile fields and then editing the postbit and postbit_legacy templates. But unless the font and size tag are actually saved in the message, all it is doing is changing the way the user sees his or her own posts. It doesn't affect what other people see because they don't hit the other person's custom fields. I THINK the only way to do this and do it RIGHT is to have the tags written to the message the same way the editor does when you select a different font when typing your message.

Now I don't personally know how to do this, but I KNOW SOMEBODY on here has got to.

TDF
Firstly, there is no RIGHT way; there are at least two different ways, both have advantages and disadvantages. What was right for me was the way I programmed it but that way may not be right for you.

The fact that the font tag is being applied to the message in the postbit or postbit_legacy template is not the reason why it only appears to be in your default font only when you're logged in. If that's the case, there is an error somewhere. It sounds like it's using info for the logged-in user, rather than for the user who posted the message. In my version, this problem does not exist, which I've confirmed by logging out of my own message board and looking at my messages. They continue to be in my default font, as they should. I've looked at the code for the color version, too, and although I don't use it myself, it appears to be correct. It's getting the font from the same source of info that a post gets the username, date, message text, etc. for, so I don't see why it should only work if you're logged in.

TechDawgFan
10-18-2005, 08:53 PM
Sorry. Didn't mean for that to come across wrong. I'll try to troubleshoot on my end and let you know what I find.

TDF

JJR512
10-18-2005, 09:15 PM
It didn't come across wrong, just trying to explain it more clearly. :)

You can PM me your complete postbit or postbit_legacy template if you'd like.

TechDawgFan
10-19-2005, 10:53 AM
Got it working last night. Was a problem on my side.

TDF

Snake
10-28-2005, 11:55 AM
JJR, how can I change the font color hack to 'Single-Line Text Box' so users can have their own choice of colors.

Snake
10-29-2005, 06:42 PM
Bump!

bashy
01-22-2006, 02:01 PM
Works well...thanks...

the same request as Aftermath would be nice though ;)
Any chance on a heads up?

SnapOff Racing
09-04-2006, 09:06 AM
how could you make the default font bold? would this be difficult?

The Librarian
01-17-2007, 07:48 PM
Hello,

I've installed this mod and the color addon found here:
https://vborg.vbsupport.ru/showpost.php?p=791952&postcount=23

Both work beautifully, but I find the fonts difficult to read sometimes. Some fonts just need to be bigger. So I wanted to add the font size choice found here:

https://vborg.vbsupport.ru/showthread.php?t=133225

I followed the directions to add the field to the UserCP Options. It's a Single Line Text Box with a default value of 12.

But the code looks VERY different, so I decided to try to modify it to match the coding on the first mods.

Here's what I came up with:

ORIGINAL POSTBIT LEGACY TEMPLATE CODE (with font and color added):

<div id="post_message_$post[postid]"><if condition="$post[field13]"><font face="$post[field13]"<if condition="$post[field14]"> color="$post[field14]"</if>>$post[message]</font><else />$post[message]</if></div>


NEW POSTBIT LEGACY TEMPLATE CODE (with size field added):

<div id="post_message_$post[postid]"><if condition="$post[field13]"><font face="$post[field13]"<if condition="$post[field14]"> color="$post[field14]"<if condition="$post[field17]"> font size="$post[field17]"</if>>$post[message]</font><else />$post[message]</if></div>


*But* everytime I try to save it, I get the following error message:

The following error occurred when attempting to evaluate this template:

The conditional on line 78 appears to be missing its end tag (</if>). The template will not function properly unless this is fixed.

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

I've checked it and I can't find my error... but I'm not a programmer. This is all Greek to me. Can somebody tell me what I need to change to make this work?

Thanks!

cartooner
10-21-2007, 06:01 PM
I've had this hack on all my versions I installed 3.6.8 on one of my forums and can't get it to work. The selections show up in the User Options. But when I go to post no changes.

Is this not compatable with Version 3.6.8??

it works with 3.6.7.....

The Librarian
10-22-2007, 04:00 PM
I've had this hack on all my versions I installed 3.6.8 on one of my forums and can't get it to work. The selections show up in the User Options. But when I go to post no changes.

Is this not compatable with Version 3.6.8??

it works with 3.6.7.....

It's working fine for me and I'm using 3.6.8 with the newest upgrade patch.

~~~~~UPDATE TO OP NOTE~~~~~~~~~~~~
I'd forgotten about this thread until I saw this reply. Just to add some closure let me point any interested parties to THIS THREAD (https://vborg.vbsupport.ru/showthread.php?t=136862) where you'll find the resolution to the difficulties I posted here.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~