אשכול: Friendly URLs
View Single Post
ישן 15-03-09, 19:30   # 1
Hezi & BomBas
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: May 2008
הודעות: 325
שלח הודעה באמצעות ICO אל Hezi & BomBas שלח הודעה באמצעות MSN אל Hezi & BomBas

Hezi & BomBas לא מחובר  

Friendly URLs

אהלן, אני מנסה לעשות בפורום שלי (IPB 2.3.6) "כתובות ידודיתיות" (כן זה נשמע מוזר בעברית :P).

בקיצור, יש לי בעיה קטנה.. אם שם הפורום הוא באנגלית - הכל עובד מצויין.
אבל.. אם שם הפורום הוא בעברית - יש שגיאה בדפדפן.. לולאה אין סופית.

זה הכתובת שאני מנסה להגיע אליה:
www.example.com/forum/forum-name-fid.html

זוהי כתובת הפורום:
www.igamer.co.il/forum

זה הפונקציה שאני חושב שעושה את הבעיות:
PHP קוד:
    function dice_the_url()
    {


        
$url $_SERVER['REQUEST_URI'];
        
$this->current_url 'http://'.$_SERVER['HTTP_HOST'].$url;

        
uksort($this->the_rules, array($this,'sortr_longer'));
        foreach (
$this->the_rules as $key => $value)
        {
            
$all_rules[$this->the_rules[$key][2]] = $this->the_rules[$key][0];
        }
        
//        $all_rules[$this->the_rules['topic_view_getnewpost'][2]] = $this->the_rules['topic_view_getnewpost'][0];
        //        $all_rules[$this->the_rules['topic_view_getlastpost'][2]] = $this->the_rules['topic_view_getlastpost'][0];    $all_rules[$this->the_rules['topic_multipage_rule'][2]] = $this->the_rules['topic_multipage_rule'][0];
        //        $all_rules[$this->the_rules['forum_multipage_rule'][2]] = $this->the_rules['forum_multipage_rule'][0];
        //        $all_rules[$this->the_rules['topic_rule'][2]] = $this->the_rules['topic_rule'][0];
        //        $all_rules[$this->the_rules['forum_rule'][2]] = $this->the_rules['forum_rule'][0];
        //        $all_rules[$this->the_rules['showuser_rule'][2]] = $this->the_rules['showuser_rule'][0];

        
if($this->call_list)
        {
            foreach (
$this->call_list as $plugin)
            {
                
$all_rules  $this->loaded_plugin[$plugin]->build_rule($all_rules);
            }
        }
        
//        $all_rules['act=help$matches[1]'] = 'help.html(.*)';

        //if we pop we dont continue
        
$poped 0;
        foreach(
$all_rules as $key_rule => $rule)
        {
                if(
preg_match('@^'.$rule.'@',$this->current_url,$matches))
                {
            if(!
$poped)
            {
$key_rule preg_replace("!^.+\?!"''$key_rule);
eval(
"\$new_query = \"" addslashes($key_rule) . "\";");
                    
parse_str($new_query,$this->ipsclass->input);
                    
//print_r($matches);
                    
$poped 1;
                }
            }
        }




        
//echo $this->current_url;

    

תודה רבה.
  Reply With Quote