SlideShare a Scribd company logo
Submit Search
Upload
Login
Signup
XOOPS Cube Conference 2012 Developer Workshop 4
Report
Hikawa Kilica
Follow
Jul. 2, 2012
•
0 likes
•
95,994 views
1
of
8
XOOPS Cube Conference 2012 Developer Workshop 4
Jul. 2, 2012
•
0 likes
•
95,994 views
Download Now
Download to read offline
Report
Self Improvement
Hikawa Kilica
Follow
Recommended
XOOPS Cube Conference 2012 Developer Workshop 2
Hikawa Kilica
678 views
•
4 slides
Programma carte di natale as_mi
officinadellostorico
244 views
•
1 slide
Gli archivi nel tempo
officinadellostorico
787 views
•
55 slides
Gasparoni il masnadiero. Mito storia e fantasia
officinadellostorico
946 views
•
19 slides
I testamenti raccontano
officinadellostorico
1.4K views
•
17 slides
Gasparoni il masnadiero. Mito storia e fantasia
officinadellostorico
882 views
•
19 slides
More Related Content
Featured
Introduction to Data Science
Christy Abraham Joy
49.1K views
•
51 slides
Time Management & Productivity - Best Practices
Vit Horky
160.1K views
•
42 slides
The six step guide to practical project management
MindGenius
29.5K views
•
27 slides
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
9.1K views
•
21 slides
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
53.8K views
•
138 slides
12 Ways to Increase Your Influence at Work
GetSmarter
400.5K views
•
64 slides
Featured
(20)
Introduction to Data Science
Christy Abraham Joy
•
49.1K views
Time Management & Productivity - Best Practices
Vit Horky
•
160.1K views
The six step guide to practical project management
MindGenius
•
29.5K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
•
9.1K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
•
53.8K views
12 Ways to Increase Your Influence at Work
GetSmarter
•
400.5K views
ChatGPT webinar slides
Alireza Esmikhani
•
28.1K views
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
•
6.2K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
•
3.1K views
Barbie - Brand Strategy Presentation
Erica Santiago
•
23.9K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
•
25.1K views
Introduction to C Programming Language
Simplilearn
•
8.2K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software
•
88.1K views
9 Tips for a Work-free Vacation
Weekdone.com
•
7K views
I Rock Therefore I Am. 20 Legendary Quotes from Prince
Empowered Presentations
•
142.7K views
How to Map Your Future
SlideShop.com
•
274.9K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast
•
3.3K views
Read with Pride | LGBTQ+ Reads
Kayla Martin-Gant
•
1K views
Exploring ChatGPT for Effective Teaching and Learning.pptx
Stan Skrabut, Ed.D.
•
56.3K views
How to train your robot (with Deep Reinforcement Learning)
Lucas García, PhD
•
42.2K views
XOOPS Cube Conference 2012 Developer Workshop 4
1.
ニュースモジュールを 作ってみよう
2012年6月 氷川 霧霞 @kilica on Twitter http://jp.xoopsdev.com/
2.
ニュースモジュール bulletin
3.
どんな機能が必要? 基本機能 • ニュース一覧(投稿日の新しい順) • ニュース詳細 •
ニュース投稿(編集) • ニュース削除 • フィールドは、 o id(topic_id) o タイトル(title) o カテゴリ(category_id) o 本文(content) o 投稿者(uid) o ニュース日時(newsdate) o 投稿日時(posttime)
4.
どんな機能が必要? 詳細 • 記事のカテゴリ分類 • タイトル、カテゴリ、本文は入力必須項目。id,
uid, 投稿日時は自動入力。 • カテゴリID付きの投稿URLをリクエストした場合、投稿画面でそのカテゴリが選択 状態になっている • 投稿・削除は管理者(かサイト運営者が設定したグループ)のみが操作できる • 一覧および詳細画面での日時は「ニュース日時」が入っていれば「ニュース日時」、 なければ「投稿日時」を使う。 • 「ニュース日時」が設定されている場合、「ニュース日時」になるまではそのニュー スを表示しない。ただし、管理者にのみは表示する。
5.
カテゴリの設定 「カテゴリID付きの投稿URLをリクエストした場合、投稿画面でそのカテゴリが選択状 態になっている」 http://localhost/xoops/html/modules/mynews/index.php?action=TopicEdit&category_id=2 actions/TopicEditAction.class.php public
function prepare() { $req = $this->mRoot->mContext->mRequest; if($this->mObject->isNew()){ $this->mObject->set('uid', Legacy_Utils::getUid()); $this->mObject->set('category_id', $req- >getRequest('category_id')); } }
6.
管理者のみ投稿可能 投稿・削除は管理者(かサイト運営者が設定したグループ)のみが操作できる templates/mynews_topic_list.html <{if $xoops_isadmin}> <ul class="hmenu">
<li><a href="<{xoops_cooluri dirname=$dirname dataname=$dataname action=edit}>"><{$smarty.const._MD_MYNEWS_LANG_ADD_A_NEW_TOPIC}></a></li > </ul> <{/if}>
7.
テンプレートの編集 一覧および詳細画面での日時は「ニュース日時」が入っていれば「ニュース日時」、な ければ「投稿日時」を使う。 ニュース日時は初期値を0にする class/handler/topic.class.php $this->initVar('newsdate', XOBJ_DTYPE_INT,
0, false); テンプレートで表示する値を場合分けする (class/handler/news.class.php で showDate みたいなメソッドを追加する方法もあり) templates/mynews_topic_list.html templates/mynews_topic_view.html <{if $obj->getShow('newsdate')}> <{$obj->getShow('newsdate')|xoops_formattimestamp:m}> <{else}> <{$obj->getShow('posttime')|xoops_formattimestamp:m}> <{/if}>
8.
表示期間の設定 「ニュース日時」が設定されている場合、「ニュース日時」になるまではそのニュースを 表示しない。ただし、管理者にのみは表示する。 actions/TopicListAction.class.php public
function getDefaultView() { ... $criteria=$this->mFilter->getCriteria(); if($this->mRoot->mContext->mUser->isInRole('Site.Owner')===false){ $criteria->add(new Criteria('newsdate', time(), '<')); } ・・・ } actions/TopicViewAction.class.php