
this code crashing
$sql = 'SELECT group_reputation_power FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . $user_group_id;
ADD.
under mysql this problem too
Code: Select all
General Error
SQL ERROR [ mysql4 ]
[0]
SQL
No values specified for SQL IN comparison
BACKTRACE
FILE: includes/db/dbal.php
LINE: 385
CALL: dbal->sql_error()
FILE: includes/functions_admin.php
LINE: 454
CALL: dbal->sql_in_set()
FILE: includes/mcp/mcp_main.php
LINE: 637
CALL: move_topics()
FILE: includes/mcp/mcp_main.php
LINE: 93
CALL: mcp_move_topic()
FILE: includes/functions_module.php
LINE: 471
CALL: mcp_main->main()
FILE: includes/functions_module.php
LINE: 766
CALL: p_master->load_active()
FILE: mcp.php
LINE: 168
CALL: p_master->load()
Code: Select all
/**
* Move topic(s)
*/
function move_topics($topic_ids, $forum_id, $auto_sync = true)
{
global $db;
if (empty($topic_ids))
{
return;
}
$forum_ids = array($forum_id);
if (!is_array($topic_ids))
{
$topic_ids = array($topic_ids);
}
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids) . '
AND forum_id = ' . $forum_id;
$db->sql_query($sql);
if ($auto_sync)
{
$sql = 'SELECT DISTINCT forum_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
}
$db->sql_freeresult($result);
}
$table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
$sql = "UPDATE $table
SET forum_id = $forum_id
WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);
}
unset($table_ary);
// user reputation points
$sql = 'DELETE FROM ' . REPUTATIONS_TABLE . '
WHERE ' . $db->sql_in_set('rep_post_id', $post_ids);
$db->sql_query($sql);
// end
if ($auto_sync)
{
sync('forum', 'forum_id', $forum_ids, true, true);
unset($forum_ids);
}
}
emm..? moving topics maybe?matthewhotdude wrote:when moving posts since doing this mod?
Code: Select all
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
WHERE " . $db->sql_in_set('post_id', $post_ids);
$db->sql_query($sql);
}
unset($table_ary);
// Adjust users post counts
if (sizeof($post_counts) && $post_count_sync)
{
foreach ($post_counts as $poster_id => $substract)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = 0
WHERE user_id = ' . $poster_id . '
AND user_posts < ' . $substract;
$db->sql_query($sql);
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts - ' . $substract . '
WHERE user_id = ' . $poster_id . '
AND user_posts >= ' . $substract;
$db->sql_query($sql);
}
}
// Remove topics now having no posts?
if (sizeof($topic_ids))
{
$sql = 'SELECT topic_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
GROUP BY topic_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$remove_topics[] = $row['topic_id'];
}
$db->sql_freeresult($result);
// Actually, those not within remove_topics should be removed. ;)
$remove_topics = array_diff($topic_ids, $remove_topics);
}
Code: Select all
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
Code: Select all
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
Code: Select all
//user reputation point
'REPUTATION' => $member['user_reputation'],
'S_REPUTATION' => ($config['rp_enable'] && !$member['user_hide_reputation']),
'REP_POWER' => get_rep_power($member['user_posts'], $member['user_regdate'], $member['user_reputation'], $member['group_id']),
// end user reputation point
Code: Select all
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
Code: Select all
Just add new language entry 'RP_NO_COMMENT' in languahe/en/mod/reputation_mod.php