 |
 |
 |
 |
 |
| Author |
Message |
yello
Joined: 08 Nov 2005 Posts: 27
|
|
Problem - Conflict between category and subcategory |
|
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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
Open show_news.php and remove this:
 |  | if ($category){
foreach (explode(',', str_replace(' ', '', $category)) as $cat){
$category_tmp .= category_get_children($cat).',';
}
} |
And change this:
 |  | $allow_categories = explode(',', chicken_dick($category_temp, ',')); |
to this:
 |  | $allow_categories = explode(',', chicken_dick($category, ',')); |
|
|
| Fri Nov 25, 2005 9:43 am |
|
 |
Kova-2CROwded
Joined: 04 Jan 2006 Posts: 38 Location: Croatia/Zagreb |
|
|
|
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
 |  | $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 |
 |
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
Open inc/show.news.php and find this:
 |  | $ucat = $_GET['ucat'] = $_POST['ucat'] = reset($ucat = explode(',', $row['category'])); |
replace with this:
 |  | $ucat = $_GET['ucat'] = $_POST['ucat'] = end($ucat = explode(',', $row['category'])); |
Any better?
|
|
| Wed Jan 11, 2006 3:32 pm |
|
 |
Kova-2CROwded
Joined: 04 Jan 2006 Posts: 38 Location: Croatia/Zagreb |
|
|
|
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 |
 |
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
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 |
|
 |
Kova-2CROwded
Joined: 04 Jan 2006 Posts: 38 Location: Croatia/Zagreb |
|
|
|
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 |
 |
 |
Kova-2CROwded
Joined: 04 Jan 2006 Posts: 38 Location: Croatia/Zagreb |
|
|
|
Any news about this bug ? 
|
|
| Mon Jan 16, 2006 5:21 pm |
 |
 |
|
|
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
|
|
 |
 |
 |
|