Save the following code to a uniquetitle.php file and upload it to your /plugins/ subdirectory:
<?php
function checkincompletes(&$object)
{
global $incomplete, $incompletemessage, $db;
if ($object->objecttype == 'link')
{
if ($object->id) $idbit = " AND id != '{$object->id}'"; else $idbit = "";
$existing = $db->selectcount('linkstable', "deleted=0 AND title='".encodeit($object->title)."' $idbit");
if (($object->id && $existing > 1) || (!$object->id && $existing)) { $incomplete = true; $incompletemessage[] = "The title {$object->title} is already in use by another topic. Each topic must have a unique title. Please choose another title."; }
}
return true;
}
?>
function checkincompletes(&$object)
{
global $incomplete, $incompletemessage, $db;
if ($object->objecttype == 'link')
{
if ($object->id) $idbit = " AND id != '{$object->id}'"; else $idbit = "";
$existing = $db->selectcount('linkstable', "deleted=0 AND title='".encodeit($object->title)."' $idbit");
if (($object->id && $existing > 1) || (!$object->id && $existing)) { $incomplete = true; $incompletemessage[] = "The title {$object->title} is already in use by another topic. Each topic must have a unique title. Please choose another title."; }
}
return true;
}
?>