ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Ignore:
Timestamp:
May 5, 2008, 5:12:30 PM (12 years ago)
Author:
ogawa
Message:

merged stable-2.12.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ogawa/renew_OpenPNE_Auth/webapp/modules/admin/lib/db_admin.php

    r6799 r6963  
    295295        $params[] = $type;
    296296    }
     297    $sql .= ' ORDER BY c_banner_id';
    297298    return db_get_all($sql, $params);
    298299}
     
    443444function db_admin_delete_c_image_link4image_filename($image_filename)
    444445{
    445     // c_banner (削除)
    446     $sql = 'DELETE FROM c_banner WHERE image_filename = ?';
    447     $params = array($image_filename);
    448     db_query($sql, $params);
    449 
    450     // c_commu
    451     $tbl = 'c_commu';
    452     _db_admin_empty_filename($tbl, $image_filename);
    453 
    454     // c_commu_topic_comment
    455     $tbl = 'c_commu_topic_comment';
    456     _db_admin_empty_filename($tbl, $image_filename, 'image_filename1');
    457     _db_admin_empty_filename($tbl, $image_filename, 'image_filename2');
    458     _db_admin_empty_filename($tbl, $image_filename, 'image_filename3');
    459 
    460     // c_diary
    461     $tbl = 'c_diary';
    462     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_1');
    463     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_2');
    464     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_3');
    465 
    466     // c_diary_comment
    467     $tbl = 'c_diary_comment';
    468     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_1');
    469     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_2');
    470     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_3');
    471 
    472     // c_member
    473     $tbl = 'c_member';
    474     _db_admin_empty_filename($tbl, $image_filename);
    475     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_1');
    476     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_2');
    477     _db_admin_empty_filename($tbl, $image_filename, 'image_filename_3');
     446    $_pos = strpos($image_filename, '_');
     447    $prefix = substr($image_filename, 0, $_pos);
     448
     449    if ($prefix == 'b') {
     450        $sql = 'DELETE FROM c_banner WHERE image_filename = ?';
     451        $params = array($image_filename);
     452        db_query($sql, $params);
     453    }
     454
     455    if ($prefix == 'c') {
     456        $tbl = 'c_commu';
     457        _db_admin_empty_image_filename($tbl, $image_filename);
     458    }
     459
     460    if ($prefix == 't' || $prefix == 'tc') {
     461        $tbl = 'c_commu_topic_comment';
     462        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename1');
     463        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename2');
     464        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename3');
     465    }
     466
     467    if ($prefix == 'd') {
     468        $tbl = 'c_diary';
     469        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     470        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     471        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     472    }
     473
     474    if ($prefix == 'dc') {
     475        $tbl = 'c_diary_comment';
     476        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     477        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     478        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     479    }
     480
     481    if ($prefix == 'm') {
     482        $tbl = 'c_member';
     483        _db_admin_empty_image_filename($tbl, $image_filename);
     484        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     485        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     486        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     487    }
     488
     489    if ($prefix == 'ms') {
     490        $tbl = 'c_message';
     491        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     492        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     493        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     494    }
    478495}
    479496
     
    683700    // 終了ポイント
    684701    if (!empty($cond_list['e_point'])) {
    685         $sql .= ' AND value <= ?';
     702        $sql .= ' AND value < ?';
    686703        $params[] = $cond_list['e_point'];
    687704    }
Note: See TracChangeset for help on using the changeset viewer.