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

   6.1.1: Count letters of Bio (Signature) in profile to Del.icio.us Add to del.icio.us
  Digg 6.1.1: Count letters of Bio (Signature) in profile Digg it
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


Top Posters Last 30 Days
AllenAyres 12
Gizmo 10
S7ARBVCK 2
Cambridge 1
Murphdog 1
MattUK 1
Kevin H 1
Who's Online
0 Registered (), 39 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
BeyondCompare v3.00
by blaaskaak
09/05/08 02:46 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
[7.3.x] ubb.links
by AllenAyres
08/26/08 09:57 AM
New Mods
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks