#
#-----[ OPEN ]------------------------------------------
#
admin/admin_mass_email.php
#
#-----[ FIND ]------------------------------------------
#
if ( !$error )
{
#
#-----[ BEFORE, ADD ]-----------------------------------
#
if (!empty($HTTP_POST_VARS['create_topic']) && $HTTP_POST_VARS['f'] > 0)
{
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
$current_time = time();
$forum_id = $HTTP_POST_VARS['f'];
$topic_type = POST_NORMAL;
$topic_vote = 0;
$bbcode_uid=make_bbcode_uid();
$post_message = prepare_message(trim($message), 1, 1, 1, $bbcode_uid);
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$user_ip = encode_ip($client_ip);
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$topic_id = $db->sql_nextid();
$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, " . $userdata['user_id'] . ", '', $current_time, '$user_ip', 1, 1, 1, 1)";
if (!$db->sql_query($sql, BEGIN_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$post_id = $db->sql_nextid();
$sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$post_message')";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$sql="UPDATE phpbb_topics SET topic_first_post_id=$post_id, topic_last_post_id=$post_id WHERE topic_id=$topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
add_search_words('single', $post_id, stripslashes($post_message), stripslashes($subject));
}
#
#-----[ FIND ]------------------------------------------
#
include('./page_header_admin.'.$phpEx);
#
#-----[ AFTER ADD ]------------------------------------------
#
make_jumpbox('admin_mass_email.'.$phpEx);
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_email_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="catBottom" align="center" colspan="2"><input type="submit" value="{L_EMAIL}" name="submit" class="mainoption" /></td>
</tr>
#
#-----[ BEFORE, ADD ]-----------------------------------
#
<tr>
<td class="row1" align="left" colspan="2"><input type="checkbox" name="create_topic" />Создать топик в форуме: {S_JUMPBOX_SELECT}</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_mass_email.php
#
#-----[ FIND ]------------------------------------------
#
if ( !$error )
{
#
#-----[ AFTER, ADD ]-----------------------------------
#
if ((!empty($HTTP_POST_VARS['create_topic']) && $HTTP_POST_VARS['f'] > 0) || (!empty($HTTP_POST_VARS['post_message']) && !empty($HTTP_POST_VARS['destination_topic'])))
{
require_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
require_once($phpbb_root_path . 'includes/functions_search.'.$phpEx);
require_once($phpbb_root_path . 'includes/functions_post.'.$phpEx);
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
$current_time = time();
$forum_id = $HTTP_POST_VARS['f'];
$topic_type = POST_NORMAL;
$topic_vote = 0;
$bbcode_uid=make_bbcode_uid();
$post_message = prepare_message(trim($message), 1, 1, 1, $bbcode_uid);
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$user_ip = encode_ip($client_ip);
if(!empty($HTTP_POST_VARS['create_topic']))
{
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$topic_id = $db->sql_nextid();
$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, " . $userdata['user_id'] . ", '', $current_time, '$user_ip', 1, 1, 1, 1)";
if (!$db->sql_query($sql, BEGIN_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$post_id = $db->sql_nextid();
$sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$post_message')";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$sql="UPDATE phpbb_topics SET topic_first_post_id=$post_id, topic_last_post_id=$post_id WHERE topic_id=$topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
add_search_words('single', $post_id, stripslashes($post_message), stripslashes($subject));
}
if(!empty($HTTP_POST_VARS['post_message']))
{
$destination_topic = $HTTP_POST_VARS['destination_topic'];
// the next block of code is borrowed from the simply merge mod...it extracts the topic id from topic_id, topic url or post url
// is this a direct value ?
$num_topic = intval($destination_topic);
if ($destination_topic == "$num_topic")
{
$destination_topic_id = $num_topic;
}
// is this a url with topic id or post id ?
else
{
$name = explode('?', $destination_topic);
$parms = ( isset($name[1]) ) ? $name[1] : $name[0];
parse_str($parms, $parm);
$found = false;
$destination_topic_id = 0;
while ((list($key, $val) = each($parm)) && !$found)
{
$vals = explode('#', $val);
$val = $vals[0];
if (empty($val))
{
$val = 0;
}
else $val = intval($val);
switch($key)
{
case POST_POST_URL:
$sql = "SELECT topic_id FROM " . POSTS_TABLE . " WHERE post_id=$val";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
if ($row = $db->sql_fetchrow($result))
{
$val = $row['topic_id'];
$found = true;
}
break;
case POST_TOPIC_URL:
$found = true;
break;
}
if ($found)
{
$destination_topic_id = $val;
}
}
}
$topic_id = $destination_topic_id;
$sql = "SELECT forum_id
FROM " . TOPICS_TABLE . "
WHERE topic_id = $destination_topic_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get forum information for destination topic', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$forum_id = $row['forum_id'];
$db->sql_freeresult($result);
if ($forum_id == '') message_die(GENERAL_MESSAGE, 'Could not get forum information (no such topic_id?)');
$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, " . $userdata['user_id'] . ", '', $current_time, '$user_ip', 1, 1, 1, 1)";
if (!$db->sql_query($sql, BEGIN_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$post_id = $db->sql_nextid();
$sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$post_message')";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$sql="UPDATE phpbb_topics SET topic_last_post_id=$post_id WHERE topic_id=$topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
sync('topic', $topic_id);
}
sync('forum', $forum_id);
}
#
#-----[ FIND ]------------------------------------------
#
include('./page_header_admin.'.$phpEx);
#
#-----[ AFTER ADD ]------------------------------------------
#
make_jumpbox('admin_mass_email.'.$phpEx);
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_email_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="catBottom" align="center" colspan="2"><input type="submit" value="{L_EMAIL}" name="submit" class="mainoption" /></td>
</tr>
#
#-----[ BEFORE, ADD ]-----------------------------------
#
<tr>
<td class="row2" align="left" colspan="2"><input type="checkbox" name="create_topic" />Создать топик в форуме: {S_JUMPBOX_SELECT}</td>
</tr>
<tr>
<td class="row2" align="left" colspan="2"><input type="checkbox" name="post_message" />Отправить сообщение в тему: <input class="post" type="text" size="35" style="width: 340px" maxlength="60" name="destination_topic" value="(вставьте id или URL темы, или URL сообщения в теме)" onfocus="javascript:if (this.value=='(вставьте id или URL темы, или URL сообщения в теме)') {this.value=''}" onblur="javascript:if (this.value=='') {this.value='(вставьте id или URL темы, или URL сообщения в теме)'}" /> </td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Error in posting
DEBUG MODE
UPDATE phpbb_topics SET topic_last_post_id=1425 WHERE topic_id=1297
Line : 229
File : admin_mass_email.php
RUFOND писал(а): всё как на вашей картинке)
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_group_select','-1');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_mass_email.php
#
#-----[ FIND ]------------------------------------------
#
if ( !$error )
{
#
#-----[ AFTER, ADD ]-----------------------------------
#
if (!empty($HTTP_POST_VARS['defsel']))
{
$sql="update phpbb_config set config_value=$group_id where config_name='default_group_select'";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error ...', '', __LINE__, __FILE__, $sql);
}
}
#
#-----[ FIND ]------------------------------------------
#
$select_list .= '<option value = "' . $row['group_id'] . '"'.$selected.'>' . $row['group_name'] . '</option>';
#
#-----[ REPLACE WITH ]-----------------------------------
#
$selected = ($row['group_id']=== $board_config['default_group_select'])? 'selected':'';
$select_list .= '<option value = "' . $row['group_id'] . '"'.$selected.'>' . $row['group_name'] . '</option>';
#
#-----[ FIND ]------------------------------------------
#
'S_GROUP_SELECT' => $select_list)
#
#-----[ REPLACE WITH ]-----------------------------------
#
'S_GROUP_SELECT' => $select_list.' '. '<input type="checkbox" name="defsel" /> Сделать текущий выбор выбором по умолчанию')
что совсем не есть хорошоДобавлено: 01 Янв 1970 04:00 am
$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, " . $userdata['user_id'] . ", '', $current_time, '$user_ip', 1, 1, 1, 1)";
Вернуться в Запросы модов для phpBB 2.0.x
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0