function show($_forum_id)
 {
     $url = new FreechURL('http://code.google.com/p/freech/', 'Powered by Freech ' . FREECH_VERSION);
     $this->api->links('footer')->add_link($url, 100);
     if (cfg('rss_enabled')) {
         $url = new FreechURL('rss.php', _('RSS feed'));
         $url->set_var('forum_id', (int) $_forum_id);
         $html = '<span id="rss">' . '<a href="' . $url->get_string(TRUE) . '">' . '<img src="themes/' . cfg('theme') . '/img/rss.png" alt="RSS 2.0" />' . '</a>' . '&nbsp;' . $url->get_html() . '</span>';
         $this->api->links('footer')->add_html($html, 200);
     }
     if (cfg('goto_top_enabled')) {
         $top_link = "<a id='goto_top' href='#top'>" . esc(_('Go to top')) . "</a>";
         $this->api->links('footer')->add_html($top_link, 300);
     }
     // Render the resulting template.
     $this->clear_all_assign();
     $this->assign_by_ref('view_links', $this->api->links('view'));
     $this->assign_by_ref('footer_links', $this->api->links('footer'));
     $this->render_php('footer.php.tmpl');
 }
Esempio n. 2
0
 function get_html()
 {
     // This entire method is an evil hack.
     $post_url = new FreechURL('', $this->get_attribute('subject'));
     $post_url->set_var('action', 'read');
     $post_url->set_var('msg_id', $this->get_attribute('id'));
     $post_url->set_var('forum_id', $this->get_attribute('forum_id'));
     $moderator_url = new FreechURL('', $this->get_moderator_name());
     $moderator_url->set_var('action', 'user_profile');
     $moderator_url->set_var('username', $this->get_moderator_name());
     $mod_icon = htmlentities($this->get_moderator_icon());
     $mod_groupname = htmlentities($this->get_moderator_group_name());
     $mod_icon_html = "<img src='{$mod_icon}'" . " title='{$mod_groupname}' alt='{$mod_groupname}' />";
     $mod_html = $moderator_url->get_html() . $mod_icon_html;
     $user_url = new FreechURL('', $this->get_attribute('username'));
     $user_url->set_var('action', 'user_profile');
     $user_url->set_var('username', $this->get_attribute('username'));
     $user_name = htmlentities($this->get_attribute('username'));
     $user_icon = htmlentities($this->get_attribute('user_icon'));
     $user_groupname = htmlentities($this->get_attribute('user_groupname'));
     $user_icon_html = "<img src='{$user_icon}'" . " title='{$user_groupname}' alt='{$user_groupname}' />";
     if ($this->get_attribute('user_groupname') == 'anonymous') {
         $user_html = $user_name . $user_icon_html;
     } else {
         $user_html = $user_url->get_html() . $user_icon_html;
     }
     $args = array('moderator_link' => $mod_html, 'posting_link' => $post_url->get_html(), 'posting_url' => $post_url->get_string(TRUE), 'user_link' => $user_html);
     $args = array_merge($args, $this->attributes);
     switch ($this->get_action()) {
         case 'lock_user':
             $text = _('[MODERATOR_LINK] has locked the account of "[USERNAME]".');
             break;
         case 'unlock_user':
             $text = _('[MODERATOR_LINK] has unlocked the account of "[USERNAME]".');
             break;
         case 'lock_posting':
             $text = _('[MODERATOR_LINK] has locked a' . ' <a href="[POSTING_URL]">posting</a> by [USER_LINK].');
             break;
         case 'unlock_posting':
             $text = _('[MODERATOR_LINK] has unlocked the posting' . ' [POSTING_LINK] by [USER_LINK].');
             break;
         case 'set_sticky':
             $text = _('[MODERATOR_LINK] has made the posting' . ' [POSTING_LINK] by [USER_LINK] sticky.');
             break;
         case 'remove_sticky':
             $text = _('[MODERATOR_LINK] has removed the sticky from' . ' [POSTING_LINK] by [USER_LINK].');
             break;
         case 'stub_posting':
             $text = _('[MODERATOR_LINK] has disabled responses to the posting' . ' [POSTING_LINK] by [USER_LINK].');
             break;
         case 'unstub_posting':
             $text = _('[MODERATOR_LINK] has enabled responses to the posting' . ' [POSTING_LINK] by [USER_LINK].');
             break;
         case 'move_thread':
             $text = _('[MODERATOR_LINK] has moved the thread' . ' [POSTING_LINK] by [USER_LINK].');
             break;
         default:
             die('Unknown modlog action.');
     }
     return replace_vars($text, $args);
 }