Beispiel #1
0
 function galleryList()
 {
     global $DBCOUNT;
     if ($this->searchErr) {
         return array();
     }
     $img = array();
     if ($imageList = imageList(($this->pageNmber - 1) * $this->imgOnPage, $this->imgOnPage, 'added', 'ASC', $this->searchFor)) {
         foreach ($imageList as $k => $image) {
             $img[] = array('thumbSmallUrl' => imageAddress(3, $image, "dt"), 'thumbLink' => imageAddress(2, $image, "pm"), 'imageAlt' => $image['alt'] != "" ? $image['alt'] : $image['name'], 'id' => $image['id']);
         }
         // endfor
     }
     $this->imagesFound = $DBCOUNT;
     return $img;
 }
Beispiel #2
0
$orderby_url = $orderBy == 'added' ? '' : '&orderBy=' . $orderBy;
// sort order
$order = isset($_GET['order']) ? 'ASC' : 'DESC';
$order_url = $order == 'DESC' ? '' : '&order=' . $order;
// what info to show from last reset or all time
$allTime = isset($_GET['v']) ? true : false;
$allTime_url = $allTime ? '&v=allTime' : '';
// ip search
$ipSearch = isset($_GET['ip']) ? true : false;
$ipSearch_url = $ipSearch ? '&ip=' . $_GET['ip'] : '';
//make image list
$list_item = '';
// hold pagination html
$pagination = '';
// Check for images in database
if ($db_img = imageList(0, 'all')) {
    // workout the last reset date
    if ($settings['SET_BANDWIDTH_RESET'] == 'm') {
        $resetdate = strtotime('01 ' . date('M Y'));
    } else {
        $resetdate = strtotime('last monday', strtotime('tomorrow'));
    }
    // add bandwidth & counter to image DB
    foreach ($db_img as $k => $v) {
        // ip search
        if ($ipSearch && $_GET['ip'] != $v['ip']) {
            unset($db_img[$k]);
            $DBCOUNT--;
            continue;
        }
        if (!($hc = db_imageCounterList(null, $v['id']))) {
Beispiel #3
0
// Gallery
if ($settings['SET_HIDE_TOS']) {
    echo '<url><loc>' . $settings['SET_SITEURL'] . '/tos.php</loc></url>';
}
// TOS
if ($settings['SET_HIDE_FAQ']) {
    echo '<url><loc>' . $settings['SET_SITEURL'] . '/faq.php</loc></url>';
}
// FAQ
if ($settings['SET_HIDE_CONTACT']) {
    echo '<url><loc>' . $settings['SET_SITEURL'] . '/contact.php</loc></url>';
}
// Contact
if ($settings['SET_HIDE_GALLERY']) {
    // get images & set $DBCOUNT
    $imageList = imageList(0, 'all');
    // get image list from db
    // list gallery pages
    $link_mod = !$settings['SET_MOD_REWRITE'] ? '/gallery.php?p=' : '/gallery/page';
    $ex_var = !$settings['SET_MOD_REWRITE'] ? '' : '.html';
    $number_of_pages = ceil($DBCOUNT / $settings['SET_IMG_ON_PAGE']);
    if ($number_of_pages * $settings['SET_IMG_ON_PAGE'] < $DBCOUNT) {
        $number_of_pages++;
    }
    for ($i = 1; $i <= $number_of_pages; $i++) {
        echo "<url>";
        echo "<loc>" . $settings['SET_SITEURL'] . $link_mod . $i . $ex_var . "</loc>";
        echo "</url>";
    }
    // list image pages
    foreach ($imageList as $k => $image) {
Beispiel #4
0
/**
 * autoDeleted()
 * Automatic remove images if they have not be viewed for some time
 */
function autoDeleted()
{
    global $settings;
    // check auto remove image is on
    if (!check_set('SET_AUTO_DELETED')) {
        return;
    }
    // make file name
    $checkfor = CFDATAPATH . 'ad' . date($settings['SET_AUTO_DELETED_JUMP']);
    // check to see if it's been run for this time period
    if (is_file($checkfor)) {
        return;
    }
    // get image index
    $db_img = imageList(0, 'all');
    // check image index for images
    if (empty($db_img) || count($db_img) < 1) {
        return;
    }
    $delete_time = time() - $settings['SET_AUTO_DELETED_TIME'] * 86400;
    // check when image was last viewed
    foreach ($db_img as $k => $image) {
        // check to see if the image has been uploaded for long then the period
        if ($delete_time > $image['added']) {
            // image viewed db address
            $img_view_db = CFBANDWIDTHPATH . $image['id'] . '_imgbw.db';
            // check to see if there is a images viewed db file
            if (is_file($img_view_db)) {
                // read files last modified date (as this is most likely the last viewed date)
                if ($last_modified = filemtime($img_view_db)) {
                    // check to see if it has not been view for the period
                    if ($delete_time > $last_modified) {
                        $delete_id[$image['id']] = array('deleteid' => $image['deleteid']);
                        // add image to remove array
                    }
                } else {
                    $db_count = db_imageCounterList(null, $image['id']);
                    if (isset($db_count['date'])) {
                        if ($delete_time > $db_count['date']) {
                            $delete_id[$image['id']] = array('deleteid' => $image['deleteid']);
                            // add image to remove array
                        }
                    }
                }
            } else {
                $delete_id[$image['id']] = array('deleteid' => $image['deleteid']);
                // add image to remove array
            }
        }
    }
    //remove images
    if (!empty($delete_id)) {
        foreach ($delete_id as $k => $image) {
            removeImage($image['deleteid']);
        }
    }
    // remove image removed meg
    $Suc = array();
    // make lasted checked file
    if (savefile(array(), CFDATAPATH . 'ad' . date($settings['SET_AUTO_DELETED_JUMP']))) {
        // check for old file
        if (is_file(CFDATAPATH . 'ad' . (date($settings['SET_AUTO_DELETED_JUMP']) - 1))) {
            // remove old file if found
            @unlink(CFDATAPATH . 'ad' . (date($settings['SET_AUTO_DELETED_JUMP']) - 1));
        }
    }
}
Beispiel #5
0
?>
</title>
			<link><?php 
echo $settings['SET_SITEURL'];
?>
</link>
			<description><?php 
echo _T("feed_description");
?>
</description>
			<language><?php 
echo _T("feed_language");
?>
</language>
	<?php 
if ($settings['SET_HIDE_GALLERY'] && ($imageList = imageList(0, 10))) {
    foreach ($imageList as $k => $image) {
        $date = date('Y-m-d\\TH:i:s\\Z', $image['added']);
        $url = imageAddress(2, $image, "pm");
        $thumb_url = imageAddress(3, $image, "dt");
        $img_ext = $image['ext'];
        if ($img_ext == 'jpg') {
            $img_ext = 'jpeg';
        }
        ?>
				<entry>
					<title><?php 
        echo $image['alt'];
        ?>
</title>
					<link rel="alternate" type="text/html" href="<?php