plugins/PunBB.php
changeset 8 8baccbad4a55
parent 6 5e1f1e916419
child 9 a932ce8c4827
equal deleted inserted replaced
7:98bbc533541c 8:8baccbad4a55
    34   ');
    34   ');
    35 
    35 
    36 $plugins->attachHook('session_started', '
    36 $plugins->attachHook('session_started', '
    37     $pid = RenderMan::strToPageId($paths->get_pageid_from_url());
    37     $pid = RenderMan::strToPageId($paths->get_pageid_from_url());
    38 
    38 
    39     $is_style_or_script = ( strpos($_SERVER["REQUEST_URI"], "/style/") || strpos($_SERVER["REQUEST_URI"], "/include/js/") );
    39     $is_style_or_script = ( ( strpos($_SERVER["REQUEST_URI"], "/style/") || strpos($_SERVER["REQUEST_URI"], "/include/js/") || strpos($_SERVER["REQUEST_URI"], "/img/") ) && !strpos($_SERVER["REQUEST_URI"], "/help/") );
    40     if ( getConfig("punbb_installed") == "yes" && getConfig("punbb_version") == PUNANO_VERSION && $pid[0] == "Forum" && $pid[1] == "Special" && !$is_style_or_script )
    40     if ( getConfig("punbb_installed") == "yes" && getConfig("punbb_version") == PUNANO_VERSION && $pid[0] == "Forum" && $pid[1] == "Special" && !$is_style_or_script )
    41     {
    41     {
    42       require( "punbb/include/common.php" );
    42       require( "punbb/include/common.php" );
    43     }
    43     }
    44     ');
    44     ');
    63   }
    63   }
    64   else if ( $paths->getParam(0) == 'admin' )
    64   else if ( $paths->getParam(0) == 'admin' )
    65   {
    65   {
    66     punano_admin_console();
    66     punano_admin_console();
    67   }
    67   }
    68   else if ( $paths->getParam(0) == 'style' )
    68   else if ( ( $paths->getParam(0) == 'style' ) || ( $paths->getParam(0) == 'include' && $paths->getParam(1) == 'js' ) || ( $paths->getParam(0) == 'img' ) )
    69   {
       
    70     $path = $paths->getAllParams();
       
    71     header('Location: ' . scriptPath . '/punbb/' . $path);
       
    72     exit();
       
    73   }
       
    74   else if ( $paths->getParam(0) == 'include' && $paths->getParam(1) == 'js' )
       
    75   {
    69   {
    76     $path = $paths->getAllParams();
    70     $path = $paths->getAllParams();
    77     header('Location: ' . scriptPath . '/punbb/' . $path);
    71     header('Location: ' . scriptPath . '/punbb/' . $path);
    78     exit();
    72     exit();
    79   }
    73   }