예제 #1
0
    function edit($width, $area)
    {
        ?>
		<tr>
			<th width="<?php 
        echo $width;
        ?>
" align="right"><?php 
        _e('Site name', 'headspace');
        ?>
:</th>
			<td>
				<input type="text" name="headspace_blog_name" value="<?php 
        echo HeadSpace_Plugin::specialchars($this->blog_name);
        ?>
" style="width: 95%"/>
			</td>
		</tr>
		<?php 
    }
예제 #2
0
    function edit($width, $area)
    {
        global $post;
        if ($area == 'page') {
            // Edit post - already have a tag box
            ?>
			
			<div class="suggested" id="suggestions" style="display: none">
				<?php 
            if (!empty($post)) {
                $this->suggestions($post->ID, $post->post_content . ' ' . $post->post_title);
            }
            ?>
			</div>
			<?php 
        } else {
            // Page settings - no existing tag box
            ?>
		<tr>
			<th width="<?php 
            echo $width;
            ?>
" align="right"><?php 
            _e('Tags', 'headspace');
            ?>
:</th>
			<td>
				<input id="tags-input_<?php 
            echo $area;
            ?>
" type="text" name="tags_input" value="<?php 
            echo HeadSpace_Plugin::specialchars($this->tags);
            ?>
" style="width: 95%"/>
			</td>
		</tr>
		<?php 
        }
    }
예제 #3
0
    function edit($width, $area)
    {
        $id = time();
        ?>
	<tr>
		<th width="<?php 
        echo $width;
        ?>
" align="right" style="vertical-align: top !important">
			<?php 
        if ($area == 'page') {
            ?>
			<a href="<?php 
            echo admin_url('admin-ajax.php');
            ?>
?action=hs_auto_description&amp;_ajax_nonce=<?php 
            echo wp_create_nonce('headspace-autodescription');
            ?>
" id="update_<?php 
            echo $id;
            ?>
">
			<?php 
        }
        ?>
			<?php 
        _e('Description', 'headspace');
        ?>
:
			<?php 
        if ($area == 'page') {
            ?>
			</a>
			<?php 
        }
        ?>
		</th>
		<td>
			<textarea rows="2" name="headspace_description" style="width: 95%" id="desc_<?php 
        echo $id;
        ?>
"><?php 
        echo HeadSpace_Plugin::specialchars($this->description);
        ?>
</textarea><br/>

			<script type="text/javascript" charset="utf-8">
				jQuery('#desc_<?php 
        echo $id;
        ?>
').Counter( { limit: <?php 
        echo $this->max_length;
        ?>
, remaining: '<?php 
        echo esc_js(__('remaining', 'headspace'));
        ?>
' } );
				jQuery('#update_<?php 
        echo $id;
        ?>
').AutoDescription( { target: '#desc_<?php 
        echo $id;
        ?>
', content: '#content' } );
			</script>
		</td>
	</tr>
	<?php 
    }
예제 #4
0
 function hs_auto_tag()
 {
     $id = intval($_GET['id']);
     if (current_user_can('edit_post', $id) && check_ajax_referer('headspace-auto_tag_' . $id)) {
         $headspace = HeadSpace2::get();
         $settings = $headspace->get_post_settings($id);
         $tags = $headspace->modules->get('hsm_tags');
         $tags->load($settings);
         include ABSPATH . 'wp-admin/admin-functions.php';
         $post = get_post($id);
         $suggestions = $tags->get_suggestions($post->post_content . ' ' . $post->post_title);
         echo HeadSpace_Plugin::specialchars(implode(', ', $suggestions));
         die;
     }
 }