if ($story->published() >= $story->expired()) { $story->setExpired(0); } $story->audienceid = intval($_POST['audience']); } elseif ($xoopsModuleConfig['autoapprove'] == 1 && !$approveprivilege) { $approve = 1; $story->setPublished(time()); $story->setExpired(0); $story->setTopicalign('R'); } else { $story->setPublished(0); $approve = 0; $story->setExpired(0); } $story->setApproved($approve); $result = $story->store(); if ($result) { // Notification $notification_handler =& xoops_gethandler('notification'); $tags = array(); $tags['STORY_NAME'] = $story->title(); $tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid(); if ($approve == 1 && $oldapprove == 0 && $story->published <= time()) { $notification_handler->triggerEvent('global', 0, 'new_story', $tags); } elseif ($approve != 1) { $tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=edit&storyid=' . $story->storyid(); $notification_handler->triggerEvent('global', 0, 'story_submit', $tags); // If notify checkbox is set, add subscription for approve if ($notifypub) { include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; $notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);