Exemplo n.º 1
0
/** NOTE: %postcontent% is NOT replaced with this function...it happens in the content filter function **/
function token_replace($replace, $referral = 'other', $id = 0, $ser_ID = 0)
{
    global $post, $orgseries;
    $p_id = $id == 0 ? $post->ID : $id;
    $ser_id = $ser_ID == 0 ? $id : $ser_ID;
    //$p_id = (empty($post->ID) || $post->ID == '') ? $id : $post->ID;
    $settings = $orgseries->settings;
    $replace = apply_filters('pre_orgseries_token_replace', $replace, $referral, $id, $p_id, $ser_id);
    if ('post-list' == $referral) {
        $ser_width = $settings['series_icon_width_post_page'];
    } elseif ('latest_series' == $referral) {
        $ser_width = $settings['series_icon_width_latest_series'];
    } else {
        $ser_width = $settings['series_icon_width_series_page'];
    }
    if ('series-toc' == $referral || 'latest_series' == $referral) {
        $replace = str_replace('%total_posts_in_series%', wp_postlist_count($ser_id), $replace);
    } else {
        $replace = str_replace('%total_posts_in_series%', wp_postlist_count($ser_id), $replace);
    }
    if (stristr($replace, '%series_icon%')) {
        $replace = str_replace('%series_icon%', get_series_icon('fit_width=' . $ser_width . '&link=0&series=' . $ser_id . '&display=0'), $replace);
    }
    if (stristr($replace, '%series_icon_linked%')) {
        $replace = str_replace('%series_icon_linked%', get_series_icon('fit_width= ' . $ser_width . '&series=' . $ser_id . '&display=0'), $replace);
    }
    if (stristr($replace, '%series_title%')) {
        $replace = str_replace('%series_title%', the_series_title($ser_id, FALSE), $replace);
    }
    if (stristr($replace, '%series_title_linked%')) {
        $replace = str_replace('%series_title_linked%', the_series_title($ser_id), $replace);
    }
    if (stristr($replace, '%post_title_list%')) {
        $replace = str_replace('%post_title_list%', get_series_posts($id, $referral), $replace);
    }
    if (stristr($replace, '%post_title%')) {
        $replace = str_replace('%post_title%', series_post_title($id, FALSE), $replace);
    }
    if (stristr($replace, '%post_title_linked%')) {
        $replace = str_replace('%post_title_linked%', series_post_title($id), $replace);
    }
    if (stristr($replace, '%series_part%')) {
        $replace = str_replace('%series_part%', wp_series_part($p_id, $ser_id), $replace);
    }
    if (stristr($replace, '%series_description%')) {
        $replace = str_replace('%series_description%', series_description($ser_id), $replace);
    }
    if (stristr($replace, '%next_post%')) {
        $replace = str_replace('%next_post%', wp_series_nav($id), $replace);
    }
    if (stristr($replace, '%previous_post%')) {
        $replace = str_replace('%previous_post%', wp_series_nav($id, FALSE), $replace);
    }
    if (stristr($replace, '%next_post_custom%')) {
        $replace = str_replace('%next_post_custom%', wp_series_nav($id, TRUE, TRUE), $replace);
    }
    if (stristr($replace, '%previous_post_custom%')) {
        $replace = str_replace('%previous_post_custom%', wp_series_nav($id, FALSE, TRUE), $replace);
    }
    $replace = apply_filters('post_orgseries_token_replace', $replace, $referral, $id, $p_id, $ser_id);
    return $replace;
}
Exemplo n.º 2
0
function edit_series_form_fields($series, $taxonomy)
{
    global $orgseries;
    $series_icon = get_series_icon('fit_width=100&fit_height=100&link=0&expand=true&display=0&series=' . $series->term_id);
    $icon_loc = series_get_icons($series->term_id);
    if ($icon_loc || $icon_loc != '') {
        $series_icon_loc = seriesicons_url() . $icon_loc;
    } else {
        $series_icon_loc = '';
    }
    ?>
			<tr valign="top">
				<?php 
    if ($series->term_id != '') {
        ?>
				<th scope="row"><?php 
        _e('Current series icon:', 'organize-series');
        ?>
</th><?php 
    }
    ?>
				<td>
					<?php 
    if ($series_icon != '') {
        echo $series_icon;
    } else {
        echo '<p>' . __('No icon currently', 'organize-series') . '</p>';
    }
    ?>
					<div id="selected-icon"></div>
				</td>
			</tr>
			<?php 
    if ($series_icon != '') {
        ?>
			<tr>
				<th></th>
				<td>
				<p style="width: 50%;"><input style="margin-top: 0px;" name="delete_image" id="delete_image" type="checkbox" value="true" />  <?php 
        _e('Delete image? (note: there will not be an image associated with this series if you select this)', 'organize-series');
        ?>
</p>
				</td>
			</tr>
			<?php 
    }
    ?>
			<tr valign="top">
				<th scope="row"><?php 
    _e('Series Icon Upload:', 'organize-series');
    ?>
</th>
				<td><label for="series_icon">
					<input id="series_icon_loc_display" type="text" size="36" name="series_icon_loc_display" value="" disabled="disabled"/>
					<input id="upload_image_button" type="button" value="Select Image" />
					<p><?php 
    _e('Upload an image for the series.', 'organize-series');
    ?>
</p>
					<input id="series_icon_loc" type="hidden" name="series_icon_loc" />
					</label>
				</td>
			</tr>
	<?php 
}