Author Topic: [MOD] Search between specifyed date  (Read 80602 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Search between specifyed date
« Reply #15 on: June 28, 2003, 04:03:43 AM »
opsy...yes, my bad, was changing it in the browser...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bgmurphy

  • Full Member
  • ***
  • Posts: 113
    • View Profile
[MOD] Search between specifyed date
« Reply #16 on: June 28, 2003, 04:11:48 AM »
v@no -

is the code now corrected to be used by all ???  :D

- bruce

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
[MOD] Search between specifyed date
« Reply #17 on: June 28, 2003, 05:01:30 AM »
im sorry v@no, but this thing really doesn't show the photos of the current day, here's my search.php modified parts:


Code: [Select]
$year_default = 2003;
$year_now = date("Y", time());
$year_start = (isset($HTTP_POST_VARS['year_start']) ) ? intval($HTTP_POST_VARS['year_start']) : ((isset($HTTP_GET_VARS['year_start'])) ? intval($HTTP_GET_VARS['year_start']) : $year_default);
$year_end = (isset($HTTP_POST_VARS['year_end']) ) ? intval($HTTP_POST_VARS['year_end']) : ((isset($HTTP_GET_VARS['year_end'])) ? intval($HTTP_GET_VARS['year_end']) : $year_now);
$month_start = (isset($HTTP_POST_VARS['month_start']) ) ? intval($HTTP_POST_VARS['month_start']) : ((isset($HTTP_GET_VARS['month_start'])) ? intval($HTTP_GET_VARS['month_start']) : 1);
$month_end = (isset($HTTP_POST_VARS['month_end']) ) ? intval($HTTP_POST_VARS['month_end']) : ((isset($HTTP_GET_VARS['month_end'])) ? intval($HTTP_GET_VARS['month_end']) : date("n", time()));
$day_start = (isset($HTTP_POST_VARS['day_start']) ) ? intval($HTTP_POST_VARS['day_start']) : ((isset($HTTP_GET_VARS['day_start'])) ? intval($HTTP_GET_VARS['day_start']) : 1);
$day_end = (isset($HTTP_POST_VARS['day_end']) ) ? intval($HTTP_POST_VARS['day_end']) : ((isset($HTTP_GET_VARS['day_end'])) ? intval($HTTP_GET_VARS['day_end']) : date("j", time()));
$date_start = $year_start."-".$month_start."-".$day_start;
$date_end = $year_end."-".$month_end."-".$day_end;


Code: [Select]
$sql = "SELECT m.image_id, i.image_date
              FROM ".WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m
              LEFT JOIN ".IMAGES_TABLE." i ON (m.image_id = i.image_id)
              WHERE w.word_text LIKE '".addslashes(str_replace("*", "%", $split_words[$i]))."'
              AND m.word_id = w.word_id AND i.image_date >= UNIX_TIMESTAMP('".$date_start."') AND i.image_date <= UNIX_TIMESTAMP('".$date_end."')
              $match_field_sql";


Code: [Select]
$site_template->register_vars(array(
    "search_keywords" => stripslashes($org_search_keywords),
    "year_start" => date_select($year_default, $year_now, $year_start),
    "year_end" => date_select($year_default, $year_now, $year_end),
    "month_start" => date_select(1, 12, $month_start, $lang['month_array']),
    "month_end" => date_select(1, 12, $month_end, $lang['month_array']),
    "day_start" => date_select(1, 31, $day_start),
    "day_end" => date_select(1, 31, $day_end),
    "lang_search_date" => $lang['search_date'],
    "lang_search_date_start" => $lang['search_start'],
    "lang_search_date_end" => $lang['search_end'],


i've followed all the steps and maybe i've forgot to post here some changed part, but i think that this is it.
hope that you can help me on this :)

thanks mate

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Search between specifyed date
« Reply #18 on: June 28, 2003, 03:13:35 PM »
ok, I got it now ;)
*thx to Jan helped trace this little ...*

in Step 1.
replace
Code: [Select]
$date_start = $year_start."-".$month_start."-".$day_start;
$date_end = $year_end."-".$month_end."-".$day_end;

with:
Code: [Select]
$date_start = mktime(0,0,0,$month_start,$day_start,$year_start);
$date_end = mktime(23,59,59,$month_end,$day_end,$year_end);

then, Step 1.2 replace:
Code: [Select]
     $sql = "SELECT m.image_id, i.image_date
              FROM ".WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m
              LEFT JOIN ".IMAGES_TABLE." i ON (m.image_id = i.image_id)
              WHERE i.image_date >= ".$date_start." AND i.image_date <= ".$date_end." AND w.word_text LIKE '".addslashes(str_replace("*", "%", $split_words[$i]))."'
              AND m.word_id = w.word_id
              $match_field_sql";


P.S. original code was updated.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bgmurphy

  • Full Member
  • ***
  • Posts: 113
    • View Profile
[MOD] Search between specifyed date
« Reply #19 on: June 28, 2003, 04:52:35 PM »
thanx V@no / Jan !!

this appears to be why i had problems finding fotos that i loaded on the current day ... at the stroke of midnite .. they would magically appear in the search ....

well no pumpkins heres now

cheers
bruce

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [MOD] Search between specifyed date
« Reply #20 on: March 11, 2005, 09:02:09 AM »
search between specifig date!
which date - date of upload of the picture or date from the IPTC Info?


sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search between specifyed date
« Reply #21 on: March 12, 2005, 01:38:03 AM »
sorry, there is nothing about IPTC...
its about date added to the gallery.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [MOD] Search between specifyed date
« Reply #22 on: March 16, 2005, 03:33:57 PM »
What about search logic with this MOD? When searching by keywords time interval limit my search, but when searching by user name - not...

Offline RuthE

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Discover Kate Gallery
Re: [MOD] Search between specifyed date
« Reply #23 on: July 02, 2005, 02:21:49 PM »
I know this is an older mod, but I really am wanting to get it working. I must have made an error somewhere, because the date searches just don't work. It doesn't return anything regardless of what dates I search. I searched whole years and found nothing, even though I know that's not the case. Maybe someone can help me out ... no clue what i did wrong.

http://www.discoverkate.com/gallery/search.php

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search between specifyed date
« Reply #24 on: July 02, 2005, 04:06:44 PM »
in step 1.2 below the code u've replace add this line:
Code: [Select]
echo $sql;then go and search something, it should show u the query it used on top of the screen. quote it here please.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline RuthE

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Discover Kate Gallery
Re: [MOD] Search between specifyed date
« Reply #25 on: July 02, 2005, 04:19:13 PM »
I wish I had something to quote to you, it appears that it's not searching at all. It comes back with no results regardless of what I enter it seems. Maybe I don't understand how to do the search. I am putting a star in, because I really just want it to show me what was added on certain dates. Is that correct?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search between specifyed date
« Reply #26 on: July 02, 2005, 04:42:36 PM »
there is minimum keyword lenght filter.

anyway, this what I got when searched for "rescue":
Quote
SELECT m.image_id, i.image_date FROM 4images_wordlist w, 4images_wordmatch m LEFT JOIN 4images_images i ON (m.image_id = i.image_id) WHERE w.word_text LIKE 'rescue' AND m.word_id = w.word_id AND i.image_date >= UNIX_TIMESTAMP('946713600') AND i.image_date <= UNIX_TIMESTAMP('1120373999')


I've highlighted the parts that are not supposed to be there, there is no such in the mod's code. are u sure u didnt do something else to it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [MOD] Search between specifyed date
« Reply #27 on: July 02, 2005, 04:44:45 PM »
hy,

is it possible to adapt the mod for  top images?

top.php&month=may for example

:)

ps: sorry for my bad english...

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [MOD] Search between specifyed date
« Reply #28 on: July 04, 2005, 10:45:53 PM »
ok, thx for the code - i ge it alone :)



http://www.hobby-fotografen.at/top.php?


and it works  :) :) :)  :!:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Search between specifyed date
« Reply #29 on: July 05, 2005, 01:39:32 PM »
hi V@no,

... thanks for this helpful MOD ....  :D

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...