| 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 |
add_action('admin_menu', 'smart_add_menu'); |
| 19 |
|
| 20 |
function screen_layout_columns($columns, $screen) { |
| 21 |
$columns[$screen] = 2; |
| 22 |
return $columns; |
| 23 |
} |
| 24 |
|
| 25 |
/*add_filter('screen_layout_columns', array(&$this, 'on_screen_layout_columns'), 10, 2); |
| 26 |
//for WordPress 2.8 we have to tell, that we support 2 columns ! |
| 27 |
function on_screen_layout_columns($columns, $screen) { |
| 28 |
if ($screen == $this->pagehook) { |
| 29 |
$columns[$this->pagehook] = 2; |
| 30 |
} |
| 31 |
return $columns; |
| 32 |
}*/ |
| 33 |
|
| 34 |
function wp_insert_admin_register_head() { |
| 35 |
echo "<link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL.'/wp-insert/css/adminStyle.css'."' /><!--[if IE 6]><link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL.'/wp-insert/css/IE6adminStyle.css'."' /><![endif]-->\n"; |
| 36 |
} |
| 37 |
add_action('admin_head', 'wp_insert_admin_register_head'); |
| 38 |
|
| 39 |
|
| 40 |
function wp_insert_get_current_page_details() { |
| 41 |
if(is_home()) return 'HOME'; |
| 42 |
else if(is_archive()) return 'ARCHIVE'; |
| 43 |
else if(is_singular()) { |
| 44 |
global $wp_query; |
| 45 |
return $wp_query->post->ID; |
| 46 |
} |
| 47 |
else return 'NULL'; |
| 48 |
} |
| 49 |
|
| 50 |
function wp_insert_is_in_array($inputString, $inputArray) { |
| 51 |
foreach($inputArray as $arrayElements) |
| 52 |
{ |
| 53 |
if($arrayElements == $inputString) |
| 54 |
{ |
| 55 |
return 'TRUE'; |
| 56 |
} |
| 57 |
} |
| 58 |
return 'FALSE'; |
| 59 |
} |
| 60 |
|
| 61 |
$random = 0; |
| 62 |
switch(get_option('wp_insert_multiple_ad_network_type')) { |
| 63 |
case "All Ad Networks": |
| 64 |
$random = rand(0,2); |
| 65 |
break; |
| 66 |
case "Primary and Alternate Ad Network 1": |
| 67 |
$random = rand(0,1); |
| 68 |
break; |
| 69 |
} |
| 70 |
|
| 71 |
function wp_insert_settings_page_layout($page_parameters, $page_title, $page_type) { ?> |
| 72 |
<div id="post_ads_container" class="wrap"> |
| 73 |
<?php screen_icon('options-general'); ?> |
| 74 |
<h2><?php echo $page_title; ?></h2> |
| 75 |
<div class="updated fade below-h2" id="message" style="opacity:0;display:none;"><p>Changes have been made to this page. Please click <b>Save Changes</b> to make them permanent</p></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.7.1.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/ui.core.js"></script> |
| 88 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/ui.draggable.js"></script> |
| 89 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery.corner.js"></script> |
| 90 |
<?php |
| 91 |
require_once (dirname(__FILE__) . '/postpicker.php'); |
| 92 |
} ?> |
| 93 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/common.js"></script> |
| 94 |
<div id="poststuff" class="metabox-holder has-right-sidebar"> |
| 95 |
<div id="side-info-column" class="inner-sidebar"> |
| 96 |
<p style="text-align:center;"> |
| 97 |
<script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script> |
| 98 |
</p> |
| 99 |
<?php do_meta_boxes('col_2','advanced',null); ?> |
| 100 |
<p class="submit wp-insert-submit"> |
| 101 |
<input type="hidden" name="action" value="update" /> |
| 102 |
<input type="hidden" name="page_options" value="<?php echo $page_parameters; ?>" /> |
| 103 |
<input type="submit" id="submit" class="button-primary button-wp-insert" value="<?php _e('Save Changes') ?>" /> |
| 104 |
</p> |
| 105 |
</div> |
| 106 |
<div id="post-body" class="has-sidebar"> |
| 107 |
<div id="post-body-content" class="has-sidebar-content"> |
| 108 |
<?php do_meta_boxes('col_1','advanced',null); ?> |
| 109 |
</div> |
| 110 |
</div> |
| 111 |
<br class="clear"/> |
| 112 |
</div> |
| 113 |
</form> |
| 114 |
</div> |
| 115 |
<script type="text/javascript"> |
| 116 |
//<![CDATA[ |
| 117 |
jQuery(document).ready( function($) { |
| 118 |
// close postboxes that should be closed |
| 119 |
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); |
| 120 |
jQuery('.postbox').addClass('closed'); |
| 121 |
// postboxes setup |
| 122 |
postboxes.add_postbox_toggles('wp-insert'); |
| 123 |
}); |
| 124 |
//]]> |
| 125 |
</script> |
| 126 |
</div> |
| 127 |
<?php } |
| 128 |
|
| 129 |
|
| 130 |
require_once (dirname(__FILE__) . '/widgethook.php'); |
| 131 |
require_once (dirname(__FILE__) . '/contenthook.php'); |
| 132 |
require_once (dirname(__FILE__) . '/ads.php'); |
| 133 |
require_once (dirname(__FILE__) . '/adsadvanced.php'); |
| 134 |
require_once (dirname(__FILE__) . '/pages.php'); |
| 135 |
require_once (dirname(__FILE__) . '/privacypolicy.php'); |
| 136 |
require_once (dirname(__FILE__) . '/feeds.php'); |
| 137 |
?> |