#set_tags(mahara,mahara patch)

* 日誌提示ブロックに「編集する」リンクを表示する。 [#iebda82f]

Mahara 1.5.2 で確認

http://sumi.riise.hiroshima-u.ac.jp/skitch/ramen.png

** artefact/blog/lib.php [#z851de7e]

#pre(soft){{
    631             }
    632             $smarty->assign('attachments', $attachments);
    633         }
    634         $smarty->assign('postedbyon', get_string('postedbyon', 'artefact.blog',
    635                                                  display_name($this->owner),
    636                                                  format_date($this->ctime)));
 
                &color(#ff0000){global $USER;};
                &color(#ff0000){$smarty->assign('viewbyowner',($USER->id==$this->owner)? 1:0);};
                &color(#ff0000){$smarty->assign('viewbyowner',($USER->id==$this->author || $USER->id==$this->owner)? 1:0);};
				
    637         return array('html' => $smarty->fetch('artefact:blog:render/blogpost_renderfull.tpl'),
    638                      'javascript' => '');
    639     }
}}

#pre(soft){{
    691         $data = get_records_sql_assoc('
    692             SELECT
    693                 a.id, a.title, a.description, a.author, a.authorname, ' .
    694                 db_format_tsfield('a.ctime', 'ctime') . ', ' . db_format_tsfield('a.mtime', 'mtime') . '    694 ,
    695                 a.locked, bp.published, a.allowcomments&color(#ff0000){, a.parent}; ' . $from . '
    696             ORDER BY bp.published ASC, a.ctime DESC',
    697             array($id),
    698             $offset, $limit
    699         );
}}


#pre(soft){{
    749             // Ensure images in the post have the right viewid associated with them
    750             if (!empty($viewoptions['viewid'])) {
    751                 safe_require('artefact', 'file');
    752                 $post->description = ArtefactTypeFolder::append_view_url($post->description, $viewoptions['viewid']);
    753             }
	            &color(#ff0000){global $USER;};
	            &color(#ff0000){$post->viewbyowner=($post->owner==$USER->id)? 1:0;};
	            &color(#ff0000){$post->viewbyowner=($post->author==$USER->id || $post->owner==$USER->id)? 1:0;};
    754         }
}}

$post->author==$USER->id を $post->owner==$USER->id に変更しました。(2012-09-28)

$post->author==$USER->id || $post->owner==$USER->id じゃないとだめかも… (2012-09-28)

753行目の後の global $USER が抜けていました… orz 自分の所では、ちょっと離れたループの外で宣言していて、ここに書くのを忘れていました。(2012-10-12)

** artefact/blog/theme/raw/viewposts.tpl [#u90cd574]

#pre(soft){{
     26     {if $options.viewid && $post->allowcomments} | <a href="{$WWWROOT}view/artefa
     26 ct.php?artefact={$post->id}&view={$options.viewid}">{str tag=Comments section=art
     26 efact.comment} ({$post->commentcount})</a>{/if}&color(#ff0000){%%</div>%%};

            &color(#ff0000){{if $post->viewbyowner} };
            &color(#ff0000){  | <a href="{$WWWROOT}artefact/blog/post.php?id={$post->id}"> };
            &color(#ff0000){     {str tag=editblogpost section=artefact.blog}</a> };
            &color(#ff0000){  | <a href="{$WWWROOT}artefact/blog/post.php?blog={$post->parent}"> };
            &color(#ff0000){     {str tag=addpost section=artefact.blog}</a> };
            &color(#ff0000){{/if}</div>	 };

     27   </td>
}}

** artefact/blog/theme/raw/render/blogpost_renderfull.tpl [#b106b749]

#pre(soft){{
     23     {if isset($commentcount) && $artefact->get('allowcomments')} | <a href="{$art
     23 efacturl}">{str tag=Comments section=artefact.comment} ({$commentcount})</a>{/if}
 
            &color(#ff0000){{if $viewbyowner} };
            &color(#ff0000){  | <a href="{$WWWROOT}artefact/blog/post.php?id={$artefact->get('id')}"> };
            &color(#ff0000){     {str tag=editblogpost section=artefact.blog}</a> };
            &color(#ff0000){{/if} };
      
     24   </div>
}}

トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS