Προσθήκη νέων πεδίων στην φόρμα εγγραφής του phpBB2

Μια περιοχή για το phpBB, την δημοφιλή δωρεάν πλατφόρμα για forums

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
Άβαταρ μέλους
Serpatinas
Δημοσιεύσεις: 605
Εγγραφή: 18 Ιούλ 2002 10:53
Τοποθεσία: ΘΓΚΑ
Επικοινωνία:

Προσθήκη νέων πεδίων στην φόρμα εγγραφής του phpBB2

Δημοσίευση από Serpatinas » 12 Φεβ 2003 01:27

Μήπως ξέρει κάποιος πως μπορώ στην φόρμα εγγραφής του phpBB2 να προσθέσω καινούρια πεδία :question: :question: :wink:
Αγ
Ρούχα στο DRESS

Άβαταρ μέλους
Serpatinas
Δημοσιεύσεις: 605
Εγγραφή: 18 Ιούλ 2002 10:53
Τοποθεσία: ΘΓΚΑ
Επικοινωνία:

Προσθήκη νέων πεδίων στην φόρμα εγγραφής του phpBB2

Δημοσίευση από Serpatinas » 13 Φεβ 2003 03:15

Αφού δεν μου απάντησε κανένας… :cry: βρήκα ένα Modification από μόνος μου. 8) Σε περίπτωση που φανεί χρήσιμο σε κάποιον άλλο το βάζω και εδώ:
########################################################
## Mod Title: Real Names Mod for phpBB 2.0.0 Super Furry Ed
## Mod Version: 1.0.4
## Author: Rod Davis <rod@ripleycc.com> www.ripleycc.com/forums
## Description: This mod will add a real name field and require users
## to submit a real name when registering.
## Can be set so Real names only viewed by admins or publically viewable
##
## Installation Level: easy
## Installation Time: 20-25 Minutes
## Files To Edit: 9
## phpBB2/memberlist.php
## phpBB2/viewtopic.php
## phpBB2/includes/usercp_register.php
## phpBB2/includes/usercp_viewprofile.php
##
## The following need to be modified for every template you are using:
## phpBB2/templates/subSilver/profile_view_body.tpl
## phpBB2/templates/subSilver/viewtopic_body.tpl
## phpBB2/templates/subSilver/profile_add_body.tpl
## phpBB2/templates/subSilver/memberlist_body.tpl
##
## The lang file needs modifying for every language you support
## phpBB2/language/lang_endlish/lang_main.php
##
## Included Files: none
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Note:
## 1. This mod will create a new field in the users table
## 2. It can easily be altered so it's not compusary to enter a real name.
## 3. Can be set up either for only admins to view or to be publically viewable.
## (There are 3 places in the code where there is an OR choice for this)
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################



#
#-----[ ACTION ]------------------------------------------
#
# You will need to add one new field into your users table in your SQL database.

SQL-query:
ALTER TABLE users ADD user_realname VARCHAR (50)

## If you have a table prefix then put it before users
## eg if default prefix then the above becomes:
## ALTER TABLE phpbb_users ADD user_realname VARCHAR (50)



#
#----- [ OPEN ] -------------------------------------
# This first section modifies registration and profile to input real name

phpBB2/includes/usercp_register.php

#
#----- [ FIND ] -------------------------------------
#

$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "

#
#----- [ REPLACE WITH ] -------------------------------------
#

$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . ", user_realname = '" . str_replace("\'", "''", $realname) . "'


#
#----- [ FIND ] -------------------------------------
#

$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";

#
#----- [ REPLACE WITH ] -------------------------------------
#

$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_realname, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, '$realname', ";

#
#----- [ FIND ] -------------------------------------
#

$username = htmlspecialchars($userdata['username']);


#
#----- [ ADD AFTER ] -------------------------------------
#

$realname = htmlspecialchars($userdata['user_realname']);

#
#----- [ FIND ] -------------------------------------
#

display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat);

#
#----- [ REPLACE WITH ] -------------------------------------
#

display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $user_realname);

#
#----- [ FIND ] -------------------------------------
#

$template->assign_vars(array(
'USERNAME' => $username,

#
#----- [ ADD AFTER ] -------------------------------------
#

'REALNAME' => $realname,

#
#----- [ FIND ] ----------------------------
# --- This makes real name required -
#

if ( empty($username) || empty($password) || empty($password_confirm) || empty($email) )

#
#----- [ REPLACE WITH ] -------------------------------------
#

if ( empty($username) || empty($realname) || empty($password) || empty($password_confirm) || empty($email) )


#
#----- [ FIND ] ----------------------------
#

'L_EMAIL_ADDRESS' => $lang['Email_address'],

#
#----- [ ADD AFTER ] -------------------------------------
#

'L_REALNAME' => $lang['real_name'],
'L_REALNAME_VIEWABLE' => $lang['real_name_viewable'],

#
#----- END OF CHANGES TO usercp_register -------------------------------------
#

#
#-----[ OPEN ]------------------------------------------
# This section puts the entry field for a real name into registering
# and into editing pofile.
#
# Remember to do this for every template you support


phpBB2/templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<tr>
<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
<td class="row2"><input type="text" class="post" style="width:200px" name="username" size="25" maxlength="40" value="{USERNAME}" /></td>
</tr>


#
#-----[ AFTER ADD ]------------------------------------------
#
#

<tr>
<td class="row1"><span class="gen">{L_REALNAME}: * </span><span class="gensmall">{L_REALNAME_VIEWABLE}</span></td>
<td class="row2">
<input type="text" class="post"style="width: 200px" name="realname" size="25" maxlength="50" value="{REALNAME}" />
</td>
</tr>

#
#-----[ OPEN ]------------------------------------------
#
# This adds the real name into the users profile
#

phpBB2/includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#

'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&',

#
#-----[ ADD AFTER ]------------------------------------------
#

'REALNAME' => ( $realname ) ? $realname : '&',

#
#-----[ FIND ]------------------------------------------
#

//
// Generate page
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#
#-------For real name only to be viewed by admins-------
#

if($userdata['user_level'] == ADMIN)
{
$realname = $profiledata['user_realname'];
}
else
{
$realname = 'WITHELD';
}

#
#-----[ OR ]------------------------------------------
#
#-------If you want the real name to be publically viewable-------
#

$realname = $profiledata['user_realname'];

#
#-----[ FIND ]------------------------------------------
#

'L_INTERESTS' => $lang['Interests'],

#
#-----[ ADD AFTER ]------------------------------------------
#

'L_REALNAME' => $lang['real_name'],

#
#-----[ OPEN ]------------------------------------------
#
# Remember to do this for every template you support


phpBB2/templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_JOINED}:&</span></td>

#
#-----[ BEFORE ADD ]----------------------------------------
#

<tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_REALNAME}:&</span></td>
<td><b><span class="gen">{REALNAME}</span></b></td>
</tr>


#
#-----[ OPEN ]------------------------------------------
#
# This inserts real names into viewtopic beside their username - only admins see it

phpBB2/viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid

#
#-----[ REPLACE WITH ]------------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_realname, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid

#
#-----[ FIND ]------------------------------------------
#

$poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $postrow[$i]['username'];

#
#-----[ AFTER ADD ]------------------------------------------
#
#-------For real name only to be viewed by admins-------
#

if($userdata['user_level'] == ADMIN)
{
$poster_realname = $postrow[$i]['user_realname'];
}
else
{
$poster_realname = '';
}

#
#-----[ OR ]------------------------------------------
#
#-------If you want the real name to be publically viewable-------
#

$poster_realname = $postrow[$i]['user_realname'];

#
#-----[ FIND ]------------------------------------------
#

'POSTER_NAME' => $poster,

#
#-----[ AFTER ADD ]------------------------------------------
#

'POSTER_REALNAME' => $poster_realname,

#
#-----[ OPEN ]------------------------------------------
#
# Remember to do this for every template you support

phpBB2/templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b>&&<i>{postrow.POSTER_REALNAME}</i></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>


#
#-----[ OPEN ]------------------------------------------
#
# This adds the real name into memberlist beside their username - only admins see it
#

phpBB2/memberlist.php

#
#-----[ FIND ]------------------------------------------
#

$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar

#
#-----[ REPLACE WITH ]------------------------------------------
#

$sql = "SELECT username, user_id, user_realname, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar

#
#-----[ FIND ]------------------------------------------
#

$username = $row['username'];

#
#-----[ AFTER ADD ]------------------------------------------
#
#-------For real name only to be viewed by admins-------
#

if($userdata['user_level'] == ADMIN)
{
$realname = $row['user_realname'];
}
else
{
$realname = "";
}

#
#-----[ OR ]------------------------------------------
#
#-------If you want the real name to be publically viewable-------
#

$realname = $row['user_realname'];


#
#-----[ FIND ]------------------------------------------
#

'POSTS' => $posts,

#
#-----[ AFTER ADD ]------------------------------------------
#

'REALNAME' => $realname,

#
#-----[ OPEN ]------------------------------------------
#
# Remember to do this for every template you support

phpBB2/templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>

#
#-----[ REPLACE WiTH]------------------------------------------
#

<td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span>&&&<span class="gensmall"><i>{memberrow.REALNAME}</i></span></td>


#
#-----[ OPEN ]------------------------------------------
#
# Remember to do this for every language you support
# It needs translating!!!

phpBB2/language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#

//
// Errors (not related to a
// specific failure on a page)
//
$lang['Information'] = "Information";
$lang['Critical_Information'] = "Critical Information";

#
#-----[ ADD BEFORE ]------------------------------------------
#

//
// Language variables for the Real Names Mod
//

$lang['real_name'] = "Real Name";
$lang['real_name_viewable'] = "[This is <b>NOT</b> publically viewable!]";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Βεβαίως μπορείτε να προσαρμόσετε στις ανάγκες σας και να βάλετε και άλλα πεδία&#8230; :idea:
Αγ
Ρούχα στο DRESS

Άβαταρ μέλους
cordis
Administrator, [F|H]ounder, [C|S]EO
Δημοσιεύσεις: 27620
Εγγραφή: 09 Οκτ 1999 03:00
Τοποθεσία: Greece
Επικοινωνία:

Προσθήκη νέων πεδίων στην φόρμα εγγραφής του phpBB2

Δημοσίευση από cordis » 13 Φεβ 2003 13:13

Το θέμα είναι ότι εάν το βάλεις αυτό πως θα κάνεις upgrade σε νεότερη έκδοση :question:
:hammer:
8)
Δεν απαντάω σε προσωπικά μηνύματα με ερωτήσεις που καλύπτονται από τις ενότητες του forum. Για ο,τι άλλο είμαι εδώ για εσάς.
- follow me @twitter

Άβαταρ μέλους
greek_manager
Honorary Member
Δημοσιεύσεις: 1243
Εγγραφή: 21 Οκτ 2002 19:01
Τοποθεσία: Back to Greece
Επικοινωνία:

Προσθήκη νέων πεδίων στην φόρμα εγγραφής του phpBB2

Δημοσίευση από greek_manager » 13 Φεβ 2003 15:40

Πάλι καλά που δεν έκανες post όλο το phpBB για λόγους πληρότητας! :lol:

Πάντως καλά τους έκανες αφού δεν σου απάντησε κανείς!
Μήπως να το κάνω και γω στο post για τα duplicate modules?
Μόνο ο Γιάννης απάντησε... :pint:

Ας βάλω κανα emoticon παραπάνω μπας και το ... χοντρύνω το θέμα.... :lol:

:hammer:
aka thkouk
Football Manager - H ελληνική κοινότητα
παιχνιδια στρατηγικης - Παίξε Δωρεάν

Απάντηση

Επιστροφή στο “phpBB”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες