Aşağıdaki kod phpBB3 için link rewrite modundan alınmıştır.
/**
* URL rewritting for viewtopic.php
* Without Virtual Folder Injection
* @access private
*/
function viewtopic_adv() {
$this->filter_url($this->seo_stop_vars);
$this->path = $this->seo_path['phpbb_urlR'];
if ( !empty($this->get_vars['p']) ) {
$this->url = $this->seo_static['post'] . $this->get_vars['p'] . $this->seo_ext['post'];
unset($this->get_vars['p'], $this->get_vars['f'], $this->get_vars['t'], $this->get_vars['start']);
return;
}
if ( !empty($this->get_vars['t']) && !empty($this->seo_url['topic'][$this->get_vars['t']]) ) {
// Filter default params
$this->filter_get_var($this->phpbb_filter['topic']);
$this->{$this->rewrite_functions['topic_pagination']}($this->seo_ext['topic']);
$this->url = $this->seo_url['topic'][$this->get_vars['t']] . $this->seo_delim['topic'] . $this->get_vars['t'] . $this->start;
unset($this->get_vars['t'], $this->get_vars['f'],$this->get_vars['p']);
return;
}
$this->path = $this->seo_path['phpbb_url'];
return;
} Veritabanından çekilen konu ismini link olarak yazdırmaktadır. Örnek:
viewforum.php?f=75/viewtopic.php?f=75&t=19995
linkini
forum-hakkinda-f75/bir-oneri-t19995.html
linkine çeviriyor.
Benim yapmak istediğim bu uzun linklerden kurtulup
forum-f75/ileti-t19995.html
gibi linkler üretmek istiyorum.
Az-çok php kodlama bilgim var ama bu kodlama dilinden hiçbirşey anlamadım. Deneme yanılma yöntemide işe yaramadı. Yardım bekliyorum.