Allowing Longer URLs for Permalinks

15th Jan 2006 stk

Phoenix (v1.6 Alpha)

This method was tested specifically on a "Phoenix Alpha" installation. It it anticipated that it will work in any of the post-Phoenix 1.6+ series installations, but no other versions have been tested. IF you are attempting to do this in another version, please email us and let us know of your success or any problems you encounter (We can then update this post with that valuable information). Thank you.

For Phoenix Alpha, there are three things you need to change ...

  1. Modify your b2evolution database. Specifically, the evo_posts table and the post_urltitle field. Do this using myphpAdmin by changing the structure of the field from varchar 50 to varchar 250 (how many characters it allows).

  2. Allow a longer "URL Title" on the EDIT form. To do this, edit your /admin/_item.form.php. Around line 234 or so, you'll find the following code. Increase the maxlength value from 50 to 250, as highlighted, below:

    PHP:

    $Form->text'post_urltitle'$post_urltitle40T_('URL Title'),
                     T_('(to be used in permalinks)'), $field_maxlength = <span style="color:#ffa"><strong>250</strong></span> ) ;
  3. Increase the URL Title length during validation. When the URL Title is "validated" (special characters replaced, spaces converted to underscores, etc.) it is truncated, before it's posted to the page. You can simply remove this truncation.

    To do this, edit evocore/_item.funcs.php. Look for the following line (about line 85). Change it from:

    PHP:

    $urlbase substr$matches[1], 040 );

    to the following:

    PHP:

    $urlbase $matches[1];

BOOM ... you can now use permalink URLs up to 250 characters long.

**********************************************************************************
Contents
  1. Question & No-hack Options
  2. Dawn (v0.9.1.0) or Earlier
  3. Phoenix (v1.6 Alpha) or Newer
  4. Longer URLs & Page Ranking
 
 
 
 

No feedback yet

Comments are closed for this post.

 

B.O.P.I.T