/** * [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. * The contents of this file are subject to the License; you may not use this file except in compliance with the License. * * @version $Revision: 2075 $ */ require "../libraries/common.inc.php"; require "session_cp.inc.php"; uses("standard", "standardtype", "attachment"); require LIB_PATH . 'time.class.php'; require PHPB2B_ROOT . 'libraries/page.class.php'; require LIB_PATH . "cache.class.php"; require CACHE_COMMON_PATH . "cache_type.php"; $page = new Pages(); $standard = new Standards(); $attachment = new Attachment('attach'); $attachment_model = new Attachments(); $cache = new Caches(); $standardtype = new Standardtypes(); $conditions = array(); $fields = null; $tpl_file = "standard"; if (isset($_POST['save']) && !empty($_POST['data']['standard'])) { $vals = $_POST['data']['standard']; if (isset($_POST['id'])) { $id = intval($_POST['id']); } if (!empty($_POST['data']['publish_time'])) { $vals['publish_time'] = Times::dateConvert($_POST['data']['publish_time']); }
<?php /** * [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. * The contents of this file are subject to the License; you may not use this file except in compliance with the License. * * @version $Revision: 2048 $ */ define('CURSCRIPT', 'sitemap'); require "../libraries/common.inc.php"; require "../share.inc.php"; require CACHE_PATH . "cache_type.php"; uses("standard"); $standard = new Standards(); $tpl_file = "list.default"; $viewhelper->setTitle(L("standards", "tpl")); $viewhelper->setPosition(L("standards", "tpl"), "standard.php"); if (isset($_GET['do'])) { $do = trim($_GET['do']); } if (isset($_GET['typeid'])) { $typeid = intval($_GET['typeid']); $conditions[] = "type_id='" . $typeid . "'"; $viewhelper->setTitle($type_name = $pdb->GetOne("SELECT name FROM {$tb_prefix}standardtypes WHERE id='" . $typeid . "'")); $viewhelper->setPosition($type_name, "standard.php?do=search&typeid=" . $typeid); setvar("TypeName", $type_name); } if (isset($_GET['filter'])) { $filter = intval($_GET['filter']); $conditions[] = "created>" . ($time_stamp - $filter); }
/** * [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. * The contents of this file are subject to the License; you may not use this file except in compliance with the License. * * @version $Revision: 2075 $ */ function smarty_block_standard($params, $content, &$smarty, &$repeat) { $conditions = array(); $param_count = count($smarty->_tag_stack); //set variable if (empty($params['name'])) { $params['name'] = "standard"; } if (class_exists("Standards")) { $standard = new Standards(); $standard_controller = new Standard(); } else { uses("standard"); $standard = new Standards(); $standard_controller = new Standard(); } $orderby = array(); if (isset($params['typeid'])) { $conditions[] = "type_id=" . $params['typeid']; } if (isset($params['id'])) { $conditions[] = "id='" . $params['id'] . "'"; } if (isset($params['orderby'])) { $orderby[] = trim($params['orderby']); } else { $orderby[] = "id DESC "; } $standard->setOrderby($orderby); $standard->setCondition($conditions); $limit = $offset = 0; if (isset($params['row'])) { $limit = $params['row']; } if (isset($params['start'])) { $offset = $params['start']; } $standard->setLimitOffset($offset, $limit); $sql = "SELECT *,title as name FROM {$standard->table_prefix}standards " . $standard->getCondition() . $standard->getOrderby() . $standard->getLimitOffset(); if (empty($smarty->blockvars[$param_count])) { $smarty->blockvars[$param_count] = $standard->GetArray($sql); if (!$smarty->blockvars[$param_count]) { return $repeat = false; } } if (list($key, $item) = each($smarty->blockvars[$param_count])) { $repeat = true; $url = $standard->getPermaLink($item['id']); $item['url'] = $url; if (isset($params['titlelen'])) { $item['name'] = mb_substr($item['title'], 0, $params['titlelen']); } $item['link'] = '<a title="' . $item['title'] . '" href="' . $url . '">' . $item['name'] . '</a>'; $item['pubdate'] = df($item['created']); $smarty->assign($params['name'], $item); } else { $repeat = false; reset($smarty->blockvars[$param_count]); } if (!is_null($content)) { print $content; } if (!$repeat) { $smarty->blockvars[$param_count] = array(); } }
<?php /** * [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. * The contents of this file are subject to the License; you may not use this file except in compliance with the License. * * @version $Revision: 2048 $ */ define('CURSCRIPT', 'sitemap'); chdir("../"); require "libraries/common.inc.php"; require "share.inc.php"; require CACHE_PATH . "cache_type.php"; uses("standard", "standardtype"); $standard = new Standards(); $standardtype = new Standardtypes(); $tpl_file = "standard/list"; $viewhelper->setTitle(L("standards", "tpl")); $viewhelper->setPosition(L("standards", "tpl"), "standard.php"); if (isset($_GET['title'])) { $title = rawurldecode(trim($_GET['title'])); $res = $standard->findByTitle($title); $id = $res['id']; } if (isset($_GET['id'])) { $id = intval($_GET['id']); } if (isset($_GET['do'])) { $do = trim($_GET['do']); } if (!empty($id)) {