Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases

Reply
 
Thread Tools
User Default Font/Color/Size hack Details »»
User Default Font/Color/Size hack
Version: 1.00, by TalkHardRandy TalkHardRandy is offline
Developer Last Online: Nov 2004 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-25-2003 Last Update: Never Installs: 22
Is in Beta Stage  
No support by the author.

First hack... please be gentle :

WHAT IT DOES:

It allows the user to specify in their profile what size, color and font that they wish to use in all their posts. This is esentially the same as surrounding stuff with SIZE, COLOR, FONT, but makes it easier.

It also uses the vbcode templates already in the system, so users can select from any of the fonts & colors you have already defined. This avoids users inputing colors that don't exist and fonts that no one else has on their systems.

INSTALLABLES

3 file mods
4 template adds
3 template mods

PROPS

Palmer ofShinra inspired the original version here, so massive props to him. I wanted to take his idea and make it more user friendly (and was tired of trying to explain to people why 'puke green' didn't work as a color).

Also, every other hacker out here (Lesane, Erwin, FireFly, Xenon, C.Birch, futureal, and a hundred others) for busting their butts and putting hacks out and for saying that if you want to do something, learn to do it. Inspiration at its finest.

BUGS

If you run TomBot, TomBot has a problem with the FONT/COLOR/SIZE tags. The fix is two posts below

Okay... let me know

FIXES

1) Fixed Spelling of 'Verdana' - Thanks Vivi!
2) Fixed for Multiple Styles - Thanks Zelda!
3) Added & fixed user ability to use default via ON/OFF - Again, Thanks Zelda!
4) Added ability to remember defaults.

Show Your Support

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

Comments
  #2  
Old 02-26-2003, 07:44 PM
TalkHardRandy's Avatar
TalkHardRandy TalkHardRandy is offline
 
Join Date: Jan 2002
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What it looks like in the User CP...
Reply With Quote
  #3  
Old 02-26-2003, 07:50 PM
TalkHardRandy's Avatar
TalkHardRandy TalkHardRandy is offline
 
Join Date: Jan 2002
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, if you're like me your running TomBot & you've figured out that he/she doesn't like the color, font, size tags... especially if you're teaching to it.

In both newreply.php & newthread.php, find this section:

PHP Code:
// #####################  BEGIN FONT COLOR SIZE HACK ##################
    
if ($bbuserinfo[default_fcs]="0") {
        
$message "[color=".$bbuserinfo[post_color]."][font=".$bbuserinfo[post_font]."][size=".$bbuserinfo[post_size]."]".$message."[/size][/font][/color]";
    }
// #####################  END FONT COLOR SIZE HACK #################### 

Replace it with:

PHP Code:
// #####################  BEGIN FONT COLOR SIZE HACK ##################
    
if ($foruminfo['forumid']!=="FORUM#" || $bbuserinfo[default_fcs]="0") {
        
$message "[color=".$bbuserinfo[post_color]."][font=".$bbuserinfo[post_font]."][size=".$bbuserinfo[post_size]."]".$message."[/size][/font][/color]";
    }
// #####################  END FONT COLOR SIZE HACK #################### 
Where FORUM# is the forum where your TomBot is running. If you have multiples, and a ||. To figure out what forum you TomBot is running in, check the tomstalkerbot.php for the $ttb_forumid variable.

NOTE: If it doesn't look like this in your files, you need to go back to post #1 and reinstall the hack.
Reply With Quote
  #4  
Old 02-26-2003, 09:23 PM
Vivi Ornitier's Avatar
Vivi Ornitier Vivi Ornitier is offline
 
Join Date: Nov 2001
Location: Black Mage Village
Posts: 442
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey great job! been waitin for somethin like this but the queries don't wokr.

I thin it's too many ' and also u spelt Veranda instead of Verdana in the queries
Reply With Quote
  #5  
Old 02-26-2003, 09:30 PM
TalkHardRandy's Avatar
TalkHardRandy TalkHardRandy is offline
 
Join Date: Jan 2002
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay... spelling bugs are fixed (which is why Notepad should have a spell checker :nods: )

As for the query, I don't know why it wouldn't work... I copied and pasted it out of MySQL and tried it again...

This is what my results look like... what about yours?
Reply With Quote
  #6  
Old 02-26-2003, 11:40 PM
Disturbed's Avatar
Disturbed Disturbed is offline
 
Join Date: Apr 2002
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i will test this locally and report you the results
Reply With Quote
  #7  
Old 02-27-2003, 01:51 AM
One-Team's Avatar
One-Team One-Team is offline
 
Join Date: Dec 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Hack
I will Install it :banana: :banana:
Reply With Quote
  #8  
Old 02-27-2003, 10:03 AM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying this out on vB 2.2.9.

Good hack. One snag though. There are 16 of each option beside each other. Also the number of times the options are indicated goes up by 1 as you go along. So in the first size one it says 'small medium large' then in the next one it says 'small medium large small medium large' and so on. (I got rid of the LARGER font sizes. I don't like seeing posts in like size 5+ font or something personally. )

Here, I took a screenshot of the bug (see attachment).

It's something to do with the member.php because if I revert that file the templates work fine.

EDIT: I fixed it. Basically, instead of using
PHP Code:
eval("\$getfontcolor.= \"".gettemplate("vbcode_colorbits")."\";");
eval(
"\$getfontsize.= \"".gettemplate("vbcode_sizebits_mod")."\";");
eval(
"\$getfontfonts.= \"".gettemplate("vbcode_fontbits")."\";");

eval(
"\$postfontcolor.= \"".gettemplate("post_font_color")."\";");
eval(
"\$postfontsize.= \"".gettemplate("post_font_size")."\";");
eval(
"\$postfontfonts.= \"".gettemplate("post_font_fonts")."\";"); 
use
PHP Code:
eval("\$getfontcolor = \"".gettemplate("vbcode_colorbits")."\";");
eval(
"\$getfontsize = \"".gettemplate("vbcode_sizebits_mod")."\";");
eval(
"\$getfontfonts = \"".gettemplate("vbcode_fontbits")."\";");

eval(
"\$postfontcolor = \"".gettemplate("post_font_color")."\";");
eval(
"\$postfontsize = \"".gettemplate("post_font_size")."\";");
eval(
"\$postfontfonts = \"".gettemplate("post_font_fonts")."\";"); 
.

You just shouldn't have the '.'s before the '='s.

The trouble is this can pose problems for boards that have several styles. If the top 'default' option was truly 'default' and didn't insert any vB code that would be perfect.

I was thinking something along the lines of
PHP Code:
// #####################  BEGIN FONT COLOR SIZE HACK ##################
        
if($bbuserinfo[post_color] == "Default"){
$message "[font=".$bbuserinfo[post_font]."][size=".$bbuserinfo[post_size]."]".$message."[/size][/font]";
} else {
$message "[color=".$bbuserinfo[post_color]."][font=".$bbuserinfo[post_font]."][size=".$bbuserinfo[post_size]."]".$message."[/size][/font][/color]";
// #####################  END FONT COLOR SIZE HACK #################### 
but that is parsed wrong in the top line. Needs correcting. That code just gets me an unexpected T_DEFAULT.
Reply With Quote
  #9  
Old 02-27-2003, 03:25 PM
TalkHardRandy's Avatar
TalkHardRandy TalkHardRandy is offline
 
Join Date: Jan 2002
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay... fixed the file with your first fix Zelda... danke.

As to the second part, I'm going to put an on/off button in there so people can select which features they wish to use. It'll double the options in the CP and make the newreply & newthread parts bigger, but you're right it is kinda a pain...
Reply With Quote
  #10  
Old 02-27-2003, 03:31 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack Randy. I saw this and thought you would have had a numeric field to enter for the font size. It's in dropdowns which i would have suggested anyway. Excellent hack pal

- miSt
Reply With Quote
Reply

Thread Tools

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 04:32 PM.


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.13805 seconds
  • Memory Usage 2,318KB
  • Queries Executed 23 (?)
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
  • (5)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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