Pagina 1 van 1

Verstuur Welkom's Pm na registratie

Geplaatst: 27 feb 2005, 20:35
door Duifje

Code: Selecteer alles

##########################################################################################
## MOD Titel: Verstuur Welkom's Pm na registratie 
## MOD Auteur: AbelaJohnB < abela@phpbb.com > (John B. Abela) http://www.JohnAbela.Com/
## MOD Auteur, Secondary: typicalgeek  < me@typicalgeek.com > (N/A)  http://www.typicalgeek.com
## MOD Auteur, Secondary: netclectic < adrian@netclectic.com > (Adrian Cockburn) http://www.netclectic.com 
## MOD Auteur, Secondary: podium4 < www.phpbbinfo.tk> vertaald... 
## MOD Beschrijving: Deze MOD verstuurd een welkom's PM naar nieuwe gebruikers.
## MOD Versie: 1.0.2 DUTCH
##
## Installatie Niveau: Gemakkelijk 
## Installatie Tijd: ongeveer 3 Minuten 
## Aan Te Passen Bestanden: includes/usercp_register.php, language/lang_english/lang_main.php, ## language/lang_english/lang_main.php
## Bijgevoegde bestanden: geen 
##########################################################################################
Heb ik er in gezet maar hij geeft een fout melding !!!

Dit moest ik doen:

Code: Selecteer alles

#
#-----[ OPEN ]------------------------------------------ 
#
includes/usercp_register.php

#
#-----[ ZOEK ]------------------------------------------ 
#

$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)

#
#-----[ ACHTER, TOEVOEGEN ]------------------------------------------ 
#

        // START - SEND PM ON REGISTER MOD - AbelaJohnB
	//
	// According to 'netclectic' we need to set the datastamp to '9999999999' in order to
	// insure the pop-up notification about a new message existing. I concur with 'netclectic'
	// and have thus made the change to his suggestion. Thanks netclectic!
        //
	$sql = "UPDATE " . USERS_TABLE . " 
		SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
				WHERE user_id = $user_id";
		if ( !($result = $db->sql_query($sql)) )
        {
		    message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
        }

        $register_pm_subject = $lang['register_pm_subject'];
        $register_pm = $lang['register_pm'];
        $privmsgs_date = date("U");
        $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$board_config['sitename']))) . "', '2', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
		}

		$privmsg_sent_id = $db->sql_nextid();
		$privmsgs_text = $lang['register_pm_subject'];
        //
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$board_config['sitename'],$board_config['sitename']))) . "')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
		}
        // END - SEND PM ON REGISTER MOD - AbelaJohnB
En de rest maar als ik wat hier boven heb gedaan in het bestand toegevoegd hebt dan krijg ik deze foutmelding !!!
Parse error: syntax error, unexpected T_STRING in c:\wamp\www\phpBB2\includes\usercp_register.php on line 611

Weet iemand waar door het komt :?

Regel 584 tot regel 681 van usercp_register.php

Code: Selecteer alles

				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, ";
			if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
			{
				$user_actkey = gen_rand_string(true);
				$key_len = 54 - (strlen($server_url));
				$key_len = ( $key_len > 6 ) ? $key_len : 6;
				$user_actkey = substr($user_actkey, 0, $key_len);
				$sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
			}
			else
			{
				$sql .= "1, '')";
			}

			if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
			}

			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
	
	// START - SEND PM ON REGISTER MOD - AbelaJohnB
	//
	// According to 'netclectic' we need to set the datastamp to '9999999999' in order to
	// insure the pop-up notification about a new message existing. I concur with 'netclectic'
	// and have thus made the change to his suggestion. Thanks netclectic!
        //
	$sql = "UPDATE " . USERS_TABLE . " 
		SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
				WHERE user_id = $user_id";
		if ( !($result = $db->sql_query($sql)) )
        {
		    message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
        }

        $register_pm_subject = $lang['register_pm_subject'];
        $register_pm = $lang['register_pm'];
        $privmsgs_date = date("U");
        $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$board_config['sitename']))) . "', '2', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
		}

		$privmsg_sent_id = $db->sql_nextid();
		$privmsgs_text = $lang['register_pm_subject'];
        //
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$board_config['sitename'],$board_config['sitename']))) . "')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
		}
        // END - SEND PM ON REGISTER MOD - AbelaJohnB
				VALUES ('', 'Personal User', 1, 0)";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
			}

			$group_id = $db->sql_nextid();

			$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
				VALUES ($user_id, $group_id, 0)";
			if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
			}

			if ( $coppa )
			{
				$message = $lang['COPPA'];
				$email_template = 'coppa_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_SELF )
			{
				$message = $lang['Account_inactive'];
				$email_template = 'user_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
			{
				$message = $lang['Account_inactive_admin'];
				$email_template = 'admin_welcome_inactive';
			}
			else
			{
				$message = $lang['Account_added'];
				$email_template = 'user_welcome';
			}

			include($phpbb_root_path . 'includes/emailer.'.$phpEx);
			$emailer = new emailer($board_config['smtp_delivery']);

			$emailer->from($board_config['board_email']);
			$emailer->replyto($board_config['board_email']);

			$emailer->use_template($email_template, stripslashes($user_lang));
			$emailer->email_address($email);
			$emailer->set_subject(sprintf($lang['Welcome_subject'], $board_config['sitename']));

Geplaatst: 27 feb 2005, 20:38
door Paul
Ik had ook een probleem met die mod. Je moet midden in sql ietz zetten. ALs je ff wacht kijk ik er naar :D

Code: Selecteer alles

          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, ";
         if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
         {
            $user_actkey = gen_rand_string(true);
            $key_len = 54 - (strlen($server_url));
            $key_len = ( $key_len > 6 ) ? $key_len : 6;
            $user_actkey = substr($user_actkey, 0, $key_len);
            $sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
         }
         else
         {
            $sql .= "1, '')";
         }

         if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
         {
            message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
         }
   // START - SEND PM ON REGISTER MOD - AbelaJohnB
   //
   // According to 'netclectic' we need to set the datastamp to '9999999999' in order to
   // insure the pop-up notification about a new message existing. I concur with 'netclectic'
   // and have thus made the change to his suggestion. Thanks netclectic!
        //
   $sql = "UPDATE " . USERS_TABLE . "
      SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
            WHERE user_id = $user_id";
      if ( !($result = $db->sql_query($sql)) )
        {
          message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
        }

        $register_pm_subject = $lang['register_pm_subject'];
        $register_pm = $lang['register_pm'];
        $privmsgs_date = date("U");
        $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$board_config['sitename']))) . "', '2', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
        if ( !$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
      }

      $privmsg_sent_id = $db->sql_nextid();
      $privmsgs_text = $lang['register_pm_subject'];
        //
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$board_config['sitename'],$board_config['sitename']))) . "')";
        if ( !$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
      }
        // END - SEND PM ON REGISTER MOD - AbelaJohnB
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
           VALUES ('', 'Personal User', 1, 0)";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
         }

         $group_id = $db->sql_nextid();

         $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
            VALUES ($user_id, $group_id, 0)";
         if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
         {
            message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
         }

         if ( $coppa )
         {
            $message = $lang['COPPA'];
            $email_template = 'coppa_welcome_inactive';
         }
         else if ( $board_config['require_activation'] == USER_ACTIVATION_SELF )
         {
            $message = $lang['Account_inactive'];
            $email_template = 'user_welcome_inactive';
         }
         else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
         {
            $message = $lang['Account_inactive_admin'];
            $email_template = 'admin_welcome_inactive';
         }
         else
         {
            $message = $lang['Account_added'];
            $email_template = 'user_welcome';
         }

         include($phpbb_root_path . 'includes/emailer.'.$phpEx);
         $emailer = new emailer($board_config['smtp_delivery']);

         $emailer->from($board_config['board_email']);
         $emailer->replyto($board_config['board_email']);

         $emailer->use_template($email_template, stripslashes($user_lang));
         $emailer->email_address($email);
         $emailer->set_subject(sprintf($lang['Welcome_subject'], $board_config['sitename']));

Geplaatst: 27 feb 2005, 20:39
door Luuk
Het lijkt me logischer als je het stukje wat je moest toevoegen ervoor toevoegt in plaats van erna, nu splits je een sql querrie in tweeen.

Geplaatst: 27 feb 2005, 20:43
door Duifje
Bij de mod staat dat ik het er achter moet doen? :shock:

Geplaatst: 27 feb 2005, 20:43
door Paul
Duifje schreef:Bij de mod staat dat ik het er achter moet doen? :shock:
Heb je mijn code al geprobeert? Volgens mij moest het zo :D

Geplaatst: 27 feb 2005, 20:44
door Luuk
Probeer er eens voor.

//Edit: Of daarachter, komt op hetzelfde neer :wink:

Geplaatst: 27 feb 2005, 20:47
door Duifje
Toen ik het erachter zette zo als het stond kreeg ik een fout toen ik het er voor zette was het super thx :thumb: