If duplicate title, add rand else, do nothing??
View Single Post
02-17-2010, 10:12 PM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
The same way you would check whether or not you needed to generate the random number for duplicate titles in the first case. Make it a function, 'check_duplicate()' and run it once to see if the number needs to be generated, and again to make sure the generated number isn't already in there.
Or take a page from WordPress and generate it in numerical order. Find the last title, 'some-duplicate-title-2' and add 1 to it.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity