function allSetCode($allPostCode, $getPostTitle) { global $hostString, $eff_settings_page; $shortname = ""; $eff_details = getMyEffectoPluginDetails("0"); if ($eff_details != null) { foreach ($eff_details as $detail) { $shortname = $detail->shortname; } } $ad_email = urlencode(get_option('admin_email')); $b_url = urlencode(get_option('siteurl')); $prev_ifrm_url = $hostString . "/ep?ty=preview&wadm=1&email=" . $ad_email . "&l=" . $b_url . "&s="; if ($shortname == null || !isset($shortname)) { $shortname = createDefaultPlugin(false); } echo "<script type='text/javascript'>\n\t\t\tvar eMeth=window.addEventListener ? 'addEventListener':'attachEvent';\n\t\t\tvar msgEv = eMeth == 'attachEvent' ? 'onmessage' : 'message';var detect = window[eMeth];\n\t\t\t detect(msgEv,mye_logHandle,false);\n\t\t\t function mye_logHandle(e){\n\t\t\t \t var m = e.data;\n\t\t\t \t if(e.origin=='" . $hostString . "'){\n\t\t\t \t \tif(m.indexOf('mye_log')>-1){\n\t\t\t\t \t \tm=m.split('#');\n\t\t\t\t \t \tjQuery('#load').css('display','');\n\t\t\t\t \t \tvar h=jQuery('#mye_editEmo').attr('href'); \n\t\t\t\t \t \th=h+m[1]; jQuery('#mye_editEmo').attr('href',h);\n\t\t\t\t \t \tvar report=jQuery('#mye_rpt_a').attr('href'); \n\t\t\t\t \t \treport=report+m[1]; jQuery('#mye_rpt_a').attr('href',report);\n\t\t\t\t \t \tvar data = {'action': 'mye_sname_store','s':m[1]};\n\t\t\t\t \t \tjQuery.post(ajaxurl, data).always(function(){\n\t\t\t\t \t \t\tjQuery('#load').css('display','none');\n\t\t\t\t \t \t});\n\t\t\t \t \t}\n\t\t\t \t \telse if(m.indexOf('setHt')>-1){\n\t\t\t \t \t\tm=m.split('#');\n\t\t\t \t \t\tjQuery('#effecto_bar').css('height',m[1]);\n\t\t\t \t \t\tjQuery('#mye_prev_frame').css('height',m[1]);\n\t\t\t \t \t}\n\t\t\t \t }\n\t\t\t }\n\t\t\t</script>"; $frame_src = $prev_ifrm_url . $shortname; $eff_json = "<div id='effecto_bar'style='text-align:center;min-height:175px;position:;'>"; $eff_json = $eff_json . "<div id='wp_mye_preview' style='background-color: white;margin: 0 auto;margin-top: 7px;border: 1px solid #DDDD;'><div id='load'></div><script>function delLoad(){jQuery('#load').css('display','none');}</script>\n\n\t\t\t\t<iframe id='mye_prev_frame' onload='delLoad();' src='" . $frame_src . "' width='100%' frameborder='0' scrolling='no' style='min-height:185px;width: 100%; border: 0px; overflow: hidden; clear: both; margin: 0px; background: transparent;'></iframe></div>"; $eff_json = $eff_json . "</div>"; /*<span style="font-size:15px;padding:0px 10px;"> | </span> */ echo '<div class="updated" style="margin-top: 11px;margin-bottom: 1px;">'; echo '<p style="position:relative;font-size:16px;font-weight:700 !important"> Emotion-Set below has been added to all your blog post <span style="position:relative;"><img style="position:absolute;width:15px;top: 5px;left: 6px;" src="' . plugins_url('/img/down.png', __FILE__) . '"></span>'; echo '<span style="position:absolute;right: 12px;">'; $prev_link = getRandomLink(); if (isset($prev_link)) { echo '<span style="border-right: 1px solid #E3E3E3;margin-right: 10px;padding-right: 10px;">'; echo '<a style="font-size:18px;font-weight: 500;" class="effectoConfig button-primary mye_btn" href="' . $prev_link . '#effecto_bar" target="_blank" title="Preview plugin on your blog">Preview</a>'; echo '</span>'; } echo '<a style="font-size:18px;font-weight: 500;" class="effectoConfig button-primary mye_btn" href="' . get_site_url() . '/wp-admin/admin.php?page=' . $eff_settings_page . '&postName=' . $getPostTitle . '&pluginType=defaultEdit&postURL=' . $_SERVER['REQUEST_URI'] . '&shortname=' . $shortname . '" title="Configure New Plugin for your blog">Create New</a>'; echo '<span style="font-size:15px;padding: 0px 5px;margin: auto 5px;">OR</span> '; echo '<a style="font-size:18px;font-weight: 500;" id="mye_editEmo" class="effectoConfig button mye_edit_btn" href="' . get_site_url() . '/wp-admin/admin.php?page=' . $eff_settings_page . '&pluginType=editExist&sname=' . $shortname . '" title="Edit/Update existing default Emotion-Set">Edit</a>'; echo '</span>'; echo '</p> <p>Goto <a href="' . admin_url('options-general.php?page=eff_conf_nav&pluginType=advSetting') . '">Advance settings</a> to configure where to show the plugin</p> </div>' . $eff_json; //predfined_emo($frame_src); echo '<h2><style>.mye_btn{font-weight:bold;padding-top: 5px !important;padding-bottom: 31px !important;} .mye_edit_btn{font-weight:bold;padding-top: 5px !important;padding-bottom: 31px !important;} @media all and (max-width: 782px){ .mye_edit_btn{font-weight:bold;padding-top: 5px !important;padding-bottom: 5px !important;} } </style></h2> <style>#mye_report{position:fixed;top:52%;z-index:99999999999;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-o-transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);right:0;height:0;width:75px}#mye_report a{padding-left: 10px;padding-right: 25px !important;display:block;background:rgba(195, 90, 79, 0.86);width:60px;padding:10px 16px 8px;color:#fff;font-family:Arial,sans-serif;font-size:17px;font-weight:700;text-decoration:none;letter-spacing:.06em}#mye_report a:hover{background:#06c}</style> <div id="mye_report"><a id="mye_rpt_a" target="_blank" href="' . $hostString . '/support_mail?site=' . urlencode(get_site_url()) . '&sname=' . $shortname . '">Support</a></div>'; ?> <script type="text/javascript" > var onload_eff_isHome = jQuery("#home").is(":checked"); jQuery("#eff_visib").click(function() { var eff_isPost = jQuery("#posts").is(":checked"); var eff_isPage = jQuery("#pages").is(":checked"); var eff_isHome = jQuery("#home").is(":checked"); var eff_isCustom = jQuery("#custom").is(":checked"); var lod_on=jQuery(".m_lod:checked").val(); var eff_custom_list = {}; if (eff_isCustom) { jQuery("input[class=eff_customPostList]:checked").each(function() { eff_custom_list[jQuery(this).attr('c-name')] = true; }); jQuery("input[class=eff_customPostList]:not(:checked)").each(function() { eff_custom_list[jQuery(this).attr('c-name')] = false; }); } //alert(JSON.stringify(eff_custom_list)); eff_custom_list = JSON.stringify(eff_custom_list); var eff_msg_ele = jQuery("#eff_msg"); // console.log(eff_isPost + ", " + eff_isPage); eff_msg_ele.show(); eff_msg_ele.html("Saving......"); var data = {'action': 'mye_update_view', 'isPost': eff_isPost, 'isPage': eff_isPage, 'isHome': eff_isHome, 'isCustom': eff_isCustom, 'eff_custom_list': eff_custom_list, 'mye_load_on':lod_on, }; // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php jQuery.post(ajaxurl, data, function(response) { eff_msg_ele.html("Settings Saved"); if (eff_isHome) { if(!onload_eff_isHome){jQuery("#eff_shCode").show();}} else {jQuery("#eff_shCode").hide();} onload_eff_isHome=eff_isHome; }); }); jQuery("#custom").click(function() { if (jQuery(this).is(":checked")) { jQuery("#eff_customPostList").show(); } else { jQuery("#eff_customPostList").hide(); } }); </script> <?php }
function getEmoWiseVoted($atts) { global $hostString; $site = get_site_url(); if (isset($site)) { $site = parse_url($site); if (array_key_exists('host', $site)) { $site = $site['host']; } else { $site = ''; } } $dbPluginDtls = getMyEffectoPluginDetails("0"); $p_shortname = ""; if (isset($dbPluginDtls) && !empty($dbPluginDtls)) { foreach ($dbPluginDtls as $detail) { $p_shortname = $detail->shortname; } $p_shortname = trim($p_shortname); } else { $p_shortname = '0'; } $atts = shortcode_atts(array('emo' => '', 'height' => '', 'width' => ''), $atts, 'effecto-bar'); $html = "<div id='effecto_emo_widget' site='" . $site . "' sname='" . $p_shortname . "' emo='" . $atts['emo'] . "' ht='" . $atts['height'] . "' wt='" . $atts['width'] . "'></div><script src='//storage.googleapis.com/effecto/js/emo_widget.js' type='text/javascript' async></script>"; return $html; }