/ Published in: PHP
This is an example of how to use the articleHandler.class.php , this class can be found @ pietervp.com -> downloads
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$currentCat = $_REQUEST['cat']; $categories = new articleHandler($CATEGORIES_PATH) ; ... // getting the breadcrumds $bread = $categories->get_breadCrumbs($currentCat); if($i==O){ //this is the location the user is @, so no link has to be set $t->set_var("currentone" , $bread[$i][0]); }else{ //parse the breadcrumbs $t->set_var("loc", $bread[$i][1]); $t->set_var("tekst", $bread[$i][0]); $t->parse("crumbs" , "bread", true); } } } //get items in a categorie //1 stands for the field number being used $itemsInCat = $items->searchFor($currentCat, 1); //get subcategories of an categorie //5 stands for the field number being used $subCats = $categories->searchFor($currentCat, 5); //adding an article without a photo $items->add_art($cat, $csv); //adding a product with a photo $items->add_art($cat, $csv,$_FILES["_pic"]["tmp_name"]); //deleting an article $items->del_art(...); ... //The same goes with categories