Exemplo n.º 1
0
/**
 * Check if mod_rewrite is active and clean up templates cache
 */
function fn_settings_actions_addons_discussion_home_page_testimonials(&$new_value, $old_value)
{
    $dicussion = array();
    $discussion['type'] = $new_value;
    $discussion['object_type'] = 'E';
    $discussion['object_id'] = 0;
    fn_update_discussion($discussion);
    return true;
}
Exemplo n.º 2
0
function fn_exim_products_discussion_import($product_id, $value)
{
    $allow_discussion_type = 'BCRD';
    if (empty($value) || strpos($allow_discussion_type, $value) === false) {
        $value = 'D';
    }
    $product_company_id = db_get_field('SELECT company_id FROM ?:products WHERE product_id = ?i', $product_id);
    if (!empty($product_company_id)) {
        $product_data['company_id'] = $product_company_id;
    } else {
        if (Registry::get('runtime.company_id')) {
            $product_company_id = Registry::get('runtime.company_id');
        }
    }
    $discussion = array('object_type' => 'P', 'object_id' => $product_id, 'type' => $value, 'company_id' => $product_company_id);
    fn_update_discussion($discussion);
    return true;
}
Exemplo n.º 3
0
function fn_create_empty_thread($type, $company_id = null)
{
    $discussion = array('type' => $type, 'object_type' => 'E', 'object_id' => 0);
    if (is_null($company_id)) {
        if (fn_allowed_for('ULTIMATE')) {
            if (!Registry::get('runtime.company_id')) {
                $discussion['for_all_companies'] = 1;
            } else {
                $discussion['company_id'] = Registry::get('runtime.company_id');
            }
        }
    } else {
        $discussion['company_id'] = $company_id;
    }
    if (function_exists('fn_update_discussion')) {
        fn_update_discussion($discussion);
    }
    return true;
}
Exemplo n.º 4
0
function fn_discussion_update_event($event_data, $event_id)
{
    if (empty($event_data['discussion_type'])) {
        return false;
    }
    $discussion = array('object_type' => 'G', 'object_id' => $event_id, 'type' => $event_data['discussion_type']);
    fn_update_discussion($discussion);
}