Exemplo n.º 1
0
    update_option("DMSGuestbook_options", mysql_real_escape_string($save_to_db));
    message("<b>" . __("saved", "dmsguestbook") . "...</b>", 300, 800);
    /* save to dmsguestbook.css if is writable */
    $abspath = str_replace("\\", "/", ABSPATH);
    if (is_writable($abspath . "wp-content/plugins/dmsguestbook/dmsguestbook.css")) {
        $notice = "/*\n" . __("Use the DMSGuestbook admin interface for change these css settings.\nDon't edit this file direct, your change could be overwrite by the DMSGuestbook admin.\nIf dmsguestbook.css is exist and writable, all CSS settings will be read from it.\nOtherwise these settings will be load from the database.", "dmsguestbook") . "\n*/\n\n";
        $csscode = make_css();
        $handle = fopen($abspath . "wp-content/plugins/dmsguestbook/dmsguestbook.css", "w");
        fwrite($handle, $notice . $csscode);
        fclose($handle);
    }
}
/* end of write DMSGuestbook option in wordpress options database */
/* reset DMSGuestbook */
if ($POSTVARIABLE['action'] == 'default_settings') {
    default_option();
}
/* save advanced */
if ($POSTVARIABLE['action'] == 'save_advanced_data') {
    $abspath = str_replace("\\", "/", ABSPATH);
    /* check the folder variable */
    if ($POSTVARIABLE['folder'] == "language/") {
        $folder = "language/";
    } else {
        $folder = "";
    }
    /* check the file variable xxxx.txt */
    if (preg_match('/^[a-z0-9]+\\.+(txt)/i', $POSTVARIABLE['file']) == 1) {
        $file = $POSTVARIABLE['file'];
    } else {
        $file = "";
Exemplo n.º 2
0
function telop_plugin_options() {/*{{{*/

?>
<div class="wrap">
 <h2>Options for "Telop"</h2>
  <p>テロップに表示したいニュースとリンクを入れてください。長すぎると表示されないよ。</p>
  <p>テロップを表示するには、以下のテンプレートタグをテンプレートに記述してください</p>
  <pre>
   &lt;?php telop(); ?&gt;
  </pre>
  <br />
  <form action="options.php" method="post" >
  <h3>Telop title</h3>
    <ul>
      <li><label>タイトル<label> : <input type="text" name="telop_title" value="<?php echo (get_option('telop_title')) ? get_option('telop_title') : default_option('telop_title') ; ?>"/></li>
    </ul>
  <h3>Telop duration setting</h3>
    <ul>
      <li><label>ながれる速度<label> : <input type="text" name="telop_duration" value="<?php echo (get_option('telop_duration')) ? get_option('telop_duration') : default_option('telop_duration') ; ?>"/></li>
    </ul>
  <h3>Telop contents setting</h3>
    <?php wp_nonce_field('update-options');?>
<p><input type="radio" name="gettelop_setting" value="selfinput" <?php echo (get_option('gettelop_setting') === 'selfinput') ? "checked" : ""; ?> />  <label><b>自分で入力する</b></label></p>
  <p style="font-size: 0.5em">* 現状設定できるニュースの数を増やす方法は用意しておりません。なぜなら、めんどくさいから。欲しい方は言ってください。</p>

    <table width="700" style="border: 1px solid #ccc;">
      <tr>
        <th scope='col' width="10%" class="manage-column column-title">No</th>
        <th scope='col' width="60%" class="manage-column column-title">表示するニュース記事</th>
        <th scope='col' width="30%" class="manage-column column-title">ニュースへのリンク</th>
      <tr>
      <tr>
        <td width="10%">1</td>
        <td width="60%"><input type="text" name="news_body1" style="width:100%;" value="<?php echo get_option('news_body1'); ?>" /> </td>
        <td width="30%"><input type="text" name="news_link1" style="width:100%;" value="<?php echo get_option('news_link1'); ?>" /></td>
      </tr>
      <tr>
        <td width="10%">2</td>
        <td width="60%"><input type="text" name="news_body2" style="width:100%;" value="<?php echo get_option('news_body2'); ?>" /></td>
        <td width="30%"><input type="text" name="news_link2" style="width:100%;" value="<?php echo get_option('news_link2'); ?>" /></td>
      </tr>
      <tr>
        <td width="10%">3</td>
        <td width="60%"><input type="text" name="news_body3" style="width:100%;" value="<?php echo get_option('news_body3'); ?>" /></td>
        <td width="30%"><input type="text" name="news_link3" style="width:100%;" value="<?php echo get_option('news_link3'); ?>" /></td>
      </tr>
      <tr>
        <td width="10%">4</td>
        <td width="60%"><input type="text" name="news_body4" style="width:100%;" value="<?php echo get_option('news_body4'); ?>" /></td>
        <td width="30%"><input type="text" name="news_link4" style="width:100%;" value="<?php echo get_option('news_body4'); ?>" /></td>
      </tr>
      <tr>
        <td width="10%">5</td>
        <td width="60%"><input type="text" name="news_body5" style="width:100%;" value="<?php echo get_option('news_body5'); ?>" /></td>
        <td width="30%"><input type="text" name="news_link5" style="width:100%;" value="<?php echo get_option('news_body5'); ?>" /></td>
      </tr>
    </table>
    <p><input type="radio" name="gettelop_setting" value="rssinput" <?php echo (get_option('gettelop_setting') === 'rssinput') ? "checked" : ""; ?> /> <label><b>RSSを流す</b></label></p>
    <p>記事を取得するRSSのURLを入力してください。</p>
    <ul>
      <li><label>取得元URL</label> : <input type="text" name="news_rss_url" value="<?php echo get_option('news_rss_url'); ?>" /></li>
    </ul>
    <p><input type="radio" name="gettelop_setting" value="twitterinput" <?php echo (get_option('gettelop_setting') === 'twitterinput') ? "checked" : ""; ?> /> <label><b>Twitterを流す</b></label></p>
    <p>Twitterのアカウントとパスワードを入れてください。(未実装につき注意)</p>
    <ul>
      <li><label>username</label> : <input type="text" name="news_twitter_user" value="<?php echo get_option('news_twitter_user'); ?>" /></li>
      <li><label>password</label> : <input type="password" name="news_twitter_pass" value="<?php echo get_option('news_twitter_pass'); ?>" /></li>
      <li><label>記事数</label> : <input type="text" name="news_twitter_numtwit" value="<?php echo ( get_option('news_twitter_numtwit') ) ? get_option('news_twitter_numtwit') : default_option('news_twitter_numtwit'); ?>" /></li>
    </ul>

    <input type="hidden" name="action" value="update" />
    <input type="hidden" name="page_options" value="telop_title,telop_duration,gettelop_setting,news_body1,news_link1,news_body2,news_link2,news_body3,news_link3,news_body4,news_link4,news_body5,news_link5" />
    <?php settings_fields( 'telop-option-group' );?>
    <p class="submit"><input class="button-primary" type="submit" value="Submit" name="submit" /></p>
  </form>
</div>
<?

}/*}}}*/