Re: Search on publish date and after 14 days email user about options
on :October 26, 2021, 7:34 pm #555
@Calinbehtuk
Thanks but now i am confused ;-) Does this have to be in model like for instance:
public function get_dates14days_old($item_id, $date, $days, $contact) {
$this->dao->from($this->getTable_Item());
$date = date('Y-m-d H:i:s');
$days = 14;
$mSearch = new Search(false);
$mSearch->addItemConditions(sprintf("%st_item.dt_pub_date + INTERVAL '$days' DAY < '$date'"));
$aItems = $mSearch->doSearch();
$iTotalItems = $mSearch->count();
if ($iTotalItems > 0) {
$aSet= array(
'pk_i_id' => $item_id,
'dt_pub_date' => $today,
's_contact_email' => $contact );
if( !$result) { return array(); }
$result = $result->result();
return $result->dao->get( $result->getTable_Item(),$aSet);
}
And then in some other file that i call by cron job on my host:
function get_dates14days_old() {
$data = ModelBO::newInstance()->get_dates14days_old($item_id, $today, $contact);
if ($iTotalItems > 0) {
foreach ($aItems as $item) {
$item = Item::newInstance()->findByPrimaryKey($item['pk_i_id']);
osc_add_hook('bo_mgr_status_email','$item');
}
}
Re: Search on publish date and after 14 days email user about options
on :October 26, 2021, 7:39 pm #556
No. You can retrieve information from the database in multiple ways. I just offer you the most simple solution using the search class. But again this will not help you because is not enough just to retrieve that information. How I told you, you will repeat the same process on every cron and you will send the same message again and again.
You need a custom plugin that will insert some records about each item. Is not so simple how you think.
Re: Search on publish date and after 14 days email user about options
on :October 26, 2021, 7:52 pm #557
@Calinbehtuk
I know you are capable to make this plugin because i see more nice plugins and got help from you.
is it possible to make this for a price?
How can we contact each other?
Re: Search on publish date and after 14 days email user about options
on :October 27, 2021, 8:29 pm #558
You can use the contact page. Send all the request, explained as well you can, and i will give you a fee.