F.I.N.D News-Input anpassen
Verfasst: 11.03.2006 17:02
In der functions_news.php gibt es einen Code-Schnipsel "topic_already_exists", der die Überschriften, also das subject von den Feeds vergleicht, ob vorhanden oder nicht.
Ich hätte aber gerne, dass nicht das subject sondern der Text in der Message verglichen wird, weil das Subject für die diversen Feeds oft gleich ist, der Text aber nicht.
Ich hätte aber gerne, dass nicht das subject sondern der Text in der Message verglichen wird, weil das Subject für die diversen Feeds oft gleich ist, der Text aber nicht.
Code: Alles auswählen
/***************************************************************************
* topic_already_exists
* --------------------
* Author : netclectic - Adrian Cockburn - adrian/at/netclectic.com
* Version : 1.0.0
* Created : Monday, Sept 23, 2002
* Last Updated : Monday, Feb 17, 2003
*
* Description : This functions checks to see if a topic already exists
* with the give subject
*
* Parameters : $subject - the topic subject to search for
*
* Returns : true - if a topic with the subject exists
* flase - if a topic with the subject does not exist
*
***************************************************************************/
function topic_already_exists( $subject, $forum_id )
{
global $db;
$topic_already_exists = false;
$sql = "SELECT topic_id FROM " . TOPICS_TABLE . " WHERE forum_id = $forum_id AND topic_title LIKE '%" . str_replace("'", "''", $subject) . "%'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Topic Already Exists', '', __LINE__, __FILE__, $sql);
}
$topic_already_exists = ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
return $topic_already_exists;
}