PluginProbe
Wp-Insert / 1.7.4
Wp-Insert v1.7.4
trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.3.0 1.3.1 1.3.3 1.4 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 2.0 All 63 releases
wp-insert / includes / essentials.php

essentials.php in Wp-Insert 1.7.4, at includes/essentials.php

140 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 //avoid direct calls to this file where wp core files not present
3 if (!function_exists ('add_action')) {
4 header('Status: 403 Forbidden');
5 header('HTTP/1.1 403 Forbidden');
6 exit();
7 }
8 // Pre-2.6 compatibility
9 if ( ! defined( 'WP_CONTENT_URL' ) )
10 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
11 if ( ! defined( 'WP_CONTENT_DIR' ) )
12 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
13 if ( ! defined( 'WP_PLUGIN_URL' ) )
14 define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
15 if ( ! defined( 'WP_PLUGIN_DIR' ) )
16 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
17
18 function screen_layout_columns($columns, $screen) {
19 $columns[$screen] = 2;
20 return $columns;
21 }
22
23 add_action( 'admin_init', 'wp_insert_admin_init' );
24 function wp_insert_admin_init() {
25 wp_register_style('WpInsertAdminCSS', WP_PLUGIN_URL.'/wp-insert/css/adminStyle.css');
26 }
27
28 function wp_insert_admin_styles() {
29 wp_enqueue_style('WpInsertAdminCSS');
30 }
31
32 function wp_insert_admin_register_head() {
33 echo "<link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL.'/wp-insert/css/adminStyle.css'."' />";
34 }
35 add_action('admin_head', 'wp_insert_admin_register_head');
36
37
38 function wp_insert_get_current_page_details() {
39 if(is_home()) return 'HOME';
40 else if(is_archive()) return 'ARCHIVE';
41 else if(is_singular()) {
42 global $wp_query;
43 return $wp_query->post->ID;
44 }
45 else return 'NULL';
46 }
47
48 function wp_insert_is_in_array($inputString, $inputArray) {
49 foreach($inputArray as $arrayElements)
50 {
51 if($arrayElements == $inputString)
52 {
53 return 'TRUE';
54 }
55 }
56 return 'FALSE';
57 }
58
59 $random = 0;
60 switch(get_option('wp_insert_multiple_ad_network_type')) {
61 case "All Ad Networks":
62 $random = rand(0,2);
63 break;
64 case "Primary and Alternate Ad Network 1":
65 $random = rand(0,1);
66 break;
67 }
68
69 function wp_insert_settings_page_layout($page_parameters, $page_title, $page_type) { ?>
70 <div id="post_ads_container" class="wrap">
71 <?php screen_icon('options-general'); ?>
72 <h2><?php echo $page_title; ?></h2>
73 <div class="updated fade below-h2" id="message" style="opacity:0;display:none;">
74 <p>Changes have been made to this page. Please click <b>Save Changes</b> to make them permanent</p>
75 </div>
76 <?php show_support_options(); ?>
77 <form method="post" action="options.php">
78 <?php
79 wp_nonce_field('update-options');
80 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
81 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
82 ?>
83 <?php if($page_type == 'pages') { ?>
84 <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery-ui-1.8.14.custom.min.js"></script>
85 <?php } ?>
86 <?php if($page_type == 'ads') { ?>
87 <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery-ui-1.8.14.custom.min.js"></script>
88 <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery.corner.js"></script>
89 <?php
90 require_once (dirname(__FILE__) . '/postpicker.php');
91 } ?>
92 <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/common.js"></script>
93 <div id="poststuff" class="metabox-holder has-right-sidebar">
94 <div id="side-info-column" class="inner-sidebar">
95 <p style="text-align:center;">
96 <script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script>
97 </p>
98 <?php do_meta_boxes('col_2','advanced',null); ?>
99 <p class="submit wp-insert-submit">
100 <input type="hidden" name="action" value="update" />
101 <input type="hidden" name="page_options" value="<?php echo $page_parameters; ?>" />
102 <input type="submit" id="submit" class="button-primary button-wp-insert" value="<?php _e('Save Changes') ?>" />
103 </p>
104 </div>
105 <div id="post-body" class="has-sidebar">
106 <div id="post-body-content" class="has-sidebar-content">
107 <?php do_meta_boxes('col_1','advanced',null); ?>
108 </div>
109 </div>
110 <br class="clear"/>
111 </div>
112 </form>
113 <script type="text/javascript">
114 //<![CDATA[
115 jQuery(document).ready( function($) {
116 // close postboxes that should be closed
117 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
118 jQuery('.postbox').addClass('closed');
119 // postboxes setup
120 postboxes.add_postbox_toggles('wp-insert');
121 });
122 //]]>
123 </script>
124 </div>
125 <?php }
126
127 require_once (dirname(__FILE__) . '/menu.php');
128
129 require_once (dirname(__FILE__) . '/widgethook.php');
130 require_once (dirname(__FILE__) . '/contenthook.php');
131 require_once (dirname(__FILE__) . '/ads.php');
132 require_once (dirname(__FILE__) . '/adsadvanced.php');
133 require_once (dirname(__FILE__) . '/pages.php');
134 require_once (dirname(__FILE__) . '/syntax-highlighter.php');
135 require_once (dirname(__FILE__) . '/privacypolicy.php');
136 require_once (dirname(__FILE__) . '/tandc.php');
137 require_once (dirname(__FILE__) . '/feeds.php');
138 require_once (dirname(__FILE__) . '/miscellaneous.php');
139 require_once (dirname(__FILE__) . '/dashboardwidget.php');
140 ?>