function bizVektorOptions($optionLabel)
{
    $options = biz_bektor_option_validate();
    if (isset($options[$optionLabel]) && $options[$optionLabel]) {
        return $options[$optionLabel];
    } else {
        $options_default = biz_vektor_generate_default_options();
        if (isset($options_default[$optionLabel])) {
            return $options_default[$optionLabel];
        }
        return false;
    }
}
function biz_vektor_seo_set_HeadKeywords()
{
    $options = biz_bektor_option_validate();
    $commonKeyWords = $options['commonKeyWords'];
    // get custom field
    $entryKeyWords = post_custom('metaKeyword');
    $keywords = array();
    if ($commonKeyWords) {
        $keywords[] = $commonKeyWords;
    }
    if ($entryKeyWords) {
        $keywords[] = $entryKeyWords;
    }
    $key = implode(',', $keywords);
    // print individual keywords
    if (!$key) {
        return;
    }
    echo '<meta name="keywords" content="' . $key . '" />' . "\n";
}
 function __construct()
 {
     global $biz_vektor_options;
     $biz_vektor_options = biz_bektor_option_validate();
     $widget_name = biz_vektor_get_short_name() . '_' . sprintf(__('%1$s list for top', 'biz-vektor'), $biz_vektor_options['infoLabelName']);
     parent::__construct('top_list_info', $widget_name, array('description' => sprintf(__('Displays recent %1$s posts.', 'biz-vektor'), $biz_vektor_options['infoLabelName'])));
 }
Beispiel #4
0
function biz_vektor_sns_config()
{
    global $biz_vektor_options;
    $options = biz_bektor_option_validate();
    $biz_vektor_name = get_biz_vektor_name();
    /*-------------------------------------------*/
    /*	SNS
    /*-------------------------------------------*/
    ?>
<div id="snsSetting" class="sectionBox">
<?php 
    get_template_part('inc/theme-options-nav');
    ?>
<h3><?php 
    _e('Social media', 'biz-vektor');
    ?>
</h3>
<?php 
    _e('If you are unsure, you can leave for later.', 'biz-vektor');
    ?>
<table class="form-table">
<tr>
<th>facebook</th>
<td><?php 
    _e('If you wish to link to a personal account or a Facebook page  banner will be displayed if you enter<label> the URL.', 'biz-vektor');
    ?>
<br />
<input type="text" name="biz_vektor_theme_options[facebook]" id="facebook" value="<?php 
    echo esc_attr($options['facebook']);
    ?>
" class="width-600" /><br/>
<span><?php 
    _e('ex) ', 'biz-vektor');
    ?>
https://www.facebook.com/FacebookJapan</span>
</td>
</tr>
<!-- facebook application ID -->
<tr>
<th><?php 
    _e('facebook application ID', 'biz-vektor');
    ?>
</th>
<td><input type="text" name="biz_vektor_theme_options[fbAppId]" id="fbAppId" value="<?php 
    echo esc_attr($options['fbAppId']);
    ?>
" />
<span>[ <a href="https://developers.facebook.com/apps" target="_blank">&raquo; <?php 
    _e('I will check and get the application ID', 'biz-vektor');
    ?>
</a> ]</span><br />
<?php 
    _e('* If an application ID is not specified, neither a Like button nor the comment field displays and operates correctly.', 'biz-vektor');
    ?>
<br />
<?php 
    _e('Please search for terms as [get Facebook application ID] If you do not know much about how to get application ID for Facebook.', 'biz-vektor');
    ?>
</td>
</tr>
<!-- facebook user ID -->
<tr>
<th><?php 
    _e('Facebook user ID (optional)', 'biz-vektor');
    ?>
</th>
<td><?php 
    _e('Please enter the Facebook user ID of the administrator.', 'biz-vektor');
    ?>
<br />
<input type="text" name="biz_vektor_theme_options[fbAdminId]" id="fbAdminId" value="<?php 
    echo esc_attr($options['fbAdminId']);
    ?>
" class="width-600" /><br />
<?php 
    _e('* It is not the application ID of the Facebook page.', 'biz-vektor');
    ?>
<br />
<?php 
    _e('You can see the personal Facebook ID when you access the following url http://graph.facebook.com/(own url name(example: TheStig )).', 'biz-vektor');
    ?>
<br />
<?php 
    _e('Please search for terms as [find facebook user ID] if you are still not sure.', 'biz-vektor');
    ?>
</td>
</tr>
<!-- twitter -->
<tr>
<th><?php 
    _e('twitter account', 'biz-vektor');
    ?>
</th>
<td><?php 
    _e('If you would like to link to a Twitter account, banner will be displayed if you enter the account name.', 'biz-vektor');
    ?>
<br />
@<input type="text" name="biz_vektor_theme_options[twitter]" id="twitter" value="<?php 
    echo esc_attr($options['twitter']);
    ?>
" /><br />
<?php 
    $twitter_widget = '<a href="' . get_admin_url() . 'widgets.php" target="_blank">' . __('widget', 'biz-vektor') . '</a>';
    printf(__('* If you prefer to use Twitter widgets etc, this can be left blank, paste the source code into a [text] %s here.', 'biz-vektor'), $twitter_widget);
    ?>
</td>
</tr>
<!-- OGP -->
<tr>
<th><?php 
    _e('OGP default image', 'biz-vektor');
    ?>
</th>
<td><?php 
    _e('If, for example someone pressed the Facebook [Like] button, this is the image that appears on the Facebook timeline.', 'biz-vektor');
    ?>
<br />
<?php 
    _e('If a featured image is specified for the page, it takes precedence.', 'biz-vektor');
    ?>
<br />
<input type="text" name="biz_vektor_theme_options[ogpImage]" id="ogpImage" value="<?php 
    echo esc_attr($options['ogpImage']);
    ?>
" class="width-300" /> 
<button id="media_ogpImage" class="media_btn"><?php 
    _e('Select an image', 'biz-vektor');
    ?>
</button><br />
<span><?php 
    _e('ex) ', 'biz-vektor');
    ?>
http://www.vektor-inc.co.jp/images/ogpImage.png</span><br />
<?php 
    _e('* Picture sizes are 300x300 pixels or more and picture ratio 16:9 is recommended.', 'biz-vektor');
    ?>
</td>
</tr>
<!-- Social buttons -->
<tr>
<th><?php 
    _e('Social buttons', 'biz-vektor');
    ?>
</th>
<td><?php 
    _e('Please check the type of page that displays the social button.', 'biz-vektor');
    ?>
<ul>
<li><label><input type="checkbox" name="biz_vektor_theme_options[snsBtnsFront]" id="snsBtnsFront" value="false" <?php 
    if ($options['snsBtnsFront']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    _ex('Home page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[snsBtnsPage]" id="snsBtnsPage" value="false" <?php 
    if ($options['snsBtnsPage']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    _ex('Page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[snsBtnsPost]" id="snsBtnsPost" value="false" <?php 
    if ($options['snsBtnsPost']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['postLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[snsBtnsInfo]" id="snsBtnsInfo" value="false" <?php 
    if ($options['snsBtnsInfo']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['infoLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
</ul>
<p><?php 
    _e('Within the type of page that is checked, if there is a particular pa<label>ge you do not wish to display, enter the Page ID. If multiple pages, please separate by commas.', 'biz-vektor');
    ?>
<br />
<input type="text" name="biz_vektor_theme_options[snsBtnsHidden]" value="<?php 
    echo esc_attr($options['snsBtnsHidden']);
    ?>
" /><br />
<?php 
    _e('ex) ', 'biz-vektor');
    ?>
1,3,7</p>
</td>
</tr>
<!-- facebook comment -->
<tr>
<th><?php 
    _e('facebook comments box', 'biz-vektor');
    ?>
</th>
<td><?php 
    _e('Please check the type of the page to display Facebook comments.', 'biz-vektor');
    ?>
<ul>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbCommentsFront]" id="fbCommentsFront" value="false" <?php 
    if ($options['fbCommentsFront']) {
        ?>
 checked<?php 
    }
    ?>
>
	<?php 
    _ex('Home page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbCommentsPage]" id="fbCommentsPage" value="false" <?php 
    if ($options['fbCommentsPage']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    _ex('Page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbCommentsPost]" id="fbCommentsPost" value="false" <?php 
    if ($options['fbCommentsPost']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['postLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbCommentsInfo]" id="fbCommentsInfo" value="false" <?php 
    if ($options['fbCommentsInfo']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['infoLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
</ul>
<p><?php 
    _e('Within the type of page that is checked, if there is a particular page you do not wish to display, enter the Page ID. If multiple pages, please separate by commas.', 'biz-vektor');
    ?>
<br />
<input type="text" name="biz_vektor_theme_options[fbCommentsHidden]" value="<?php 
    echo esc_attr($options['fbCommentsHidden']);
    ?>
" /><br />
<?php 
    _e('ex) ', 'biz-vektor');
    ?>
1,3,7</p>
</td>
</tr>
<!-- facebook LikeBox -->
<tr>
<th>facebook LikeBox</th>
<td><?php 
    _e('If you wish to use Facebook LikeBox, please check the location.', 'biz-vektor');
    ?>
<br />
<?php 
    _e('* Please be sure to set Facebook application ID.', 'biz-vektor');
    ?>
<ul>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxFront]" id="fbLikeBoxFront" value="false" <?php 
    if ($options['fbLikeBoxFront']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    _ex('Home page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxPage]" id="fbLikeBoxPage" value="false" <?php 
    if ($options['fbLikeBoxPage']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    _ex('Page', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxPost]" id="fbLikeBoxPost" value="false" <?php 
    if ($options['fbLikeBoxPost']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['postLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
<li><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxInfo]" id="fbLikeBoxInfo" value="false" <?php 
    if ($options['fbLikeBoxInfo']) {
        ?>
 checked<?php 
    }
    ?>
> 
	<?php 
    echo esc_html($biz_vektor_options['infoLabelName']);
    ?>
 <?php 
    _ex('Post', 'sns display', 'biz-vektor');
    ?>
</label></li>
</ul>
<dl>
<dt><?php 
    _e('URL of the Facebook page.', 'biz-vektor');
    ?>
</dt>
<dd><input type="text" name="biz_vektor_theme_options[fbLikeBoxURL]" id="fbLikeBoxURL" value="<?php 
    echo esc_attr($options['fbLikeBoxURL']);
    ?>
" class="width-500" /><br />
<span><?php 
    _e('ex) ', 'biz-vektor');
    ?>
https://www.facebook.com/bizvektor</span></dd>
<dt><?php 
    _e('Display stream', 'biz-vektor');
    ?>
</dt>
<dd><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxStream]" id="fbLikeBoxStream" value="false" <?php 
    if ($options['fbLikeBoxStream']) {
        ?>
 checked<?php 
    }
    ?>
> <?php 
    _e('Display', 'biz-vektor');
    ?>
</label></dd>
<dt><?php 
    _e('Display faces', 'biz-vektor');
    ?>
</dt>
<dd><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxFace]" id="fbLikeBoxFace" value="false" <?php 
    echo $options['fbLikeBoxFace'] == 'false' ? "checked " : "";
    ?>
> <?php 
    _e('Display', 'biz-vektor');
    ?>
</label></dd>
<dt><?php 
    _e('Hide Cover Photo', 'biz-vektor');
    ?>
</dt>
<dd><label><input type="checkbox" name="biz_vektor_theme_options[fbLikeBoxHideCover]" id="fbLikeBoxHideCover" value="false" <?php 
    echo $options['fbLikeBoxHideCover'] == 'false' ? "checked " : "";
    ?>
> <?php 
    _e('Hide', 'biz-vektor');
    ?>
</label></dd>
<dt><?php 
    _e('Height of LikeBox', 'biz-vektor');
    ?>
</dt>
<dd><input type="text" name="biz_vektor_theme_options[fbLikeBoxHeight]" id="fbLikeBoxHeight" value="<?php 
    echo esc_attr($options['fbLikeBoxHeight']);
    ?>
" class="width-100" style="text-align:right;" />
px</dd>
</dl>
</td>
</tr>
<!-- OGP hidden -->
<tr>
<th><?php 
    _e('Do not output the OGP', 'biz-vektor');
    ?>
</th>
<td>
<p><?php 
    printf(__('If other plug-ins are used for the OGP, do not output the OGP using %s.', 'biz-vektor'), $biz_vektor_name);
    ?>
</p>
<label><input type="radio" name="biz_vektor_theme_options[ogpTagDisplay]" value="ogp_on" <?php 
    echo $options['ogpTagDisplay'] == 'ogp_on' ? 'checked' : '';
    ?>
> <?php 
    printf(__('I want to output the OGP tags using %s', 'biz-vektor'), $biz_vektor_name);
    ?>
</label><br />
<label><input type="radio" name="biz_vektor_theme_options[ogpTagDisplay]" value="ogp_off" <?php 
    echo $options['ogpTagDisplay'] != 'ogp_on' ? 'checked' : '';
    ?>
> <?php 
    printf(__('Do not output OGP tags using %s', 'biz-vektor'), $biz_vektor_name);
    ?>
</label><br />
</td>
</tr>
<!-- twitter card -->
<tr>
<th><?php 
    printf(__('%1$s Settings', 'biz-vektor'), __('Twitter Card', 'biz-vektor'));
    ?>
</th>
<td>
<p>
* <?php 
    printf(__('%1$s related tags won\'t display if you don\'t fill a Twitter account above.', 'biz-vektor'), __('Twitter Card', 'biz-vektor'));
    ?>
<br />
* <?php 
    printf(__('Image used for %1$s is the Featured Image set for each post. In case there is no Featured Image, the default OGP image will be used.', 'biz-vektor'), __('Twitter Card', 'biz-vektor'));
    ?>
</p>
</td>
</tr>
</table>
<?php 
    submit_button();
    ?>
</div>
<?php 
}
 /** constructor */
 function __construct()
 {
     $biz_vektor_options = biz_bektor_option_validate();
     $widget_name = biz_vektor_get_short_name() . '_' . sprintf(__('%s category', 'biz-vektor'), $biz_vektor_options['infoLabelName']);
     parent::__construct('infoTerms', $widget_name, array('description' => sprintf(__('Category list of %s', 'biz-vektor'), $biz_vektor_options['infoLabelName']), 'hanshin tigers'));
 }
function biz_vektor_theme_options_validate($input)
{
    $defaults = biz_vektor_get_theme_options();
    $output = biz_bektor_option_validate();
    if (isset($_POST['bizvektor_action_mode']) && $_POST['bizvektor_action_mode'] == 'reset') {
        if (isset($_POST['bizvektor_reset_check']) && isset($_POST['bizvektor_reset_key_port']) && $_POST['bizvektor_reset_key_port'] == $_POST['bizvektor_reset_key']) {
            echo "reseted";
            return $defaults;
        } else {
            echo "faild";
            return $output;
        }
    }
    // Design
    $output['gMenuDivide'] = $input['gMenuDivide'] ? $input['gMenuDivide'] : $defaults['gMenuDivide'];
    $output['head_logo'] = $input['head_logo'];
    $output['foot_logo'] = $input['foot_logo'];
    $output['font_title'] = $input['font_title'];
    $output['font_menu'] = $input['font_menu'];
    $output['side_child_display'] = $input['side_child_display'];
    $output['enable_google_font'] = $input['enable_google_font'];
    // Contact info
    $output['contact_txt'] = $input['contact_txt'];
    $output['tel_number'] = $input['tel_number'];
    $output['contact_time'] = $input['contact_time'];
    $output['sub_sitename'] = $input['sub_sitename'];
    $output['contact_address'] = $input['contact_address'];
    $output['contact_link'] = $input['contact_link'];
    // 3PR
    $output['top3PrDisplay'] = isset($input['top3PrDisplay']) && $input['top3PrDisplay'] == 'true' ? true : false;
    $output['pr1_title'] = $input['pr1_title'] == '' ? $defaults['pr1_title'] : $input['pr1_title'];
    $output['pr1_description'] = $input['pr1_description'] == '' ? $defaults['pr1_description'] : $input['pr1_description'];
    $output['pr1_link'] = $input['pr1_link'];
    $output['pr1_image'] = $input['pr1_image'];
    $output['pr1_image_s'] = $input['pr1_image_s'];
    $output['pr2_title'] = $input['pr2_title'] == '' ? $defaults['pr2_title'] : $input['pr2_title'];
    $output['pr2_description'] = $input['pr2_description'] == '' ? $defaults['pr2_description'] : $input['pr2_description'];
    $output['pr2_link'] = $input['pr2_link'];
    $output['pr2_image'] = $input['pr2_image'];
    $output['pr2_image_s'] = $input['pr2_image_s'];
    $output['pr3_title'] = $input['pr3_title'] == '' ? $defaults['pr3_title'] : $input['pr3_title'];
    $output['pr3_description'] = $input['pr3_description'] == '' ? $defaults['pr3_description'] : $input['pr3_description'];
    $output['pr3_link'] = $input['pr3_link'];
    $output['pr3_image'] = $input['pr3_image'];
    $output['pr3_image_s'] = $input['pr3_image_s'];
    // Infomation & Blog
    $output['postLabelName'] = !$input['postLabelName'] ? $defaults['postLabelName'] : $input['postLabelName'];
    $output['listBlogTop'] = $input['listBlogTop'];
    $output['listBlogArchive'] = $input['listBlogArchive'];
    $output['postTopUrl'] = $input['postTopUrl'];
    $output['postTopCount'] = !$input['postTopCount'] ? 0 : $input['postTopCount'];
    // TopPage
    $output['topSideBarDisplay'] = isset($input['topSideBarDisplay']) && $input['topSideBarDisplay'] == 'true' ? true : false;
    // SlideShow
    for ($i = 1; $i <= 5;) {
        $output['slide' . $i . 'link'] = $input['slide' . $i . 'link'];
        $output['slide' . $i . 'image'] = $input['slide' . $i . 'image'];
        $output['slide' . $i . 'alt'] = $input['slide' . $i . 'alt'];
        $output['slide' . $i . 'display'] = isset($input['slide' . $i . 'display']) && $input['slide' . $i . 'display'] ? "true" : '';
        $output['slide' . $i . 'blank'] = isset($input['slide' . $i . 'blank']) && $input['slide' . $i . 'blank'] ? "true" : '';
        $i++;
    }
    if ($input['theme_layout'] == '') {
        $output['theme_layout'] = "content-sidebar";
    }
    $output['theme_style'] = $input['theme_style'] == '' ? "rebuild" : $input['theme_style'];
    // Theme layout must be in our array of theme layout options
    if (isset($input['theme_layout']) && array_key_exists($input['theme_layout'], biz_vektor_layouts())) {
        $output['theme_layout'] = $input['theme_layout'];
    }
    // sidebar child menu display
    if (isset($input['side_child_display']) && $input['side_child_display']) {
        $output['side_child_display'] = $input['side_child_display'];
    }
    return apply_filters('biz_vektor_theme_options_validate', $output, $input, $defaults);
}
<?php

/*-------------------------------------------*/
/*	info
/*-------------------------------------------*/
$biz_vektor_options = biz_bektor_option_validate();
if (isset($biz_vektor_options['infoTopCount']) && $biz_vektor_options['infoTopCount'] != 0) {
    $infoTopCount = $biz_vektor_options['infoTopCount'];
    $loop = new WP_Query(array('post_type' => 'info', 'posts_per_page' => $infoTopCount));
    if ($loop->have_posts()) {
        ?>
<div id="topInfo" class="infoList">
<h2><?php 
        echo esc_html($biz_vektor_options['infoLabelName']);
        ?>
</h2>
<div class="rssBtn"><a href="<?php 
        echo home_url();
        ?>
/feed/?post_type=info" id="infoRss" target="_blank">RSS</a></div>
<?php 
        if (isset($biz_vektor_options['listInfoTop']) && $biz_vektor_options['listInfoTop'] == 'listType_set') {
            ?>
	<?php 
            while ($loop->have_posts()) {
                $loop->the_post();
                ?>
		<?php 
                get_template_part('module_loop_post2');
                ?>
	<?php 
function biz_vektor_ad_contet_more($post_content)
{
    if (is_single() && get_post_type() == 'post') {
        // moreタグとすぐ次の</p>まで取得
        $moreTag = '/<span id="more-[0-9]+"><\\/span>.*[\\/a-z]+>/';
        // 広告タグ
        $biz_vektor_options = biz_bektor_option_validate();
        $adTags = apply_filters('widget_text', $biz_vektor_options['ad_content_moretag']);
        preg_match($moreTag, $post_content, $matches);
        $match = isset($matches[0]) ? $matches[0] : '';
        if ($match) {
            // $matchしている(moreタグが存在する)場合
            if (strpos($match, '</p>') !== false) {
                $post_content = preg_replace($moreTag, '</p>' . $adTags, $post_content);
            } else {
                $post_content = preg_replace($moreTag, '</p>' . $adTags . '<p>', $post_content);
            }
        }
        if ($biz_vektor_options['ad_content_after']) {
            $post_content = $post_content . '<div class="sectionBox">' . $biz_vektor_options['ad_content_after'] . '</div>';
        }
    }
    // post
    return $post_content;
}