php forum
php mysql forum
php mysql smarty
 
Topic Options
#226410 - 10/16/02 02:38 PM 6.1.1: Count letters of Bio (Signature) in profile
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
edited by caymuc (I put in Astaran's corrections of the instructions):<br />Original title was "6.1.1: Count letters of Signature in profile"<br />Changed that as my instructions were for the Bio, actually. But that all would work for the signature as well, of course. You actually can use the script for both fields with a few changes in the code, I think. - I'll neet to figure out, how.<br />-------<br /><br />Where: EditBasic<br />---<br />What: A counter of how many letters are still free for use in the bio field.<br />---<br />Note: To change the default of how many letters can be uses maximum, change the number at that code in my hack:<br />var maxlang=250;<br />---<br />Status of the hack: Works well in 6.1.1.<br />---<br />Status of the instructions: beta - let me know if you understand this here and get it working <img src="/forum/images/graemlins/wink.gif" alt="" /><br />---<br />Example: running on my board; login info, see signature below.<br />---<br />Autor: Me, Myself and I<br /><br /><br />------------<br />In EDITBASIC.PHP<br /><br />Replace:<br />$formmethod = "<form method=\"post\" action=\"{$config['phpurl']}/changebasic.php\">";<br />By: <br />// Count-hack next line, name=\"Profil\" added:<br />$formmethod = "<form name=\"Profil\" method=\"post\" action=\"{$config['phpurl']}/changebasic.php\">";<br /><br />and <br /><br />Replace: <br />$formmethod = "<form method=\"post\" enctype='multipart/form-data' action=\"{$config['phpurl']}/changebasic.php\">";<br />By:<br />// Count-hack next line, method=\"post\" added:<br />$formmethod = "<form name=\"Profil\" method=\"post\" enctype='multipart/form-data' action=\"{$config['phpurl']}/changebasic.php\">";<br /><br /><br />(Scream, why don't you give all forms a "name" by default? Makes JavaScripts easier to apply. <img src="/forum/images/graemlins/wink.gif" alt="" /> )<br /><br /><br /><br />In EDITBASIC.TMPL<br /><br /><br />After:<br />{$ubbt_lang['PROF_HEAD']} $Username<br /></td><br /></tr><br /></table><br /></td><br /></tr><br /></table><br /><br />Insert this:<br /><br /><!-- Count-hack begin --><br /><script language="javascript" type="text/javascript"><br /><!--<br />var formfeld=" ";<br />var maxlang=250;<br />function z()<br />{<br />if (window.document.Profil.Bio.value.length>maxlang)<br />{<br />window.document.Profil.Bio.value=formfeld;<br />return;<br />}<br />else<br />{<br />formfeld=window.document.Profil.Bio.value;<br />window.document.Profil.anzeigen.value=maxlang-window.document.Profil.Bio.value.length;<br />}<br />}<br />//--><br /></script><br /><!-- Count-hack end --><br /><br />and <br /><br />replace the full line starting with:<br /><textarea name="Bio"<br /><br />by these two lines:<br /><!-- Count-hack begin --><br /><textarea name="Bio" cols="$TextCols" rows="$TextRows" wrap="soft" class="formboxes" onkeyup="javascript:z()">$Bio</textarea><br /><input type="text" value="-?-" name="anzeigen" class="formboxes" size="3" /><br /><!-- Count-hack end --><br />


Edited by caymuc (11/04/02 02:05 AM)
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#226411 - 11/02/02 06:10 AM Re: 6.1.1: Count letters of Signature in profile [Re: rodrigo1]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Hi Carl,<br />i took a look at this hack.<br />Really nice idea, very useful. <br />But i noticed a few issues during appling this hack.<br /><br />The changes have to be made in editbasic.php and editbasic.tmpl.<br />The instructions are written to apply that hack to the bio field an not to the signature field.<br />You could the variable $config['Sig_length'] to get the maxlength of the signature field from the config file.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#226412 - 11/04/02 01:52 AM Re: 6.1.1: Count letters of Bio in profile [Re: -Fusion-]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
Hi,<br />yes, i feared that the instructions are not perfect yet. <img src="/forum/images/graemlins/wink.gif" alt="" /><br />Also I like your idea to grab the needed variable from the database instead of hard coding it. But I wasn't 100% sure how to do it (and had no time testing it) and what I have here is better than nothing...<br /><br />Actually I wanted to spread the idea and see whether there is any interest in this feature before I spend any extra time on it. (At the moment I have a so much work at my job that there is no extra time for playing around too much...)<br />Also there is the hope that Scream would like to include that feature in a standard version, anyway. This Script is a nice service to all board users I think and almost zero effort to include.


Edited by caymuc (11/04/02 02:06 AM)
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top


Who's Online
0 registered (), 25 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Forum 'Trader Ratings'.
by blaaskaak
11/20/08 08:27 AM
Problems reading a lot of old posts here
by Ruben Rocha
11/18/08 04:33 PM
PhotoPost BB Code Popup
by Iann128
11/15/08 01:24 PM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
Looking for a simple upload script
by AllenAyres
11/11/08 02:12 PM
New Mods
Forum 'Trader Ratings'.
by McLemore
11/19/08 02:14 PM
[7.4] Keep log of custom title changes
by blaaskaak
10/27/08 07:51 AM
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Newest Members
nick1, Begbie, cenk, MATTO, DougMMcts
13362 Registered Users
Top Posters
AllenAyres 25448
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks