Pagina 1 van 1

BPM-mod (Birthday Private Message)

Geplaatst: 06 okt 2005, 19:00
door ukkepuk
Support template:
  • Wat is het probleem? bpm_db_install.php geeft een fout

    Code: Selecteer alles

    Parse error: parse error, unexpected T_STRING in /home/divinglo/domains/divinglommel.be/public_html/forum/bpm_db_install.php on line 63
    
    Wanneer ontstond het probleem? tijdens het uitvoeren van deze DB-install
    Adres van je forum: http://www.divinglommel.be
    Geïnstalleerde mods:heel wat, maar deze werken foutloos, en hebben hier geen invloed op (denk ik toch)
    Huidige template:subsilver
    phpBB versie: 2.0.17
    Host:???
    Heb je onlangs een mod of stijl geïnstalleerd?ben ik nu mee bezig
    Heb je gezocht naar een antwoord?ja
Overige opmerkingen:
hier line 55 tot 70

Code: Selecteer alles

$sql = array();
	$sql[] = "CREATE TABLE " . WPM_INST . " (name varchar(255) NOT NULL default '', value text NOT NULL) TYPE=MyISAM";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('bpm_version', '1.0.2')";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('active_bpm', '1')";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('active_bpmmail', '0')";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('bpm_username', 'Anonymous')";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('bpm_userid', '-1')";
	$sql[] = "INSERT INTO " . WPM_INST . " VALUES ('bpm_subject', 'Happy birthday')";
	INSERT INTO phpbb_wpm VALUES ('bpm_message', 'Happy birthday [username]!
You are now [age] years old :lol:
If you have any questions about the site, please ask. If it goes about this mod please
visit: http://www.vitrax.vze.com thnx you!');

for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = $db->sql_query ($sql[$i]) )
en dit is dus line 63

Code: Selecteer alles

	INSERT INTO phpbb_wpm VALUES ('bpm_message', 'Happy birthday [username]!
mis ik hier een haakje? zo ja, waar moet dit staan?

Geplaatst: 06 okt 2005, 19:41
door Paul
maak van:

Code: Selecteer alles

   INSERT INTO phpbb_wpm VALUES ('bpm_message', 'Happy birthday [username]! 
You are now [age] years old :lol: 
If you have any questions about the site, please ask. If it goes about this mod please 
visit: http://www.vitrax.vze.com thnx you!'); 
Dot

Code: Selecteer alles

$sql[] = "   INSERT INTO phpbb_wpm VALUES ('bpm_message', 'Happy birthday [username]! 
You are now [age] years old :lol: 
If you have any questions about the site, please ask. If it goes about this mod please 
visit: http://www.vitrax.vze.com thnx you!'); ";

Geplaatst: 08 okt 2005, 05:37
door ukkepuk
Bedankt, dat is opgelost.
Gisteren heb ik de rest van de mod gedaan en geupload.
Alles leek goed te werken.
Dan had ik een test account aangemaakt die dan vandaag zou verjaren (om te zien wat er zou gaan gebeuren)
Nu kijk ik vandaag op het forum en dan krijg ik dit:
Fatal error: Call to undefined function: bpm_send_pm() in /home/divinglo/domains/divinglommel.be/public_html/forum/index.php on line 337

hier is mijn index.php van lijn 313 tot 385:

Code: Selecteer alles

				// START Birthday Mail Extension & bpm mod
				{
					$sql = "SELECT *
						FROM " . WPM;
					if(!$result = $db->sql_query($sql))
					{
						message_die(GENERAL_ERROR, "", "", __LINE__, __FILE__, $sql);
					}
					else
					{
						while($row = $db->sql_fetchrow($result))
						{
							$swpm_config[$row['name']] = $row['value'];
						}
					}
					if($swpm_config['active_bpm'])
					{
						$bpm_subject = str_replace("[username]", $username, $swpm_config['bpm_subject']);
						$bpm_subject = str_replace("[age]", $user_age, $bpm_subject);
						$bpm_subject = str_replace("[sitename]", $board_config['sitename'], $bpm_subject);
						$bpm_message = str_replace("[username]", $username, $swpm_config['bpm_message']);
						$bpm_message = str_replace("[age]", $user_age, $bpm_message);
						$bpm_message = str_replace("[sitename]", $board_config['sitename'], $bpm_message);

						bpm_send_pm($user_id, $bpm_subject, $bpm_message, 1);
						}
					}
					if($swpm_config['active_bpmmail'])
					{
						$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = " . $userdata['user_id'];
						if ( !($result = $db->sql_query($sql)) )
						{
							message_die(GENERAL_ERROR, "", "", __LINE__, __FILE__, $sql);
						}
						while( $row = $db->sql_fetchrow($result) )
						{
							$bd_mail = intval($row['user_email']);
						}
						$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id";
						if ( !($result = $db->sql_query($sql)) )
						{
							message_die(GENERAL_ERROR, "", "", __LINE__, __FILE__, $sql);
						}
						while ($row = $db->sql_fetchrow($result))
							$emailer->from($board_config['board_email']); 
							$emailer->replyto($board_config['board_email']); 
							$emailer->email_address(trim($row['user_email'])); 
							$emailer->use_template("birthday", $row['user_lang']);
							$emailer->set_subject($bpm_subject);
							$emailer->set_message($bpm_message);
							$bpm_subject = str_replace("[username]", $username, $swpm_config['bpm_subject']);
							$bpm_subject = str_replace("[age]", $user_age, $bpm_subject);
							$bpm_subject = str_replace("[sitename]", $board_config['sitename'], $bpm_subject);
							$bpm_message = str_replace("[username]", $username, $swpm_config['bpm_message']);
							$bpm_message = str_replace("[age]", $user_age, $bpm_message);
							$bpm_message = str_replace("[sitename]", $board_config['sitename'], $bpm_message);
							$emailer->assign_vars(array(
								'MESSAGE' => str_replace($bpm_message),
								'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $row['username']), 0, 25)),
								'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']))
								);
							$emailer->send();
							$emailer->reset();
					}
				$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '"' . $style_color .'>' . $birthdayrow['username'] . ' ('.$user_age.')</a>,'; 
		      }
			 
		}
		if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
		if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
	} 
	$db->sql_freeresult($result);
}
en dit is dan regel 337:

Code: Selecteer alles

						bpm_send_pm($user_id, $bpm_subject, $bpm_message, 1);

Geplaatst: 08 okt 2005, 08:20
door Bee
De functie moet ergens anders toegevoegd zijn, dus controleer of het bestand included wordt (zal wel zo zijn, of dat je het bestand geuploaded hebt)

Geplaatst: 08 okt 2005, 13:15
door ukkepuk
Ik heb de mod nog eens volledig doorgelopen en heb geen fout ontdekt, van hetgeen ik vergeten zou kunnen zijn.
Ook heb ik alle files geupload.
Voorlopig heb ik de volledige mod terug verwijderd, zodat m'n forum terug werkt. (ik heb al wat mails ontvangen dat het forum eruit lag :cry: )
Indien er een andere oplossing is, dan zou ik deze graag weten, want het lijkt mij een mooie toevoeging voor mijn forum.

Thankx