How to set up a news publication, the automatic Activate
8 posts
• Page 1 of 1
How to set up a news publication, the automatic Activate
How to set up a news publication, the automatic Activate? 
TomatoCms Chinese version demo (中文版本演示)
http://www.showip.cn
http://www.showip.cn
- ooabcoo
- Posts: 38
- Joined: Tue May 25, 2010 3:45 am
Re: How to set up a news publication, the automatic Activate
You can't activate automatic articles.
If you sill want to activate automatic articles, you correct as follows:
Go to app\modules\news\controllers\ArticleController.php file, in addAction (line: 350):
[Before]
[After]
If you sill want to activate automatic articles, you correct as follows:
Go to app\modules\news\controllers\ArticleController.php file, in addAction (line: 350):
[Before]
- Code: Select all
$article = new Tomato_Modules_News_Models_Article(array(
'category_id' => $categoryId,
'title' => strip_tags($title),
'sub_title' => strip_tags($subTitle),
'slug' => $slug,
'description' => $description,
'content' => $content,
'allow_comment' => $allowComment,
'created_date' => date('Y-m-d H:i:s'),
'created_user_id' => $user->user_id,
'created_user_name' => $user->user_name,
'author' => strip_tags($author),
'icons' => $articleIcons,
'sticky' => false,
));
[After]
- Code: Select all
$article = new Tomato_Modules_News_Models_Article(array(
'category_id' => $categoryId,
'title' => strip_tags($title),
'sub_title' => strip_tags($subTitle),
'slug' => $slug,
'description' => $description,
'content' => $content,
'allow_comment' => $allowComment,
'created_date' => date('Y-m-d H:i:s'),
'created_user_id' => $user->user_id,
'created_user_name' => $user->user_name,
'author' => strip_tags($author),
'icons' => $articleIcons,
'sticky' => false,
'status' => 'active',
));
- LeHa
- Posts: 143
- Joined: Tue Jan 19, 2010 1:50 am
Re: How to set up a news publication, the automatic Activate
Thank you! 
TomatoCms Chinese version demo (中文版本演示)
http://www.showip.cn
http://www.showip.cn
- ooabcoo
- Posts: 38
- Joined: Tue May 25, 2010 3:45 am
Re: How to set up a news publication, the automatic Activate
- Code: Select all
$article = new Tomato_Modules_News_Models_Article(array(
'category_id' => $categoryId,
'title' => strip_tags($title),
'sub_title' => strip_tags($subTitle),
'slug' => $slug,
'description' => $description,
'content' => $content,
'allow_comment' => $allowComment,
'created_date' => date('Y-m-d H:i:s'),
'created_user_id' => $user->user_id,
'created_user_name' => $user->user_name,
'author' => strip_tags($author),
'icons' => $articleIcons,
'sticky' => false,
));
if ($preview) {
$article->status = 'draft';
Also must increase following 4 lines,
- Code: Select all
'status' => 'active',
'updated_date' => date('Y-m-d H:i:s'),
'updated_user_id' => $user->user_id,
'updated_user_name' => $user->user_name,
));
if ($preview) {
$article->status = 'draft';
Main title 1
Posted by admin at 2010-05-27 14:56:37
Last activated by at 1970-01-01 01:00:00 Activated

Last edited by ooabcoo on Thu May 27, 2010 2:04 pm, edited 1 time in total.
TomatoCms Chinese version demo (中文版本演示)
http://www.showip.cn
http://www.showip.cn
- ooabcoo
- Posts: 38
- Joined: Tue May 25, 2010 3:45 am
Re: How to set up a news publication, the automatic Activate
TomatoCms Chinese version demo (中文版本演示)
http://www.showip.cn
http://www.showip.cn
- ooabcoo
- Posts: 38
- Joined: Tue May 25, 2010 3:45 am
Re: How to set up a news publication, the automatic Activate
oh, I'm sorry.
You have to set 'activate_date' => date('Y-m-d H:i:s').
You have to set 'activate_date' => date('Y-m-d H:i:s').
- Code: Select all
$article = new Tomato_Modules_News_Models_Article(array(
'category_id' => $categoryId,
'title' => strip_tags($title),
'sub_title' => strip_tags($subTitle),
'slug' => $slug,
'description' => $description,
'content' => $content,
'allow_comment' => $allowComment,
'created_date' => date('Y-m-d H:i:s'),
'created_user_id' => $user->user_id,
'created_user_name' => $user->user_name,
'author' => strip_tags($author),
'icons' => $articleIcons,
'sticky' => false,
'status' => 'active',
'activate_date' => 'date('Y-m-d H:i:s')',
));
- LeHa
- Posts: 143
- Joined: Tue Jan 19, 2010 1:50 am
Re: How to set up a news publication, the automatic Activate
Yes
TomatoCms Chinese version demo (中文版本演示)
http://www.showip.cn
http://www.showip.cn
- ooabcoo
- Posts: 38
- Joined: Tue May 25, 2010 3:45 am
Re: How to set up a news publication, the automatic Activate
If you ask me.
The easy way to do it is to forward to activation method after saving the article.
You can even add checkbox in the Article add.phtml to handle do you want to activate it or not.
This way you don't need to change sqls and so on, you just run 'automatic' the activation action.
The easy way to do it is to forward to activation method after saving the article.
You can even add checkbox in the Article add.phtml to handle do you want to activate it or not.
This way you don't need to change sqls and so on, you just run 'automatic' the activation action.
- simmol
- Posts: 5
- Joined: Tue Jun 01, 2010 12:16 pm
8 posts
• Page 1 of 1
Return to General Announcement
Who is online
Users browsing this forum: No registered users and 1 guest