Please login or register.

Login with username, password and session length
Advanced search  

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

philmoz

  • 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
http://snewscms.com/forum/index.php?topic=4582

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

in function snews_startup()

add another case item...
Quote
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
Quote
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 »
Logged
Of all the things I have lost, it is my mind that I miss the most.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
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:

Quote
FROM:
case (!empty($articleSEF) && false === strpos($articleSEF,l('paginator'))  && (!is_numeric($articleCatID) || $articleCatID!=$categoryID)):
TO:
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 »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU