Example #1
0
function MG_saveEnroll()
{
    global $_CONF, $_MG_CONF, $_MG_USERPREFS, $_TABLES, $_USER, $LANG_MG03;
    if ($_MG_CONF['member_albums'] != 1) {
        echo COM_refresh($_MG_CONF['site_url'] . '/index.php');
        exit;
    }
    if (!isset($_MG_CONF['member_quota'])) {
        $_MG_CONF['member_quota'] = 0;
    }
    $sql = "SELECT album_id FROM {$_TABLES['mg_albums']} WHERE owner_id=" . (int) $_USER['uid'] . " AND album_parent=" . $_MG_CONF['member_album_root'];
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        $display = MG_siteHeader();
        $display .= COM_showMessageText($LANG_MG03['existing_member_album'], '', true);
        $display .= MG_siteFooter();
        echo $display;
        exit;
    }
    $uid = (int) $_USER['uid'];
    $aid = plugin_user_create_mediagallery($uid, 1);
    $result = DB_query("UPDATE {$_TABLES['mg_userprefs']} SET member_gallery=1,quota=" . $_MG_CONF['member_quota'] . " WHERE uid=" . $uid, 1);
    $affected = DB_affectedRows($result);
    if (DB_error()) {
        $sql = "INSERT INTO {$_TABLES['mg_userprefs']} (uid, active, display_rows, display_columns, mp3_player, playback_mode, tn_size, quota, member_gallery) VALUES (" . $uid . ",1,0,0,-1,-1,-1," . $_MG_CONF['member_quota'] . ",1)";
        DB_query($sql, 1);
    }
    CACHE_remove_instance('menu');
    echo COM_refresh($_MG_CONF['site_url'] . '/album.php?aid=' . $aid);
    exit;
}
Example #2
0
         if (DB_error()) {
             $msg = $LANG_CLASSIFIEDS_2['save_fail'];
         } else {
             $msg = $LANG_CLASSIFIEDS_2['deletion_succes'];
             if (function_exists('CLASSIFIEDS_emailDeleteAd')) {
                 CLASSIFIEDS_emailDeleteAd(stripslashes($A['title']), '', $_REQUEST['ad'], $_USER['uid'], $A['price']);
             }
         }
         echo COM_refresh($_CLASSIFIEDS_CONF['site_url'] . "/index.php?mode=my&msg={$msg}");
         exit;
     }
     break;
 case 'delete':
     if (SEC_hasRights('classifieds.admin')) {
         DB_delete($_TABLES['cl'], 'clid', $_REQUEST['clid']);
         if (DB_affectedRows('') == 1) {
             $msg = $LANG_CLASSIFIEDS_2['deletion_succes'];
         } else {
             $msg = $LANG_CLASSIFIEDS_2['deletion_fail'];
         }
         // delete complete, return to ad list
         echo COM_refresh($_CONF['site_url'] . "/admin/plugins/classifieds/index.php?msg={$msg}");
     }
     exit;
     break;
 case 'save':
     $missingfields = CLASSIFIEDS_missingField($_REQUEST);
     if ($missingfields != '') {
         $display .= COM_startBlock($LANG_CLASSIFIEDS_2['error']);
         $display .= $LANG_CLASSIFIEDS_2['missing_field'];
         $display .= '<ul>';
Example #3
0
function CMT_updateCommentcodes()
{
    global $_CONF, $_TABLES;
    $cleared = 0;
    if ($_CONF['comment_close_rec_stories'] > 0) {
        $results = DB_query("SELECT sid FROM {$_TABLES['stories']} ORDER BY date DESC LIMIT " . (int) $_CONF['comment_close_rec_stories']);
        while ($A = DB_fetchArray($results)) {
            $allowedcomments[] = $A['sid'];
        }
        //update comment codes.
        $sql = '';
        if (is_array($allowedcomments)) {
            foreach ($allowedcomments as $sid) {
                $sql .= "AND sid <> '" . DB_escapeString($sid) . "' ";
            }
            $sql = "UPDATE {$_TABLES['stories']} SET commentcode = 1 WHERE commentcode = 0 " . $sql;
            $result = DB_query($sql, 1);
            if (DB_affectedRows($result) > 0) {
                CACHE_remove_instance('story_');
                $cleared = 1;
            }
        }
    }
    $sql = "UPDATE {$_TABLES['stories']} SET commentcode = 1 WHERE UNIX_TIMESTAMP(comment_expire) < UNIX_TIMESTAMP() AND UNIX_TIMESTAMP(comment_expire) <> 0";
    $result = DB_query($sql, 1);
    if ($cleared == 0) {
        if (DB_affectedRows($result) > 0) {
            CACHE_remove_instance('story_');
        }
    }
}
function bb2_db_affected_rows()
{
    return DB_affectedRows();
}
Example #5
0
                 //Create mode
                 $sql = "INSERT INTO {$_TABLES['paypal_shipping_cost']} SET {$sql} ";
             }
             DB_query($sql);
             if (DB_error()) {
                 $msg = $LANG_PAYPAL_1['save_fail'];
             } else {
                 $msg = $LANG_PAYPAL_1['save_success'];
             }
             echo COM_refresh($_CONF['site_admin_url'] . '/plugins/paypal/index.php?mode=shipping&amp;msg=' . urlencode($msg));
             exit;
             break;
         case 'delete_shipping_cost':
             //delete shipping cost
             DB_delete($_TABLES['paypal_shipping_cost'], 'shipping_id', $shipping_id);
             if (DB_affectedRows('') >= 1) {
                 $msg = $LANG_PAYPAL_1['deletion_succes'];
             } else {
                 $msg = $LANG_PAYPAL_1['deletion_fail'];
             }
             // delete complete, return to shipping page
             echo COM_refresh($_CONF['site_admin_url'] . '/plugins/paypal/index.php?mode=shipping&amp;msg=' . urlencode($msg));
             exit;
             break;
         default:
             PAYPAL_reorderShippingTo();
             $display .= PAYPAL_shippingServices();
             break;
     }
     break;
 default: