Example #1
0
                //get custom icons for this forum
                $topic_icons = get_topic_icons($forum_id, false);
                //and display them
                while (list($key, $val) = each($topic_icons)) {
                    $template->assign_block_vars('catrow.forumrow.icon', array('ICON_SRC' => $val['icon_url'], 'U_REMOVE_ICON' => URL::admin("&do=topic_icons&remove=true&id=" . $val['icon_id'])));
                }
            }
            // if ... forumid == catid
        }
        // for ... forums
    }
    // for ... categories
}
// if ... total_categories
//get global custom icons
$topic_icons = get_topic_icons(-1, false);
//and display them
while (list($key, $val) = each($topic_icons)) {
    $template->assign_block_vars('globalicon', array('ICON_SRC' => $val['icon_url'], 'U_REMOVE_GLOBAL_ICON' => URL::admin("&do=topic_icons&remove=true&id=" . $val['icon_id'])));
}
$template->set_filenames(array('body' => 'forums/admin/topic_icons_select_body.html'));
$lang_icons_admin['display001'] = 'Topic Icons';
$lang_icons_admin['display002'] = 'This page allows you to add and remove topic icons from your forums. To add an icon, check the box for each forum you wish to add the icon to, and fill in the details at the bottom of this page. To remove an icon, click on it. This will also remove that icon from all topics using that icon, which may be quite a big change so you will need to give confirmation. Removing an icon is not reversible - you may want to take a database backup first.';
$lang_icons_admin['display003'] = 'Forum Icons';
$lang_icons_admin['display004'] = 'Add';
$lang_icons_admin['display005'] = 'Global Icons';
$lang_icons_admin['add001'] = 'Add an icon';
$lang_icons_admin['add002'] = 'Icon path (from root) EG \'images/icons/icon1.gif\'';
$lang_icons_admin['add003'] = 'Icon name';
$lang_icons_admin['add004'] = "Global?";
$lang_icons_admin['add005'] = 'Add icon';
Example #2
0
}
//
// Include page header
//
require_once 'includes/phpBB/page_header.php';
$template->set_filenames(array('body' => 'forums/posting_body.html', 'pollbody' => 'forums/posting_poll_body.html', 'reviewbody' => 'forums/posting_topic_review.html'));
make_jumpbox('viewforum');
$template->assign_vars(array('FORUM_NAME' => $forum_name, 'FORUM_DESC' => $forum_desc, 'BC_DELIM' => _BC_DELIM, 'L_POST_A' => $page_title, 'L_POST_SUBJECT' => $lang['Post_subject'], 'U_VIEW_FORUM' => URL::index("&file=viewforum&" . POST_FORUM_URL . "={$forum_id}")));
//
// This enables the forum/topic title to be output for posting
// but not for privmsg (where it makes no sense)
//
$template->assign_block_vars('switch_not_privmsg', array());
//get custom icons for this forum
if (!empty($forum_id)) {
    $topic_icons = get_topic_icons($forum_id);
}
//if this forum has icons
$set_topic_icon = !empty($topic_icons) && ($mode == 'newtopic' || $mode == 'editpost' && $post_data['first_post']);
if ($set_topic_icon) {
    //if new topic, or we are editing the first post of a topic
    $icons_array = "var icons_array = new Array();icons_array[0]='images/spacer.gif';";
    $topic_icon_post = isset($_POST['topic_icon']) ? intval($_POST['topic_icon']) : NULL;
    while (list($key, $val) = each($topic_icons)) {
        $selected = '';
        if (isset($topic_icon_post) && $val['icon_id'] == $topic_icon_post) {
            //icon is set in post data EG preview. this must override all
            //note: no icon is 0 in which case this will never pass
            $selected = 'selected';
        } else {
            if (isset($post_data['icon_id']) && $val['icon_id'] == $post_data['icon_id']) {