Good day to all.
If respected Admins will decide that this is the MOD. Replace this to Mods & Plugins (Releases & Support) topic.
Description:
This mod will show you photos by three days, last week, last 30 days and last year since current date.
Installation:
1. In search.php
find:
if ($search_new_images && $show_result == 1) {
$search_id['search_new_images'] = 1;
}
add after:
if ($search_new_images == 3) {
$search_id['search_new_images'] = 3;
}
if ($search_new_images == 7) {
$search_id['search_new_images'] = 7;
}
if ($search_new_images == 30) {
$search_id['search_new_images'] = 30;
}
if ($search_new_images == 365) {
$search_id['search_new_images'] = 365;
}
1.2 find:
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
}
add after:
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 3) {
$new_cutoff = time() - 60 * 60 * 24 * 3;
$sql_where_query .= "AND i.image_date >= $new_cutoff";
}
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 7) {
$new_cutoff = time() - 60 * 60 * 24 * 7;
$sql_where_query .= "AND i.image_date >= $new_cutoff";
}
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 30) {
$new_cutoff = time() - 60 * 60 * 24 * 30;
$sql_where_query .= "AND i.image_date >= $new_cutoff";
}
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 365) {
$new_cutoff = time() - 60 * 60 * 24 * 365;
$sql_where_query .= "AND i.image_date >= $new_cutoff";
}
2. In includes/page_header:
find:
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
add after:
"url_new_images_tree" => $site_sess->url(ROOT_PATH."search.php?search_new_images=3"),
"url_new_images_week" => $site_sess->url(ROOT_PATH."search.php?search_new_images=7"),
"url_new_images_month" => $site_sess->url(ROOT_PATH."search.php?search_new_images=30"),
"url_new_images_year" => $site_sess->url(ROOT_PATH."search.php?search_new_images=365"),
3. In home.html:
insert when you need:
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=3")?>"><b>Last 3 Days Photos</b></a>
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=7")?>"><b>Last 7 Days Photos</b></a>
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=30")?>"><b>Last 30 Days Photos</b></a>
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=365")?>"><b>Last 365 Days Photos</b></a>
This is all..
ONE QUESTION. Anyone have idea how it realize to sort by image hits????