In der functions_post.php habe ich ja folgenden Code:
Code: Alles auswählen
//
// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$current_time = time();
if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')
{
//
// Flood control
//
$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE $where_sql";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
{
message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
}
}
}
}
Das ist ja nur der ANFANG der Funktion.
Könnte ich das jetzt ganz stumpf so ausbauen?
Code: Alles auswählen
//
// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$current_time = time();
if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')
{
//
// Flood control
//
$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE $where_sql";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
{
message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
}
}
}
}
if($topic_type == POST_ANNOUNCE)
{
// Einstellungen
$sms_group = 1;
$user_phone_number = 'mobiltel';
// Abfrage/Script
$sql = "SELECT DISTINCT u.$user_phone_number
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
WHERE g.group_id = ug.group_id
AND ug.user_id = u.user_id
AND g.group_single_user <> " . TRUE . "
AND ug.user_pending <> " . TRUE . "
AND g.group_id = $sms_group";
if (!($result = $db->sql_query($sql)))
{
mesage_die(GENERAL_ERROR, 'Could not read user mobiltel', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$mobiltel = $row[$user_phone_number];
// Hier das SMS-Script für die SMS an den aktuell abgefragten User
// Input username, password and URL to MOSMS.
$mosms_username = "your moms-username";
$mosms_password = "your moms-password";
$mosms_url = "http://www.domain.com/se/sms-send.php";
// Phonenumbers
$number = $mobiltel;
// Type of SMS
$mosms_type = "text";
// Message to be sent
$mosms_data = "New important message in the forum!";
// Call MOSMS and send the SMS
$mosms_data = rawurlencode($mosms_data);
//Start loop
for ($x = 0;$x<=count($number)-1;$x++)
{
$result = file_get_contents($mosms_url . "?username=$mosms_username&password=$mosms_password&nr=$number[$x]&type=$mosms_type&data=$mosms_data");
// Check errorcodes
if ($result <> "0") {
// Errorcode was returned
echo "Error when calling number: $number[$x] - errorcode: $result <br>";
} else {
// No errorvode
echo "SMS was sent to $number[$x]! <br>";
}
//End loop
}
//End if announcement
}
}
$db->sql_freeresult($result);
Ist DER Teil korrekt so: