Changeset 1202408
- Timestamp:
- 07/20/2015 04:06:21 PM (11 years ago)
- Location:
- appendad/trunk
- Files:
-
- 2 edited
-
appendad.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
appendad/trunk/appendad.php
r1201782 r1202408 2 2 /* Plugin Name: FirstImpression 3 3 Plugin URI: http://www.firstimpression.io/ 4 Version: 1.3. 04 Version: 1.3.1 5 5 Description: FirstImpression is the first platform that allows publishers create different ad products anywhere on their website in seconds and with no coding. 6 6 Author: FirstImpression … … 12 12 * Update this variable to modify plugin version text in actual site tag 13 13 */ 14 $pluginVersion = '1.3.0'; 14 $pluginVersion = '1.3.1'; 15 16 // refer to uninstall hook if deleted 17 register_uninstall_hook('uninstall.php', ''); 15 18 16 19 // Add settings link on plugin page … … 65 68 $output = "\n<!--BEGIN FIRSTIMPRESSION TAG -->\n"; 66 69 $output .= "<script data-cfasync='false' type='text/javascript'>\n"; 67 $output .= " if (window.location.hash.indexOf('apdAdmin')!= -1){if(typeof(Storage) !== 'undefined') {localStorage.apdAdmin = 1;}}\n";68 $output .= " var adminMode = ((typeof(Storage) == 'undefined') || (localStorage.apdAdmin == 1));\n";69 70 $output .= " window.apd_options = {\n"; 70 71 $output .= " \"accelerate\": 0,\n"; 71 72 $output .= " \"dynamicElements\": 1,\n"; 72 $output .= " \"websiteId\": ". $ssb['site_id']."\n";73 $output .= " \"websiteId\": ". ( isset($ssb['site_id']) ? $ssb['site_id'] : 0 ) ."\n"; 73 74 $output .= " };\n"; 75 $output .= " if (window.location.hash.indexOf('apdAdmin')!= -1){if(typeof(Storage) !== 'undefined') {localStorage.apdAdmin = 1;}}\n"; 74 76 $output .= " (function() {\n"; 75 77 $output .= " var apd = document.createElement('script'); apd.type = 'text/javascript'; apd.async = true;\n"; 76 $output .= " if( adminMode){\n";78 $output .= " if((typeof(Storage) == 'undefined') || (localStorage.apdAdmin == 1)){\n"; 77 79 $output .= " apd.src = 'https://ecdn.firstimpression.io/apd.js?id=' + apd_options.websiteId;\n"; 78 80 $output .= " }\n"; … … 91 93 function ssb_page_data_demo() { 92 94 global $pluginVersion, $wp_version; 93 $output = "<!-- FirstImpression Targeting - Start -->\n" 94 . "<div id='apdPageData' data-plugin-version='$pluginVersion' data-wp-version='$wp_version' style='display:none;visibility:hidden;'>\n" 95 . "<span id='apdPageData_categories'>[categories]</span>\n" 96 . "<span id='apdPageData_tags'>[tags]</span>\n" 97 . "<span id='apdPageData_author'>[author]</span>\n" 98 . "</div><!-- FirstImpression Targeting - End -->\n"; 95 $output = "<!-- FirstImpression Targeting - Start --> <div id='apdPageData' data-plugin-version='$pluginVersion' data-wp-version='$wp_version' style='display:none;visibility:hidden;'> <span id='apdPageData_categories'>[categories]</span> <span id='apdPageData_tags'>[tags]</span> <span id='apdPageData_author'>[author]</span> </div><!-- FirstImpression Targeting - End -->"; 99 96 100 97 echo $output; … … 141 138 function ssb_admin_function() 142 139 { 140 ssb_ajax_javascript(); 143 141 //check if the user is allowed to edit wordress settings 144 142 if(!current_user_can('manage_options')) … … 159 157 </th> 160 158 <td> 161 <input type="text" id="site_id_vas" onchange="chTXT()"name="site_id_vas" value="<?php echo $ssb['site_id'];?>" /><span id="setting-error-settings_error" class="error settings-error asd_error " style=" border-color: #c00;display: inline-block;display:none;background-color: #ffebe8;border: 1px solid #c00;padding: 0 3px;margin-left: 10px;border-radius: 4px;"><p style="padding: 1px;margin: 0;"><strong>Enter A Valid Number.</strong></p></span>159 <input type="text" id="site_id_vas" name="site_id_vas" value="<?php echo $ssb['site_id'];?>" /><span id="setting-error-settings_error" class="error settings-error asd_error " style=" border-color: #c00;display: inline-block;display:none;background-color: #ffebe8;border: 1px solid #c00;padding: 0 3px;margin-left: 10px;border-radius: 4px;"><p style="padding: 1px;margin: 0;"><strong>Enter A Valid Number.</strong></p></span> 162 160 </td> 163 161 </tr> 164 162 </table> 165 163 <p class="submit"> 166 <input name="update_settings" id="submit_options_form" type=" submit" class="button-primary vasu_btn" value="Updated Embedded Code" />164 <input name="update_settings" id="submit_options_form" type="button" class="button-primary vasu_btn" value="Updated Embedded Code" /> 167 165 </p> 168 166 … … 176 174 177 175 // this will add javascript in admin required for ajax 178 add_action( 'admin_footer', 'ssb_ajax_javascript' ); 176 // add_action( 'admin_footer', 'ssb_ajax_javascript' ); // carnivore1 179 177 function ssb_ajax_javascript() { 180 178 … … 184 182 //this function is providing the functionality of live realtime change of code in textarea 185 183 function chTXT(){ 186 //saving to variables 187 var tmp_site_id_vas = document.getElementById('site_id_vas').value; 184 //saving to variables 185 var site_id_parser = document.getElementById('site_id_vas').value; 186 var tmp_site_id_vas = 0; 187 if (site_id_parser != null) tmp_site_id_vas = site_id_parser; 188 188 189 189 var output = "<!--BEGIN FIRSTIMPRESSION TAG -->\n<scri"+"pt data-cfasync='false' type='text/javascript'\>\n"; 190 output = output+ "if (window.location.hash.indexOf('apdAdmin')!= -1){if(typeof(Storage) !== 'undefined') {localStorage.apdAdmin = 1;}}\n";191 output = output+ "var adminMode = ((typeof(Storage) == 'undefined') || (localStorage.apdAdmin == 1));\n";192 190 output = output+ "window.apd_options = {\n"; 193 191 output = output+ " \"accelerate\": 0,\n"; 194 192 output = output+ " \"dynamicElements\": 1,\n"; 195 output = output+ " \"websiteId\": "+ tmp_site_id_vas+"\n";193 output = output+ " \"websiteId\": "+ tmp_site_id_vas+"\n"; 196 194 output = output+ "};\n"; 195 output = output+ "if (window.location.hash.indexOf('apdAdmin')!= -1){if(typeof(Storage) !== 'undefined') {localStorage.apdAdmin = 1;}}\n"; 197 196 output = output+ "(function() {\n"; 198 197 output = output+ "var apd = document.createElement('script'); apd.type = 'text/javascript'; apd.async = true;\n"; 199 output = output+ "if( adminMode){\n";198 output = output+ "if((typeof(Storage) == 'undefined') || (localStorage.apdAdmin == 1)){\n"; 200 199 output = output+ "apd.src = 'https://ecdn.firstimpression.io/apd.js?id=' + apd_options.websiteId;\n"; 201 200 output = output+ "}\n"; … … 230 229 { 231 230 //if verified, create a json varibale for sending 232 var data = {action: 'my_action', 233 a:site_id_vas, 231 var data = { 232 action: 'my_action', 233 a:site_id_vas 234 234 }; 235 235 //use post method to send the data 236 236 $.post(ajaxurl, data, function(response) 237 237 { 238 console.log(response + " tags:" + tags); 238 239 //show the response in teatarea 239 240 $('.result_demo').html(response.trim() + "\n\n" + tags); … … 246 247 //if verification fails, show the error message 247 248 $('.asd_error').css("display", "inline-block"); 249 $('.asd_saved').hide('slow'); 248 250 } 249 251 }); -
appendad/trunk/readme.txt
r1201779 r1202408 5 5 Requires at least: 2.5 6 6 Tested up to: 4.2.2 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 9 9 … … 32 32 33 33 == Upgrade Notice == 34 = 1.3.1 = 35 Bug fixes. 36 34 37 = 1.3.0 = 35 38 Changing the plugin name from AppendAd to FirstImpression. Removing the accelerated and dynamic elements options which are now controled via FirstImpression's platform. 36 39 37 == Upgrade Notice ==38 40 = 1.1.2 = 39 41 Preventing AppendAd plugin from being loaded via CloudFlare Rocket Loader
Note: See TracChangeset
for help on using the changeset viewer.