<?php /* * VideoPlayer * Copyright(c) 2012 . Student. * * http://xoops.ec-cube.net/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // {{{ requires require_once PLUGIN_UPLOAD_REALDIR . 'VideoPlayer/LC_Page_Plugin_VideoPlayer_Config.php'; // }}} // {{{ generate page $objPage = new LC_Page_Plugin_VideoPlayer_Config(); //$objPage->blocItems = $params['items']; register_shutdown_function(array($objPage, 'destroy')); $objPage->init(); $objPage->process();
/** * * @param type $arrData * @return type */ function updateData($arrData) { $arrErr = array(); $objQuery =& SC_Query_Ex::getSingletonInstance(); $objQuery->begin(); // UPDATEする値を作成する。 $sqlval = array(); $sqlval['product_id'] = $arrData['product_id']; $sqlval['video_url'] = $arrData['video_url']; $sqlval['disp_width'] = $arrData['disp_width']; $sqlval['disp_height'] = $arrData['disp_height']; //dbのproduct_id検索 $teble = "dtb_videoplayer "; //テーブル名 $where = ""; $product_id = array(); $list_id = $objQuery->getCol('product_id', $teble, $where); // UPDATEの実行 if (LC_Page_Plugin_VideoPlayer_Config::Search($list_id, $arrData['product_id'])) { $searchId = $arrData['product_id']; $where = "product_id = {$searchId}"; // $objQuery->update($teble, $sqlval, $where); } else { //dbのid検索+1 $where = ""; $max_id = $objQuery->max('id', $teble, $where); $sqlval['id'] = $max_id + 1; $objQuery->insert($teble, $sqlval); } $objQuery->commit(); return $arrErr; }