• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Model_Content类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Model_Content的典型用法代码示例。如果您正苦于以下问题:PHP Model_Content类的具体用法?PHP Model_Content怎么用?PHP Model_Content使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Model_Content类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: index

 function index()
 {
     $model = new Model_Content();
     $content = $model->getContent();
     $this->template->vars('content', $content);
     $this->template->view('index');
 }
开发者ID:andxbes,项目名称:phpFirstSite,代码行数:7,代码来源:index.php


示例2: action_index

 public function action_index()
 {
     $data["trial"] = Model_Content::find("all", ["where" => [["type_id", -1], ["deleted_at", 0]], "order_by" => [["number", "asc"], ["text_type_id", "asc"]]]);
     $data["enchant"] = Model_Content::find("all", ["where" => [["type_id", 0], ["deleted_at", 0]], "order_by" => [["number", "asc"], ["text_type_id", "asc"]]]);
     $view = View::forge("teachers/textbooks", $data);
     $this->template->content = $view;
 }
开发者ID:Trd-vandolph,项目名称:game-bootcamp,代码行数:7,代码来源:textbooks.php


示例3: action_goal

 /**
  * action product goal after buying
  * @return void 
  */
 public function action_goal()
 {
     if (!Auth::instance()->logged_in()) {
         $this->redirect(Route::get('oc-panel')->uri());
     }
     $user = Auth::instance()->get_user();
     $order = new Model_Order();
     $order->where('id_order', '=', $this->request->param('id'))->where('id_user', '=', $user->id_user)->limit(1)->find();
     if ($order->loaded()) {
         $product = $order->product;
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($product->category->name)->set_url(Route::url('list', array('category' => $product->category->seoname))));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($product->title)->set_url(Route::url('product', array('seotitle' => $product->seotitle, 'category' => $product->category->seoname))));
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Thanks')));
         $this->template->title = $product->title . ' - ' . $product->category->name;
         $this->template->meta_description = $product->description;
         $thanks_message = NULL;
         if (core::config('payment.thanks_page') != '') {
             $thanks_message = Model_Content::get_by_title(core::config('payment.thanks_page'));
         }
         $this->template->bind('content', $content);
         $this->template->content = View::factory('pages/product/goal', array('product' => $product, 'thanks_message' => $thanks_message, 'order' => $order, 'price_paid' => $order->amount));
     } else {
         Alert::set(Alert::INFO, __('Order not found.'));
         $this->redirect(Route::url('default'));
     }
 }
开发者ID:alirezadamash,项目名称:open-eshop,代码行数:31,代码来源:product.php


示例4: action_205

 /**
  * This function will upgrate DB that didn't existed in verisons below 2.0.5 
  * changes added: subscription widget, new email content, map zoom, paypal seller etc..  
  */
 public function action_205()
 {
     // build array with new (missing) configs
     $configs = array(array('config_key' => 'paypal_seller', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'map_zoom', 'group_name' => 'advertisement', 'config_value' => '16'), array('config_key' => 'center_lon', 'group_name' => 'advertisement', 'config_value' => '3'), array('config_key' => 'center_lat', 'group_name' => 'advertisement', 'config_value' => '40'), array('config_key' => 'new_ad_notify', 'group_name' => 'email', 'config_value' => '0'));
     $contents = array(array('order' => '0', 'title' => 'Advertisement `[AD.TITLE]` is created on [SITE.NAME]!', 'seotitle' => 'ads.subscribers', 'description' => "Hello [USER.NAME],\n\nYou may be interested in this one [AD.TITLE]!\n\nYou can visit this link to see advertisement [URL.AD]", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => '0', 'title' => 'Advertisement `[AD.TITLE]` is created on [SITE.NAME]!', 'seotitle' => 'ads.to_admin', 'description' => "Click here to visit [URL.AD]", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'));
     // returns TRUE if some config is saved
     $return_conf = Model_Config::config_array($configs);
     $return_cont = Model_Content::content_array($contents);
     $prefix = Database::instance()->table_prefix();
     $config_db = Kohana::$config->load('database');
     $charset = $config_db['default']['charset'];
     /*
       @todo NOT DINAMIC, get charset
     */
     mysql_query("CREATE TABLE IF NOT EXISTS `" . $prefix . "subscribers` (\n                    `id_subscribe` int(10) unsigned NOT NULL AUTO_INCREMENT,\n                    `id_user` int(10) unsigned NOT NULL,\n                    `id_category` int(10) unsigned NOT NULL DEFAULT '0',\n                    `id_location` int(10) unsigned NOT NULL DEFAULT '0',\n                    `min_price` decimal(14,3) NOT NULL DEFAULT '0',\n                    `max_price` decimal(14,3) NOT NULL DEFAULT '0',\n                    `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n                    PRIMARY KEY (`id_subscribe`)\n                  ) ENGINE=MyISAM DEFAULT CHARSET=" . $charset . ";");
     // remove INDEX from content table
     mysql_query("ALTER TABLE `" . $prefix . "content` DROP INDEX `" . $prefix . "content_UK_seotitle`");
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:22,代码来源:update.php


示例5: action_view

 /**
  *
  * Display single faq
  * @throws HTTP_Exception_404
  */
 public function action_view($seotitle)
 {
     $faq = Model_Content::get_by_title($seotitle, 'help');
     if ($faq->loaded()) {
         Breadcrumbs::add(Breadcrumb::factory()->set_title($faq->title));
         $this->template->title = $faq->title . ' - ' . __(' Frequently Asked Questions - FAQ');
         $this->template->meta_description = $faq->description . ' - ' . __(' Frequently Asked Questions - FAQ');
         $this->template->bind('content', $content);
         if ($faq->status == 1 and strlen(core::config('general.faq_disqus')) > 0) {
             $disqus = View::factory('pages/disqus', array('disqus' => core::config('general.faq_disqus')));
         } else {
             $disqus = '';
         }
         $this->template->content = View::factory('pages/faq/single', array('faq' => $faq, 'disqus' => $disqus));
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:24,代码来源:faq.php


示例6: action_view

 /**
  *
  * Display single page
  * @throws HTTP_Exception_404
  */
 public function action_view()
 {
     $seotitle = $this->request->param('seotitle', NULL);
     if ($seotitle !== NULL) {
         $page = Model_Content::get_by_title($seotitle);
         if ($page->loaded()) {
             Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
             Breadcrumbs::add(Breadcrumb::factory()->set_title($page->title));
             $this->template->title = $page->title;
             $this->template->meta_description = $page->description;
             $this->template->bind('content', $content);
             $this->template->content = View::factory('page', array('page' => $page));
         } else {
             //throw 404
             throw HTTP_Exception::factory(404, __('Page not found'));
         }
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:26,代码来源:page.php


示例7: action_affiliates

 /**
  * affiliate configuration can be configured here
  * @return [view] Renders view with form inputs
  */
 public function action_affiliates()
 {
     Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Affiliates')));
     $this->template->title = __('Affiliates');
     $this->template->scripts['footer'][] = 'js/jquery.validate.min.js';
     $this->template->scripts['footer'][] = 'js/oc-panel/settings.js';
     // all form config values
     $paymentconf = new Model_Config();
     $config = $paymentconf->where('group_name', '=', 'affiliate')->find_all();
     // save only changed values
     if ($this->request->post()) {
         $validation = Validation::factory($this->request->post())->rule('active', 'range', array(':value', 0, 1))->rule('cookie', 'not_empty')->rule('cookie', 'digit')->rule('payment_days', 'not_empty')->rule('payment_days', 'digit')->rule('payment_min', 'not_empty')->rule('payment_min', 'digit');
         if ($validation->check()) {
             foreach ($config as $c) {
                 $config_res = $this->request->post($c->config_key);
                 if ($config_res != $c->config_value) {
                     $c->config_value = $config_res;
                     try {
                         $c->save();
                     } catch (Exception $e) {
                         echo $e;
                     }
                 }
             }
         } else {
             $errors = $validation->errors('config');
             foreach ($errors as $error) {
                 Alert::set(Alert::ALERT, $error);
             }
             $this->redirect(Route::url('oc-panel', array('controller' => 'settings', 'action' => 'affiliates')));
         }
         Alert::set(Alert::SUCCESS, __('Affiliate Configuration updated'));
         $this->redirect(Route::url('oc-panel', array('controller' => 'settings', 'action' => 'affiliates')));
     }
     $pages = array('' => __('Deactivated'));
     foreach (Model_Content::get_pages() as $key => $value) {
         $pages[$value->seotitle] = $value->title;
     }
     $this->template->content = View::factory('oc-panel/pages/settings/affiliates', array('config' => $config, 'pages' => $pages));
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:44,代码来源:settings.php


示例8: defined

<?php

defined('SYSPATH') or die('No direct script access.');
if (!isset($_COOKIE['accept_terms']) and core::config('general.alert_terms') != '') {
    ?>
<div id="accept_terms_modal" class="modal fade" data-backdrop="static">
	<?php 
    $content = Model_Content::get_by_title(core::config('general.alert_terms'));
    ?>
	<div class="modal-dialog">
	    <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" onclick='location.href="http://www.google.com"' aria-hidden="true">&times;</button>
				<h1><?php 
    echo $content->title;
    ?>
</h1>
			</div>
			<div class="modal-body">
				<div class="text-description"><?php 
    echo Text::bb2html($content->description, TRUE, FALSE);
    ?>
</div>
			</div>
			<div class="modal-footer">
				<a name="decline_terms" class="btn btn-default" onclick='location.href="http://www.google.com"' ><?php 
    echo __('No');
    ?>
</a>
				<a name="accept_terms" class="btn btn-success" onclick='setCookie("accept_terms",1,10000)' data-dismiss="modal" aria-hidden="true"><?php 
    echo __('I accept');
开发者ID:ThomWensink,项目名称:common,代码行数:31,代码来源:alert_terms.php


示例9: __

            <div class="form-group">
                <?php 
echo FORM::label($forms['contact']['key'], __('Contact form'), array('class' => 'control-label col-sm-3', 'for' => $forms['contact']['key']));
?>
                <div class="col-sm-4">
                    <?php 
echo FORM::select($forms['contact']['key'], array(FALSE => "FALSE", TRUE => "TRUE"), $forms['contact']['value'], array('placeholder' => "", 'class' => 'tips form-control', 'id' => $forms['contact']['key'], 'data-content' => __("Enables Contact Form"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Contact form appears int he ad.")));
?>
 
                </div>
            </div>
			<?php 
$pages = array('' => __('Deactivated'));
?>
			<?php 
foreach (Model_Content::get_pages() as $key => $value) {
    $pages[$value->seotitle] = $value->title;
}
?>
			<div class="form-group">
				<?php 
echo FORM::label($forms['tos']['key'], "<a target='_blank' href='http://open-classifieds.com/2013/08/13/how_to_add_pages/'>" . __('Terms of Service') . "</a>", array('class' => 'control-label col-sm-3', 'for' => $forms['tos']['key']));
?>
				<div class="col-sm-4">
					<?php 
echo FORM::select($forms['tos']['key'], $pages, $forms['tos']['value'], array('placeholder' => "http://foo.com/", 'class' => 'tips form-control', 'id' => $forms['tos']['key'], 'data-content' => __("If you choose to use terms of service, you can select activate. And to edit content, select link 'Content' on your admin panel sidebar. Find page named 'Terms of service' click 'Edit'. In section 'Description' add content that suits you."), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Terms of Service")));
?>
 
				</div>
			</div>
			<div class="form-group">
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:31,代码来源:advertisement.php


示例10:

            echo $reservation->number;
            ?>
 / 12 Lessons
						<?php 
        } else {
            ?>
							<span class="icon-course1"><?php 
            echo Model_Lessontime::getCourse($reservation->language);
            ?>
</span>
						<?php 
        }
        ?>
					</div>
					<?php 
        $text = Model_Content::find("first", ["where" => [["number", $reservation->number], ["type_id", $reservation->language], ["text_type_id", 0], ["deleted_at", 0]]]);
        if ($text != null) {
            ?>
					<p class="textbook"><?php 
            echo Html::anchor("contents/{$text->path}", '<i class="fa fa-fw fa-book"></i> ', ["target" => "_blank"]);
            ?>
</p>
					<?php 
        }
        ?>
				</li>
				<?php 
    }
    ?>
			</ul>
			<?php 
开发者ID:Trd-vandolph,项目名称:game-bootcamp,代码行数:31,代码来源:top.php


示例11: getByNid

 public function getByNid($nid)
 {
     $model = new Model_Content();
     return $model->getByNid($nid);
 }
开发者ID:iloster,项目名称:rumor-php,代码行数:5,代码来源:Content.php


示例12: action_delete

 /**
  * action: DELETE
  */
 public function action_delete()
 {
     $this->auto_render = FALSE;
     $id = $this->request->param('id');
     $content = new Model_Content($id);
     $type = $content->type;
     $locale = $content->locale;
     if ($content->loaded()) {
         try {
             $content->delete();
             Cache::instance()->delete_all();
             $this->template->content = 'OK';
             Alert::set(Alert::SUCCESS, __('Content is deleted'));
         } catch (Exception $e) {
             Alert::set(Alert::ERROR, $e->getMessage());
         }
     } else {
         Alert::set(Alert::INFO, __('Content is not deleted'));
     }
     Request::current()->redirect(Route::url('oc-panel', array('controller' => 'content', 'action' => 'list')) . '?type=' . $type . '&locale_select=' . $locale);
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:24,代码来源:content.php


示例13: action_saveorder

 /**
  * saves the content in a specific order
  * @return void 
  */
 public function action_saveorder()
 {
     $this->auto_render = FALSE;
     $this->template = View::factory('js');
     $locale = core::get('locale_select', core::config('i18n.locale'));
     if ($contents = Model_Content::get_contents(core::get('type'), $locale)) {
         $order = Core::get('order');
         //using order they send us
         foreach ($order as $key => $value) {
             $c = new Model_Content($value);
             $c->order = $key;
             $c->save();
         }
         Core::delete_cache();
         $this->template->content = __('Saved');
     } else {
         $this->template->content = __('Error');
     }
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:23,代码来源:content.php


示例14: before

 /**
  * Automatically executed before the widget action. Can be used to set
  * class properties, do authorization checks, and execute other custom code.
  *
  * @return  void
  */
 public function before()
 {
     $this->page_items = Model_Content::get_pages();
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:10,代码来源:pages.php


示例15: action_203

 /**
  * This function will upgrade configs that didn't existed in versions prior to 2.0.3 
  */
 public function action_203()
 {
     // build array with new (missing) configs
     $configs = array(array('config_key' => 'watermark', 'group_name' => 'image', 'config_value' => '0'), array('config_key' => 'watermark_path', 'group_name' => 'image', 'config_value' => ''), array('config_key' => 'watermark_position', 'group_name' => 'image', 'config_value' => '0'), array('config_key' => 'ads_in_home', 'group_name' => 'advertisement', 'config_value' => '0'));
     $contents = array(array('order' => '0', 'title' => 'Hello [USER.NAME]!', 'seotitle' => 'user-profile-contact', 'description' => "User [EMAIL.SENDER] [EMAIL.FROM], have a message for you: \n\n [EMAIL.SUBJECT] \n\n[EMAIL.BODY]. \n\n Regards!", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'));
     // returns TRUE if some config is saved
     $return_conf = Model_Config::config_array($configs);
     $return_cont = Model_Content::content_array($contents);
 }
开发者ID:johnulist,项目名称:openclassifieds2,代码行数:12,代码来源:update.php


示例16: content

 /**
  * sends an email using content from model_content
  * @param  string $to        
  * @param  string $to_name   
  * @param  string $from      
  * @param  string $from_name 
  * @param  string $content   seotitle from Model_Content
  * @param  array $replace   key value to replace at subject and body
  * @param  array $file      file to attach to email
  * @return boolean            s
  */
 public static function content($to, $to_name = '', $from = NULL, $from_name = NULL, $content, $replace, $file = NULL)
 {
     $email = Model_Content::get_by_title($content, 'email');
     //content found
     if ($email->loaded()) {
         if ($replace === NULL) {
             $replace = array();
         }
         if ($from === NULL) {
             $from = $email->from_email;
         }
         if ($from_name === NULL) {
             $from_name = core::config('general.site_name');
         }
         if (isset($file) and self::is_valid_file($file)) {
             $file_upload = $file;
         } else {
             $file_upload = NULL;
         }
         //adding extra replaces
         $replace += array('[SITE.NAME]' => core::config('general.site_name'), '[SITE.URL]' => core::config('general.base_url'), '[USER.NAME]' => $to_name);
         if (!is_array($to)) {
             $replace += array('[USER.EMAIL]' => $to);
         }
         //adding anchor tags to any [URL.* match
         foreach ($replace as $key => $value) {
             if (strpos($key, '[URL.') === 0 or $key == '[SITE.URL]' and $value != '') {
                 $replace[$key] = '<a href="' . $value . '">' . parse_url($value, PHP_URL_HOST) . '</a>';
             }
         }
         $subject = str_replace(array_keys($replace), array_values($replace), $email->title);
         $body = str_replace(array_keys($replace), array_values($replace), $email->description);
         return Email::send($to, $to_name, $subject, $body, $from, $from_name, $file_upload);
     } else {
         return FALSE;
     }
 }
开发者ID:nick-catanchin-ie,项目名称:common,代码行数:48,代码来源:email.php


示例17: before

 /**
  * Automatically executed before the widget action. Can be used to set
  * class properties, do authorization checks, and execute other custom code.
  *
  * @return  void
  */
 public function before()
 {
     $pages = new Model_Content();
     $pages = $pages->select('seotitle', 'title')->where('type', '=', 'page')->where('status', '=', 1)->order_by('order', 'asc')->cached()->find_all();
     $this->page_items = Model_Content::get_pages();
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:12,代码来源:pages.php


示例18: post_changecontenttype

 public function post_changecontenttype()
 {
     $code = 0;
     $message = "ok";
     if ($this->auth_status) {
         $content = Model_Content::find(Input::post("id", 0));
         if ($content != null) {
             $content->type_id = Input::post("type_id", 0);
             $content->text_type_id = Input::post("text_type_id", 0);
             $content->exam = NULL;
             $content->save();
         } else {
             $code = 404;
             $message = "Content not found.";
         }
     } else {
         $code = 500;
         $message = "Auth error.";
     }
     $this->response(array('code' => $code, 'message' => $message));
 }
开发者ID:Trd-vandolph,项目名称:game-bootcamp,代码行数:21,代码来源:api.php


示例19: copy

 public static function copy($from_locale, $to_locale, $type)
 {
     //get the contents for type locale
     $contents = Model_Content::get_contents($type, $to_locale);
     //only if theres no existent content
     if (count($contents) == 0) {
         $prefix = Database::instance()->table_prefix();
         $query = "INSERT INTO " . $prefix . "content (locale,`order`,title,seotitle,description,from_email,type,status)\n                        SELECT '" . $to_locale . "',`order`,title,seotitle,description,from_email,type,status\n                        FROM " . $prefix . "content\n                        WHERE type='" . $type . "' AND locale='" . $from_locale . "'";
         try {
             DB::query(Database::DELETE, $query)->execute();
         } catch (Exception $e) {
             Alert::set(Alert::ERROR, $e->getMessage());
         }
         return TRUE;
     }
     return FALSE;
 }
开发者ID:nick-catanchin-ie,项目名称:common,代码行数:17,代码来源:content.php


示例20: action_12

 /**
  * This function will upgrade configs  
  */
 public function action_12()
 {
     //coupons product
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "coupons` ADD  `id_product` INT NULL DEFAULT NULL AFTER  `id_coupon`")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` ADD  `notes` VARCHAR( 245 ) NULL DEFAULT NULL")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` ADD  `signature` VARCHAR( 245 ) NULL DEFAULT NULL")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "visits` DROP  `contacted`")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "posts` ADD  `id_post_parent` INT NULL DEFAULT NULL AFTER  `id_user`")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "posts` ENGINE = MYISAM ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "products` ADD `rate` FLOAT( 4, 2 ) NULL DEFAULT NULL ;")->execute();
     } catch (exception $e) {
     }
     DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS  `" . self::$db_prefix . "forums` (\n                      `id_forum` int(10) unsigned NOT NULL AUTO_INCREMENT,\n                      `name` varchar(145) NOT NULL,\n                      `order` int(2) unsigned NOT NULL DEFAULT '0',\n                      `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n                      `id_forum_parent` int(10) unsigned NOT NULL DEFAULT '0',\n                      `parent_deep` int(2) unsigned NOT NULL DEFAULT '0',\n                      `seoname` varchar(145) NOT NULL,\n                      `description` varchar(255) NULL,\n                      PRIMARY KEY (`id_forum`) USING BTREE,\n                      UNIQUE KEY `" . self::$db_prefix . "forums_IK_seo_name` (`seoname`)\n                    ) ENGINE=MyISAM")->execute();
     DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS " . self::$db_prefix . "reviews (\n                    id_review int(10) unsigned NOT NULL AUTO_INCREMENT,\n                    id_user int(10) unsigned NOT NULL,\n                    id_order int(10) unsigned NOT NULL,\n                    id_product int(10) unsigned NOT NULL,\n                    rate int(2) unsigned NOT NULL DEFAULT '0',\n                    description varchar(1000) NOT NULL,\n                    created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n                    ip_address float DEFAULT NULL,\n                    status tinyint(1) NOT NULL DEFAULT '0',\n                    PRIMARY KEY (id_review) USING BTREE,\n                    KEY " . self::$db_prefix . "reviews_IK_id_user (id_user),\n                    KEY " . self::$db_prefix . "reviews_IK_id_order (id_order),\n                    KEY " . self::$db_prefix . "reviews_IK_id_product (id_product)\n                    ) ENGINE=MyISAM;")->execute();
     // build array with new (missing) configs
     $configs = array(array('config_key' => 'minify', 'group_name' => 'general', 'config_value' => '0'), array('config_key' => 'stripe_public', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'stripe_private', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'stripe_address', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'alternative', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'related', 'group_name' => 'product', 'config_value' => '5'), array('config_key' => 'faq', 'group_name' => 'general', 'config_value' => '0'), array('config_key' => 'faq_disqus', 'group_name' => 'general', 'config_value' => ''), array('config_key' => 'forums', 'group_name' => 'general', 'config_value' => '0'), array('config_key' => 'reviews', 'group_name' => 'product', 'config_value' => '0'), array('config_key' => 'demo_theme', 'group_name' => 'product', 'config_value' => 'yeti'), array('config_key' => 'demo_resize', 'group_name' => 'product', 'config_value' => '1'));
     $contents = array(array('order' => '0', 'title' => '[EMAIL.SENDER] wants to contact you!', 'seotitle' => 'contact-admin', 'description' => "Hello Admin,\n\n [EMAIL.SENDER]: [EMAIL.FROM], have a message for you:\n\n [EMAIL.BODY] \n\n Regards!", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => '0', 'title' => 'Ticket assigned to you: [TITLE]', 'seotitle' => 'assign-agent', 'description' => '[URL.QL]\\n\\n[DESCRIPTION]', 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => '0', 'title' => 'New review for [TITLE] [RATE]', 'seotitle' => 'review-product', 'description' => '[URL.QL]\\n\\n[RATE]\\n\\n[DESCRIPTION]', 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => '0', 'title' => 'New support ticket created `[TITLE]`', 'seotitle' => 'new-ticket', 'description' => 'We have received your support inquiry. We will try to answer you within the next 24 working hours, thank you for your patience.\\n\\n[URL.QL]', 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'));
     // returns TRUE if some config is saved
     $return_conf = Model_Config::config_array($configs);
     $return_cont = Model_Content::content_array($contents);
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:43,代码来源:update.php



注:本文中的Model_Content类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Model_Context类代码示例发布时间:2022-05-23
下一篇:
PHP Model_Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap