vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Individual Textfield size for each user (https://vborg.vbsupport.ru/showthread.php?t=34977)

T?Pau 02-10-2002 10:00 PM

Have you ever wanted to change the size of the textfield when you post a message? Now it is possible....
With this Hack every user can have a custom textfield size.
Both width and hight can simply be changed by specifying your favorit values in your Options Menu.
For a demo click here

Many thanks to Thomas"cptza" woh helped me a lot, to finish this hack :)

You need to edit 2 files and 3 templates

First open admin/functions.php
find
Code:

if (eregi("MSIE",$HTTP_USER_AGENT)) { // browser is IE
                return "70";

and replace it with
Code:

// ###################### Start gettextareawidth #######################
function gettextareawidth () {
  global $DB_site,$HTTP_USER_AGENT, $bbuserinfo;
  $textareacols=$DB_site->query_first("SELECT textareacols FROM user WHERE userid='$userid'");
  $textarearows=$DB_site->query_first("SELECT textarearows FROM user WHERE userid='$userid'");

    if        ($bbuserinfo[textareacols]!=0) {
      return "$bbuserinfo[textareacols]";
    }if        ($bbuserinfo[textarearows]!=20) {
      return "$bbuserinfo[textarearows]"; 
            }elseif (eregi("MSIE",$HTTP_USER_AGENT)) { // browser is IE
                return "70";

In member.php
find
Code:

if ($bbuserinfo[showsignatures]) {
    $showsignatureschecked="checked";
    $showsignaturesnotchecked="";
  } else {
    $showsignatureschecked="";
    $showsignaturesnotchecked="checked";
  }

And under it insert
Code:

// textarea Begin
$textareacols=$DB_site->query_first("SELECT textareacols FROM user WHERE userid='$userid'");
$textarearows=$DB_site->query_first("SELECT textarearows FROM user WHERE userid='$userid'");       
       
 // Textarea End

find
Code:

$DB_site->query("UPDATE user
                  SET ".$updatestyles."adminemail='$adminemail',
                      showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
                      maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
                      timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
                      startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
                      emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
                      nosessionhash='$nosessionhash'
                  WHERE userid='$bbuserinfo[userid]'");

and replace it with
Code:

$DB_site->query("UPDATE user
                  SET ".$updatestyles."adminemail='$adminemail',
                      showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
                      maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
                      timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
                      startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
                      emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
                      nosessionhash='$nosessionhash',textareacols='$textareacols',textarearows='$textarearows'
                  WHERE userid='$bbuserinfo[userid]'");

in your Admin CP edit the templates newreply and newthread
Find
Code:

<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2">$message</textarea>
and replace it with
Code:

<textarea name="message" rows="$bbuserinfo[textarearows]" cols="$textareacols" wrap="virtual" tabindex="2">$message</textarea>
Edit modifyoptions template
insert
Code:

<tr><td bgcolor="#1C5780"><normalfont><b>Textarea Size:</b></normalfont><br>
        <smallfont>Edit the Size of the textarea.
$userinfo[textareacols]</smallfont></td>
        <td bgcolor="#1C5780"><normalfont>

<smallfont>width:</smallfont><input type="text" size="3" value="$bbuserinfo[textareacols]" name="textareacols" class="bginput">  <smallfont> hight:</smallfont><input type="text" size="3" value="$bbuserinfo[textarearows]" name="textarearows" class="bginput">
</normalfont></td></tr>

were you want it to appear.

Lesane 02-11-2002 01:00 PM

Nice but i'm not gonna use it for my forums because people will gonna abuse it.

One comment: https://vborg.vbsupport.ru/showthrea...threadid=31969 ;)


All times are GMT. The time now is 03:39 AM.

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.01049 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete