is class="pagemenu", the
that holds the icons is class="icons", and the
that holds the credit to my site is class="credit". If you are having a problem, send in a contact form at my site (http://new-place.org/) or post at the CodeGrrl forums (http://codegrrl.com/) and I will try to help. CONFIG VARIABLES ------------------------------------------------*/ $catdir = 'categories'; // the icon categories folder (see step 1) $sort = 'first'; // set 'first' to show newest icons first, 'last' to show newest icons last $getcount = true; // true shows the icon count per category in the menu, and false turns it off $perpage = 20; // the number of icons shown on each page (set to a really high number to turn off pagination) $divider = ' '; // the divider between the numbers and front/back arrows in the page navigation // DO NOT EDIT THE PHP BELOW THIS LINE. Scroll down to edit the text above the menu, and to add your footer. // ---------------------------------------------- // get category folders and sort if (!file_exists($catdir)) { echo 'Error! The folder named ' . $catdir . ', as specified in the config, does not exist in this directory. The value of the variable $catdir must match the name of the created folder (case-sensitive), and that folder must be in this directory for the script to work. Create the folder and put the individual icon category folders inside it.'; exit(); } $getfolders = opendir($catdir); while (($file = readdir($getfolders)) !== false) { if (($file != '.' && $file != '..') && (is_dir($catdir.'/'.$file))) { $cats[] = $file; } } if (!$cats) { echo 'No category folders were found inside the folder named ' . $catdir . '. Create your individual category folders inside that folder and the menu will appear.'; exit(); } natcasesort($cats); // build main menu if ((!$_GET['cat']) || (!in_array($_GET['cat'], $cats))) { ?>
If you'd like any content on your main icon page, above the menu, such as usage rules, resource credits, etc., place it here. It will only show up if a category is not selected. If you don't want anything here, delete this paragraph! To add content that will show up at the top or bottom of every page, put it in the header or footer. To wrap the script in a div, place the opening tag in the header and the closing tag in the footer.
'; foreach ($cats as $value) { $catname = str_replace('_', ' ', $value); echo '' . $catname . ': ' . $count; if ($count == 1) { echo ' icon'; } else { echo ' icons'; } echo '
'; // configure pagination if ((!$perpage) || ($perpage < 1) || (!is_numeric($perpage))) { $perpage = 20; } $pagecalc = ($count / $perpage); $pagecount = ceil($pagecalc); $page = $_GET['page']; if (($page > $pagecount) || ($page == '0')) { $start = 0; } elseif (!$page) { $start = 0; $page = 1; } elseif (!is_numeric($page)) { $start = 0; $page = 1; } else { $start = (($page * $perpage) - $perpage); } $pagearray = array_slice($icons, $start, $perpage); // if there is more than one page, show the page menu if ($pagecount > 1) { if (($page <= $pagecount) && ($page > 1)) { $backpagecalc = ($page - 1); $backpage = '« ' . $divider; } if ($page < $pagecount) { $nextpagecalc = ($page + 1); $nextpage = $divider . ' »'; } echo ' '; } // show the icons echo '';
foreach ($pagearray as $value) {
$iconsize = getimagesize($catdir . '/' . $_GET['cat'] . '/' . $value['name']);
echo ' ';
}
} else {
echo '
There are no icons in this category.'; } echo '
« back
'; } ?>Powered by Icon Sort