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

Changeset 6937


Ignore:
Timestamp:
May 2, 2008, 9:20:13 PM (12 years ago)
Author:
ebihara
Message:

#2350:とりあえずプレフィックスに応じた画像のリンクを削除するように修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.10.x/webapp/modules/admin/lib/db_admin.php

    r6903 r6937  
    434434function db_admin_delete_c_image_link4image_filename($image_filename)
    435435{
    436     // c_banner (削除)
    437     $sql = 'DELETE FROM c_banner WHERE image_filename = ?';
    438     $params = array($image_filename);
    439     db_query($sql, $params);
    440 
    441     // c_commu
    442     $tbl = 'c_commu';
    443     _db_admin_empty_image_filename($tbl, $image_filename);
    444 
    445     // c_commu_topic_comment
    446     $tbl = 'c_commu_topic_comment';
    447     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename1');
    448     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename2');
    449     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename3');
    450 
    451     // c_diary
    452     $tbl = 'c_diary';
    453     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
    454     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
    455     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
    456 
    457     // c_diary_comment
    458     $tbl = 'c_diary_comment';
    459     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
    460     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
    461     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
    462 
    463     // c_member
    464     $tbl = 'c_member';
    465     _db_admin_empty_image_filename($tbl, $image_filename);
    466     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
    467     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
    468     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
    469 
    470     // c_message
    471     $tbl = 'c_message';
    472     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
    473     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
    474     _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     436    $_pos = strpos($image_filename, '_');
     437    $prefix = substr($image_filename, 0, $_pos);
     438
     439    if ($prefix == 'b') {
     440        $sql = 'DELETE FROM c_banner WHERE image_filename = ?';
     441        $params = array($image_filename);
     442        db_query($sql, $params);
     443    }
     444
     445    if ($prefix == 'c') {
     446        $tbl = 'c_commu';
     447        _db_admin_empty_image_filename($tbl, $image_filename);
     448    }
     449
     450    if ($prefix == 't' || $prefix == 'tc') {
     451        $tbl = 'c_commu_topic_comment';
     452        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename1');
     453        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename2');
     454        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename3');
     455    }
     456
     457    if ($prefix == 'd') {
     458        $tbl = 'c_diary';
     459        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     460        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     461        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     462    }
     463
     464    if ($prefix == 'dc') {
     465        $tbl = 'c_diary_comment';
     466        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     467        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     468        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     469    }
     470
     471    if ($prefix == 'm') {
     472        $tbl = 'c_member';
     473        _db_admin_empty_image_filename($tbl, $image_filename);
     474        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     475        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     476        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     477    }
     478
     479    if ($prefix == 'ms') {
     480        $tbl = 'c_message';
     481        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     482        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     483        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     484    }
    475485}
    476486
Note: See TracChangeset for help on using the changeset viewer.