1 cslepage May 22, 2008 04:10
3 cslepage May 22, 2008 07:01
The hack keeps causing error messages to appear, but I will keep trying, thanks.
4 sam2kb May 22, 2008 07:11
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;
}
5 sam2kb May 22, 2008 07:16
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;
}
6 cslepage May 26, 2008 14:41
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');
7 sam2kb May 26, 2008 16:43
I'll add a crop feature to the original plugin and let you know.
8 sam2kb May 26, 2008 23:22
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"
9 cslepage May 27, 2008 00:15
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?
10 sam2kb May 27, 2008 00:26
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)
11 cslepage May 27, 2008 00:31
So, with just the normal 2.x, without the plugin, is my URL limit 40, or something less?
12 sam2kb May 27, 2008 00:33
Yep, 40 is maximum with or without this plugin
13 cslepage May 27, 2008 00:47
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.
14 sam2kb May 27, 2008 01:14
15 cslepage May 27, 2008 01:50
That's perfect, thank you!
16 sam2kb May 27, 2008 02:11
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