includes/functions.php
changeset 909 94c1ff984286
parent 906 c949e82b8f49
child 915 91f4da84966f
equal deleted inserted replaced
908:44302dd20d62 909:94c1ff984286
   428 function redirect($url, $title = 'etc_redirect_title', $message = 'etc_redirect_body', $timeout = 3)
   428 function redirect($url, $title = 'etc_redirect_title', $message = 'etc_redirect_body', $timeout = 3)
   429 {
   429 {
   430   global $db, $session, $paths, $template, $plugins; // Common objects
   430   global $db, $session, $paths, $template, $plugins; // Common objects
   431   global $lang;
   431   global $lang;
   432 
   432 
   433   // POST check added in 1.1.x because Firefox asks us if we want to "resend the form
   433   // POST check added in 1.1.x because Firefox 3.0 asks us if we want to "resend the form
   434   // data to the new location", which can be confusing for some users.
   434   // data to the new location", which can be confusing for some users.
   435   if ( $timeout == 0 && empty($_POST) )
   435   $is_firefox_3 = ( strstr(@$_SERVER['HTTP_USER_AGENT'], 'Firefox/3.') ) ? true : false;
       
   436   if ( $timeout == 0 && ( empty($_POST) || !$is_firefox_3 ) )
   436   {
   437   {
   437     header('Location: ' . $url);
   438     header('Location: ' . $url);
   438     header('Content-length: 0');
   439     header('Content-length: 0');
   439     header('HTTP/1.1 307 Temporary Redirect');
   440     header('HTTP/1.1 307 Temporary Redirect');
   440     
   441     
  2286       for ( $i = 0; $i < 3; $i++ )
  2287       for ( $i = 0; $i < 3; $i++ )
  2287       {
  2288       {
  2288         $list[] = $lower + $i;
  2289         $list[] = $lower + $i;
  2289       }
  2290       }
  2290     }
  2291     }
  2291     $url = sprintf($result_url, '0');
  2292     $url = sprintf($result_url, $start_add);
  2292     $link = ( 0 == $current_page ) ? "<b>" . $lang->get('paginate_btn_first') . "</b>" : "<a href=".'"'."$url".'"'." style='text-decoration: none;'>&laquo; " . $lang->get('paginate_btn_first') . "</a>";
  2293     $link = ( 0 == $current_page ) ? "<b>" . $lang->get('paginate_btn_first') . "</b>" : "<a href=".'"'."$url".'"'." style='text-decoration: none;'>&laquo; " . $lang->get('paginate_btn_first') . "</a>";
  2293     $blk->assign_vars(array(
  2294     $blk->assign_vars(array(
  2294       'CLASS'=>$cls,
  2295       'CLASS'=>$cls,
  2295       'LINK'=>$link
  2296       'LINK'=>$link
  2296       ));
  2297       ));
  2328       $inner .= $blk->run();
  2329       $inner .= $blk->run();
  2329     }
  2330     }
  2330 
  2331 
  2331   }
  2332   }
  2332 
  2333 
  2333   $inner .= '<td class="row2" style="cursor: pointer;" onclick="paginator_goto(this, '.$current_page.', '.$num_pages.', '.$start_mult.', unescape(\'' . rawurlencode($result_url) . '\'));">&darr;</td>';
  2334   $inner .= '<td class="row2" style="cursor: pointer;" onclick="paginator_goto(this, '.$current_page.', '.$num_pages.', '.$start_mult.', '.$start_add.', unescape(\'' . rawurlencode($result_url) . '\'));">&darr;</td>';
  2334 
  2335 
  2335   $paginator = "\n$begin$inner$end\n";
  2336   $paginator = "\n$begin$inner$end\n";
  2336   return $paginator;
  2337   return $paginator;
  2337 }
  2338 }
  2338 
  2339