function tcc_flexslider() {
    echo '<div class="flexslider_box"><h2 class="hide">' . __('Flex Slider', 'tcc') . '</h2><div class="flexslider"><ul class="slides">';
    $options = ThemeOptions::getOptions(); //載入主題設定值
    $lang = get_locale();
    $flexCount = count($options[$lang]['flex']['title']);
    if ($flexCount > 0) {
        for ($i = 0; $i < $flexCount; $i ++) {
            echo '<li><div class=' . $options[$lang]['flex']['style'][$i] . '><img src=' . $options[$lang]['flex']['image'][$i] . '><div><h3>' . $options[$lang]['flex']['title'][$i] . '</h3></div></div></li>';
        }
    }
    else 
    {
        // 預設圖片牆
        for ($i = 1; $i <= 4; $i ++) {
            echo '<li><img src="';
            bloginfo('template_directory');
            echo '/images/image' . $i . '.jpg"/></li>';
        }
    }
    echo '</ul></div></div>';
}
    if (empty($alb)) {
        foreach ($themelist as $albumtitle => $alb) {
            break;
        }
        if (empty($alb)) {
            $album = NULL;
        } else {
            $alb = sanitize_path($alb);
            $album = newAlbum($alb);
            $albumtitle = $album->getTitle();
            $themename = $album->getAlbumTheme();
        }
    }
    if (!(false === ($requirePath = getPlugin('themeoptions.php', $themename)))) {
        require_once $requirePath;
        $optionHandler = new ThemeOptions();
        $supportedOptions = $optionHandler->getOptionsSupported();
        if (method_exists($optionHandler, 'getOptionsDisabled')) {
            $unsupportedOptions = $optionHandler->getOptionsDisabled();
        } else {
            $unsupportedOptions = array();
        }
    } else {
        $unsupportedOptions = array();
        $supportedOptions = array();
    }
    standardThemeOptions($themename, $album);
    ?>
						<form class="dirty-check" action="?action=saveoptions" method="post" id="themeoptionsform" autocomplete="off">
							<?php 
    XSRFToken('saveoptions');
Beispiel #3
0
            $option->updatePOST();
            echo $option->getHTML();
        }
        ?>
					</table>
					<input type="submit" value="save" class="button-primary" />
				</form>
				</td>
			</tr>
		</table>
		</div>
		<?php 
    }
}
global $TO;
$TO = new ThemeOptions();
$TO->add_option_group('Homepage Top Block', 'hptop');
$TO->add_option('Title');
$TO->add_option('Subtitle');
$TO->add_option('Link');
$TO->add_option_group('Homepage Block 1', 'hblock1');
$TO->add_option('Image', 'type=image');
$TO->add_option('Title');
$TO->add_option('Text', 'height=5&type=text');
$TO->add_option('Link', 'slug=rm_link');
$TO->add_option_group('Homepage Block 2', 'hblock2');
$TO->add_option('Image', 'type=image');
$TO->add_option('Title');
$TO->add_option('Text', 'height=5&type=text');
$TO->add_option('Link', 'slug=rm_link');
$TO->add_option_group('Homepage Block 3', 'hblock3');
        <footer class="footer">
            <div class="copyright">
                © 2014-2015 <a href="<? bloginfo("url");?>"><? bloginfo("name");?></a>
            </div>
            <div class="lastmodified">
                <?_e('last Update:', 'tcc');?>
                <script>
                    //取得最近更新日期
                    update = new Date(document.lastModified);
                    theYear = update.getFullYear();
                    theMonth = update.getMonth() + 1;
                    theDate = update.getDate();
                    document.write(theYear + "/" + theMonth + "/" + theDate);
                </script>
            </div>
            <?//自訂頁尾資訊
            $options = ThemeOptions::getOptions();
            foreach ($options[get_locale()]['footer']['info'] as $key => $value) {
                echo '<div>'.$value.'</div>';
            }
            ?>
        </footer>
    </div>
    <div id="gotop"><i class="fa fa-chevron-up"></i><div></div></div>
    <div class="loading hide"><div><?_e('Loading...', 'tcc');?><br><img src="<?bloginfo('template_directory')?>/images/ajax-loader.gif"></div></div>
</body>
</html>
					<br />
					<?php 
                    echo gettext('Hint text') . ' ';
                    print_language_string_list(getThemeOption($album, 'user_registration_tip'), 'user_registration_tip');
                    ?>
				</td>
				<td><?php 
                    echo gettext("If this option is not empty, the visitor login form will include a link to this page. The link text will be labeled with the text provided.");
                    ?>
</td>
			</tr>
			<?php 
                }
                if (!(false === ($requirePath = getPlugin('themeoptions.php', $themename)))) {
                    require_once $requirePath;
                    $optionHandler = new ThemeOptions();
                    $supportedOptions = $optionHandler->getOptionsSupported();
                    if (count($supportedOptions) > 0) {
                        ?>
			<tr class="alt1" >
				<td colspan="2" align="left">
					<?php 
                        echo gettext('<strong>Custom theme options</strong>');
                        ?>
				</td>
				<td><em><?php 
                        echo gettext('The following are options specifically implemented by the theme.');
                        ?>
</em></td>
			</tr>
				<?php 
 /**
  *  跑馬燈選項
  *        呼叫顯示跑馬燈設定頁。
  *
  *   @access Public
  *   @author TCC
  *   @version v1.000
  */
 static public function  marquee_options() {
      ThemeOptions::show_page('marquee_options');
 }
<?get_header();?>
<div id="content" class="content">
    <!-- 跑馬燈 -->
    <section>
        <h2 class='hide'><?_e('Marquee', 'tcc');?></h2>
        <ul id="marquee" class="marquee">
            <?$options = ThemeOptions::getOptions(); //載入主題設定值
            foreach ($options[get_locale()]['marquee']['message'] as $key => $value) {
                echo '<li><h3>'.$value.'</h3></li>';// class="setofont" 引用字型
            }?>
        </ul>
    </section>
    <!-- 跑馬燈 -->
    <div class="article">
        <?tcc_flexslider();?>
        <?tcc_message_table();?>
    </div>
</div>
<?get_footer();?>
    public static function theme_options_do_page()
    {
        if ($_POST['update_themeoptions'] == 'true') {
            ThemeOptions::themeoptions_update();
        }
        ?>
	
						<div class="wrap">
						<div id="social_options">
							<h2>Social Icon Links</h2>
							<form method="post" action="" name="social_form" id="social_form" >
								<input type="hidden" name="update_themeoptions" value="true" />
								<label>Facebook URL</label><br />
								<input type="text" name="facebook_url" size="40" id="fb" value="<?php 
        echo get_option('facebook_url');
        ?>
"/><br />
								<label>Twitter URL</label><br />
								<input type="text" name="twitter_url" size="40" id="tw"  value="<?php 
        echo get_option('twitter_url');
        ?>
"/><br />
								<label>Google Plus URL</label><br />
								<input type="text" name="google_url" size="40" id="in"  value="<?php 
        echo get_option('google_url');
        ?>
"/><br />
								<label>Youtube URL</label><br />
								<input type="text" name="youtube_url" size="40" id="pl"  value="<?php 
        echo get_option('youtube_url');
        ?>
"/><br />
								<input id="btn" type="submit" value="Save" name="req_submit" />	
					
							</form>
						</div>
					</div>
						<style>
						#social_options{
							width: 50%;
							}
						#social_options label {
						font-size: 15px;
						font-weight: bold;
						padding: 0 0 12px;
						}
						#social_options input {
						margin: 0 0 25px;
						}
						#social_options form {
						margin-left: 25px;
						margin-top:35px;
						}	
						#social_options #btn {
						cursor: pointer;
						width: 100px;
						}
						</style>	
					<?php 
    }