15 changed files with 249 additions and 21 deletions
-
11app/controllers/TagController.php
-
41app/models/postn/Postn.php
-
31app/models/postn/PostnDAO.php
-
20app/models/tag/Tag.php
-
56app/models/tag/TagDAO.php
-
7app/views/tag.tpl
-
24app/widgets/Blog/Blog.php
-
24app/widgets/Blog/blog.tpl
-
13app/widgets/Group/_group_posts.tpl
-
13app/widgets/Post/_post.tpl
-
13app/widgets/Publish/Publish.php
-
14app/widgets/Publish/_publish_create.tpl
-
1bootstrap.php
-
1locales/locales.ini
-
1system/Route.php
@ -0,0 +1,11 @@ |
|||||
|
<?php |
||||
|
|
||||
|
class TagController extends BaseController { |
||||
|
function load() { |
||||
|
$this->session_only = false; |
||||
|
} |
||||
|
|
||||
|
function dispatch() { |
||||
|
$this->page->setTitle(__('page.tag')); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace modl; |
||||
|
|
||||
|
class Tag extends Model { |
||||
|
public $tag; |
||||
|
public $nodeid; |
||||
|
|
||||
|
public function __construct() { |
||||
|
$this->_struct = ' |
||||
|
{ |
||||
|
"tag" : |
||||
|
{"type":"string", "size":64, "mandatory":true, "key":true }, |
||||
|
"nodeid" : |
||||
|
{"type":"string", "size":96, "mandatory":true, "key":true } |
||||
|
}'; |
||||
|
|
||||
|
parent::__construct(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace modl; |
||||
|
|
||||
|
class TagDAO extends SQL { |
||||
|
function set(Tag $t) { |
||||
|
$this->_sql = ' |
||||
|
update tag |
||||
|
set nodeid = :nodeid, |
||||
|
tag = :tag |
||||
|
where nodeid = :nodeid |
||||
|
and tag = :tag'; |
||||
|
|
||||
|
$this->prepare( |
||||
|
'Tag', |
||||
|
array( |
||||
|
'nodeid' => $t->nodeid, |
||||
|
'tag' => $t->tag |
||||
|
) |
||||
|
); |
||||
|
|
||||
|
$this->run('Tag'); |
||||
|
|
||||
|
if(!$this->_effective) { |
||||
|
$this->_sql = ' |
||||
|
insert into tag |
||||
|
(nodeid, tag) |
||||
|
values (:nodeid, :tag)'; |
||||
|
|
||||
|
$this->prepare( |
||||
|
'Tag', |
||||
|
array( |
||||
|
'nodeid' => $t->nodeid, |
||||
|
'tag' => $t->tag |
||||
|
) |
||||
|
); |
||||
|
|
||||
|
$this->run('Tag'); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function getTags($nodeid) { |
||||
|
$this->_sql = ' |
||||
|
select * from tag |
||||
|
where nodeid = :nodeid'; |
||||
|
|
||||
|
$this->prepare( |
||||
|
'Tag', |
||||
|
array( |
||||
|
'nodeid' => $nodeid |
||||
|
) |
||||
|
); |
||||
|
|
||||
|
return $this->run('Tag'); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
<main> |
||||
|
<section> |
||||
|
<div style="background-color: #EEE;"> |
||||
|
<?php $this->widget('Blog');?> |
||||
|
</div> |
||||
|
</section> |
||||
|
</main> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue