Advertisement:

Author Topic: [SOLVED]How to change an AD state to BLOCKED just after published  (Read 3441 times)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How to change an AD state to BLOCKED just after published
« Reply #15 on: September 12, 2014, 09:24:23 pm »
Nope, not possible. I'm done here, please add [SOLVED] to the title of this thread.

Regards

Nuwan2014

  • Newbie
  • *
  • Posts: 11
Re: How to change an AD state to BLOCKED just after published
« Reply #16 on: September 12, 2014, 09:29:01 pm »
Thank you very much Teseo..you did a nice work and you save me from big troubles and I am 100% satisfied about the solution. Thank you again to your kind support ;D


teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [SOLVED]How to change an AD state to BLOCKED just after published
« Reply #17 on: September 13, 2014, 12:41:25 am »
Just occurred to me a way to do that redirection, I think this is the definitive code:

Code: [Select]
<?php
function cust_disable_posted_item($item) {

    
$dItem = new ItemActions(false);
    
$dItem->disable($item['pk_i_id']);

    
osc_add_flash_ok_message('Your ad will be published after admin\'s approval');
    
osc_redirect_to(osc_base_url());
}

osc_add_hook('posted_item''cust_disable_posted_item');
osc_add_hook('edited_item''cust_disable_posted_item');

function 
cust_approved_item_mail($id) {

    
$eItem Item::newInstance()->findByPrimaryKey($id);
    
View::newInstance()->_exportVariableToView('item'$eItem);

    
fn_email_new_item_non_register_user($eItem);
}

osc_add_hook('enable_item''cust_approved_item_mail');
?>



Regards

Nuwan2014

  • Newbie
  • *
  • Posts: 11
Re: [SOLVED]How to change an AD state to BLOCKED just after published
« Reply #18 on: September 27, 2014, 08:40:56 am »
Hi Teseo,

That works as well...100% complete solution..Thank you very much. ;D

Wish you all the best