123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- class ElggBlog extends ElggObject {
-
- protected function initializeAttributes() {
- parent::initializeAttributes();
- $this->attributes['subtype'] = "blog";
- }
-
- public function canComment($user_guid = 0) {
- $result = parent::canComment($user_guid);
- if ($result == false) {
- return $result;
- }
- if ($this->comments_on == 'Off') {
- return false;
- }
-
- return true;
- }
-
- public function getExcerpt($length = 250) {
- if ($this->excerpt) {
- return $this->excerpt;
- } else {
- return elgg_get_excerpt($this->description, $length);
- }
- }
- }
|