Olsenfans.com

Your Dutch Fansite for Mary-Kate and Ashley Olsen

Welcome to Olsen Fan! We're your Dutch source for everything Mary-Kate and Ashley Olsen! Please make sure that you return for all of the latest news, photos and projects as we're updating the site on regular basis. We are simply a fansite that posts news found on the internet or given to us but we simply do not claim it as our own copyrighted information. Enjoy your stay! - Marijke

Icons







Lovely Reese Icons








Icon Sort



“). Upload this file. That’s it!

CUSTOMIZATION AND SUPPORT
————————————————
There are a few built in CSS styles to help you style your page. The menu

    is id=”iconmenu”, the category page menu

    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))) {
    ?>

     

    ‘;
    foreach ($cats as $value) {
    $catname = str_replace(‘_’, ‘ ‘, $value);
    echo ‘

  • ‘ . $catname . ‘‘;
    if ($getcount) {
    $icons = array();
    $getcount = opendir($catdir . ‘/’ . $value);
    while (($icon = readdir($getcount)) !== false) {
    if (eregi(“.jpg$|.jpeg$|.gif$|.png$|.bmp$”, $icon)) {
    $icons[] = $value;
    }
    }
    $count = count($icons);
    if ($count == 1) {
    echo ‘ (‘ . $count . ‘ icon)’;
    } else {
    echo ‘ (‘ . $count . ‘ icons)’;
    }
    }
    echo ‘
  • ‘;
    }
    echo ‘

‘;
}

// get icons and sort
if (in_array($_GET[‘cat’], $cats)) {
$icons = array();
$geticons = opendir($catdir.’/’.$_GET[‘cat’]);
while (($icon = readdir($geticons)) !== false) {
if (eregi(“.jpg$|.jpeg$|.gif$|.png$|.bmp$”, $icon)) {
$icons[] = array(“name” => $icon, “modified” => filemtime($catdir . ‘/’ . $_GET[‘cat’] . ‘/’ . $icon));
}
}
$count = count($icons);
if ($count > 0) {
function modcmp($a, $b) {
return strcmp($a[‘modified’], $b[‘modified’]);
}
usort($icons, ‘modcmp’);
if ($sort == ‘first’) {
$icons = array_reverse($icons);
}

// show category name and total icon count
$catname = str_replace(‘_’, ‘ ‘, $_GET[‘cat’]);
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



Leave a Reply

Your email address will not be published. Required fields are marked *

x Close

Like Us On Facebook