// Get array of available emoticon sets $emoticon_sets_array = emoticons_get_available(false); // Check for preview argument in URL. if (isset($_GET['pack']) && emoticons_set_exists($_GET['pack'])) { // Get the emoticon pack from the URL. $emoticon_set = basename($_GET['pack']); } else { if (isset($_SESSION['EMOTICONS']) && strlen(trim($_SESSION['EMOTICONS'])) > 0) { $emoticon_set = $_SESSION['EMOTICONS']; } else { // Get the user's emoticon pack. $emoticon_set = basename(forum_get_setting('default_emoticons', null, 'default')); } } // Check the emoticon set exists. if (!emoticons_set_exists($emoticon_set)) { // Use the forum default emoticon pack. $emoticon_set = basename(forum_get_setting('default_emoticons', null, 'default')); } // Make sure the emoticon set has no path info. $emoticon_set = basename($emoticon_set); // Output starts here html_draw_top(array('title' => gettext("Emoticons"), 'js' => array('js/emoticons.js'), 'pm_popup_disabled' => true, 'class' => 'window_title', 'emoticons' => $emoticon_set)); echo "<h1>", gettext("Emoticons"), "</h1>\n"; echo "<br />\n"; echo "<div align=\"center\">\n"; echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"450\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n";
$new_forum_settings['forum_content_rating'] = FORUM_RATING_GENERAL; } if (isset($_POST['forum_keywords']) && strlen(trim($_POST['forum_keywords'])) > 0) { $new_forum_settings['forum_keywords'] = trim($_POST['forum_keywords']); } else { $new_forum_settings['forum_keywords'] = ""; } if (isset($_POST['default_style']) && style_exists(trim($_POST['default_style']))) { $new_forum_settings['default_style'] = trim($_POST['default_style']); } else { $error_msg_array[] = gettext("You must choose a default forum style"); $valid = false; } if (isset($_POST['default_emoticons']) && strlen(trim($_POST['default_emoticons'])) > 0) { $new_forum_settings['default_emoticons'] = trim($_POST['default_emoticons']); if (!emoticons_set_exists($new_forum_settings['default_emoticons'])) { $error_msg_array[] = gettext("Unknown emoticons name"); $valid = false; } } else { $error_msg_array[] = gettext("You must choose default forum emoticons"); $valid = false; } if (isset($_POST['default_language']) && in_array($_POST['default_language'], $available_langs)) { $new_forum_settings['default_language'] = $_POST['default_language']; } else { $error_msg_array[] = gettext("You must choose a default forum language"); $valid = false; } if (forum_get_global_setting('allow_forum_google_analytics', 'Y')) { if (isset($_POST['enable_google_analytics']) && $_POST['enable_google_analytics'] == "Y") {
function html_get_emoticon_style_sheet($emoticon_set = false, $allow_cdn = true) { if ($emoticon_set && emoticons_set_exists($emoticon_set)) { $user_emoticon_pack = basename($emoticon_set); } else { if (isset($_SESSION['EMOTICONS']) && strlen(trim($_SESSION['EMOTICONS'])) > 0) { $user_emoticon_pack = $_SESSION['EMOTICONS']; } else { $user_emoticon_pack = forum_get_setting('default_emoticons', 'strlen', 'default'); } } if (emoticons_set_exists($user_emoticon_pack)) { return html_get_forum_file_path(sprintf('emoticons/%s/style.css', basename($user_emoticon_pack)), $allow_cdn); } return false; }
function html_get_emoticon_style_sheet($emoticon_set = false) { if ($emoticon_set && emoticons_set_exists($emoticon_set)) { $user_emoticons = basename($emoticon_set); } else { if (($user_emoticons = session::get_value('EMOTICONS')) === false) { $user_emoticons = forum_get_setting('default_emoticons'); } } if (emoticons_set_exists($user_emoticons)) { return html_get_forum_file_path(sprintf('emoticons/%s/style.css', basename($user_emoticons))); } return false; }
function emoticons_preview($emoticon_set, $width = 190, $height = 100) { $webtag = get_webtag(); // Make sure the emoticon set has no path info. $emoticon_set = basename($emoticon_set); // Check the emoticon set exists. if (!emoticons_set_exists($emoticon_set)) { $emoticon_set = basename(forum_get_setting('default_emoticons', null, 'default')); } // No previews for text / no emoticons if ($emoticon_set == 'text' || $emoticon_set == 'none') { return false; } // Array to hold text to emoticon lookups. $emoticon = array(); // Include the emoticon pack. if (@file_exists("emoticons/{$emoticon_set}/definitions.php")) { include "emoticons/{$emoticon_set}/definitions.php"; } // Check it has some emoticons in it! if (sizeof($emoticon) == 0) { return false; } // Remove duplicate matches $emoticon = array_unique($emoticon); // HTML container $html = "<div style=\"width: {$width}px; height: {$height}px\" class=\"emoticon_preview\">"; // Array to hold emoticon preview images $emoticon_preview = array(); // Iterate over the emoticons and generate HTML foreach ($emoticon as $emot_text => $emot_class) { $emoticon_preview[] = sprintf('<span class="emoticon e_%1$s" title="%2$s"><span class="e__">%2$s</span></span>', $emot_class, $emot_text); } // Add the emoticons to the HTML. $html .= implode(' ', $emoticon_preview); // Close the container. $html .= "</div>"; // Return the HTML. return $html; }