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

Changeset 6938


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

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

File:
1 edited

Legend:

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

    r6905 r6938  
    443443function db_admin_delete_c_image_link4image_filename($image_filename)
    444444{
    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');
    478 
    479     // c_message
    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');
     445    $_pos = strpos($image_filename, '_');
     446    $prefix = substr($image_filename, 0, $_pos);
     447
     448    if ($prefix == 'b') {
     449        $sql = 'DELETE FROM c_banner WHERE image_filename = ?';
     450        $params = array($image_filename);
     451        db_query($sql, $params);
     452    }
     453
     454    if ($prefix == 'c') {
     455        $tbl = 'c_commu';
     456        _db_admin_empty_image_filename($tbl, $image_filename);
     457    }
     458
     459    if ($prefix == 't' || $prefix == 'tc') {
     460        $tbl = 'c_commu_topic_comment';
     461        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename1');
     462        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename2');
     463        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename3');
     464    }
     465
     466    if ($prefix == 'd') {
     467        $tbl = 'c_diary';
     468        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     469        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     470        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     471    }
     472
     473    if ($prefix == 'dc') {
     474        $tbl = 'c_diary_comment';
     475        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     476        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     477        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     478    }
     479
     480    if ($prefix == 'm') {
     481        $tbl = 'c_member';
     482        _db_admin_empty_image_filename($tbl, $image_filename);
     483        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     484        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     485        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     486    }
     487
     488    if ($prefix == 'ms') {
     489        $tbl = 'c_message';
     490        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_1');
     491        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_2');
     492        _db_admin_empty_image_filename($tbl, $image_filename, 'image_filename_3');
     493    }
    484494}
    485495
Note: See TracChangeset for help on using the changeset viewer.