Admin panel is under presentation tab. Need Help? Visit the Official INAP support thread
Author: Aaron Dowden
Version: 2.3.3
Author URI: http://anthologyoi.com/
Liscense:
This Plugin is free for use, and may be modified, but may not be included in any bundled download without appropriate credits and links on the download page, nor may it or its derivitive works be distributed in such a way that it creates a profit. A commerical license removes these restrictions.
*/
$inapall = array();
$inapall = get_option('inap');
if(!strpos($_SERVER['PHP_SELF'], '/wp-admin/')){
if(!$inapall['no_posts']){
include('inap-functions-posts.php');
}
if(!$inapall['no_comments']){
include('inap-functions-comments.php');
}
}
add_action('init', 'inap_init');
function inap_init() {
$currentLocale = get_locale();
if(!empty($currentLocale)) {
$moFile = dirname(__FILE__) . "/inap-" . $currentLocale . ".mo";
if(@file_exists($moFile) && is_readable($moFile)) load_textdomain('inap', $moFile);
}
//Fix a conflict with Postviews Plus
if(function_exists('process_postviews')){
remove_action('the_content', 'process_postviews');
add_action('loop_start', 'process_postviews');
}
}
add_action('wp_head', 'inap_header');
function inap_header(){
global $inapall,$wp_version;
$home = get_settings('siteurl');
if(function_exists('wp_register_script')){
if($inapall['js_library'] == 3){
$ajax = 'prototype';
if($inapall['special_effects'] == 1){
wp_print_scripts('scriptaculous-effects');
}
}elseif($inapall['js_library'] == 2){
$ajax='jquery';
if($wp_version == 2.1)
wp_register_script('jquery', $home.'/wp-includes/js/jquery.js', false, '1');
}else{
$ajax='sack';
}
wp_register_script('inap-misc', $home.'/wp-content/plugins'.inap_get_base().'/js/inap-misc.js.php', false, '1');
wp_print_scripts(array($ajax, 'inap-misc'));
}
if($inapall['do_effect'] == 'Fade'){
//this is for IE support only. Everybody BOOOOOOO IE
//It's not like they could make it easy for us...
$style = "zoom:1; \n background-color:$inapall[background_color];";
}
?>
post_author),$link_text);
$link_text = str_replace('%date', mysql2date(get_option('date_format'), $embedded_post->post_date),$link_text);
$link_text = str_replace('%time', mysql2date('U', $embedded_post->post_date),$link_text);
$link_text = str_replace('%categories','',$link_text);
}
$link_text = htmlspecialchars($link_text,ENT_QUOTES);
//The following line is to help make javascript and php play nice.
$link_text= str_replace("'",'’',$link_text);
//We do this otherwise it will double encode things.
$link_text= str_replace('’','’',$link_text);
$link_text= str_replace('“','“',$link_text);
$link_text= str_replace('”','”',$link_text);
return $link_text;
}
function get_a_category_list(){
$categories = get_the_category();
if (empty($categories))
return __('Uncategorized');
$separator = ',';
$thelist = '';
$i = 0;
foreach ( $categories as $category ) {
if ( 0 < $i )
$thelist .=', ';
$thelist .= $category->cat_name;
++$i;}
return $thelist;
}
add_action('admin_menu', 'inap_menu');
function inap_menu() {
add_submenu_page('themes.php', 'INAP Managment', 'INAP Managment', 8,dirname(__FILE__).'/inap_admin.php');
}
function inap_update_options($options){
global $inapall;
$checkboxes = array('strip_excerpt','strip_html','use_fade','simple_posts','simple_comments','special_effects','comment_threaded','show_addcomments_single','show_comments_single','show_addcomments_page','show_comments_page','show_addcomments_home','show_comments_home','trimfeeds','live_preview','live_preview_smilies','live_preview_html','comment_order','inap_pages');
foreach($checkboxes as $name){
if(!$options[$name]){ $options[$name] = 0; }
}
if(!$options['comment_order']){ $options['comment_order'] = 'ASC'; }
while (list($option, $value) = each($options)) {
if( get_magic_quotes_gpc() ) {
$value = stripslashes($value);
}
$inapall[$option] =$value;
}
return $inapall;
}
function inap_next_posts_link($label='Next Page »', $max_page=0) {
global $paged, $wpdb, $wp_query;
if ( !$max_page ) {
$max_page = $wp_query->max_num_pages;
}
if ( !$paged )
$paged = 1;
$nextpage = intval($paged) + 1;
if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) {
echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'';
}
}
function inap_previous_posts_link($label='« Previous Page') {
global $paged;
if ( (!is_single()) && ($paged > 1) ) {
echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'';
}
}
function inap_posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') {
global $wp_query;
if ( !is_singular() ) {
$max_num_pages = $wp_query->max_num_pages;
$paged = get_query_var('paged');
//only have sep if there's both prev and next results
if ($paged < 2 || $paged >= $max_num_pages) {
$sep = '';
}
if ( $max_num_pages > 1 ) {
inap_previous_posts_link($prelabel);
echo preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $sep);
inap_next_posts_link($nxtlabel);
}
}
}
function inap_previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {
if ( is_attachment() )
$post = & get_post($GLOBALS['post']->post_parent);
else
$post = get_previous_post($in_same_cat, $excluded_categories);
if ( !$post )
return;
$title = apply_filters('the_title', $post->post_title, $post);
$string = '';
$link = str_replace('%title', $title, $link);
$link = $pre . $string . $link . '';
$format = str_replace('%link', $link, $format);
echo $format;
}
function inap_next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') {
$post = get_next_post($in_same_cat, $excluded_categories);
if ( !$post )
return;
$title = apply_filters('the_title', $post->post_title, $post);
$string = '';
$link = str_replace('%title', $title, $link);
$link = $string . $link . '';
$format = str_replace('%link', $link, $format);
echo $format;
}
//
// To integrate with the WP-PostViews plugin
//
function inap_process_postviews() {
global $id;
$post_views = get_post_custom($post_id);
$post_views = intval($post_views['views'][0]);
if(empty($_COOKIE[USER_COOKIE])) {
if($post_views > 0) {
update_post_meta($id, 'views', ($post_views+1));
} else {
add_post_meta($id, 'views', 1, true);
}
}
}
function inap_get_base(){
return '/'.end(explode('/', str_replace(array('\\','/inap.php'),array('/',''),__FILE__)));
}
?>