Here's a suggestion on how you might want to handle this, as well as the ignoring of news items with duplicate titles (but different text):Smix wrote:
- You can't stop the posting of a message, that you've removed, it always checks for a new content and than it's posted.
Code: Select all
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_title = "' . $db->sql_escape($subject) . '"
AND topic_poster = ' . (int) $this->poster_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Do we have a new item to post ?
if (strnatcasecmp($row['topic_title'], $subject))
{
Code: Select all
$sql_ary = array(
'SELECT' => 't.topic_first_post_id, p.post_id, p.post_text',
'FROM' => array(
POSTS_TABLE => 'p',
TOPICS_TABLE => 't'
),
'WHERE' => 't.topic_title = ' . $db->sql_escape($subject) . ' AND t.topic_poster = ' . (int) $this->poster_id' AND t.topic_first_post_id = p.post_id',
);
$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Message content the same? Do not re-post
if (!strnatcasecmp($row['post_text'], $message))
{
goto exitwithoutpost;
}
// Message just has word "removed"? Do not re-post
while( $aRow= $db-> sql_fetchrow( $result ) )
{
if( stripos( $aRow['post_text'], 'removed' ) !== false )
{
goto exitwithoutpost;
}
}
$db-> sql_freeresult( $result );
Code: Select all
}
// change $i to the next (ehm previous :D ) item
$i--;
$j++;
}
Code: Select all
// change $i to the next (ehm previous :D ) item
$i--;
$j++;
}
exitwithoutpost:
Using phpBB 3.0.8[phpBB Debug] PHP Notice: in file /includes/db/mysql.php on line 188: strpos() expects parameter 1 to be string, array given
Warning: Cannot modify header information - headers already sent by (output started at /home/www/public_html/forum/includes/functions.php:3780) in /home/www/public_html/forum/includes/functions.php on line 2678
Return to the index page
General Error
ERROR during SQL query : Array
Please helpGeneral Error
SQL ERROR [ mysql4 ]
Can't find file: './xxx_phpbb/phpbb_smixmods_feed_news_center.frm' (errno: 2) [1017]
SQL
RENAME TABLE phpbb_smixmods_feed_news_center TO phpbb_sfnc_feeds
BACKTRACE
FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()
FILE: contrib/install.php
LINE: 137
CALL: dbal_mysql->sql_query()