Recent Topics

1 Apr 23, 2006 08:40    

Hi,

I tried to search this in the source codes several times and I was not able to find it. How can I hack the phoenix version that it won't longer suggest a URL with underlindes but with hypens instead?

If I post a blog article the url will be named: this_is_a_title, but I want to have this-is-a-title.

(Please no discussion if underlines are better, I just want to find the line of code where I can change that).

TIA

Marian

2 Apr 23, 2006 08:54

It appears to be caused by this line in evocore/_item.funcs.php (1.6/7) or inc/model/items/_item.funcs.php (1.8)

function urltitle_validate( $urltitle, $title, $post_ID = 0, $query_only = false,
$dbprefix = 'post_', $dbIDname = 'post_ID', $dbtable = 'T_posts' )
{
global $DB;

$urltitle = trim( $urltitle );

if( empty( $urltitle ) ) $urltitle = $title;
if( empty( $urltitle ) ) $urltitle = 'title';

// echo 'staring with: ', $urltitle, '<br />';

// Replace HTML entities
$urltitle = htmlentities( $urltitle, ENT_NOQUOTES );
// Keep only one char in emtities!
$urltitle = preg_replace( '/&(.).+?;/', '$1', $urltitle );
// Remove non acceptable chars
$urltitle = preg_replace( '/[^A-Za-z0-9]+/', '_', $urltitle );
$urltitle = preg_replace( '/^_+/', '', $urltitle );
$urltitle = preg_replace( '/_+$/', '', $urltitle );

¥

3 Apr 23, 2006 09:15

thanks a Lot. That was exactly what I needed. :D

Marian


Form is loading...