Esempio n. 1
0
 /**
  * ブロックIDからカウンタデータ取得
  *
  * @access	public
  */
 function getCounter()
 {
     $params = array($this->_request->getParameter("block_id"));
     $result = $this->_db->execute("SELECT " . " block_id," . " counter_digit," . " counter_num," . " show_type, " . " show_char_before," . " show_char_after," . " comment " . " FROM {counter} " . " WHERE block_id=?", $params);
     if (!$result) {
         return false;
     }
     return $result[0];
 }
Esempio n. 2
0
 /**
  * ブロックIDからiframeデータ取得
  * @param int block_id
  * @access	public
  */
 function &getIframeById($id)
 {
     $params = array("block_id" => $id);
     $result = $this->_db->execute("SELECT * " . " FROM {iframe} " . " WHERE {iframe}.block_id=?", $params);
     if (!$result) {
         return $result;
     }
     return $result[0];
 }
Esempio n. 3
0
 /**
  * itemを取得する
  * 
  * @param   int   $item_id  項目ID
  * @return array
  * @access	public
  */
 function &getItems($where_params = null, $order_params = null, $limit = null, $offset = null, $func = null, $func_param = null)
 {
     $sql = "SELECT {items}.*, {items_options}.options,{items_options}.default_selected" . " FROM {items} " . " LEFT JOIN {items_options} ON ({items}.item_id={items_options}.item_id)";
     $sql .= $this->_db->getWhereSQL($params, $where_params);
     $sql .= $this->_db->getOrderSQL($order_params);
     $result = $this->_db->execute($sql, $params, $limit, $offset, true, $func, $func_param);
     if ($result === false) {
         // エラーが発生した場合、エラーリストに追加
         $this->_db->addError();
         return $result;
     }
     return $result;
 }
Esempio n. 4
0
 /**
  *
  * RSS用ブロックデータが存在するかチェック
  *
  * @return boolean	true:存在する,false:存在しない
  * @access	public
  */
 function rssExists()
 {
     $params = array($this->_request->getParameter("block_id"));
     $sql = "SELECT block_id " . "FROM {rss_block} " . "WHERE block_id = ?";
     $result = $this->_db->execute($sql, $params, 1);
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     if (count($result) > 0) {
         return true;
     }
     return false;
 }
Esempio n. 5
0
 /**
  * languageリストを取得する
  * 
  * @param   array   $where_params  Whereパラメータ引数
  * @param   array   $order_params  Orderパラメータ引数
  * @param   array   $func          関数
  * @param   array   $func_params   Funcパラメータ引数
  * @return array
  * @access	public
  */
 function &getLanguages($where_params = null, $order_params = null, $func = null, $func_param = null)
 {
     if (!isset($order_params)) {
         $order_params = array("{language}.display_sequence" => "ASC");
     }
     $db_params = array();
     $sql = $this->_db->getSelectSQL("language", $db_params, $where_params, $order_params);
     $result = $this->_db->execute($sql, $db_params, null, null, true, $func, $func_param);
     if (!$result) {
         $this->_db->addError();
         return $result;
     }
     return $result;
 }
Esempio n. 6
0
 /**
  * 自サイト情報取得
  * @return array
  * @access	public
  */
 function &getSelfSite()
 {
     $params = array("self_flag" => _ON);
     $result = $this->_db->execute("SELECT * FROM {sites} WHERE self_flag=?", $params);
     if ($result === false) {
         //エラー
         $this->_db->addError();
         return $result;
     }
     if ($result[0]['url'] === "BASE_URL") {
         $result[0]['url'] = BASE_URL;
     }
     return $result[0];
 }
Esempio n. 7
0
 /**
  * module_object(authority_module_link_object)の一覧を取得する
  * @return object module_object(authority_module_link_object)
  * @access	public
  */
 function &getAuthoritiesModulesLinkByAuthorityId($role_authority_id, $where_params = null, $order_params = null, $func = null, $func_param = null)
 {
     $db_params = array();
     $sql_where = "";
     if (isset($role_authority_id)) {
         $db_params[] = $role_authority_id;
     }
     if (!empty($where_params)) {
         foreach ($where_params as $key => $item) {
             $db_params[] = $item;
             $sql_where .= " AND " . $key . "=?";
         }
     }
     $sql_order = "";
     if (!isset($order_params)) {
         $order_params = array("{modules}.display_sequence" => "ASC");
     }
     if (!empty($order_params)) {
         foreach ($order_params as $key => $item) {
             $sql_order .= "," . $key . " " . (empty($item) ? "ASC" : $item);
         }
     }
     $sql = "";
     $sql .= "SELECT {modules}.*,{authorities_modules_link}.authority_id" . " FROM {modules}" . " LEFT JOIN {authorities_modules_link} ON ({modules}.module_id={authorities_modules_link}.module_id" . (isset($role_authority_id) ? " AND {authorities_modules_link}.role_authority_id=?)" : ")");
     $sql .= " WHERE {modules}.disposition_flag=" . _ON;
     $sql .= $sql_where ? " AND " . substr($sql_where, 5) : "";
     $sql .= $sql_order ? " ORDER BY " . substr($sql_order, 1) : "";
     $result = $this->_db->execute($sql, $db_params, null, null, true, $func, $func_param);
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     return $result;
 }
Esempio n. 8
0
 /**
  * 圧縮処理
  *
  * @return boolean
  * @access private
  */
 function _compressFile($parent_id, $folder_path = "")
 {
     $sql = "SELECT F.file_id, F.parent_id, F.file_type, F.file_name, F.extension, U.file_path, U.physical_file_name " . "FROM {cabinet_file} F " . "LEFT JOIN {uploads} U ON (F.upload_id=U.upload_id) ";
     $sql .= "WHERE F.cabinet_id = ? ";
     $sql .= "AND F.parent_id = ? ";
     $params = array("cabinet_id" => $this->_request->getParameter("cabinet_id"), "parent_id" => $parent_id);
     $files = $this->_db->execute($sql, $params);
     if ($files === false) {
         $this->_db->addError();
         return false;
     }
     if (empty($files)) {
         return true;
     }
     foreach ($files as $i => $db_file) {
         if ($db_file["file_type"] == CABINET_FILETYPE_FOLDER) {
             $result = $this->_compressFile($db_file["file_id"], $folder_path . mb_convert_encoding($db_file["file_name"], $this->encode, "auto") . "/");
             if ($result === false) {
                 return $result;
             }
         } else {
             $physical_file = FILEUPLOADS_DIR . $db_file["file_path"] . $db_file["physical_file_name"];
             $target_file = $folder_path . mb_convert_encoding($db_file["file_name"], $this->encode, "auto") . "." . $db_file["extension"];
             if (file_exists($physical_file)) {
                 $this->_source[] = File_Archive::read($physical_file, $target_file);
                 //File_Archive::extract(File_Archive::read($physical_file, $target_file), $this->archive_full_path);
             }
             $cabinet = $this->_request->getParameter("cabinet");
             if ($cabinet["compress_download"] == _ON) {
                 $this->setDownload($db_file["file_id"]);
             }
         }
     }
     return true;
 }
Esempio n. 9
0
 /**
  * 集計データを変更する
  *
  * @param	string	$summaryID	集計ID
  * @return boolean	true or false
  * @access	public
  */
 function updateSummary($summaryID)
 {
     $params = array($summaryID);
     $updateParams["summary_id"] = $summaryID;
     $sql = "SELECT insert_time " . "FROM {quiz_answer} " . "WHERE summary_id = ? " . "ORDER BY answer_id DESC";
     $insertTimes = $this->_db->execute($sql, $params, 1, null, false);
     if ($insertTimes === false) {
         $this->_db->addError();
         return $insertTimes;
     }
     $updateParams["answer_time"] = $insertTimes[0][0];
     $sql = "SELECT MIN(quiz_id), COUNT(answer_id), MIN(answer_flag), SUM(score) " . "FROM {quiz_answer} " . "WHERE summary_id = ?";
     $answers = $this->_db->execute($sql, $params, 1, null, false);
     if ($answers === false) {
         $this->_db->addError();
         return $answers;
     }
     list($quizID, $answerCount, $answerFlag, $updateParams["summary_score"]) = $answers[0];
     $params = array("quiz_id" => $quizID);
     $questionCount = $this->_db->countExecute("quiz_question", $params);
     $updateParams["answer_flag"] = QUIZ_ANSWER_NOT_MARK_VALUE;
     if ($answerCount < $questionCount) {
         $updateParams["answer_flag"] = QUIZ_ANSWER_NONE_VALUE;
     } elseif ($answerFlag > QUIZ_ANSWER_SCORED_VALUE) {
         $updateParams["answer_flag"] = QUIZ_ANSWER_SCORED_VALUE;
     }
     if (!$this->_db->updateExecute("quiz_summary", $updateParams, "summary_id", true)) {
         return false;
     }
     return true;
 }
Esempio n. 10
0
 /**
  * カテゴリリンクデータ配列を取得する
  *
  * @return array	カテゴリリンクデータ配列
  * @access	public
  */
 function &getCategoryLinks()
 {
     $categories = $this->getCategories();
     if (empty($categories)) {
         return $categories;
     }
     $linklist = $this->_request->getParameter("linklist");
     $entry = $this->_request->getParameter("entry");
     $search = $this->_request->getParameter("search");
     $params = array($this->_request->getParameter("linklist_id"));
     $sql = "SELECT L.link_id, L.linklist_id, L.category_id, L.link_sequence, L.title, L.url, L.insert_user_id";
     if ($entry == _ON || $linklist["display"] != LINKLIST_DISPLAY_DROPDOWN) {
         $sql .= ", " . "L.description";
     }
     if ($linklist["view_count_flag"] == _ON) {
         $sql .= ", " . "L.view_count";
     }
     $sql .= " " . "FROM {linklist_link} L " . "INNER JOIN {linklist_category} C " . "ON L.category_id = C.category_id " . "WHERE L.linklist_id = ? ";
     if (!empty($search)) {
         $sql .= "AND (L.title LIKE ? " . "OR L.description LIKE ?) ";
         $params[] = "%" . $search . "%";
         $params[] = "%" . $search . "%";
     }
     $sql .= "ORDER BY C.category_sequence, L.link_sequence";
     $categoryLinks = $this->_db->execute($sql, $params, null, null, true, array($this, "_makeCategoryLinkArray"), $categories);
     if ($categoryLinks === false) {
         $this->_db->addError();
     }
     return $categoryLinks;
 }
Esempio n. 11
0
 /**
  * conf_nameよりConfig情報取得
  *
  * @param   int      $conf_modid  モジュールID
  * @param   string   $conf_name   conf名
  * @return array
  * @access	public
  */
 function &getConfigByConfname($conf_modid, $conf_name)
 {
     if (!$this->isMultiLanguage) {
         $where_params = array("conf_modid" => $conf_modid, "conf_name" => $conf_name);
         $configs =& $this->_db->selectExecute("config", $where_params);
         if ($configs === false) {
             return $configs;
         }
     } else {
         $params = array($this->_session->getParameter('_lang'), $conf_modid, $conf_name);
         $sql = $this->_getConfigSQL() . "AND C.conf_name = ?";
         $configs = $this->_db->execute($sql, $params);
         if ($configs === false) {
             $this->_db->addError();
             return $configs;
         }
     }
     if (empty($configs)) {
         $configs = null;
         return $configs;
     }
     $config = $configs[0];
     if (isset($config['CLValue'])) {
         $config['conf_value'] = $config['CLValue'];
     }
     return $config;
 }
Esempio n. 12
0
 /**
  * 投票データを登録する
  *
  * @return boolean	true or false
  * @access	public
  */
 function vote()
 {
     $postID = $this->_request->getParameter("post_id");
     $container =& DIContainerFactory::getContainer();
     $session =& $container->getComponent("Session");
     $userID = $session->getParameter("_user_id");
     if (empty($userID)) {
         $votes = $session->getParameter("bbs_votes");
         $votes[] = $postID;
         $session->setParameter("bbs_votes", $votes);
     } else {
         $where = array("user_id" => $userID, "post_id" => $postID);
         $params = array("vote_flag" => _ON);
         $result = $this->_db->updateExecute("bbs_user_post", $params, $where);
         if ($result === false) {
             return false;
         }
     }
     $params = array($postID);
     $sql = "UPDATE {bbs_post} " . "SET vote_num = vote_num + 1 " . "WHERE post_id = ?";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 13
0
 /**
  * アドレス切り替え取得
  *
  * @access	public
  */
 function switchFolder()
 {
     $address = $this->_request->getParameter("address");
     if ($address == "") {
         return "0";
     }
     $addressArr = explode("/", $address);
     if (count($addressArr) == 1) {
         return "0";
     }
     $sql = "SELECT file_id, parent_id, depth" . " FROM {cabinet_file}" . " WHERE cabinet_id = ?" . " AND file_type = ?";
     $params = array("cabinet_id" => $this->_request->getParameter("cabinet_id"), "file_type" => CABINET_FILETYPE_FOLDER);
     $sql_where = array();
     foreach ($addressArr as $i => $file_name) {
         if ($i == 0) {
             continue;
         }
         $sql_where[] = "(depth = ? AND file_name = ?)";
         $params["depth" . $i] = $i;
         $params["file_name" . $i] = $file_name;
     }
     $sql .= " AND (" . implode(" OR ", $sql_where) . ")";
     $result = $this->_db->execute($sql, $params, null, null, true, array($this, "_switchFolder"));
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     return $result;
 }
Esempio n. 14
0
 /**
  * タスクデータを削除する
  *
  * @return boolean	true or false
  * @access	public
  */
 function deleteTask()
 {
     $calendarAction =& $this->_container->getComponent("calendarAction");
     $task = $this->_request->getParameter("task");
     if (!empty($task["calendar_id"]) && !$calendarAction->deletePlan($task["calendar_id"], CALENDAR_PLAN_EDIT_THIS)) {
         return false;
     }
     $params = array("task_id" => $task["task_id"]);
     $sql = "SELECT task_sequence " . "FROM {todo_task} " . "WHERE task_id = ?";
     $sequences = $this->_db->execute($sql, $params, 1, null, false);
     if ($sequences === false) {
         $this->_db->addError();
         return false;
     }
     $sequence = $sequences[0][0];
     if (!$this->_db->deleteExecute("todo_task", $params)) {
         return false;
     }
     $params = array("todo_id" => $task["todo_id"]);
     $sequenceParam = array("task_sequence" => $sequence);
     if (!$this->_db->seqExecute("todo_task", $params, $sequenceParam)) {
         return false;
     }
     // -- 新着情報関連 Start --
     $whatsnewAction =& $this->_container->getComponent("whatsnewAction");
     $result = $whatsnewAction->delete($task["task_id"]);
     if ($result === false) {
         return false;
     }
     // -- 新着情報関連 End --
     return true;
 }
Esempio n. 15
0
 /**
  * モジュールIDからアップロードオブジェクトを取得
  * @param int module_id
  * @return array uploads_object
  * @access	public
  */
 function getUploadByModuleid($module_id)
 {
     $params = array("module_id" => $module_id);
     $sql = "SELECT * FROM {uploads}" . " WHERE {uploads}.module_id = ?" . " ";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         //エラーが発生した場合、エラーリストに追加
         $db->addError();
         return false;
     }
     if (isset($result[0])) {
         return $result;
     } else {
         return null;
     }
 }
Esempio n. 16
0
 /**
  * 投票データを登録する
  *
  * @return boolean	true or false
  * @access	public
  */
 function vote()
 {
     $photoID = $this->_request->getParameter("photo_id");
     $container =& DIContainerFactory::getContainer();
     $session =& $container->getComponent("Session");
     $userID = $session->getParameter("_user_id");
     if (empty($userID)) {
         $votes = $session->getParameter("photoalbum_votes");
         $votes[] = $photoID;
         $session->setParameter("photoalbum_votes", $votes);
     } else {
         $params = array("user_id" => $userID, "photo_id" => $photoID, "vote_flag" => _ON);
         if (!$this->_db->insertExecute("photoalbum_user_photo", $params, true)) {
             return false;
         }
     }
     $params = array($photoID);
     $sql = "UPDATE {photoalbum_photo} " . "SET photo_vote_count = photo_vote_count + 1 " . "WHERE photo_id = ?";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     $params = array($this->_request->getParameter("album_id"));
     $sql = "UPDATE {photoalbum_album} " . "SET album_vote_count = album_vote_count + 1 " . "WHERE album_id = ?";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 17
0
 /**
  * 携帯表示に対応できるルームのツリーを作成する
  * ルームツリー自体はFilter_AllowRoom...にて作成されている
  * 作成済みルームツリーに対して、携帯メニューに表示可能なルームを判定する
  * 2010.02.04 add by AllCreator
  *
  * @return true false
  * @access public
  */
 function getRoomTree(&$roomArr, $display_type, $each_room, $roomIds)
 {
     $roomTree = array();
     $request =& $this->_container->getComponent('Request');
     $invisiblePageIds = $this->getInvisiblePageIds($display_type, $each_room, $roomIds);
     // エラー
     if ($invisiblePageIds === false) {
         return false;
     }
     $mobileModuleIds = $this->getMobileModuleIds($display_type, $each_room, $roomIds);
     if ($mobileModuleIds === false) {
         return false;
     }
     // 表示可能なモジュールが何もない
     if (empty($mobileModuleIds)) {
         // Roomデータ全てにvisible=falseを設定して戻る
         $temporaryRoomArr = null;
         $this->setVisibleFlagToRoomRecursive($roomArr, $roomArr[0][0], array(), $temporaryRoomArr);
         return true;
     }
     $params = array(_DISPLAY_POSITION_CENTER);
     if (empty($invisiblePageIds)) {
         $invisiblePageWhere = "";
     } else {
         $invisiblePageWhere = "AND P.page_id NOT IN (" . implode(',', $invisiblePageIds) . ") ";
     }
     $sql = "SELECT P.room_id, count(B.block_id) as block_ct " . " FROM {pages} P INNER JOIN {blocks} B ON P.page_id = B.page_id AND B.module_id IN (" . implode(',', $mobileModuleIds) . ") " . " WHERE P.room_id IN ( " . implode(',', $roomIds) . ")" . " AND P.space_type IN (" . _SPACE_TYPE_PUBLIC . "," . _SPACE_TYPE_GROUP . ") " . " AND P.private_flag IN (" . _ON . "," . _OFF . ") " . " AND P.display_position = ? " . $invisiblePageWhere . $this->_getPageWhereSQL($invisiblePageIds) . " GROUP BY P.room_id ";
     $visibleRoomIds = $this->_db->execute($sql, $params, null, null, true, array($this, '_fetchVisibleRoomIds'));
     $temporaryRoomArr = null;
     $this->setVisibleFlagToRoomRecursive($roomArr, $roomArr[0][0], $visibleRoomIds, $temporaryRoomArr);
     return true;
 }
Esempio n. 18
0
 /**
  * 集計データを変更する
  *
  * @param	string	$summaryID	集計ID
  * @return boolean	true or false
  * @access	public
  */
 function updateSummary($summaryID)
 {
     $params = array($summaryID);
     $updateParams["summary_id"] = $summaryID;
     $sql = "SELECT insert_time " . "FROM {questionnaire_answer} " . "WHERE summary_id = ? " . "ORDER BY answer_id DESC";
     $insertTimes = $this->_db->execute($sql, $params, 1, null, false);
     if ($insertTimes === false) {
         $this->_db->addError();
         return false;
     }
     $updateParams["answer_time"] = $insertTimes[0][0];
     $sql = "SELECT MIN(questionnaire_id), COUNT(answer_id) " . "FROM {questionnaire_answer} " . "WHERE summary_id = ?";
     $answers = $this->_db->execute($sql, $params, 1, null, false);
     if ($answers === false) {
         $this->_db->addError();
         return false;
     }
     list($questionnaireID, $answerCount) = $answers[0];
     $params = array("questionnaire_id" => $questionnaireID);
     $questionCount = $this->_db->countExecute("questionnaire_question", $params);
     $updateParams["answer_flag"] = QUESTIONNAIRE_ANSWER_DONE_VALUE;
     if ($answerCount < $questionCount) {
         $updateParams["answer_flag"] = QUESTIONNAIRE_ANSWER_NONE_VALUE;
     }
     if (!$this->_db->updateExecute("questionnaire_summary", $updateParams, "summary_id", true)) {
         return false;
     }
     return true;
 }
Esempio n. 19
0
 /**
  * メールアドレスからユーザーIDを取得する
  *
  * @param string $mail メールアドレス
  * @param boolean $isActive 利用可能ユーザー対象フラグ
  * @return ユーザーID
  * @access private
  */
 function &getUserIdByMail($mail, $isActive = false)
 {
     $userId = null;
     if (empty($mail)) {
         return $userId;
     }
     $sql = "SELECT UI.user_id " . "FROM {items} I " . "INNER JOIN {users_items_link} UI " . "ON I.item_id = UI.item_id ";
     if ($isActive) {
         $sql .= "INNER JOIN {users} U " . "ON UI.user_id = U.user_id ";
     }
     $sql .= "WHERE (I.type = ? " . "OR I.type = ?) " . "AND UI.content = ? ";
     $bindValues = array(USER_TYPE_EMAIL, USER_TYPE_MOBILE_EMAIL, $mail);
     if ($isActive) {
         $sql .= "AND U.active_flag = ? ";
         $bindValues[] = _USER_ACTIVE_FLAG_ON;
     }
     $users = $this->_db->execute($sql, $bindValues);
     if ($users === false) {
         $this->_db->addError();
     }
     if (!empty($users)) {
         $userId = $users[0]['user_id'];
     }
     return $userId;
 }
Esempio n. 20
0
 /**
  * 入力データを削除する
  *
  * @return boolean	true or false
  * @access	public
  */
 function deleteData()
 {
     $dataID = $this->_request->getParameter("data_id");
     $params = array("registration_id" => $this->_request->getParameter("registration_id"));
     $where = "WHERE ID.registration_id = ? ";
     if (!empty($dataID)) {
         $params["data_id"] = $dataID;
         $where .= "AND ID.data_id = ?";
     }
     $sql = $this->_getFileSQL() . $where;
     $files = $this->_db->execute($sql, $params);
     if ($files === false) {
         $this->_db->addError();
         return false;
     }
     if (!$this->deleteFile($files)) {
         return false;
     }
     if (!$this->_db->deleteExecute("registration_item_data", $params)) {
         return false;
     }
     if (!$this->_db->deleteExecute("registration_data", $params)) {
         return false;
     }
     return true;
 }
Esempio n. 21
0
 /**
  * 条件に該当する短縮URLデータを削除する。
  * 
  * @param string $whereClause where句文字列
  * @param array $bindValues バインド値配列
  * @return boolean true or false
  * @access	public
  */
 function deleteByWhereClause($whereClause, $bindValues)
 {
     $sql = "DELETE FROM {abbreviate_url} " . "WHERE " . $whereClause;
     if (!$this->_db->execute($sql, $bindValues)) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 22
0
 /**
  * 過去のMonthlynumberデータ削除処理
  * 指定年より以前のデータを削除
  * @param int year
  * @return boolean true or false
  * @access	public
  */
 function delMonthlynumberByYear($year)
 {
     $params = array("year" => $year);
     $result = $this->_db->execute("DELETE FROM {monthly_number} WHERE year<=?" . " ", $params);
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     return true;
 }
Esempio n. 23
0
 /**
  * block_idによるMenuDetail削除処理
  * 
  * @return boolean true or false
  * @access	public
  */
 function delMenuDetailByPageId($page_id, $visibility_flag = _OFF)
 {
     $params = array("page_id" => $page_id, "visibility_flag" => $visibility_flag);
     $result = $this->_db->execute("DELETE FROM {mobile_menu_detail} WHERE page_id=? AND visibility_flag = ?" . " ", $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 24
0
 /**
  * block_idによるMenuDetail削除処理
  * 
  * @return boolean true or false
  * @access  public
  */
 function delMobileMenuDetailByPageId($page_id)
 {
     $params = array("page_id" => $page_id);
     $result = $this->_db->execute("DELETE FROM {mobile_menu_detail} WHERE page_id=? " . " ", $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 25
0
 function hasMobileBlock($page_id)
 {
     $block_sql = "SELECT count( block_id ) as block_ct FROM {blocks} " . " INNER JOIN {mobile_modules} ON {mobile_modules}.module_id = {blocks}.module_id " . " WHERE {blocks}.page_id = ? " . " AND {mobile_modules}.display_position = " . _DISPLAY_POSITION_CENTER;
     $block_params = array("page_id" => $page_id);
     $block_result = $this->_db->execute($block_sql, $block_params, null, null, true);
     if ($block_result === false) {
         return false;
     } else {
         return $block_result[0]['block_ct'];
     }
 }
Esempio n. 26
0
 /**
  * 携帯用ブロックデータを取得
  *
  * @access	public
  */
 function getBlocksForMobile($room_id, $block_id_arr)
 {
     $sql = "SELECT regist.registration_id" . " FROM {registration} regist" . " INNER JOIN {registration_item} item ON (regist.registration_id=item.registration_id)" . " WHERE regist.room_id = ?" . " AND regist.active_flag = ?" . " AND item.item_type = ?" . " GROUP BY regist.registration_id";
     $reg_no_list = $this->_db->execute($sql, array($room_id, _ON, REGISTRATION_TYPE_FILE), null, null, true, array($this, "_getNoListForMobile"));
     if ($reg_no_list === false) {
         $this->_db->addError();
         return false;
     }
     $sql = "SELECT regist.*, block.block_id" . " FROM {registration} regist" . " INNER JOIN {registration_block} block ON (regist.registration_id=block.registration_id)" . " WHERE block.block_id IN (" . implode(",", $block_id_arr) . ")" . " AND regist.active_flag = " . _ON . (!empty($reg_no_list) ? " AND regist.registration_id NOT IN (" . implode(",", $reg_no_list) . ")" : "") . " GROUP BY regist.registration_id, block.block_id" . " ORDER BY block.insert_time DESC, block.registration_id DESC";
     return $this->_db->execute($sql, null);
 }
Esempio n. 27
0
 /**
  * 期限切れ課題を終了に変更する
  *
  * @return boolean	true or false
  * @access	public
  */
 function setPeriodOver()
 {
     $params = array("period" => timezone_date());
     $sql = "UPDATE {assignment} SET activity = " . _OFF . " WHERE period != ''" . " AND activity = " . _ON . " AND period < ?";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     return true;
 }
Esempio n. 28
0
 /**
  * ログイン会員のメール項目IDを取得する
  *
  * @return string ログイン会員のメール項目ID
  * @access public
  */
 function getEmailItemId()
 {
     $emailItemId = '';
     $where_params = array($this->_session->getParameter("_user_id"));
     $sql = "SELECT I.item_id " . "FROM {items} I, {users_items_link} U " . "WHERE I.type='email' AND I.item_id=U.item_id " . "AND U.content!='' AND U.user_id=? limit 1";
     $email = $this->_db->execute($sql, $where_params);
     if (!empty($email)) {
         $emailItemId = $email[0]['item_id'];
     }
     return $emailItemId;
 }
Esempio n. 29
0
 /**
  * 会員のルームアクセス状況一覧を取得する
  * @param int user_id
  * @return array key:room_id last_access_time
  * @access	public
  */
 function &getUserAccessTime($user_id)
 {
     $params = array("user_id" => $user_id);
     $sql = "SELECT {monthly_number}.user_id, {monthly_number}.room_id, {monthly_number}.update_time AS last_access_time " . " FROM {monthly_number} " . " WHERE {monthly_number}.user_id=? ";
     $result = $this->_db->execute($sql, $params, null, null, true, array($this, "_fetchcallbackUserAccessTime"));
     if ($result === false) {
         $this->_db->addError();
         return $result;
     }
     return $result;
 }
Esempio n. 30
0
 /**
  * データを取得
  *
  * @access	public
  */
 function &getWhatsnew($whatsnews_id)
 {
     $sql = "SELECT whatsnew.*, module.action_name AS module_action_name, page.page_name, page.private_flag, page.default_entry_flag" . " FROM {whatsnew} whatsnew" . " INNER JOIN {modules} module ON (whatsnew.module_id=module.module_id)" . " LEFT JOIN {pages} page ON (whatsnew.room_id=page.page_id)" . " WHERE whatsnew.whatsnew_id = ?";
     $params = array("whatsnew_id" => $whatsnews_id);
     $result = $this->_db->execute($sql, $params, null, null, true, array($this, "_callbackWhatsnew"));
     if (empty($result)) {
         $result = false;
         return $result;
     }
     return $result;
 }