Support Forums - Classified Ads Script Osclass

Osclass plugin support => General plugins discussion => Topic started by: Bhagwati Suthar on August 17, 2024, 08:28:25 AM

Title: Need set value if post is spam or not on hook after post ad
Post by: Bhagwati Suthar on August 17, 2024, 08:28:25 AM
May be this hook is used after post ad
osc_add_hook('posted_item', 'check_item_spam');

function check_item_spam($xyz) {
   
    if ($is_spam) {
    // Code to be executed if the condition is true
    Set item value to spam ( ad not live)
} else {
    // Code to be executed if the condition is false.
  Set value is not spam(ad will live on site)
}
   
}

Need help, how to set based on this example. Set value if item is spam of posted item.
Title: Re: Need set value if post is spam or not on hook after post ad
Post by: MB Themes on August 19, 2024, 10:34:35 AM
You can use itemactions

Code: [Select]
$manager = new ItemActions(false);
$manager->spam($item_id, true);
Title: Re: Need set value if post is spam or not on hook after post ad
Post by: Bhagwati Suthar on August 19, 2024, 02:46:52 PM
Thankyou so much, working.