Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Problem - Conflict between category and subcategory

 
Reply to topic    Forum Index » Help View previous topic
View next topic
Problem - Conflict between category and subcategory
Author Message
yello



Joined: 08 Nov 2005
Posts: 27

Post Problem - Conflict between category and subcategory Reply with quote
When reading as user the subcategory articles, it shows me only the articles of the specific subcategory. But when i visit the parent category, it also shows me the articles of the subcategory! I saw that also the default version of the script does such a thing. How can i avoid it? I dont want when clicking a category to view also the articles belonging in the subcategories of this category.



Please help.
Fri Nov 25, 2005 1:34 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Open show_news.php and remove this:

Code:
if ($category){

   foreach (explode(',', str_replace(' ', '', $category)) as $cat){

       $category_tmp .= category_get_children($cat).',';

   }

}




And change this:

Code:
$allow_categories   = explode(',', chicken_dick($category_temp, ','));




to this:

Code:
$allow_categories   = explode(',', chicken_dick($category, ','));

Fri Nov 25, 2005 9:43 am View user's profile Send private message
Kova-2CROwded



Joined: 04 Jan 2006
Posts: 38
Location: Croatia/Zagreb

Post Reply with quote
Please check this site: www.2crowded.com/test



There are 5 articles.



Category is set like this:



Experti

-Hardware

--Overclock

---Procesori

--Odrzavanje

---Procesori

--Moding

---Procesori



So, how come, when I press on Moding for example, he doesn't sort moding articles, he sort, all of them ?



Here is example, I use

Code:
$number = 5;

include $cutepath.'/show_news.php';



if ($id and $ucat){

   $static['template'] = 'Headlines';

   $static['number'] = 7;

   $static['category'] = $ucat;

   include $cutepath.'/show_news.php';

}








Moding AMD Barton 2200+



Date: 11 Jan 2006 / Author: Kova / Category: Experti, Hardware, Moding, Procesori / Views: 1



Moding long



Print

RSS



Moding AMD Barton 2200+

Overclock AMD

Moding Procesora

Odrzavanje Procesora

Overclock Procesora



Like you see CATEGORY is MODING (So why is he listing Overclock, and Odrzavanje).



Please help me, this is realy important stuff. Nither normal script, nither this part helps in my problem.
Wed Jan 11, 2006 1:39 pm View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Open inc/show.news.php and find this:

Code:
$ucat  = $_GET['ucat']   = $_POST['ucat']  = reset($ucat = explode(',', $row['category']));




replace with this:

Code:
$ucat  = $_GET['ucat']   = $_POST['ucat']  = end($ucat = explode(',', $row['category']));




Any better?
Wed Jan 11, 2006 3:32 pm View user's profile Send private message
Kova-2CROwded



Joined: 04 Jan 2006
Posts: 38
Location: Croatia/Zagreb

Post Reply with quote
Well now it's ok, with head-lines.



But links are not working like should, I click on Moding, he shows all articles. (i talk about short story and link above it Experts/Hardware/Moding/Procesors)



You can see it by your self.



But you should tell me, should I make first replacment too, or just new one.
Wed Jan 11, 2006 6:36 pm View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Ok, this seems to be a bug. I just found out that it is working perfectly with txtSQL. With MySQL it's not working at all.



Scenario:

I have 1 category and 2 subcategories:

Category

--Subcategory

----Subsubcategory



When I write a news and put it in Subcategory it shows when clicking on this category.



But when I put this news in Subsubcategory it doesn't show when clicking on this category.



So there seems to be a bug in the subcategories.



Anybody else can confirm this?


Last edited by FI-DD on Wed Jan 11, 2006 9:07 pm; edited 1 time in total
Wed Jan 11, 2006 8:36 pm View user's profile Send private message
Kova-2CROwded



Joined: 04 Jan 2006
Posts: 38
Location: Croatia/Zagreb

Post Reply with quote
FI I can confirm that from start, cause I tried it before.



I had that problem even with 2.5.2 I think.
Wed Jan 11, 2006 9:02 pm View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
Kova-2CROwded



Joined: 04 Jan 2006
Posts: 38
Location: Croatia/Zagreb

Post Reply with quote
Any news about this bug ? Sad
Mon Jan 16, 2006 5:21 pm View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.