PDA

View Full Version : Board Optimization - User Font/Color Post Addon


Neo_Angelo
12-03-2006, 10:00 PM
This is my first ever Mod i've ever written, i'm very new to PHP and template modding so don't expect an Uber code :P

There was a thread released on a mod that allowed users to change the font color and font of their posts. with this addon your users will be able to choose how big their font will be.

How it works:

To prevent users from using overly sized fonts, i've tried to limit font sizes to just double figures, yes i know you can still put 72 for a huge font but i'm not advanced enough yet to provide a solution to this.

What you need to do:

Ok firstly Log into your ACP and create a new custom field.

Option: Single Line Text Box
Title: Post Font Size
Description: Change the Size of your Post font here (EG 8,12,14).
Private: NO
Default Value: 12
Field Required: NO
Searchable: NO
Editable By Users: YES
Max User Input: 2
Field Length: 3
Show on Memeber List: No

Now Note Down the Field Number (example Field ID: 12)

Next Open up you Postbit_legacy template and find the following:
$post[message]

Replace with:
<div id="post_message_$post[postid]"><if condition="$post['fieldX'] != ''>
<font style="font-size:
$post[fieldX]px;">$post[message]</font>

<else />

$post[message]

and your done, Replace X with the field ID of your custom field.

If your using the Mod for changing Color of text and font then do the following.

Find:
<div id="post_message_$post[postid]"><if condition="$post['fieldX'] != '' OR $post['fieldX'] != ''">

and Replace With:
<div id="post_message_$post[postid]"><if condition="$post['fieldX'] != '' OR $post['fieldX'] != '' OR $post['fieldX'] != ''">

then find:
<font style="font-family:$post[fieldX]; color:$post[fieldX];"></font>



<else />

$post[message]

And Replace with:
<font style="font-family:$post[fieldX]; color:$post[fieldX]; font-size:
$post[fieldX]px;">$post[message]</font>



<else />

$post[message]

Remember to change the X's to the ID's of your custom fields.

Enjoy!

Ntfu2
12-04-2006, 08:07 PM
Creative, good work

Neo_Angelo
12-04-2006, 08:10 PM
thanks, i know its not something special but its a starting point of me learning to code properly. hopefully now i know this i can use it to master other things. its main purpose is an addon for the other hack. otherwise its only worth installing if you needed something like that.

UncoderMom
12-05-2006, 04:08 PM
Thanks!!!!

Me clicks install!!

obmob
01-12-2007, 03:33 AM
Hmm... i think it can be quite special :p
I'll try it, thanks.

Neo_Angelo
01-25-2007, 07:42 PM
glad to see its come in useful ^_^

BBF
02-13-2007, 10:24 AM
Thanks alot, Going to Install it :)

X-Rated
02-22-2007, 01:41 PM
this cod only font size setting but dont change colour or font but thread title is user font color post add on :S:S:S help me

Neo_Angelo
09-19-2007, 03:25 PM
This mod will not change the color of your posts nor the font of posts, it'll only change the SIZE of the font.