Forum-Bot mit eigenem User-Account

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
hannes68
Mitglied
Beiträge: 58
Registriert: 14.10.2004 19:52
Wohnort: Paderborn
Kontaktdaten:

Beitrag von hannes68 »

Wie lange dauert den das bis der Bot antwortet??
Weil der schreibt trotz 100% nix :(
MartinWilli83
Mitglied
Beiträge: 666
Registriert: 04.04.2005 11:38
Wohnort: Berlin

Beitrag von MartinWilli83 »

in der regel sofort jedoch max 1min später denke ich

mh mach mal nen bild von den gespeicherten einstellungen?hat er schreibrecht in den forum?
Meine Signatur war zu groß und wurde deshalb gelöscht - Siehe phpBB.de-Knigge
hannes68
Mitglied
Beiträge: 58
Registriert: 14.10.2004 19:52
Wohnort: Paderborn
Kontaktdaten:

Beitrag von hannes68 »

Es kommt ein Fehler beim Abschicken einer Nachricht hat aber glaube nix damit zu tun

Code: Alles auswählen

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' '', 1120766424, '50b97db5', 1, 1, 1, 1)' at line 1

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (778, 18, , '', 1120766424, '50b97db5', 1, 1, 1, 1)

Line : 49
File : functions_post.php
Hier der Screen
[ externes Bild ]

Schreibrecht hat der Bot
hannes68
Mitglied
Beiträge: 58
Registriert: 14.10.2004 19:52
Wohnort: Paderborn
Kontaktdaten:

Beitrag von hannes68 »

Doch das wird der Fehler sein aber was ist da falsch??

Code: Alles auswählen

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

# 
#-----[ FIND ]------------------------------------------ 
#
//
// This function will prepare a posted message for
// entry into the database.
//

# 
#-----[ ADD BEFORE ]------------------------------------------ 
#
//
// Post IAI's response to database
//
function iai_submit_post($mode, &$iai_id, &$forum_id, &$topic_id, &$iai_post_id, &$topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, &$bbcode_uid, &$iai_username, &$iai_subject, &$iai_message)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
        
	//Stores user's IP since IAI has none. Can be changed as wished.
	global $user_ip;

	$current_time = time();

	$sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, $iai_id, '$iai_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)";
	if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	$iai_post_id = $db->sql_nextid();

	$sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($iai_post_id, '$iai_subject', '$bbcode_uid', '$iai_message')";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	add_search_words($iai_post_id, stripslashes($iai_message), stripslashes($iai_subject));

	return false;
}
//
// Update Stats for IAI: must be run AFTER update_post_stats() for original post
//
function iai_update_post_stats(&$forum_id, &$topic_id, &$iai_post_id, &$iai_id)
{
	global $db;

	//This simply runs the 3 db updating functions (only used for IAI replies).

	$sql = "UPDATE " . FORUMS_TABLE . "
		SET forum_posts = forum_posts + 1, forum_last_post_id = $iai_post_id
		WHERE forum_id = $forum_id";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	$sql = "UPDATE " . TOPICS_TABLE . "
		SET topic_last_post_id = $iai_post_id, topic_replies = topic_replies + 1
		WHERE topic_id = $topic_id";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	// Comment out the next 7 lines if you don't want user posts to be updated (it will annoy some users otherwise).
	$sql = "UPDATE " . USERS_TABLE . "
		SET user_posts = user_posts + 1
		WHERE user_id = $iai_id";
	if ( !($result = $db->sql_query($sql, END_TRANSACTION)) )
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	return;
}
//
// Allows bot to send pms requiring only subject, message and user_id of user it is being sent to.
// I've made it an easy to use function so you can adapt it to use in many situations on your site
// an example is in the welcome message system which is included with this package. The function
// also sends emails (if $send_email set) and does all the inbox checking stuff that normal pms do.
//
function iai_send_pm($user_to_id, $iai_subject, $iai_message, $send_email)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;

	$sql = "SELECT *
		FROM " . USERS_TABLE . " 
		WHERE user_id = " . $user_to_id . "
		AND user_id <> " . ANONYMOUS;
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);
	}
	$usertodata = $db->sql_fetchrow($result);

	// prepare IAI message (IAI may have used html, smilies etc...)
	$bbcode_uid = make_bbcode_uid();
	$iai_message = str_replace("'", "''", $iai_message);

	// This is to fix up some of the bad formatting which comes out of the AI
	if(empty($iai_message))
	{
		$iai_message = "Thank you.";
	}
	$iai_message = prepare_message(trim($iai_message), 0, 1, 1, $bbcode_uid);

	$msg_time = time();

	// Do inbox limit stuff
	$sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time 
		FROM " . PRIVMSGS_TABLE . " 
		WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " 
			OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "  
			OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) 
			AND privmsgs_to_userid = " . $usertodata['user_id'];
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_such_user']);
	}

	$sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';

	if ( $inbox_info = $db->sql_fetchrow($result) )
	{
		if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )
		{
			$sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " 
				WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " 
					OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " 
					OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  ) 
					AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " 
					AND privmsgs_to_userid = " . $usertodata['user_id'];
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete your oldest privmsgs', '', __LINE__, __FILE__, $sql);
			}
		}
	}

	$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
		VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $iai_subject) . "', " . $board_config['iai_userid'] . ", " . $usertodata['user_id'] . ", $msg_time, '$user_ip', 0, 1, 1, 1)";

	if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
	{
		message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql_info);
	}

	$privmsg_sent_id = $db->sql_nextid();

	$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
		VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $iai_message) . "')";

	if ( !$db->sql_query($sql, END_TRANSACTION) )
	{
		message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
	}

	// Add to the users new pm counter
	$sql = "UPDATE " . USERS_TABLE . "
		SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "  
		WHERE user_id = " . $usertodata['user_id']; 
	if ( !$status = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
	}

	// now send email if all the usual conditions & $send_email is set
	if ( $send_email && $usertodata['user_notify_pm'] && !empty($usertodata['user_email']) && $usertodata['user_active'] )
	{
		$email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";

		$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
		$script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
		$server_name = trim($board_config['server_name']);
		$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
		$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

		include($phpbb_root_path . 'includes/emailer.'.$phpEx);
		$emailer = new emailer($board_config['smtp_delivery']);
			
		$emailer->use_template('privmsg_notify', $usertodata['user_lang']);
		$emailer->extra_headers($email_headers);
		$emailer->email_address($usertodata['user_email']);
		$emailer->set_subject(); //$lang['Notification_subject']
			
		$emailer->assign_vars(array(
			'USERNAME' => $usertodata['username'], 
			'SITENAME' => $board_config['sitename'],
			'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']), 

			'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')
		);

		$emailer->send();
		$emailer->reset();
	}

	return;
}
Das habe ich ja auch gemacht :-?
MartinWilli83
Mitglied
Beiträge: 666
Registriert: 04.04.2005 11:38
Wohnort: Berlin

Beitrag von MartinWilli83 »

nimm mal bei
AI Call Words
deine 3 wörter raus
bei
Percentage Response
0% bitte lassen

teste dann mal
Meine Signatur war zu groß und wurde deshalb gelöscht - Siehe phpBB.de-Knigge
hannes68
Mitglied
Beiträge: 58
Registriert: 14.10.2004 19:52
Wohnort: Paderborn
Kontaktdaten:

Beitrag von hannes68 »

Ich glaube das liegt an der Fehlermeldung in meinem vorherigen Post
Die Funktion dürfte doch gar nicht aufgerufen werden wenn ich Poste :-?

Auch wenn ich das mache was du geschrieben hast geht es nicht
MartinWilli83
Mitglied
Beiträge: 666
Registriert: 04.04.2005 11:38
Wohnort: Berlin

Beitrag von MartinWilli83 »

Meine Signatur war zu groß und wurde deshalb gelöscht - Siehe phpBB.de-Knigge
hannes68
Mitglied
Beiträge: 58
Registriert: 14.10.2004 19:52
Wohnort: Paderborn
Kontaktdaten:

Beitrag von hannes68 »

So der Fehler kommt nun nicht mehr :grin: Thx
Nur schreibt der Bot immer noch nix :(
Ich schreibe in ein Topic ,welches in einem 100% Forum ist, "hilfe" und der Bot meldet sich nicht :cry:

Steht der eigentlich auch in der Wer ist Online Liste drin?
Muss man das Passwort von dem Botuser eigentlich entfernen??
MartinWilli83
Mitglied
Beiträge: 666
Registriert: 04.04.2005 11:38
Wohnort: Berlin

Beitrag von MartinWilli83 »

ne msute net in wer ist online steht nix

p.s lies mal deine pn
Meine Signatur war zu groß und wurde deshalb gelöscht - Siehe phpBB.de-Knigge
Benutzeravatar
Enano
Mitglied
Beiträge: 107
Registriert: 24.11.2004 16:45
Wohnort: Dömitz
Kontaktdaten:

Beitrag von Enano »

Hat Jemand ne Idee, wie man die namentliche Anrede vernüftig hinbekommt?

Wenn man z.B. "Hi Alice" schreibt ...
kommt von der "KI" -> "Hallo it."

Hab das schon in mehreren Foren gesehen.
Über die Suche aber auch nix gefunden.
° warum haben eigentlich alle Mädchen im Internet den Nachnamen "JPG"???
Antworten

Zurück zu „phpBB 2.0: Mod Support“