Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Fix 404 errors  (Read 3366 times)

Rui Mendes

  • Development,Testing, Support
  • sNews Dude
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1039
  • sNews1.7
    • Comunidade Portuguesa
Fix 404 errors
« on: January 08, 2009, 01:56:58 AM »

Please fix your sNews 1.7 version:

Joost fix, add blue text in startup
Quote
if (!empty($_GET['category'])) {
   $url = explode('/', clean($_GET['category']));
   $categorySEF = $url[0];

....some lines down

Find in startup this code and add red text
Quote
if (!empty($MainQuery)){
      $Mainresult = mysql_query($MainQuery);
      if (mysql_num_rows($Mainresult) === 1 ){
         $R = mysql_fetch_assoc($Mainresult);
      } else if(!in_array($_GET['action'],explode(',',l('cat_listSEF')))){
         $categorySEF = '404';
         header('HTTP/1.1 404 Not Found');
         unset($subcatSEF,$articleSEF);}
      update_articles();

And in center function add red text
Quote
global $categorySEF, $subcatSEF, $articleSEF;
      switch(true) {
         case isset($_GET['category']):
            $action = $categorySEF;
            break;
         case isset($_GET['action']):
            $action = $categorySEF == '404' ? $categorySEF : clean(cleanXSS($_GET['action']));
            break;
      }
« Last Edit: January 08, 2009, 11:03:26 PM by Rui Mendes »
Logged
Need a Job on Europe. Linkdin - Facebook / Group