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



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks