예제 #1
0
function ipin_enqueue_scripts()
{
    wp_enqueue_style('ipin-bootstrap', get_template_directory_uri() . '/css/bootstrap.css');
    wp_enqueue_style('ipin-fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css');
    wp_enqueue_style('ipin-style', get_stylesheet_directory_uri() . '/style.css', array('ipin-bootstrap'));
    if (of_get_option('color_scheme') == 'dark') {
        wp_enqueue_style('ipin-style-dark', get_template_directory_uri() . '/style-dark.css', array('ipin-style'));
    }
    global $current_user, $wp_rewrite;
    get_currentuserinfo();
    if (is_singular() && comments_open() && get_option('thread_comments') && is_user_logged_in()) {
        wp_enqueue_script('comment-reply');
    }
    if (is_page_template('page_cp_pins.php')) {
        wp_enqueue_script('suggest');
    }
    wp_enqueue_script('ipin_library', get_template_directory_uri() . '/js/ipin.library.js', array('jquery'), null, true);
    wp_enqueue_script('ipin_custom', get_template_directory_uri() . '/js/ipin.custom.js', array('jquery'), null, true);
    //for infinite scroll
    if (function_exists('wp_pagenavi')) {
        $nextSelector = '#navigation a:nth-child(3)';
    } else {
        $nextSelector = '#navigation #navigation-next a';
    }
    $tags_html = '';
    $price_html = '';
    $minWidth = 2;
    $minHeight = 2;
    $minWidth = apply_filters('ipin_minwidth', $minWidth);
    $minHeight = apply_filters('ipin_minheight', $minHeight);
    if (is_user_logged_in() && !is_page_template('page_cp_boards.php') && !is_page_template('page_cp_boards.php') && !is_page_template('page_cp_login.php') && !is_page_template('page_cp_login_lpw.php') && !is_page_template('page_cp_notifications.php') && !is_page_template('page_cp_pins.php') && !is_page_template('page_cp_register.php') && !is_page_template('page_cp_settings.php') && !is_page_template('page_top_users.php') && !is_404()) {
        if (of_get_option('form_title_desc') != 'separate') {
            if (of_get_option('htmltags') == 'enable') {
                $description_fields = ipin_wp_editor('pin-title');
            } else {
                $description_fields = '<textarea class="form-control" id="pin-title" placeholder="' . __('Describe your pin...', 'ipin') . '"></textarea>';
            }
        } else {
            if (of_get_option('htmltags') == 'enable') {
                $description_fields = '<textarea class="form-control" id="pin-title" placeholder="' . __('Title...', 'ipin') . '"></textarea><p></p>' . ($description_fields = ipin_wp_editor('pin-content'));
            } else {
                $description_fields = '<textarea class="form-control" id="pin-title" placeholder="' . __('Title...', 'ipin') . '"></textarea><p></p><textarea id="pin-content" class="form-control" placeholder="' . __('Description...', 'ipin') . '"></textarea>';
            }
        }
        if (of_get_option('posttags') == 'enable') {
            $tags_html = '<div class="input-group"><span class="input-group-addon"><i class="fa fa-tags"></i></span><input class="form-control" type="text" name="tags" id="tags" value="" placeholder="' . __('Tags e.g. comma, separated', 'ipin') . '" /></div>';
        }
        if (of_get_option('price_currency') != '') {
            if (of_get_option('price_currency_position') == 'right') {
                $price_html = '<div class="input-group"><input class="form-control text-right" type="text" name="price" id="price" value="" placeholder="' . __('Price e.g. 23.45', 'ipin') . '" /><span class="input-group-addon">' . of_get_option('price_currency') . '</span></div>';
            } else {
                $price_html = '<div class="input-group"><span class="input-group-addon">' . of_get_option('price_currency') . '</span><input class="form-control" type="text" name="price" id="price" value="" placeholder="' . __('Price e.g. 23.45', 'ipin') . '" /></div>';
            }
        }
        $dropdown_categories = ipin_dropdown_categories(__('Category for New Board', 'ipin'), 'board-add-new-category');
    } else {
        $description_fields = '';
        $tags_html = '';
        $price_html = '';
        $dropdown_categories = '';
    }
    $translation_array = array('__allitemsloaded' => __('All items loaded', 'ipin'), '__addanotherpin' => __('Add Another Pin', 'ipin'), '__addnewboard' => __('Add new board...', 'ipin'), '__boardalreadyexists' => __('Board already exists. Please try another title.', 'ipin'), '__errorpleasetryagain' => __('Error. Please try again.', 'ipin'), '__cancel' => __('Cancel', 'ipin'), '__close' => __('Close', 'ipin'), '__comment' => __('comment', 'ipin'), '__comments' => __('comments', 'ipin'), '__enternewboardtitle' => __('Enter new board title', 'ipin'), '__Follow' => __('Follow', 'ipin'), '__FollowBoard' => __('Follow Board', 'ipin'), '__Forgot' => __('Forgot?', 'ipin'), '__imagetoosmall' => sprintf(__('Image is too small (min size: %d x %dpx)', 'ipin'), $minWidth, $minHeight), '__incorrectusernamepassword' => __('Incorrect Username/Password', 'ipin'), '__invalidimagefile' => __('Invalid image file. Please choose a JPG/GIF/PNG file.', 'ipin'), '__Likes' => __('Likes', 'ipin'), '__loading' => __('Loading...', 'ipin'), '__Login' => __('Login', 'ipin'), '__NotificationsLatest30' => __('Notifications (Latest 30)', 'ipin'), '__onto' => __('onto', 'ipin'), '__Pleasecreateanewboard' => __('Please create a new board', 'ipin'), '__Pleaseentertitle' => __('Please enter title', 'ipin'), '__Pleaseloginorregisterhere' => __('Please login or register here', 'ipin'), '__Pleasetypeacomment' => __('Please type a comment', 'ipin'), '__or' => __('or', 'ipin'), '__Password' => __('Password', 'ipin'), '__pinnedto' => __('Pinned to', 'ipin'), '__pleaseenterbothusernameandpassword' => __('Please enter both username and password.', 'ipin'), '__pleaseenterurl' => __('Please enter url', 'ipin'), '__Repin' => __('Repin', 'ipin'), '__Repins' => __('Repins', 'ipin'), '__repinnedto' => __('Repinned to', 'ipin'), '__seethispin' => __('See This Pin', 'ipin'), '__SeeAll' => __('See All', 'ipin'), '__shareitwithyourfriends' => __('Share it with your friends', 'ipin'), '__SignUp' => __('Sign Up', 'ipin'), '__sorryunbaletofindanypinnableitems' => __('Sorry, unable to find any pinnable items.', 'ipin'), '__Unfollow' => __('Unfollow', 'ipin'), '__UnfollowBoard' => __('Unfollow Board', 'ipin'), '__Username' => __('Username or Email', 'ipin'), '__Video' => __('Video', 'ipin'), '__Welcome' => __('Welcome', 'ipin'), '__yourpinispendingreview' => __('Your pin is pending review', 'ipin'), 'ajaxurl' => admin_url('admin-ajax.php'), 'avatar30' => get_avatar($current_user->ID, '30'), 'avatar48' => get_avatar($current_user->ID, '48'), 'blogname' => get_bloginfo('name'), 'categories' => $dropdown_categories, 'current_date' => date('j M Y g:ia', current_time('timestamp')), 'description_fields' => $description_fields, 'home_url' => home_url(), 'infinitescroll' => of_get_option('infinitescroll'), 'lightbox' => of_get_option('lightbox'), 'login_url' => wp_login_url($_SERVER['REQUEST_URI']), 'nextselector' => $nextSelector, 'nonce' => wp_create_nonce('ajax-nonce'), 'price_html' => $price_html, 'site_url' => site_url(), 'stylesheet_directory_uri' => get_template_directory_uri(), 'stylesheet_directory_uri_child' => get_stylesheet_directory_uri(), 'tags_html' => $tags_html, 'u' => $current_user->ID, 'ui' => $current_user->display_name, 'ul' => $current_user->user_nicename, 'user_rewrite' => $wp_rewrite->author_base);
    wp_localize_script('ipin_custom', 'obj_ipin', $translation_array);
}
예제 #2
0
"></textarea>
						<?php 
            }
            ?>
					<?php 
        } else {
            ?>
						<textarea class="form-control" id="pin-title" placeholder="<?php 
            _e('Title...', 'ipin');
            ?>
"></textarea>
						<p></p>
						
						<?php 
            if (of_get_option('htmltags') == 'enable') {
                echo ipin_wp_editor('pin-content');
            } else {
                ?>
							<textarea class="form-control" id="pin-content" placeholder="<?php 
                _e('Description...', 'ipin');
                ?>
"></textarea>
						<?php 
            }
            ?>
					<?php 
        }
        ?>

					<p></p>