function blogitSkinMU($fn, $opt, $txt) { global $bi_AuthorGroup, $bi_Pagename, $bi_CommentsEnabled, $bi_LinkToCommentSite, $bi_CommentPattern, $EnableBlocklist, $bi_Pages; $args = ParseArgs($opt); #$args['p'], args[]['s'] $dateFmt = array('long' => '%B %d, %Y, at %I:%M %p', 'short' => '%B %d, %Y', 'entry' => '%d-%m-%Y %H:%M'); switch ($fn) { case 'date': return ME_ftime(XL(array_key_exists($args['fmt'], $dateFmt) ? $dateFmt[$args['fmt']] : $args['fmt']), '@' . $txt); case 'intro': return '(:div999991 class="' . $args['class'] . '":)' . blogitMU_intro('', $txt) . '%blogit-more%' . blogitMU_more($args['page'], $txt) . "%%\n(:div99991end:)"; case 'author': return $txt > '' ? $args['pre_text'] . (PageExists(MakePageName($bi_Pagename, "{$bi_AuthorGroup}/{$txt}")) ? "[[{$bi_AuthorGroup}/{$txt}]]" : $txt) . $args['post_text'] : ''; case 'edit': return bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_be', $txt, $args['post-text']) : ''; case 'newentry': return bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link($args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, $args['post-text']) : ''; case 'delete': return bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_del', $txt, $args['post-text']) : ''; case 'commentedit': return bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_ce', '$[edit]', $args['post_text']) : ''; case 'commentdelete': return bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_del', '$[delete]', $args['post_text']) : ''; case 'commentreply': return bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], bi_BasePage($txt), 'bi_cr', '$[reply]', $args['post_text']) : ''; case 'commentapprove': return bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_' . ($args['status'] == 'true' ? 'cua' : 'ca'), '$[' . ($args['status'] == 'true' ? 'un' : '') . 'approve]', $args['post_text']) : ''; case 'commentblock': return IsEnabled($EnableBlocklist) && bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_bip', '$[block]', $args['post_text']) : ''; case 'tags': return $txt > '' ? $args['pre_text'] . bi_SaveTags('', $txt, 'display') . $args['post_text'] : ''; case 'commentcount': return $args['status'] != 'none' && $bi_CommentsEnabled != 'none' ? $args['pre_text'] . '[[' . $args['group'] . '.' . $args['name'] . '#blogit-comment-list | ' . '(:includesection "#comments-count-pagelist entrygroup=\'' . $args['group'] . '\' entryname=\'' . $args['name'] . '\' commentstatus=true":)' . $txt . ']]' . $args['post_text'] : ''; case 'commentauthor': return $bi_LinkToCommentSite == 'true' && $args['website'] > '' ? '[[' . $args['website'] . ' | ' . $args['author'] . ']]' : $args['author']; case 'commenttext': return strtr($txt, array("\r\n" => '<br />', "\r" => '<br />', "\n" => '<br />', "\v" => '<br />')); case 'commentid': return 'bi_ID' . (preg_match($bi_CommentPattern, $txt, $m) ? $m[3] : $txt); #1-group; 2-name; 3-commentid, OR FullName for blog-list } }
function blogitSkinMU($fn, $opt, $txt) { global $bi_AuthorGroup, $bi_Pagename, $bi_CommentsEnabled, $bi_LinkToCommentSite, $bi_CommentPattern, $EnableBlocklist, $bi_Pages; $args = ParseArgs($opt); //$args['p'], args[]['s'] $dateFmt = array('long' => '%B %d, %Y, at %I:%M %p', 'short' => '%B %d, %Y', 'entry' => '%d-%m-%Y %H:%M'); //Can't use {$x} below because markup is processed on 'fulltext', before FmtPV are processed. Thus, parameters need to be passed in. //Need to pass in pagename, since may be running from a pagelist, so pagename would be Blog.Blog, etc. switch ($fn) { case 'date': return ME_ftime(XL(array_key_exists($args['fmt'], $dateFmt) ? $dateFmt[$args['fmt']] : $args['fmt']), '@' . $txt); case 'intro': return '(:div999991 class="' . $args['class'] . '":)' . blogitMU_intro('', $txt) . '%blogit-more%' . blogitMU_more($args['page'], $txt) . "%%\n(:div99991end:)"; case 'author': return $txt > '' ? $args['pre_text'] . (PageExists(MakePageName($bi_Pagename, "{$bi_AuthorGroup}/{$txt}")) ? "[[{$bi_AuthorGroup}/{$txt}]]" : $txt) . $args['post_text'] : ''; //PmWiki will apply the last class in a line to all links, regardless of the class requested for each link. //So putting a class on a link means we need to ensure links are on separate lines either with (:nl:) or using LI lists //PmWiki will apply the last class in a line to all links, regardless of the class requested for each link. //So putting a class on a link means we need to ensure links are on separate lines either with (:nl:) or using LI lists case 'edit': return bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_be', $txt, $args['post_text'], 'bi-link-blog-edit') : ''; case 'newentry': return bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link($args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, $args['post_text'], 'bi-link-blog-new') : ''; //blog delete function on blog-grid //blog delete function on blog-grid case 'delete': return bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_del', $txt, $args['post_text'], 'bi-link-blog-delete') : ''; case 'commentedit': return bi_Auth('comment-edit ' . $txt) ? bi_Link($args['pre_text'], $txt, 'bi_ce', '$[edit]', $args['post_text'], 'bi-link-comment-edit', bi_BasePage($txt, $args['base'])) : ''; case 'commentdelete': return bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_del', '$[delete]', $args['post_text'], 'bi-link-comment-delete') : ''; case 'commentreply': return bi_Auth('comment-edit ' . bi_BasePage($txt, $args['base'])) ? bi_Link($args['pre_text'], bi_BasePage($txt, $args['base']), 'bi_cr', '$[reply]', $args['post_text'], 'bi-link-comment-reply') : ''; case 'commentapprove': return bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_' . ($args['status'] == 'true' ? 'cua' : 'ca'), '$[' . ($args['status'] == 'true' ? 'un' : '') . 'approve]', $args['post_text'], 'bi-link-comment-' . ($args['status'] == 'true' ? '' : 'un') . 'approved') : ''; case 'commentblock': return IsEnabled($EnableBlocklist) && bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_bip', '$[block]', $args['post_text'], 'bi-link-comment-block') : ''; case 'tags': return $txt > '' ? $args['pre_text'] . bi_SaveTags('', $txt, $args['page'], 'display') . $args['post_text'] : ''; //TODO: Why is this split by name/group? So #comments-count-pagelist can create group-name-* wildcard. Better to use basepage? //TODO: Why is this split by name/group? So #comments-count-pagelist can create group-name-* wildcard. Better to use basepage? case 'commentcount': return $args['status'] != 'none' && $bi_CommentsEnabled != 'none' ? $args['pre_text'] . '[[' . $args['group'] . '.' . $args['name'] . '#blogit-comment-list | ' . '(:includesection "#comments-count-pagelist entrygroup=\'' . $args['group'] . '\' entryname=\'' . $args['name'] . '\' commentstatus=true":)' . $txt . ']]' . $args['post_text'] : ''; case 'commentauthor': return $bi_LinkToCommentSite == 'true' && $args['website'] > '' ? '[[' . $args['website'] . ' | ' . $args['author'] . ']]' : $args['author']; case 'commenttext': return strtr($txt, array("\r\n" => '<br />', "\r" => '<br />', "\n" => '<br />', "\v" => '<br />')); case 'commentid': return 'bi_ID' . (preg_match($bi_CommentPattern, $txt, $m) ? $m[3] : $txt); //1-group; 2-name; 3-commentid, OR FullName for blog-list } }