Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Jon P. Jon P. is offline
Developer Last Online: Aug 2002 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-01-2001 Last Update: Never Installs: 0
 
No support by the author.

The following minor code and template modifications will allow Planetweb browser users to actively participate in your vBulleitn forums. The Planetweb browser is a small-footprint browser suite used in several internet devices, including the Sega Dreamcast and Sony PlayStation 2 videogame consoles. As an operator of a site that specifically caters to gamers that use their consoles to access the Internet, I've found it necessary to modify vBulletin to make it as compatible as possible with the Planetweb browser. If you expect any Planetweb users to visit your forums you will want to make the modifications below.


1) The first thing you'll want to do is configure a textarea value for the Planetweb browser. Because it's designed to output to a television screen, the Planetweb browser makes fonts and form objects larger than you're used to seeing in PC browsers. The vBulletin default textarea of 60 columns will require a Planetweb user to horizontally scroll to view the entire input area when filling out forms. Changing this to 37 columns will require no horizontal scrolling from the user.

Inside admin/functions.php, Find:
Code:
	} elseif (eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
		return "50";
Directly below it add:
Code:
	} elseif (eregi("Planetweb",$HTTP_USER_AGENT)) { // browser is Planetweb
		return 37;

2) The "Code Buttons" and "Clicky Smilies" JavaScript goodies used in posting threads, replies, Private Messages, and calendar events don't work with the Planetweb browser. All they do is take up space and cause unnecessary horizontal scrolling, so you'll want to supress them for Planetweb users. To do this, we'll enclose the code inside the getcodebuttons and getclickysmilies functions inside an if statement that determines if the user is using a Planetweb browser.

Inside admin/functions.php, Find:
Code:
function getcodebuttons () {
Directly below it add:
Code:
  global $HTTP_USER_AGENT;

  if (!eregi("Planetweb",$HTTP_USER_AGENT)) {
Inside admin/functions.php, Find:
Code:
	return $vbcode_buttons;
Directly below it add:
Code:
  }
Also inside admin/functions.php, Find:
Code:
function getclickysmilies () {
Directly below it add:
Code:
  global $HTTP_USER_AGENT;

  if (!eregi("Planetweb",$HTTP_USER_AGENT)) {
Also inside admin/functions.php, Find:
Code:
	} else {
		return "";
	}
Directly below it add:
Code:
  }

3) If you've noticed, the message icons that are selectable on the new thread, reply, and Personal Message forms, are forcefully wrapped with a <br> tag after 7 icons are displayed (creating multiple rows of icons). On the Planetweb browser, the wrapping gets ugly. 5 icons are diplayed on one row (they wrap to the next row due to lack of space), and then on the next row only 2 icons are diplayed because the <br> tag after the 7th icon forces another wrap. So you get alternating rows of 5 icons and 2 icons. Forcing the wrap after 5 icons instead of 7 creates even rows for Planetweb users.

Inside admin/functions.php, Find:
Code:
    if ($counter%7==0 and $counter!=0) {
Replace it with:
Code:
    if ($counter%5==0 and $counter!=0) {

4) In the newreply, newthread, editpost, priv_forwardmultiple, priv_sendprivmsg, and priv_sendtobuddies templates the JavaScript validate(theform) function prevents Planetweb users from submitting the form (thus preventing them from posting new threads, replying, or sending Personal Messages). There's nothing wrong with JavaScript function but for some reason it isn't properly parsed by the Planetweb browser. To fix this, I've simply removed the offending code from the templates. This JavaScript function is merely a convenience that can be safely removed, as all form input is double checked by vBulletin.

The snippet to remove from the listed templates follows:
Code:
function validate(theform) {
	if (theform.message.value=="") {
		alert("Please complete the message field.");
		return false; }
	if (postmaxchars != 0) {
		if (theform.message.value.length > $postmaxchars) {
			alert("Your message is too long...");
			return false; }
		else { return true; }
	} else { return true; }
}
That's it.

Show Your Support

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

Comments
  #2  
Old 11-02-2001, 05:57 AM
Mr. X's Avatar
Mr. X Mr. X is offline
 
Join Date: Oct 2001
Location: Iowa
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm. Even though I dont expect any this is a neat hack! I'd love to see what my forums look like on a Dreamcast.
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:49 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.03520 seconds
  • Memory Usage 2,213KB
  • Queries Executed 17 (?)
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
  • (13)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete