function updateUSRSettings($usrLang, $usrStarSize, $usrMaxStars, $usrStarText, $usrCalcAverage, $usrPermitShortcodedComments, $usrSchemaOrg, $usrSchemaOrgType, $usrCustomImagesFolder, $usrStarImage) { //Update user language update_option("usrLang", $usrLang); //Update star size $usrStarSize = str_replace(',', '.', $usrStarSize); if (is_numeric($usrStarSize)) { update_option("usrStarSize", $usrStarSize); } else { echo $MESSAGES['ERROR']['StarSizeNotNumeric'][$usrLang]; } //Update max stars $usrMaxStars = intval($usrMaxStars); if ($usrMaxStars < 1) { $usrMaxStars = 1; } update_option("usrMaxStars", $usrMaxStars); //Update text output update_option("usrStarText", $usrStarText); //Update average rating calculation update_option("usrCalcAverage", $usrCalcAverage); //Update permission to use shortcodes inside comments update_option("usrPermitShortcodedComments", $usrPermitShortcodedComments); if ($usrPermitShortcodedComments == "true") { permitShortcodedComments(); } //Update permission to use Schema.org SEO update_option("usrSchemaOrg", $usrSchemaOrg); //Update type of Schema.org - Can be a rating or a review rating update_option("usrSchemaOrgType", $usrSchemaOrgType); //Update CUSRI folder update_option("usrCustomImagesFolder", $usrCustomImagesFolder); //Update star image update_option("usrStarImage", $usrStarImage); }
// Shortcodes // // // //############################################################################// //Including shortcodes require 'includes/shortcodes.php'; //############################################################################// // // // Options Page // // // //############################################################################// //Register options initUSR(); //Register Filter if admins allows shortcodes inside comments $usrPermitShortcodedComments = get_option('usrPermitShortcodedComments'); if ($usrPermitShortcodedComments == "true") { permitShortcodedComments(); } //Initialize admin area function usrAdminInit() { $usrLang = get_option('usrLang'); if ($usrLang == '') { $usrLang = 'en'; } global $MESSAGES; //if user is administrator options will be displayed if (current_user_can('manage_options')) { //Register the option group usrSettings with the option name usrOption if (function_exists('register_setting')) { register_setting('usrSettings', 'usrOption', ''); }