Please Log in to join the conversation.
while ( $table->load( array( 'alias' => $alias, 'catid' => $article->get( 'catid' ) ) ) ) {
$matches = null;
if ( preg_match( '#-(\d+)$#', $alias, $matches ) ) {
$alias = preg_replace( '#-(\d+)$#', '-' . ( $matches[1] + 1 ). '', $alias );
} else {
$alias .= '-2';
}
}
else {
$alias .= '-2';
}
Please Log in to join the conversation.