1. Osclass Forum
  2. Other
  3. Search on publish date and after 14 days email user about op...

Search on publish date and after 14 days email user about options

Started by smos, October 13, 2021, 6:05 pm

smos

@Calinbehtuk


Thanks but now i am confused ;-) Does this have to be in model like for instance:

Code: [Select]
​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:

Code: [Select]


Code: [Select]
  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');

      }
    }



calinbehtuk

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.

smos

@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?


  • << Last edit: October 26, 2021, 7:54 pm by smos >>
  • Quote

calinbehtuk

You can use the contact page. Send all the request, explained as well you can, and i will give you a fee.

Subscribe
X

Subscribe!

Subscribe to get the latest listings, updates and special offers delivered directly in your inbox.