PHP_CGIの最近のブログ記事
(2週間から1年に)
services/userservice.php の line:21 あたり
var $cookietime = 31536000; // 1 year
Fatal error: Maximum execution time of 30 seconds exceeded
php.ini 設定
デフォルトで30秒
max_execution_time
または、php.iniで無制限設定 0 にして
スクリプトで
set_time_limit(60);
Koshoten.net2でもosCommerceの同じ機能を使用しているので同じことになります。
これは、admin/includes/functions/general.phpの974行目を次のように変更することで対応できます。
tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . ", products_status = '1' where products_id = '" . $order['products_id'] . "'");
これで注文データを削除する際に「在庫数を元に戻す」チェックを入れていれば、同時にステータスが在庫ありとなります。
http://www.koshoten.net/k2/modules/icontent/index.php?page=13
<form enctype="multipart/form-data" action="" method="POST" accept-charset="utf-8">
<input type="hidden" name="dummy" value="�"><!-- IEにaccept-charsetを理解させるおまじない -->
★SQL実行
INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )
VALUES (
'', 'max products per page admin-side', 'MAX_PROD_ADMIN_SIDE', '30', 'Maximum numba of products per page in administration panel', '3', NULL , '2003-11-10 14:54:12', '2003-11-10 14:54:12', NULL , NULL
);
-----------------------------------
admin/categories.phpカスタマイズ
★781行目に挿入
<?php
$categories_count = 0;
<?php
#QUERY TO KNOW THE MAX_PROD_ADMIN_SIDE
$max_prod_admin_side_q=tep_db_query("select configuration_value FROM configuration WHERE configuration_key='MAX_PROD_ADMIN_SIDE'");
$max_prod_admin_side=(tep_db_fetch_array($max_prod_admin_side_q));
#
$lmt=$max_prod_admin_side['configuration_value'];
#
$categories_count = 0;
★818行目
$products_count = 0;
if ($HTTP_GET_VARS['search']) {
$products_count = 0;
if (! $limite_1){
$limite_1=0;
}
if (! $limite_2){
$limite_2=$lmt;
}
if ($HTTP_GET_VARS['search']) {
★824行目
} else {
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");
}
} else {
if (! $limite_1 & ! $limite_2)
{
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");
}
else
{
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name LIMIT $limite_1, $limite_2 ");
}
}
★874行目
<tr>
<td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<tr>
<td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td colspan="3" class="smallText">
<?
if ( $cPath){
$num_prod=tep_db_query("SELECT * from products_to_categories where categories_id=$cPath");
$np=mysql_num_rows($num_prod);
echo "<b><font=1>NUMERO TOTALE DI ARTICOLI PER QUESTA CATEGORIA</font></b>\n".$np;
}
?></td>
</tr>
<tr>
<td colspan="3" class="smallText">
<?
if ( $cPath){
$records_per_page=$lmt;
$page_num=round(($np/$records_per_page),0);
echo "go to page: ";
$lim_1=0;
$lim_2=$lmt;
for ($i=0; $i <= $page_num; $i++)
{
$a=$i+1;
echo "<a href=categories.php?cPath=$cPath&limite_1=$lim_1&limite_2=$lim_2>".$a."</a>|";
$lim_1=$lim_1+$lim_2;
}
}
?>
</td>
</tr>
<tr>
---------------------------------------------
Add UPC numbers, SKUs, ISBN/ISSN, etc
http://www.oscommerce.com/community/contributions,126
This example uses prodct UPC. you can change it to use SKU, ISBN, or whatever you choose.
You can adjust the length of the number of characters in the varchar from 12 to whatever you choose.
If you use something other than UPC, you will also have to alter the "insert" statement and replace UPC with whatever.
Add_ISBN_UPC_SKU_v1.zip
SYSTEM REQUIREMENTS
Ensure your server/hosting account meets the following
1.FFMPEG
2.LAME MP3
3.FFMPEG-PHP
4.FLVTOOL2
5.MPLAYER
6.MENCODER
7.ALL PHP requirements setout here
なので、
まずFFMPEGのインストール
livnaのレポジトリを追加
# wget http://livna-dl.reloumirrors.net/fedora/7/i386/livna-release-7-2.noarch.rpm
# rpm -Uvh livna-release-7-2.noarch.rpm
yumのデフォルトで有効にならないように設定
# vi /etc/yum.repos.d/livna.repo
enabled = 1
↓
enabled = 0
ffmpegのインストール
# yum --enablerepo=livna install ffmpeg
Running Transaction
Installing: libogg
Installing: libvorbis
Installing: libtheora
Installing: libid3tag
Installing: xvidcore
Installing: giflib
Installing: imlib2
Installing: faad2
Installing: a52dec
Installing: gsm
Installing: lame-libs
Installing: SDL
Installing: x264
Installing: libmp4v2
Installing: faac
Installing: libdca
Installing: ffmpeg-libs
Installing: ffmpeg
次にlameのインストール
# yum --enablerepo=livna install lame
Running Transaction
Installing: lame
ffmpeg-phpのインストール
# yum -y install php-devel
# wget http://jaist.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
# tar jxvf ffmpeg-php-0.5.1.tbz2
# cd ffmpeg-php-0.5.1
# phpize
# ./configure
ffmpegが?enable-sharedでコンパイルされていないのでエラー
subversionでコンパイルしなおす。
# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
# cd ffmpeg
# ./configure ?enable-shared
# make
# make install
再度configure
# cd ffmpeg-php-0.5.1
# phpize
# ./configure
# make
# make install
php.ini に extension=ffmpeg.so を追加
Apache再起動
FLVTOOL2のインストール
rubyが必要なのでインストール
# yum -y install ruby
Running Transaction
Installing: ruby-libs
Installing: ruby
FreshrpmsにFedora7用があるのでインストール
# wget ftp://rpmfind.net/linux/freshrpms/fedora/linux/7/flvtool2/flvtool2-1.0.6-1.fc7.noarch.rpm
# rpm -Uvh flvtool2-1.0.6-1.fc7.noarch.rpm
MPLAYERのインストール
# yum --enablerepo=livna install mplayer
Running Transaction
Installing: libXv
Installing: libXvMC
Installing: mesa-libGLU
Installing: freeglut
Installing: libcaca
Installing: libXxf86dga
Installing: cdparanoia-libs
Installing: speex
Installing: libdv
Installing: lirc
Installing: libdvdnav
Installing: fribidi
Installing: enca
Installing: libdvdread
Installing: libmpcdec
Installing: aalib
Installing: lzo
Installing: mplayer
MENCODERのインストール
# yum --enablerepo=livna install mencoder
Running Transaction
Installing: libsndfile
Installing: twolame
Installing: mencoder
ひと通りインストール完了なのでアップロード&chmodの設定
MySQLデータベースを作成
classes/config.inc.phpを設定
とりあえずはデータベースの設定だけ
siteadmin/tester.phpを実行
すべてOKが出てる
siteadmin/setup.phpを実行
各種設定
日本語が文字化けするのでtemplateのhtmファイルのヘッダをUTF-8に書き換える
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
管理ページも文字化けするみたいなのでsiteadminのhtmファイルすべてのヘッダを書き換える
参照先
http://kawayan.zeta-blog.com/4.html
catalog/includes/modules/shipping/table.php
変更前:
// class constructor
function table() {
global $order;
$this->code = 'table';
$this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
変更後:
// class constructor
function table() {
global $order;
global $total_weight;
$this->code = 'table';
$this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
if ( $total_weight > 0.1 ) {
$this->enabled = false;
}
catalog/includes/modules/payment/cod_table.php の26行目あたりを
[変更前]
------------------------------------------------------------
$this->enabled = ((MODULE_PAYMENT_COD_TABLE_STATUS == 'True')
? true : false);
------------------------------------------------------------
変更後]
------------------------------------------------------------
$this->enabled = (MODULE_PAYMENT_COD_TABLE_STATUS == 'True') && in_array($GLOBALS['shipping']['id'], array('yamato_yamato','sagawaex_sagawaex'));
------------------------------------------------------------
/catalog/includes/title_meta.phpにアップロード
product_info.phpの
<title><?php echo TITLE; ?></title>を
<?php require(DIR_WS_INCLUDES . 'title_meta.php'); ?>
に変更。