Recent Topics

1 May 22, 2008 04:10    

My b2evolution Version: 2.x

If I use, at comiclist.com, the following for a title of a post:

Alterna Announces New Releases For The Second Half Of 2008

The URL becomes:

http://www.comiclist.com/index.php/news/alterna-announces-new-releases-for-the-s-2008

Is there a way to automatically cut off the last fragment of a word on a post URL?

Is there a way to do away with the limit on the number of characters in a post URL?

3 May 22, 2008 07:01

The hack keeps causing error messages to appear, but I will keep trying, thanks.

4 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 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 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 May 26, 2008 16:43

I'll add a crop feature to the original plugin and let you know.

9 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 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 May 27, 2008 00:31

So, with just the normal 2.x, without the plugin, is my URL limit 40, or something less?

12 May 27, 2008 00:33

Yep, 40 is maximum with or without this plugin

13 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.

15 May 27, 2008 01:50

That's perfect, thank you!

16 May 27, 2008 02:11

No problem, if you changed the limit you can now change it in plugin on line 78


Form is loading...