pospan
-
Posts
2 -
Joined
-
Last visited
Posts posted by pospan
-
-
Hello Community,
I have some diffuclties about getting the right logic for article management with subcategories. So everything with Categorys is fine.
TABLE: articles
articleID
title
content
cat_relatedID
TABLE: categories
catID
cat_name
On submit it Works fine where in "selection option" I can select the Category for that post. Now I want to extend it with subcategories.
TABLE: articles
articleID
title
content
cat_relatedID
TABLE: categories
catID
cat_name
TABLE: subcategories
subcatID
subcat_name
related_catID
Now the problem is how to relate Cats and Subcats in the form where I am adding new Articles and submit it to mysql. Do I need a additional field in the article table subcatID or anything else? My logic is something to make like in Wordpress when adding New posts you have the option to check categories related with that post.
<ul class="list-unstyled categorychecklist "> <li><input type="checkbox" value=""> Category 1 <ul class="children"> <li><input type="checkbox" value=""> Subcategory 1</li> <li><input type="checkbox" value=""> Subcategory 2</li> <li><input type="checkbox" value=""> Subcategory 3</li> </ul> </li> <li><input type="checkbox" value=""> Category 2 <ul class="children"> <li><input type="checkbox" value=""> Subcategory 4</li> <li><input type="checkbox" value=""> Subcategory 5</li> <li><input type="checkbox" value=""> Subcategory 6</li> </ul> </li> <li><input type="checkbox" value=""> Category 3 - No subcategories</li> </ul>
LINK should look something like this example:
mylink.com/category.php?ID=12&sub_ID=15
Image attached is how it looks now.
Custom CMS - Comment Reply or Comment Tree - 1 lvl
in PHP Coding Help
Posted
Hello I am working on a comment system in my custom cms i want to implement a Reply to an existing comment feature. My basic structure looks now like this. Users can only add comments with no Tree. All comments are going bellow another comment. I want only one 1 lvl after the main comment. Do I miss a field in DB, i don't get the right logic? What Am I missing in the markup?
Table: komentari
How it should look like on the attached picture.