הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   Friendly URLs (https://hosts.co.il/forums/showthread.php?t=72707)

Hezi & BomBas 15-03-09 19:30

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;

    


תודה רבה.

vadimg88 15-03-09 21:22

אתה יודע מה הפונקציה הזאת עושה? או שלקחת את זה מאיפשהו?

אדיר 16-03-09 03:12

זה מוד מוכן או משהו שהורדת.. לא?

Hezi & BomBas 16-03-09 21:11

זה מוד עם שינויים שלי בנסיון לתמיכה בעברית - ללא הצלחה..

ואדים - הפונקציה "מכניסה" (פורסת) את הכתובת החדשה (חלק ממנה) לתוך ה URL הנוכחי.


כל הזמנים הם GMT +2. הזמן כעת הוא 13:06.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ