コード例 #1
0
function feature_column_display($column)
{
    global $post;
    switch ($column) {
        case "feature-description":
            the_excerpt();
            break;
        case "feature-media":
            if (m_pagelines('feature-media', $post->ID)) {
                em_pagelines('feature-media', $post->ID);
            } elseif (m_pagelines('feature-media-image', $post->ID)) {
                echo '<img src="' . m_pagelines('feature-media', $post->ID) . '" style="max-width: 200px; max-height: 200px" />';
            } elseif (m_pagelines('feature-background-image', $post->ID)) {
                echo '<img src="' . m_pagelines('feature-background-image', $post->ID) . '" style="max-width: 200px; max-height: 200px" />';
            }
            break;
        case "feature-sets":
            echo get_the_term_list($post->ID, 'feature-sets', '', ', ', '');
            break;
    }
}
コード例 #2
0
    function _get_image_upload_option($oid, $o)
    {
        global $post_ID;
        ?>
		
			<p>
				<label class="context" for="<?php 
        echo $oid;
        ?>
"><?php 
        echo $o['label'];
        ?>
</label>
				<input class="regular-text uploaded_url" type="text" name="<?php 
        echo $oid;
        ?>
" value="<?php 
        em_pagelines($oid, $post_ID);
        ?>
" /><br/><br/>


				<span id="<?php 
        echo $oid;
        ?>
" class="image_upload_button button">Upload Image</span>
				<span title="<?php 
        echo $oid;
        ?>
" id="<?php 
        echo $oid;
        ?>
" class="image_reset_button button">Remove</span>
				<input type="hidden" class="ajax_action_url" name="wp_ajax_action_url" value="<?php 
        echo admin_url("admin-ajax.php");
        ?>
" />
				<input type="hidden" class="image_preview_size" name="img_size_<?php 
        echo $oid;
        ?>
" value="100"/>
			</p>
			<?php 
        if (m_pagelines($oid, $post_ID)) {
            ?>
				<img class="pagelines_image_preview" id="image_<?php 
            echo $oid;
            ?>
" src="<?php 
            em_pagelines($oid, $post_ID);
            ?>
" style="max-width: 100px"/>
			<?php 
        }
        ?>

		
	<?php 
    }
コード例 #3
0
    function draw_meta_options()
    {
        global $post_ID;
        ?>
		<div class="pagelines_pagepost_options">
	<?php 
        foreach ($this->meta_array as $optionid => $o) {
            ?>
				<?php 
            if (isset($o['where']) && $o['where'] != $this->settings['posttype']) {
            } else {
                ?>
						<?php 
                if (VPRO || !VPRO && $o['version'] != 'pro') {
                    ?>
						<div class="page_option">
								<div class="option-description">
									<label for="<?php 
                    echo $optionid;
                    ?>
"><strong><?php 
                    echo $o['inputlabel'];
                    ?>
</strong></label><br/>
									<small><?php 
                    echo $o['exp'];
                    ?>
</small>
								</div>
								<?php 
                    if ($o['type'] == 'check') {
                        ?>
								
									<div class="option-inputs">
										
											<input class="admin_checkbox" type="checkbox" id="<?php 
                        echo $optionid;
                        ?>
" name="<?php 
                        echo $optionid;
                        ?>
" <?php 
                        checked((bool) m_pagelines($optionid, $post_ID));
                        ?>
 />
						
									</div>
								<?php 
                    } elseif ($o['type'] == 'textarea') {
                        ?>
									
										<div class="option-inputs">
											<textarea class="html-textarea"  id="<?php 
                        echo $optionid;
                        ?>
" name="<?php 
                        echo $optionid;
                        ?>
" /><?php 
                        em_pagelines($optionid, $post_ID);
                        ?>
</textarea>
										</div>
								
								<?php 
                    } elseif ($o['type'] == 'text' || $o['type'] == 'text_small' || $o['type'] == 'text_link' || $o['type'] == 'text_big') {
                        ?>

										<div class="option-inputs">
											<input type="text" class="html-text <?php 
                        echo 'meta-' . $o['type'];
                        ?>
"  id="<?php 
                        echo $optionid;
                        ?>
" name="<?php 
                        echo $optionid;
                        ?>
" value="<?php 
                        em_pagelines($optionid, $post_ID);
                        ?>
" />
										</div>
								<?php 
                    } elseif ($o['type'] == 'select') {
                        ?>
										
										
											<div class="option-inputs">
												<select id="<?php 
                        echo $optionid;
                        ?>
" name="<?php 
                        echo $optionid;
                        ?>
">
													<option value="">&mdash;<?php 
                        _e("SELECT", 'pagelines');
                        ?>
&mdash;</option>

													<?php 
                        foreach ($o['selectvalues'] as $sval => $sset) {
                            ?>
														<?php 
                            if ($o['type'] == 'select_same') {
                                ?>
																<option value="<?php 
                                echo $sset;
                                ?>
" <?php 
                                if (get_pagelines_meta($optionid, $post_ID) == $sset) {
                                    echo 'selected';
                                }
                                ?>
><?php 
                                echo $sset;
                                ?>
</option>
														<?php 
                            } elseif (is_array($sset)) {
                                $disabled_option = isset($sset['version']) && $sset['version'] == 'pro' && !VPRO ? true : false;
                                ?>
															<option <?php 
                                if ($disabled_option) {
                                    echo 'disabled="disabled" class="disabled_option"';
                                }
                                ?>
 value="<?php 
                                echo $sval;
                                ?>
" <?php 
                                if (get_pagelines_meta($optionid, $post_ID) == $sval) {
                                    echo 'selected';
                                }
                                ?>
><?php 
                                echo $sset['name'];
                                if ($disabled_option) {
                                    echo ' (pro)';
                                }
                                ?>
</option>
														<?php 
                            } else {
                                ?>
																<option value="<?php 
                                echo $sval;
                                ?>
" <?php 
                                if (get_pagelines_meta($optionid, $post_ID) == $sval) {
                                    echo 'selected';
                                }
                                ?>
><?php 
                                echo $sset;
                                ?>
</option>
														<?php 
                            }
                            ?>

													<?php 
                        }
                        ?>
												</select>
											</div>

								<?php 
                    } elseif ($o['type'] == 'count_select') {
                        ?>
									
									<div class="option-inputs">
									
										<select id="<?php 
                        echo $optionid;
                        ?>
" name="<?php 
                        echo $optionid;
                        ?>
">
											<option value="">&mdash;SELECT&mdash;</option>
											<?php 
                        if (isset($o['count_start'])) {
                            $count_start = $o['count_start'];
                        } else {
                            $count_start = 0;
                        }
                        ?>
											<?php 
                        for ($i = $count_start; $i <= $o['count_number']; $i++) {
                            ?>
													<option value="<?php 
                            echo $i;
                            ?>
" <?php 
                            selected($i, get_pagelines_meta($optionid, $post_ID));
                            ?>
><?php 
                            echo $i;
                            ?>
</option>
											<?php 
                        }
                        ?>
										</select>
									</div>
									
								<?php 
                    } elseif ($o['type'] == 'image_upload') {
                        ?>
							
									<div class="option-inputs">
										<p>
											<label class="context" for="<?php 
                        echo $optionid;
                        ?>
"><?php 
                        echo $o['inputlabel'];
                        ?>
</label><br/>
											<input class="regular-text uploaded_url" type="text" name="<?php 
                        echo $optionid;
                        ?>
" value="<?php 
                        em_pagelines($optionid, $post_ID);
                        ?>
" /><br/><br/>


											<span id="<?php 
                        echo $optionid;
                        ?>
" class="image_upload_button button">Upload Image</span>
											<span title="<?php 
                        echo $optionid;
                        ?>
" id="<?php 
                        echo $optionid;
                        ?>
" class="image_reset_button button">Remove</span>
											<input type="hidden" class="ajax_action_url" name="wp_ajax_action_url" value="<?php 
                        echo admin_url("admin-ajax.php");
                        ?>
" />
											<input type="hidden" class="image_preview_size" name="img_size_<?php 
                        echo $optionid;
                        ?>
" value="100"/>
										</p>
										<?php 
                        if (m_pagelines($optionid, $post_ID)) {
                            ?>
											<img class="pagelines_image_preview" id="image_<?php 
                            echo $optionid;
                            ?>
" src="<?php 
                            em_pagelines($optionid, $post_ID);
                            ?>
" style="max-width: 100px"/>
										<?php 
                        }
                        ?>
									</div>
								<?php 
                    } elseif ($o['type'] == 'select_taxonomy') {
                        ?>
									<?php 
                        $terms_array = get_terms($o['taxonomy_id']);
                        ?>
 
									<div class="option-inputs">
									<?php 
                        if (is_array($terms_array) && !empty($terms_array)) {
                            ?>
									
											<select id="<?php 
                            echo $optionid;
                            ?>
" name="<?php 
                            echo $optionid;
                            ?>
">
												<option value="">&mdash;<?php 
                            _e("SELECT", 'pagelines');
                            ?>
&mdash;</option>
												<?php 
                            foreach ($terms_array as $term) {
                                ?>
													<option value="<?php 
                                echo $term->slug;
                                ?>
" <?php 
                                if (get_pagelines_meta($optionid, $post_ID) == $term->slug) {
                                    echo 'selected';
                                }
                                ?>
><?php 
                                echo $term->name;
                                ?>
</option>
												<?php 
                            }
                            ?>
											</select>
										
									<?php 
                        } else {
                            ?>
										<div class="meta-message">No sets have been created and added to a post yet!</div>
									<?php 
                        }
                        ?>
									</div>
								<?php 
                    }
                    ?>
							<div class="clear"></div>
						</div>
						<?php 
                }
                ?>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
			<div class="page_option fix update-meta-options">
					<input type="hidden" name="_posttype" value="<?php 
        echo $this->settings['posttype'];
        ?>
" />
					<input id="update" class="button-primary" type="submit" value="<?php 
        _e("Update Options", 'pagelines');
        ?>
" accesskey="p" tabindex="5" name="update"/>
			</div>
		</div>
			
	
	
	<?php 
    }