BS-Fusion Deutschland

Some text can be placed here...

Surftips
Create new User field
Released: 23. June 2009
<?php
/*---------------------------------------------------------+
| BS-Fusion - Content Management System
| Version 1.00.x
+----------------------------------------------------------+
| Copyright © 2009 Manuel Kurz
| http://www.bs-fusion.org/
+----------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license (version 3). You can redistribute
| it and/or modify it under the terms of this license which
| you can read by viewing the included agpl-3.0.txt or
| online at http://www.gnu.org/licenses/agpl-3.0.html.
| Removal of this copyright header is strictly prohibited
| without written permission from the original author(s).
+----------------------------------------------------------+
| Code based on PHP-Fusion
| http://www.php-fusion.co.uk/
+----------------------------------------------------------*/
if (!defined("IN_FUSION")) exit;

// for admin data
$uf_name=$locale['uf_user_feldname_name'];
$uf_desc=$locale['uf_user_feldname_desc'];

// table field name
$uf_dbfield="user_feldname"; // The user_ prefix must be maintained

// table field properties
$uf_dbdata="VARCHAR(16) NOT NULL DEFAULT ''";

// Leave blank if no table field must be created.
//If this line is filled, a table field in the table DB_PREFIX_users inserted.
// field to where
$uf_group=2;
// 1 = Information, 2=Contact, 3=Other Informations

// Required field ??
$uf_user_feldname_mandory=0; // 0=No, 1=Yes


switch($uf_methode) {
########## Display in Userprofil #############
case 'display':
if ($data['user_feldname']!='') {
// Number of array is Userfieldgroup
$uf_display[$uf_group].='<tr><td width="35%">'.$locale['uf_user_feldname'].':</td><td> '.$data['user_feldname'].'</td></tr>';
}
break;

############# Display in membersadmin ##############
case 'admin':
// Number of array is Userfieldgroup
$uf_display[$uf_group].="<tr>
<td class='tbl1' align='left' style='width:30%;'>".$locale['uf_user_feldname'].(!$uf_user_feldname_mandory ? '' : '<span style="color:#ff0000">*</span>').":</td>
<td class='tbl2' align='left'><input type='text' name='user_feldname' class='textbox' value='".$data['user_feldname']."' style='width:200px;'></td>
</tr>";
break;

############### Display in edit_profile.php ###########
case 'input':
// Number of array is Userfieldgroup
$uf_display[$uf_group].="<tr>
<td class='tbl1' align='left' style='width:30%;'>".$locale['uf_user_feldname'].(!$uf_user_feldname_mandory ? '' : '<span style="color:#ff0000">*</span>').":</td>
<td class='tbl2' align='left'><input type='text' name='user_feldname' class='textbox' value='".$userdata['user_feldname']."' style='width:200px;'></td>
</tr>";
break;

########### Display in register.php #############
case 'register':
// if required field
if ($uf_user_feldname_mandory) {
$uf_display[0].="<tr>
<td class='tbl1' align='left' style='width:30%;'>".$locale['uf_user_feldname'].(!$uf_user_feldname_mandory ? '' : '<span style="color:#ff0000">*</span>').":</td>
<td class='tbl2' align='left'><input type='text' name='user_feldname' class='textbox' style='width:200px;'></td>
</tr>";
} else {
$uf_display[$uf_group].="<tr>
<td class='tbl1' align='left' style='width:30%;'>".$locale['uf_user_feldname'].":</td>
<td class='tbl2' align='left'><input type='text' name='user_feldname' class='textbox' style='width:200px;'></td>
</tr>";
}
$javascript.=$uf_user_feldname_mandory?"if(frm.user_feldname.value=='') {alert('".$locale['uf_user_feldname_mandory']."');
return false;}":"";
break;

################ Check the data ############
case 'validate_update':
$user_feldname = isset($_POST['user_feldname']) && strlen($_POST['user_feldname'])<=16 ? stripinput(trim($_POST['user_feldname'])) : '';
if ($uf_user_feldname_mandory && $user_feldname=='' && !iADMIN) {
$error.=$locale['uf_user_feldname_mandory'];
}
$usr_db_values.=",user_feldname='".$user_feldname."'";
break;

########### Check new entry ############
case 'validate_insert':
$user_aim = isset($_POST['user_feldname']) && strlen($_POST['user_feldname'])<=16 ? stripinput(trim($_POST['user_feldname'])) : '';
if ($uf_user_feldname_mandory && $user_feldname=='') {
$error.=$locale['uf_user_feldname_mandory'];
}
$usr_db_fields.= ',user_feldname;
$usr_db_values.= ",'".$user_feldname."'";
$usr_register[] = array("user_feldname"=>$user_feldname);
break;
default:
break;
}

################## Important ########################
feldname -> must be selected and used in all areas of this file

/**
The file must be saved under user_feldname.php in
/includes/userfields/ directory .

The languages should be included in definitions of the language file
/locale/your_language/userfields.php .

If your cms in multilingual mode, you have to adjust the language variables in all the different language userfields.php (in language directories).

About the admin area you can then decide, whether there is a registration field or not.
**/
?>
 0 Comments  Print Print
Comments
No Comments have been Posted.
Please Login to Post a Comment.
Ratings
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Login
Shoutbox
You must login to post a message.

bullet webmaster2001 offline
21.07.2018 - 11:53
Wow - hier scheint ja gar nichts mehr zu laufen. Silvermooooon - lebst du noch? )
bullet mbcowboy offline
19.11.2016 - 22:37
@powerrace
http://www.deeone.de/infusions/pro_download_panel/download.php?did=129
bullet powerrace offline
19.09.2016 - 14:18
Hallo ich suche einen der mir mal sagen kann wie ich einen eventkalender auf meine seite bekomme
bullet Chicko2012 offline
17.03.2016 - 12:37
Mahlzeit an Alle Bin Neu Hier
ig schmeiß mal ne runde Kaffee in die Runde
bullet CobraT0T offline
11.06.2015 - 14:22
läuft ....
bullet CobraT0T offline
11.06.2015 - 14:21
Ihr Leistet echt eine Super arbeit hier... eurer Security System leuft Super... und das kosten los.... Ich & meine Community danken euch dafür....
Gruß Cobra
bullet baerchen offline
24.09.2014 - 10:43
mal alle schnell grüßen
bullet webmaster2001 offline
05.09.2014 - 17:11
Ein Hallo in die Runde!
bullet Darkangel offline
20.05.2013 - 14:28
Hallo super Seite habt ihr hier weiter so :-)
bullet wely offline
28.04.2013 - 20:58