- Open file /tiki-sefurl.php. Insert the script below, exactly before the script if ($type == 'blog' && $prefs['feature_sefurl_title_blog'] == 'y' && empty($with_next)) {:
- Open file /lib/smarty_tiki/modifier.sefurl.php. Insertthe script below, exactly before the script case 'file':
- Open file .htaccess. The default file name when the first time Tiki installed was _htaccess. Therefore, if you find file name _htaccess, rename it with .htaccess. The file location of .htaccess should be in the root or main directory of your web domain (e.g: http://www.example.com).
- Insert the script RewriteRule ^print_article([0-9]+)\-.*$ print_article$1
right under the script RewriteRule ^article([0-9]+)\-.*$ article$1 - Insert the script RewriteRule ^print_article([0-9]+)(.*) tiki-print_article.php?articleId=$1$2 [L]
right under the script RewriteRule ^article([0-9]+)(.*) tiki-read_article.php?articleId=$1$2 [L].
Save and close file .htaccess - Open phpMyAdmin and your Tiki database, then open table tiki_sefurl_regex_out.
- Insert one row/record in the last order with the columns/field as follow:
- Left: tiki-print_article.php\?articleId=(\d+)
- Right: print_article$1
- Type:article
- Feature:feature_articles
- Leave other fields as they are.
- Save and close table tiki_sefurl_regex_out.
- Open file /templates/article_trailer.tpl.
- Edit or change script <a class="icon" href="tiki-print_article.php?articleId={$articleId}">{icon _id='printer' alt="{tr}Print{/tr}"}</a> with script <a class="icon" href="{$articleId|sefurl:print_article}">{icon _id='printer' alt="{tr}Print{/tr}"}</a>
- Save and close /templates/article_trailer.tpl.
- Finish. Your SEFURL for print article is ready.
if ($type == 'print_article' && $prefs['feature_sefurl_title_article'] == 'y' && empty($with_next)) {
global $artlib;
include_once ('lib/articles/artlib.php');
if (preg_match('/articleId=([0-9]+)/', $tpl_output, $matches)) {
if (empty($title)) $title = $artlib->get_title($matches[1]);
$title = preg_replace(PATTERN_TO_CLEAN_TEXT, CLEAN_CHAR, $tikilib->take_away_accent($title));
$title = preg_replace('/' . CLEAN_CHAR . CLEAN_CHAR . '+/', '-', $title);
$title = preg_replace('/' . CLEAN_CHAR . '+$/', '', $title);
}
}
Save and close file /tiki-sefurl.php.global $artlib;
include_once ('lib/articles/artlib.php');
if (preg_match('/articleId=([0-9]+)/', $tpl_output, $matches)) {
if (empty($title)) $title = $artlib->get_title($matches[1]);
$title = preg_replace(PATTERN_TO_CLEAN_TEXT, CLEAN_CHAR, $tikilib->take_away_accent($title));
$title = preg_replace('/' . CLEAN_CHAR . CLEAN_CHAR . '+/', '-', $title);
$title = preg_replace('/' . CLEAN_CHAR . '+$/', '', $title);
}
}
case 'print_article':
$href = 'tiki-print_article.php?articleId='.$source;
break;
Save and close file /lib/smarty_tiki/modifier.sefurl.php.$href = 'tiki-print_article.php?articleId='.$source;
break;
No comments:
Post a Comment