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

Changeset 1195


Ignore:
Timestamp:
Dec 15, 2006, 2:28:49 PM (14 years ago)
Author:
takanashi
Message:

#323 NoImageをデフォルトに戻す機能

Location:
OpenPNE/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/setup/sql/update/mysql40/update13-for2.5.7_create_table_c_holiday.sql

    r1187 r1195  
    11CREATE TABLE `c_holiday` (
    22  `c_holiday_id` int(11) NOT NULL auto_increment,
    3   `name` text collate utf8_unicode_ci NOT NULL,
     3  `name` text NOT NULL,
    44  `month` int(11) NOT NULL,
    55  `day` int(11) NOT NULL,
    66  PRIMARY KEY  (`c_holiday_id`)
    77) ENGINE=MyISAM;
     8
     9alter table c_sns_config ADD COLUMN bg_14 text NOT NULL after bg_13;
     10UPDATE c_sns_config SET bg_14 = 'FFFFFF';
  • OpenPNE/trunk/setup/sql/update/mysql41/update13-for2.5.7_create_table_c_holiday.sql

    r1187 r1195  
    66  PRIMARY KEY  (`c_holiday_id`)
    77) ENGINE=MyISAM DEFAULT CHARSET=utf8;
     8
     9alter table c_sns_config ADD COLUMN bg_14 text NOT NULL after bg_13;
     10UPDATE c_sns_config SET bg_14 = 'FFFFFF';
  • OpenPNE/trunk/webapp/lib/db/etc.php

    r1187 r1195  
    661661}
    662662
     663/**
     664 * デフォルト画像をマスター画像からコピー(デフォルトに戻すの一環)
     665 */
     666function db_master_copy_c_skin_filename($skinname)
     667{
     668
     669    $data = array(
     670        'skinname' => strval($skinname),
     671        'filename' => 'skin_'.strval($skinname).'.gif',
     672    );
     673    db_insert('c_skin_filename', $data);
     674
     675    $sql = "INSERT INTO c_image (SELECT '', ?, bin, ?, type FROM c_image WHERE filename = ?)";
     676    $params = array(
     677        'skin_'.strval($skinname).'.gif',
     678        db_now(),
     679        'skin_'.strval($skinname).'_master.gif',
     680    );
     681    db_query($sql, $params);
     682}
     683
    663684//---
    664685
  • OpenPNE/trunk/webapp/modules/admin/do/delete_skin_image.php

    r2 r1195  
    1212        db_delete_c_skin_filename($requests['skinname']);
    1313
     14        //マスタ-画像からコピーするスキン名
     15        $skinname_list = array(
     16            'no_image',
     17            'no_logo',
     18            'no_logo_small',
     19        );
     20        if (in_array($requests['skinname'], $skinname_list)) {
     21            db_master_copy_c_skin_filename($requests['skinname']);
     22        }
     23
    1424        admin_client_redirect('edit_skin_image', '画像をデフォルトに戻しました');
    1525    }
  • OpenPNE/trunk/webapp/modules/admin/templates/edit_skin_image.tpl

    r278 r1195  
    508508({assign var=skinname value=no_image})
    509509<img src="({t_img_url_skin filename=$skinname w=180 h=180})">
     510({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    510511</td>
    511512<td class="skin_image">
    512513({assign var=skinname value=no_logo})
    513514<img src="({t_img_url_skin filename=$skinname w=180 h=180})">
     515({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    514516</td>
    515517<td class="skin_image">
    516518({assign var=skinname value=no_logo_small})
    517519<img src="({t_img_url_skin filename=$skinname w=76 h=76})">
     520({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    518521</td>
    519522</tr>
Note: See TracChangeset for help on using the changeset viewer.