Bij registratie punten toekennen?
Geplaatst: 10 feb 2005, 19:53
door Kaza
Ik wil als men zich registreert automatisch 50 punten krijgt van de point mod.
Nu doe ik het handmatig da's te veel werk
Kan dit automatisch, zo ja hoe?
Geplaatst: 10 feb 2005, 20:11
door Luuk
Ik weet niet hoe de point mod in elkaar steekt, dwz hoe de tabel in de database eruit ziet. Als de punten worden opgeteld in de tabel phpbb_users is het heel makkelijk, verander in includes/register.php bij
Code: Selecteer alles
$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("\'", "''", $new_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, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
de 0 van het bijbehorende veld naar 50.
Je moet dus zelf een beetje zoeken, maar ik dnek dat het niet erg moeilijk is

Geplaatst: 11 feb 2005, 17:22
door Kaza
Had al gezocht in de database, niks op het eerste gezicht gevonden.
Dit is de aanpassing waar jij op doelde:
Code: Selecteer alles
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifydonation = ( isset($HTTP_POST_VARS['notifydonation']) ) ? ( ($HTTP_POST_VARS['notifydonation']) ? TRUE : 0 ) : TRUE;
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm = $notifypm,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_notify_donation = $notifydonation,
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . " (
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_notify_donation,
#
#-----[ FIND ]------------------------------------------
#
VALUES (
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
$notifydonation,
#
#-----[ FIND ]------------------------------------------
#
$notifyreply = $userdata['user_notify'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifydonation = $userdata['user_notify_donation'];
#
#-----[ FIND ]------------------------------------------
#
'NOTIFY_REPLY_NO' => ( !$notifyreply ) ? 'checked="checked"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'NOTIFY_DONATION_YES' => ( $notifydonation ) ? 'checked="checked"' : '',
'NOTIFY_DONATION_NO' => ( !$notifydonation ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_EMAIL_ADDRESS' => $lang['Email_address'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_NOTIFY_DONATION' => sprintf($lang['Points_notify'], $board_config['points_name']),
'L_NOTIFY_DONATION_EXPLAIN' => sprintf($lang['Points_notify_explain'], $board_config['points_name']),
Zou het dus een twee drie niet durven zeggen waar ik eventueel die waarde zou moeten aanpassen.
Wellicht een regel toevoegen die een waarde invoegt aan de database
Geplaatst: 11 feb 2005, 19:10
door Luuk
Gokje:
Code: Selecteer alles
#
#-----[ FIND ]------------------------------------------
#
VALUES (
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
50,
In plaats van wat daar stond.
Geplaatst: 12 feb 2005, 09:00
door Kaza
Nee ik zie geen waarde in deze regel en volgens mij heeft het te maken met het krijgen van een private mail bij een donatie van.
Regel uit mijn forum, includes/usercp_register.php:
$sql = "INSERT INTO " . USERS_TABLE . " (user_reg_ip, user_reg_host, user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_from_flag, 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_notify_donation, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_passwd_change, user_active, user_actkey)
VALUES ('" . str_replace("\'", "''", $user_reg_id) . "', '" . str_replace("\'", "''", $user_reg_host) . "', $user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '$user_flag', '" . 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, $popup_pm, $notifydonation, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, '$gender', 0, 1, '$birthday', '$next_birthday_greeting', ".time().",";
Geplaatst: 12 feb 2005, 10:15
door Luuk
Dan worden de punten in een nieuwe tabel opgeslagen. Welke mod gebruik je precies? Met download erbij aub.
Geplaatst: 12 feb 2005, 17:35
door Luuk
Er is dus wel een veld, user_points. Dan is het makkelijk.
Probeer dan eens zo:
Code: Selecteer alles
$sql = "INSERT INTO " . USERS_TABLE . " (user_reg_ip, user_reg_host, user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_from_flag, 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_notify_donation, user_points, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_passwd_change, user_active, user_actkey)
VALUES ('" . str_replace("\'", "''", $user_reg_id) . "', '" . str_replace("\'", "''", $user_reg_host) . "', $user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '$user_flag', '" . 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, $notifydonation, 50, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, '$gender', 0, 1, '$birthday', '$next_birthday_greeting', ".time().",";
Er zat trouwens nog een fout in ($popup_pm stond eentje te vroeg).
