teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

誤字修正

2016/05/04 04:08

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -93,7 +93,7 @@
93
93
  PHP 7 wordpress最新
94
94
 
95
95
  ###追記
96
- は解決したのですが今度は
96
+ は解決したのですが今度は
97
97
 
98
98
  コード
99
99
  ```php

1

追記

2016/05/04 04:08

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -90,4 +90,96 @@
90
90
  ```
91
91
 
92
92
  ###補足情報(言語/FW/ツール等のバージョンなど)
93
- PHP 7 wordpress最新
93
+ PHP 7 wordpress最新
94
+
95
+ ###追記
96
+ 上野は解決したのですが今度は
97
+
98
+ コード
99
+ ```php
100
+ <?php
101
+ /*
102
+ Plugin Name: KeywordsChenge
103
+ Plugin URI:
104
+ Description: Change the search keyword in the web page.
105
+ Version: 1.0
106
+ Author: mk
107
+ Author URI:
108
+ License: GPL2
109
+ */
110
+ /* Copyright 2016 mk (email : yamk4054@gmail.com)
111
+
112
+ This program is free software; you can redistribute it and/or modify
113
+ it under the terms of the GNU General Public License, version 2, as
114
+ published by the Free Software Foundation.
115
+
116
+ This program is distributed in the hope that it will be useful,
117
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
118
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
119
+ GNU General Public License for more details.
120
+
121
+ You should have received a copy of the GNU General Public License
122
+ along with this program; if not, write to the Free Software
123
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
124
+ */
125
+ //lang
126
+ $mk_kc_lang_title = "キーワード管理";
127
+ $mk_kc_lang_screen_title = "キーワード管理画面";
128
+ $mk_kc_lang_keyword = "キーワード";
129
+ $mk_kc_lang_save_messege = "変更を保存しました";
130
+ $mk_kc_lang_save_button = "変更を保存";
131
+ //settings
132
+ $mk_kc_settings_maxkyes = 5; //Google of the recommended number of keywords,5 keywords.
133
+
134
+ add_action( 'admin_menu', 'mk_kc_add_plugin_admin_menu' );
135
+ function mk_kc_add_plugin_admin_menu() {add_options_page($mk_kc_lang_title,$mk_kc_lang_screen_title,'administrator', 'keywords','mk_kc_display_plugin_admin_page');}
136
+ function mk_kc_display_plugin_admin_page() {
137
+ if ( isset($_POST['mk_kc_options'])) {check_admin_referer('kcoptions');$opt = $_POST['mk_kc_options'];update_option('mk_kc_options', $opt);
138
+ ?>
139
+ <div class="updated fade"><p><strong><?php _e($mk_kc_lang_save_messege); ?></strong></p></div>
140
+ <?php
141
+ }
142
+ ?>
143
+ <div class="wrap">
144
+ <div id="icon-options-general" class="icon32"><br /></div><h2><?php echo $mk_kc_lang_screen_title ?></h2>
145
+ <form action="" method="post">
146
+ <?php
147
+ wp_nonce_field('kcoptions');
148
+ $opt = get_option('mk_kc_options');
149
+ for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){
150
+ $show_text[$mk_kc_system_i] = isset($opt['key'[$mk_kc_system_i]]) ? $opt['key'[$mk_kc_system_i]]: null;
151
+ }
152
+ ?>
153
+ <table class="form-table">
154
+ <?php
155
+ for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){
156
+ echo "\t<tr valign=\"top\"><th scope=\"row\"><label for=\"inputtext\">" & $mk_kc_lang_keyword & "</label></th><td><input name=\"mk_kc_options[key["$mk_kc_system_i"]]\" type=\"key\" id=\"inputtext\" value=" & $show_text[$mk_kc_system_i] & " class=\"regular-text\" /></td></tr>\n\t\t\t";
157
+ }
158
+ ?>
159
+ </table>
160
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php echo $mk_kc_lang_save_button ?>" /></p>
161
+ </form>
162
+ <!-- /.wrap --></div>
163
+ <?php}
164
+ //main
165
+ function mk_kc_get_key($num) {
166
+ $opt = get_option('mk_kc_options');
167
+ $array = $opt['text'];
168
+ $array[0] = "";
169
+ if ($num == "List"){
170
+ return implode(",",$array);
171
+ }elseif (is_int($num)){
172
+ if{
173
+ $array[$num]
174
+ }else{
175
+ return "";
176
+ }
177
+ }else{return "";}
178
+
179
+ }
180
+ ?>
181
+ ```
182
+ ```
183
+ Parse error: syntax error, unexpected ';', expecting ')' in xxx/wp-content/plugins/KeywordsChenge/Plugin.php on line 56
184
+ ```
185
+ 上のエラーが出てしまいました