本文整理汇总了PHP中API::lchart方法的典型用法代码示例。如果您正苦于以下问题:PHP API::lchart方法的具体用法?PHP API::lchart怎么用?PHP API::lchart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API::lchart方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
$_criteria = new CDbCriteria();
$_criteria->condition = ' find_in_set(category_id, :category_id)';
if (isset($_GET['id'])) {
// sepcial node
if (is_numeric($_GET['id'])) {
$node = Category::model()->findByPk($_GET['id']);
} else {
$node = Category::model()->findByAttributes(array('ident_label' => $_GET['id']));
}
if ($node === null) {
throw new CHttpException(404, 'The requested Node does not exist.');
}
$this->_pageTitle = $node->name . API::lchart();
$articles = $node->forumarticles;
$_criteria->params[':category_id'] = $node->id;
} else {
//site index
$model = Category::model()->findByAttributes(array('ident_label' => 'forum_node'));
$criteria = new CDbCriteria();
$criteria->condition = ' find_in_set(category_id, :category_id)';
$criteria->order = 'reply_time desc';
$criteria->limit = '20';
$leafs = Category::model()->findAll(array('select' => 'id, name', 'condition' => ' rgt <= :rgt AND lft >= :lft ', 'params' => array(':rgt' => $model->rgt, ':lft' => $model->lft)));
$all_leafs = '';
foreach ($leafs as $_leaf) {
$all_leafs .= $_leaf->id . ',';
}
$criteria->params[':category_id'] = $all_leafs;
$articles = Article::model()->findAll($criteria);
$_criteria->params[':category_id'] = $all_leafs;
}
$latest_articles = Article::model()->latest()->findAll($_criteria);
$this->render('index', array('latest_articles' => $latest_articles, 'articles' => $articles, 'node' => $node));
}
示例2: actionIndex
public function actionIndex()
{
$u =& $this->iuser;
$this->_pageTitle = '主题回复提醒' . API::lchart();
$this->render('index', array('notices' => $u->notices));
}
示例3: actionCreate
public function actionCreate()
{
$model = new Article('forum');
// $model->content = "<p></p>";
$model->category_id = $_GET['f'];
if (isset($_POST['Article']) && !Yii::app()->user->isGuest) {
$model->attributes = $_POST['Article'];
$model->reply_time = $model->update_time = $model->create_time = date("Y-m-d H:i:s");
$model->user_id = Yii::app()->user->id;
if ($model->save()) {
$this->redirect(array('t/index', 'id' => $model->id));
exit;
}
}
$node = Category::model()->findByPk($_GET['f']);
if ($node === null) {
throw new CHttpException(404, 'The requested Node does not exist.');
}
if ($model->content == '') {
// $model->content = "<p></p>";
}
$this->_pageTitle = '新主题' . API::lchart() . $node->name . API::lchart();
$this->render('create', array('model' => $model, 'node' => $node));
}
示例4: actionReset
public function actionReset()
{
$token = trim($_GET['token']);
$model = new ResetPasswordForm();
if (isset($_POST['ResetPasswordForm'])) {
$model->attributes = $_POST['ResetPasswordForm'];
if ($model->validate() && $model->reset()) {
$str = '密码重置成功,请试着登录下!';
Yii::app()->user->setFlash('success', $str);
$this->redirect(array('s/signin'));
}
} else {
$record = User::model()->findByAttributes(array('token' => $token));
$model->token = $record->token;
if ($record == null) {
throw new CHttpException(404, 'The requested Reset Password does not exist.');
exit;
}
}
$this->_pageTitle = '重新设置密码' . API::lchart();
$this->render('reset', array('record' => $record, 'model' => $model));
}
示例5: actionSetting
public function actionSetting()
{
$m = new SettingForm();
$user =& $this->iuser;
$m->id = $user->id;
$m->sign = $user->sign;
if (isset($_POST['SettingForm'])) {
$m->attributes = $_POST['SettingForm'];
$m->avatar = CUploadedFile::getInstance($m, 'avatar');
// $user->avatar->saveAs('/home/paranoid/projects/infuzhou/123.jpg');
// $user->save(false);
if ($m->validate() && $m->setting()) {
$str = '会员资料已保存,';
if (strlen($m->password) > 0) {
$str .= "密码已更新!";
} else {
$str .= "密码未更新!";
}
Yii::app()->user->setFlash('success', $str);
}
$user = User::model()->findByPk(Yii::app()->user->id);
}
$m->password = $m->rpassword = '';
$this->_pageTitle = '会员资料设置' . API::lchart();
$this->render('setting', array('m' => $m, 'user' => $user));
}