2 sam2kb May 22, 2008 06:53

The hack keeps causing error messages to appear, but I will keep trying, thanks.
Replace TranslitUrl function with this one.
function TranslitUrl( $Item )
{
$crop_at = 15;
$urltitle = $Item->get('title');
if( strlen( $Item->get('title') ) > $crop_at )
{
$urltitle = substr( $Item->get('title'), 0, $crop_at );
}
return $urltitle;
}
Sorry, use this instead ;)
function TranslitUrl( $Item )
{
$crop_at = 15;
$urltitle = $Item->get('title');
if( strlen( $Item->get('title') ) > $crop_at )
{
$urltitle = substr( $Item->get('title'), 0, $crop_at );
}
$urltitle = urltitle_validate( $urltitle, $Item->get('title') );
return $urltitle;
}
Fatal error: Call to a member function get() on a non-object in /home/comlist/public_html/plugins/translit_urls_plugin/_translit_urls.plugin.php on line 110
Line 110 is
$urltitle = $Item->get('title');
I'll add a crop feature to the original plugin and let you know.
It's done http://ru.b2evo.net/bstat/stat.php?plugin=translit
http://ru.b2evo.net/media/images/9.JPG
Untick "Enable transliteration" I guess you don't need it ;) and set your value for "Url title length"
Thank you! Two things:
1) I get the following error messages:
Notice: Undefined variable: save_words in /home/comlist/public_html/plugins/translit_urls_plugin/_translit_urls.plugin.php on line 162
Warning: Cannot modify header information - headers already sent by (output started at /home/comlist/public_html/plugins/translit_urls_plugin/_translit_urls.plugin.php:162) in /home/comlist/public_html/inc/_core/_template.funcs.php on line 133
Warning: Cannot modify header information - headers already sent by (output started at /home/comlist/public_html/plugins/translit_urls_plugin/_translit_urls.plugin.php:162) in /home/comlist/public_html/inc/_core/_template.funcs.php on line 136
2) I noticed the limit was 40 characters. Is that based on some protocol? Could it be longer than 40, or does that cause issues?
1. Fixed, download it again.
2. The internal b2evo function crop it at 40 chars. It is changed to 200 in 2.5-beta (and this plugin knows about it and sets limit to 200 if installed in b2evo 2.5)
So, with just the normal 2.x, without the plugin, is my URL limit 40, or something less?
Yep, 40 is maximum with or without this plugin
Ah, okay, I'm looking to break that barrier. I guess I will need to wait until the next version of b2e is released. Either that, or find a way to clip them so they don't look absurd.
That's perfect, thank you!
No problem, if you changed the limit you can now change it in plugin on line 78
You can hack this plugin http://forums.b2evolution.net/viewtopic.php?t=15416
Use this function to crop the string