I am very new to php and have been taking a weekly class here in town and messing around with some different smf mods for practice. I decided to work on creating a site for my local hobby shop and we settled on using the SMFShop mod. So far I have been able to do a few tweaks that we wanted (removing some options and creating an item), but I am stuck on this tweak. I am hoping somebody may be able to help, it seems to me that it should be pretty simple, I just don’t know the code needed…
When members visit the ‘buy stuff’ page it shows the [all] category by default, and in turn all of the items. We will have nearly 10000 items, which is simply overwhelming. I will be having a large array of categories, and would like to have the category list show [Uncategorized] instead of [All] by default. I am assuming that this would be in the Shop_buy.php file, someplace around here :
[php]
// Are we only displaying a certain category?
if (isset($_GET[‘cat’]) && $_GET[‘cat’] !=-1)
{
$context[‘shop_inv’][‘category’] = (int) $_GET[‘cat’];
$catClause = 'WHERE category = ’ . $context[‘shop_inv’][‘category’];
}
else
{
$context[‘shop_inv’][‘category’] = -1;
$catClause = ‘’;
}
// List of all categories
$context['shop_inv']['categories'] = getCatList();
[/php]
I see that the ‘Uncategorized’ category is ‘0’. I changed the ‘-1’ values in the code to ‘0’ but it didn’t work. It changes the category list to show [uncategorized], but it still loads all of the items, instead of the couple in the ‘uncategorized’ section. Essentially it causes the ‘Uncategorized’ section to be treated as the ‘All’ category. What is the -1 referencing then? And what does the ‘isset’ do? Or more specifically, why does it have the same part twice: ($_GET[‘cat’])
I could not find much at all about the isset code in my book…Thank you very much for any help you can offer.