Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Default Font/Size/Color in a Post. Details »»
Default Font/Size/Color in a Post.
Version: 1.0.2, by applehat applehat is offline
Developer Last Online: May 2016 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 07-31-2005 Last Update: 08-01-2005 Installs: 67
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

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:
PHP Code:
<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:
PHP Code:
            <!--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:
PHP Code:
$post[message
There may be DIV tags around it, leave those alone!

REPLACE WITH:
PHP Code:
    <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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-18-2005, 02:38 PM
FD929's Avatar
FD929 FD929 is offline
 
Join Date: Feb 2005
Location: California
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
<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:
Code:
<!--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-->
Reply With Quote
  #13  
Old 08-19-2005, 09:57 PM
Deimos Deimos is offline
 
Join Date: Oct 2002
Posts: 529
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can get the font type and colour to change, but when I add additional font sizes, they don't seem to work?
Reply With Quote
  #14  
Old 08-31-2005, 02:54 AM
applehat applehat is offline
 
Join Date: Jun 2005
Location: Huntsville, AL
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

donno? Post up your template and maby someone can help :-O
Reply With Quote
  #15  
Old 10-01-2005, 09:28 PM
Mijae's Avatar
Mijae Mijae is offline
 
Join Date: Nov 2001
Location: Russia
Posts: 523
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you add an option to ignore these settings? I want my users to be able to use this, but I hate it :P
Reply With Quote
  #16  
Old 10-04-2005, 06:38 PM
VaaKo VaaKo is offline
 
Join Date: Jul 2005
Location: Lebanon
Posts: 400
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when I try to load the xml file in the plugin manager, it gives me this:

Code:
XML Error: XML_ERR_RESERVED_XML_NAME at Line 1
Reply With Quote
  #17  
Old 10-23-2005, 07:18 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack
Reply With Quote
  #18  
Old 10-23-2005, 07:54 PM
eNforce's Avatar
eNforce eNforce is offline
 
Join Date: Aug 2004
Location: Canada, AB
Posts: 341
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working fine for me on Gold
Reply With Quote
  #19  
Old 10-25-2005, 06:20 AM
Samira's Avatar
Samira Samira is offline
 
Join Date: Dec 2004
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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?
Reply With Quote
  #20  
Old 10-29-2005, 05:44 PM
eNforce's Avatar
eNforce eNforce is offline
 
Join Date: Aug 2004
Location: Canada, AB
Posts: 341
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Samira
Anyone?
I agree, someone needs to code that. It's the only issue I'm having at the moment.
Reply With Quote
  #21  
Old 10-30-2005, 09:48 PM
applehat applehat is offline
 
Join Date: Jun 2005
Location: Huntsville, AL
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
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 06:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12459 seconds
  • Memory Usage 2,364KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete