/** * The main WP-United settings panel */ function wpu_settings_page() { global $phpbbForum, $wpUnited; $needPreview = false; ?> <div class="wrap" id="wp-united-setup"> <img id="panellogo" src="<?php echo wpu_get_settings_logo(); ?> " /> <?php screen_icon('options-general'); ?> <h2> <?php _e('WP-United Settings', 'wp-united'); ?> </h2> <div id="wputransmit"><p><strong><?php _e('Sending settings to phpBB...', 'wp-united'); ?> </strong><br /><?php _e('Please wait...', 'wp-united'); ?> </p><img src="<?php echo $wpUnited->get_plugin_url(); ?> images/settings/wpuldg.gif" /></div> <?php if (isset($_GET['msg'])) { if ($_GET['msg'] == 'success') { $needPreview = true; ?> <div id="wpustatus" class="updated"><p><?php _e('Settings applied successfully.', 'wp-united'); ?> </p></div> <?php } elseif ($_GET['msg'] == 'fail') { ?> <div id="wpustatus" class="error"> <p><?php _e('An error occurred. The error details are below. Please check your settings or try disabling plugins.', 'wp-united'); ?> </p> <div style="margin-bottom: 8px;" id="wpuerrordets"> <?php echo html_entity_decode(base64_decode(stripslashes_deep((string) $_POST['msgerr']))); ?> </div> </div> <?php } } wpu_panel_warnings(); if ($needPreview) { wpu_reload_preview(); } ?> <p><?php _e('WP-United is modular; You can enable or disable any of the four major features below: User Integration, Theme Integration, Behaviour Integration and User Blogs.', 'wp-united'); ?> </p> <p><?php _e('Visit each of the tabs to select the settings, then hit Submit when done.', 'wp-united'); ?> </p> <form name="wpu-settings" id="wpusettings" method="post" onsubmit="return wpu_transmit('wp-united-settings', this.id);"> <div id="wputabs"> <ul> <li><a href="#wputab-basic"><?php _e('Basic Settings', 'wp-united'); ?> </a></li> <?php if (!defined('WPU_CANNOT_OVERRIDE')) { ?> <li><a href="#wputab-user"><?php _e('User Integration', 'wp-united'); ?> </a></li> <?php } ?> <li><a href="#wputab-theme"><?php _e('Theme Integration', 'wp-united'); ?> </a></li> <li><a href="#wputab-behav"><?php _e('Behaviour Integration', 'wp-united'); ?> </a></li> <!-- <li><a href="#wputab-blogs">User Blogs</a></li>--> </ul> <div id="wputab-basic"> <h3><?php _e('Path to phpBB3', 'wp-united'); ?> </h3> <p><?php _e('WP-United needs to know where phpBB is installed on your server. You can change the location on the "Setup / Status" page.', 'wp-united'); ?> </p> <p><?php _e('Path selected: ', 'wp-united'); ?> <strong id="phpbbpathshow" style="color: red;"><?php _e('Not selected', 'wp-united'); ?> </strong> <a href="admin.php?page=wp-united-setup" id="phpbbpathchange"><?php _e('Change Location »', 'wp-united'); ?> </a></p> <input id="wpupathfield" type="hidden" name="wpu-path" value="notset"></input> <h3><?php _e('Forum Page', 'wp-united'); ?> </h3> <p><?php _e("Create a WordPress forum page? If you enable this option, WP-United will create a blank page in your WordPress installation, so that 'Forum' links appear in your blog. These links will automatically direct to your forum.", 'wp-united'); ?> </p> <input type="checkbox" id="wpuforumpage" name="wpuforumpage" <?php if ($wpUnited->get_setting('useForumPage')) { ?> checked="checked"<?php } ?> /><label for="wpuforumpage"><?php _e('Enable Forum Page', 'wp-united'); ?> </label> </div> <?php if (!defined('WPU_CANNOT_OVERRIDE')) { ?> <div id="wputab-user"> <h3><?php _e('Integrate logins?', 'wp-united'); ?> </h3> <p><?php _e('This will enable some or all of your users to have a seamless session across both phpBB and WordPress. If they are logged in to one, they will be logged in to the other. Accounts will be created in the respective part of the site as needed. Note that you will need to set permissions in the User Mapper section that will appear once this option is enabled. Otherwise, by default, only the phpBB founder user is integrated.', 'wp-united'); ?> </p> <input type="checkbox" id="wpuloginint" name="wpuloginint" <?php if ($wpUnited->get_setting('integrateLogin')) { ?> checked="checked"<?php } ?> /><label for="wpuloginint"><?php _e('Enable Login Integration?', 'wp-united'); ?> </label> <div id="wpusettingsxpost" class="subsettings"> <h4><?php _e('Auto-create WordPress accounts when needed?', 'wp-united'); ?> </h4> <p><?php _e('Create WordPress accounts for unintegrated phpBB users with appropriate permissions when they visit or register?', 'wp-united'); ?> </p> <input type="checkbox" id="wpucreatewacct" name="wpucreatewacct" <?php if ($wpUnited->get_setting('integcreatewp')) { echo ' checked="checked" '; } ?> /><label for="wpucreatewacct"><?php _e('Auto-create WordPress accounts?', 'wp-united'); ?> </label> <h4><?php _e('Auto-create phpBB accounts when needed?', 'wp-united'); ?> </h4> <p><?php _e('Create phpBB accounts for unintegrated WordPress users when they visit or register?', 'wp-united'); ?> </p> <input type="checkbox" id="wpucreatepacct" name="wpucreatepacct" <?php if ($wpUnited->get_setting('integcreatephpbb')) { echo ' checked="checked" '; } ?> /><label for="wpucreatepacct"><?php _e('Auto-create phpBB accounts?', 'wp-united'); ?> </label> <h4><?php _e('Sync avatars?', 'wp-united'); ?> </h4> <p><?php _e('Avatars will be synced between phpBB & WordPress. If a user has an avatar in phpBB, it will show in WordPress. If they have a Gravatar, it will show in phpBB.', 'wp-united'); ?> </p> <p><?php _e('Enabling this option requires that the "Allow avatars" and "Remote avatar linking" options is enabled in phpBB, so WP-United will automatically enable those options for you if they are disabled.', 'wp-united'); ?> </p> <input type="checkbox" id="wpuavatar" name="wpuavatar" <?php if ($wpUnited->get_setting('avatarsync')) { echo ' checked="checked" '; } ?> /><label for="wpusmilies"><?php _e('Sync avatars?', 'wp-united'); ?> </label> <h4><?php _e('Enable cross-posting?', 'wp-united'); ?> </h4> <p><?php _e('If you enable this option, users will be able to elect to have their blog entry copied to a forum when writing a blog post. To set which forums the user can cross-post to, visit the phpBB forum permissions panel, and enable the "can cross-post" permission for the users/groups/forums combinations you need.', 'wp-united'); ?> </p> <input type="checkbox" id="wpuxpost" name="wpuxpost" <?php if ($wpUnited->get_setting('xposting')) { ?> checked="checked"<?php } ?> /><label for="wpuxpost"><?php _e('Enable Cross-Posting?', 'wp-united'); ?> </label> <div id="wpusettingsxpostxtra" class="subsettings"> <h4><?php _e('Type of cross-posting?', 'wp-united'); ?> </h4> <p><?php _e('Choose how the post should appear in phpBB. WP-United can post an excerpt, the full post, or give you an option to select when posting each post.', 'wp-united'); ?> </p> <input type="radio" name="rad_xpost_type" value="excerpt" id="wpuxpexc" <?php if ($wpUnited->get_setting('xposttype') == 'excerpt') { ?> checked="checked"<?php } ?> /><label for="wpuxpexc"><?php _e('Excerpt', 'wp-united'); ?> </label> <input type="radio" name="rad_xpost_type" value="fullpost" id="wpuxpfp" <?php if ($wpUnited->get_setting('xposttype') == 'fullpost') { ?> checked="checked"<?php } ?> /><label for="wpuxpfp"><?php _e('Full Post', 'wp-united'); ?> </label> <input type="radio" name="rad_xpost_type" value="askme" id="wpuxpask" <?php if ($wpUnited->get_setting('xposttype') == 'askme') { ?> checked="checked"<?php } ?> /><label for="wpuxpask"><?php _e('Ask Me', 'wp-united'); ?> </label> <h4><?php _e('phpBB manages comments on crossed posts?', 'wp-united'); ?> </h4> <p><?php _e('Choose this option to have WordPress comments replaced by forum replies for cross-posted blog posts. In addition, comments posted by integrated users via the WordPress comment form will be cross-posted as replies to the forum topic.', 'wp-united'); ?> <br /><br /> <?php _e('Note that for users to be able to comment from WordPress, you need to assign them the "Can reply to blog posts" permission in phpBB.', 'wp-united'); ?> </p> <input type="checkbox" name="wpuxpostcomments" id="wpuxpostcomments" <?php if ($wpUnited->get_setting('xpostautolink')) { ?> checked="checked"<?php } ?> /><label for="wpuxpostcomments"><?php _e('phpBB manages comments', 'wp-united'); ?> </label> <div id="wpusettingsxpostcomments" class="subsettings"> <h4><?php _e('Use WordPress spam filters for guest comments?', 'wp-united'); ?> </h4> <p><?php _e('To prevent forum spam from comments posted by guests, turn this option on. Comments will then be passed through WordPress spam filters (e.g. Akismet) before being sent to the forum. This only applies to posts made by guests.', 'wp-united'); ?> </p> <input type="radio" name="rad_xpostcomappr" value="all" id="xpostcomapprall" <?php if ($wpUnited->get_setting('xpostspam') === 'all') { ?> checked="checked" <?php } ?> /><label for="xpostcomapprall"><?php _e('Yes, and override phpBB post approval requirements if the comment passes WordPress checks', 'wp-united'); ?> </label><br /> <input type="radio" name="rad_xpostcomappr" value="yes" id="xpostcomappryes" <?php if ($wpUnited->get_setting('xpostspam') === 1) { ?> checked="checked" <?php } ?> /><label for="xpostcomappryes"><?php _e('Yes, but still honour phpBB post approval requirements even if the comment passes', 'wp-united'); ?> </label><br /> <input type="radio" name="rad_xpostcomappr" value="no" id="xpostcomapprno" <?php if ($wpUnited->get_setting('xpostspam') === 0) { ?> checked="checked" <?php } ?> /><label for="xpostcomapprno"><?php _e('No, I will rely on phpBB settings.', 'wp-united'); ?> </label> </div> <h4><?php _e('Force all blog posts to be cross-posted?', 'wp-united'); ?> </h4> <p><?php _e('Setting this option will force all blog posts to be cross-posted to a specific forum. You can select the forum here. Note that users must have the "can cross-post" WP-United permission under phpBB Forum Permissions, or the cross-posting will not take place.', 'wp-united'); ?> </p> <select id="wpuxpostforce" name="wpuxpostforce"> <option value="-1" <?php if ($wpUnited->get_setting('xpostforce') == -1) { echo ' selected="selected" '; } ?> >-- <?php _e('Disabled', 'wp-united'); ?> --</option> <?php if (defined('IN_PHPBB')) { global $phpbbForum, $db; $fStateChanged = $phpbbForum->foreground(); $sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE . ' WHERE ' . 'forum_type = ' . FORUM_POST; if ($result = $db->sql_query($sql)) { while ($row = $db->sql_fetchrow($result)) { echo '<option value="' . $row['forum_id'] . '"'; if ($wpUnited->get_setting('xpostforce') == (int) $row['forum_id']) { echo ' selected="selected" '; } echo '>' . $row['forum_name'] . '</option>'; } } $phpbbForum->restore_state($fStateChanged); } ?> </select> <h4><?php _e('Cross-post prefix', 'wp-united'); ?> </h4> <p><?php _e('This will be prepended to the post title when cross-posted. Leave it blank to disable.', 'wp-united'); ?> </p> <?php // The default value hasn't had translation applied as we can't do that on the phpBB side. So we translate it now. $xPostPrefix = $wpUnited->get_setting('xpostprefix'); if ($xPostPrefix == '[BLOG] ') { $xPostPrefix = __('[BLOG] ', 'wp-united'); } ?> <label for="wpuxpostprefix"><?php _e('Cross-post prefix: ', 'wp-united'); ?> </label><input type="text" name="wpuxpostprefix" id="wpuxpostprefix" value="<?php echo htmlentities($xPostPrefix); ?> "></input> </div> </div> </div> <?php } ?> <div id="wputab-theme"> <h3><?php _e('Integrate themes?', 'wp-united'); ?> </h3> <p><?php _e('WP-United can integrate your phpBB & WordPress templates.', 'wp-united'); ?> </p> <input type="checkbox" id="wputplint" name="wputplint" <?php if ($wpUnited->get_setting('showHdrFtr') != 'NONE') { ?> checked="checked" <?php } ?> /><label for="wputplint"><?php _e('Enable Theme Integration', 'wp-united'); ?> </label> <div id="wpusettingstpl" class="subsettings"> <h4><?php _e('Integration Mode', 'wp-united'); ?> </h4> <p><?php _e('Do you want WordPress to appear inside your phpBB template, or phpBB to appear inside your WordPress template?', 'wp-united'); ?> </p> <input type="radio" name="rad_tpl" value="rev" id="wputplrev" <?php if ($wpUnited->get_setting('showHdrFtr') != 'FWD') { ?> checked="checked" <?php } ?> /><label for="wputplrev"><?php _e('phpBB inside WordPress', 'wp-united'); ?> </label> <input type="radio" name="rad_tpl" value="fwd" id="wputplfwd" <?php if ($wpUnited->get_setting('showHdrFtr') == 'FWD') { ?> checked="checked" <?php } ?> /><label for="wputplfwd"><?php _e('WordPress inside phpBB', 'wp-united'); ?> </label> <h4><?php _e('Automatic CSS Integration', 'wp-united'); ?> </h4> <p><?php _e('WP-United can automatically fix CSS conflicts between your phpBB and WordPress templates. Set the slider to "maximum compatibility" to fix most problems. If you prefer to fix CSS conflicts by hand, or if the automatic changes cause problems, try reducing the level.', 'wp-united'); ?> </p> <div style="padding: 0 100px;"> <p style="height: 11px;"><span style="float: left;"><?php _e('Off', 'wp-united'); ?> </span><span style="float: right;"><?php _e('Maximum Compatibility (Recommended)', 'wp-united'); ?> </span></p> <div id="wpucssmlvl"></div> <div id="cssmdesc"><p><strong><?php _e('Current Level: ', 'wp-united'); ?> <span id="cssmlvltitle">xxx</span></strong><br /></p><p id="cssmlvldesc">xxx</p></div> </div> <input type="hidden" id="wpucssmlvlfield" name="wpucssmlevel" value="notset"></input> <p><a id="wputpladvancedstgs" href="#" onclick="return tplAdv();"><span id="wutpladvshow"><?php _e('Show Advanced Settings »', 'wp-united'); ?> </span><span id="wutpladvhide" style="display: none;"><?php _e('« Hide Advanced Settings', 'wp-united'); ?> </span></a></p> <div id="wpusettingstpladv" class="subsettings"> <h4><?php _e('Advanced Settings', 'wp-united'); ?> </h4> <div id="wputemplate-p-in-w-opts"> <p><strong><?php _e('Use full page?', 'wp-united'); ?> </strong> <a class="wpuwhatis" href="#" title="<?php _e("Do you want phpBB to simply appear inside your WordPress header and footer, or do you want it to show up in a fully featured WordPress page? Simple header and footer will work best for most WordPress themes – it is faster and less resource-intensive, but cannot display dynamic content on the forum page. However, if you want the WordPress sidebar to show up, or use other WordPress features on the integrated page, you could try 'full page'. This option could be a little slower.", 'wp-united'); ?> "><?php _e('What is this?', 'wp-united'); ?> </a> </p> <select id="wpuhdrftrspl" name="wpuhdrftrspl"> <option value="0"<?php if ($wpUnited->get_setting('wpSimpleHdr') == 1) { echo ' selected="selected" '; } ?> >-- <?php _e('Statically Cached Simple Header & Footer', 'wp-united'); ?> --</option> <?php $files = get_page_templates(); $fileNames = array_values($files); if (!in_array('page.php', $fileNames) && locate_template(array('page.php'))) { $files[wpu_fix_translation(__('Fall back to page.php', 'wp-united'))] = 'page.php'; } if (!in_array('index.php', $fileNames) && locate_template(array('index.php'))) { $files[wpu_fix_translation(__('Fall back to index.php', 'wp-united'))] = 'index.php'; } if (sizeof($files)) { foreach ($files as $fileDesc => $file) { if (strpos(strtolower($file), '.php') == strlen($file) - 4) { echo '<option value="' . $file . '"'; if ($wpUnited->get_setting('wpPageName') == $file && $wpUnited->get_setting('wpSimpleHdr') == 0) { echo ' selected="selected" '; } echo '>' . __('Full Page: ', 'wp-united') . $fileDesc . '</option>'; } } } ?> </select> <p><strong><?php _e('Padding around phpBB', 'wp-united'); ?> </strong> <?php $padding = explode('-', $wpUnited->get_setting('phpbbPadding')); ?> <a class="wpuwhatis" href="#" title="<?php _e("phpBB is inserted on the WordPress page inside a DIV. Here you can set the padding of that DIV. This is useful because otherwise the phpBB content may not line up properly on the page. The defaults here are good for most WordPress templates. If you would prefer set this yourself, just leave these boxes blank (not '0'), and style it in your stylesheet instead.", 'wp-united'); ?> "><?php _e('What is this?', 'wp-united'); ?> </a> </p> <table> <tr> <td> <label for="wpupadtop"><?php _e('Top:', 'wp-united'); ?> </label><br /> </td> <td> <input type="text" onkeypress="check_padding(event)" maxlength="3" style="width: 30px;" id="wpupadtop" name="wpupadtop" value="<?php echo $padding[0]; ?> " />px<br /> </td> </tr> <tr> <td> <label for="wpupadright"><?php _e('Right:', 'wp-united'); ?> </label><br /> </td> <td> <input type="text" onkeypress="check_padding(event)" maxlength="3" style="width: 30px;" id="wpupadright" name="wpupadright" value="<?php echo $padding[1]; ?> " />px<br /> </td> </tr> <tr> <td> <label for="wpupadbtm"><?php _e('Bottom:', 'wp-united'); ?> </label><br /> </td> <td> <input type="text" onkeypress="check_padding(event)" maxlength="3" style="width: 30px;" id="wpupadbtm" name="wpupadbtm" value="<?php echo $padding[2]; ?> " />px<br /> </td> </tr> <tr> <td> <label for="wpupadleft"><?php _e('Left:', 'wp-united'); ?> </label><br /> </td> <td> <input type="text" onkeypress="check_padding(event)" maxlength="3" style="width: 30px;" id="wpupadleft" name="wpupadleft" value="<?php echo $padding[3]; ?> " />px<br /> </td> </tr> </table> <p><a href="#" onclick="return default_padding();"><?php _e('Reset to defaults', 'wp-united'); ?> </a></p> </div> <div id="wputemplate-w-in-p-opts"> <p> <input type="checkbox" id="wpudtd" name="wpudtd" <?php if ($wpUnited->get_setting('dtdSwitch')) { echo ' checked="checked" '; } ?> /> <label for="wpudtd"><Strong><?php _e("Use WordPress' Document Type Declaration?", 'wp-united'); ?> </Strong></label> <a class="wpuwhatis" href="#" title="<?php _e("The Document Type Declaration, or DTD, is provided at the top of all web pages to let the browser know what type of markup language is being used. phpBB3's prosilver uses an XHTML 1.0 Strict DTD by default. Most WordPress templates, however, use an XHTML 1 transitional or HTML 5 DTD. In most cases, this doesn't matter -- however, If you want to use WordPress' DTD on pages where WordPress is inside phpBB, then you can turn this option on. This should prevent browsers from going into quirks mode, and will ensure that even more WordPress templates display as designed.", 'wp-united'); ?> "><?php _e('What is this?', 'wp-united'); ?> </a> </p> </div> </div> </div> </div> <div id="wputab-behav"> <h3><?php _e('Use phpBB Word Censor?', 'wp-united'); ?> </h3> <p><?php _e('Turn this option on if you want WordPress posts to be passed through the phpBB word censor.', 'wp-united'); ?> </p> <input type="checkbox" id="wpucensor" name="wpucensor" <?php if ($wpUnited->get_setting('phpbbCensor')) { echo ' checked="checked" '; } ?> /><label for="wpucensor"><?php _e('Enable word censoring in WordPress', 'wp-united'); ?> </label> <h3><?php _e('Use phpBB smilies?', 'wp-united'); ?> </h3> <p><?php _e('Turn this option on if you want to use phpBB smilies in WordPress comments and posts.', 'wp-united'); ?> </p> <input type="checkbox" id="wpusmilies" name="wpusmilies" <?php if ($wpUnited->get_setting('phpbbSmilies')) { echo ' checked="checked" '; } ?> /><label for="wpusmilies"><?php _e('Use phpBB smilies in WordPress', 'wp-united'); ?> </label> </div> <!--<div id="wputab-blogs"> User Blogs - options being revamped </div>--> </div> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Submit', 'wp-united'); ?> " name="wpusettings-submit" /> </p> </form> <div id="wpu-dialog" title="Message" style="display: none;"> <p id="wpu-desc"> </p> </div> </div> <script type="text/javascript"> // <![CDATA[ var transmitMessage; var transmitNonce = '<?php echo wp_create_nonce('wp-united-transmit'); ?> '; var disableNonce = '<?php echo wp_create_nonce('wp-united-disable'); ?> '; var blankPageMsg = '<?php wpu_js_translate(__('Blank page received: check your error log.', 'wp-united')); ?> '; var phpbbPath = '<?php echo $wpUnited->get_setting('phpbb_path') ? $wpUnited->get_setting('phpbb_path') : ''; ?> '; var treeScript = '<?php echo $wpUnited->get_plugin_url() . 'js/filetree.php'; ?> '; var statusCSSMDisabled = '<?php wpu_js_translate(__('Off', 'wp-united')); ?> '; var descCSSMDisabled = '<?php wpu_js_translate(__('All automatic CSS integration is disabled', 'wp-united')); ?> '; var statusCSSMMed = '<?php wpu_js_translate(__('Medium', 'wp-united')); ?> '; var descCSSMMed = '<?php wpu_js_translate(sprintf(__('%1$sStyles are reset to stop outer styles applying to the inner part of the page.%2$sInner CSS is made more specific so it does not affect the outer portion of the page.%2$sSome HTML IDs and class names may be duplicated.%3$s', 'wp-united'), '<ul><li>', '</li><li>', '</li></ul>')); ?> '; var statusCSSMFull = '<?php wpu_js_translate(__('Full', 'wp-united')); ?> '; var descCSSMFull = '<?php wpu_js_translate(sprintf(__('%1$sStyles are reset to stop outer styles applying to the inner part of the page.%2$sInner CSS is made more specific so it does not affect the outer portion of the page.%2$sHTML IDs and class names that are duplicated in the inner and outer parts of the page are fixed.%3$s', 'wp-united'), '<ul><li>', '</li><li>', '</li></ul>')); ?> '; <?php $cssmVal = 0; if ($wpUnited->get_setting('cssMagic')) { $cssmVal++; } if ($wpUnited->get_setting('templateVoodoo')) { $cssmVal++; } ?> var cssmVal = '<?php echo $cssmVal; ?> '; function wpu_hardened_init_tail() { setupSettingsPage(); <?php if ($wpUnited->get_setting('phpbb_path')) { ?> setPath('settings'); <?php } ?> setupHelpButtons(); settingsFormSetup(); } // ]]> </script> <?php add_action('admin_footer', 'wpu_hardened_script_init'); }
/** * Adds any required scripts and inline JS (for lang strings) * @TODO: standardize * Echoes directly to the page buffer * @return void */ public function add_scripts() { if (!$this->is_enabled()) { return; } // enqueue any JS we need if ($this->get_setting('phpbbSmilies') && !is_admin()) { wp_enqueue_script('wp-united', $this->get_plugin_url() . 'js/smilies.js', array(), false, true); } // fix broken admin bar on integrated page if ($this->get_setting('showHdrFtr') == 'FWD' && $this->get_setting('cssMagic')) { wp_enqueue_script('wpu-fix-adminbar', $this->get_plugin_url() . 'js/fix-admin-bar.js', array('admin-bar'), false, true); } // Rather than outputting the script, we just signpost any language strings we will need // The scripts themselves are already enqueud. if ($this->get_setting('phpbbSmilies')) { echo "\n<script type=\"text/javascript\">//<![CDATA[\nvar wpuLang ={"; $langStrings = array('wpu_more_smilies' => __('More smilies', 'wp-united'), 'wpu_less_smilies' => __('Less smilies', 'wp-united'), 'wpu_smiley_error' => __('Your smiley could not be inserted. You can add it manually by typing this code: %s', 'wp-united')); foreach ($langStrings as $key => $lang) { if ($key != 'wpu_more_smilies') { echo ','; } echo "'{$key}': '"; wpu_js_translate($lang); echo "'"; } echo "} // ]]>\n</script>"; } }