質問編集履歴

1

コードを乗っけました。

2018/09/24 08:59

投稿

closed_named
closed_named

スコア42

test CHANGED
File without changes
test CHANGED
@@ -23,3 +23,83 @@
23
23
  すみません、自分でもどのように説明すればよいのかわからないのですが、至らないところあれば追記していきます。
24
24
 
25
25
  よろしくお願いいたします。
26
+
27
+
28
+
29
+
30
+
31
+ function.php
32
+
33
+ ```php
34
+
35
+ <?php
36
+
37
+ add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
38
+
39
+ function theme_enqueue_styles()
40
+
41
+ { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
42
+
43
+ }
44
+
45
+ /**************外部ファイルを読み込み***********/
46
+
47
+ require_once locate_template("exam-functions/exam-functions.php");
48
+
49
+ /************************************************/
50
+
51
+ ```
52
+
53
+
54
+
55
+ exam-function.php
56
+
57
+ ```php
58
+
59
+
60
+
61
+ function answers(){
62
+
63
+ if(isset($_GET["mode"]) && $_GET["mode"] =="answer"){
64
+
65
+ print "<BR>";
66
+
67
+ $linkerd=get_stylesheet_directory_uri()."/data/db_info.php";
68
+
69
+ $linkered=explode("example.com/",$linkerd);
70
+
71
+ require_once($linkered[1]);
72
+
73
+ $s = mysqli_connect($SERV,$TextUSER,$TextPASS) or die("error:203");
74
+
75
+ mysqli_select_db($s,$TTalkDBNM);
76
+
77
+ $kekka=mysqli_query($s,"SELECT * from talklist");
78
+
79
+ while($dbarray=mysqli_fetch_array($kekka,MYSQLI_NUM)){
80
+
81
+ print "<BR>"."タイトル";
82
+
83
+ print "<a href='http://textacs.com/tom/?page_id=568&id=".$dbarray[7]."'>".$dbarray[0]."</a>";
84
+
85
+ print "<BR>"."投降者:".$dbarray[1];
86
+
87
+ print "<BR>"."投降日:".date("Y/m/d",$dbarray[6]);
88
+
89
+ print "<BR>"."更新日:".date("Y/m/d",$dbarray[2]);
90
+
91
+ print "<BR>"."返信数".$dbarray[3];
92
+
93
+ print "<BR>"."閲覧者数".$dbarray[4];
94
+
95
+ }
96
+
97
+ mysqli_close($s);
98
+
99
+ }
100
+
101
+ }
102
+
103
+ add_shortcode('answers_code','answers');
104
+
105
+ ```