Please login or register.

Login with username, password and session length
Advanced search  


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

Author Topic: incorrect category/article linking  (Read 4419 times)


  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
incorrect category/article linking
« on: May 24, 2007, 02:25:26 pm »

from bug report

NOTE grey is  default existing code...
blue is new or altered code.

in function snews_startup()

add another case item...
case ((!$categoryID || !is_numeric($categoryID)) && check_category($categorySEF) == false):
case (!empty($articleSEF) && false === strpos($articleSEF,l('paginator'))  && !is_numeric($articleCatID)):

case ( !empty($articleSEF) && $articleCatID!=$categoryID && false === strpos($articleSEF,l('paginator'))):
or alter the second one to this
case ((!$categoryID || !is_numeric($categoryID)) && check_category($categorySEF) == false):
case (!empty($articleSEF) && false === strpos($articleSEF,l('paginator'))  && (!is_numeric($articleCatID)||$articleCatID!=$categoryID)):
« Last Edit: August 21, 2007, 09:19:57 pm by Phil Martin »
Of all the things I have lost, it is my mind that I miss the most.


  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
Re: incorrect category/article linking
« Reply #1 on: December 28, 2007, 07:39:33 pm »

Note to Phil... and anyone else who might be using EQ's SubCats Mod after it is released:
This patch will conflict with the SubCats Mod... in that clicking any content link nexted under a SubCategory title in the sidebar menu... will throw a "404" error and give you the Requested contents could not be found. Please go back or use the search feature. message in the main content container.

I was/am using the second patch string Phil provided in blue (above) and made one small change to it, as shown in red:

case (!empty($articleSEF) && false === strpos($articleSEF,l('paginator'))  && (!is_numeric($articleCatID) || $articleCatID!=$categoryID)):
case (!empty($articleSEF) && false === strpos($articleSEF,l('paginator'))  && (!is_numeric($articleCatID) && $articleCatID!=$categoryID)):

With my limited PHP knowledge... I believe the 2 vertical bars serve as "OR" in the string... while the && serves as "AND". If this is the case, we're now making the string say... and if the article's category ID is not the category ID...

Phil... we'd appreciate your interpretation of this change... does it make the patch ineffective or does it make it co-exist?  :)
« Last Edit: December 28, 2007, 07:54:59 pm by Keyrocks »
Do it now... later may not come.
sNews 1.6 MESU | sNews 1.6 MEMU