-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.html
408 lines (338 loc) · 10.7 KB
/
blog.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!--
<link rel='stylesheet' href="../styles/nav.css">
<link rel="stylesheet" media="all" href="../styles/styles.css" type="text/css" />
page is also using ajax_add_email.php and add_email_form.inc.html
checking git
-->
<style>
*{
box-sizing: border-box;
}
/*****clear padding and margins from external stlye sheet**/
article,header,section,aside,.menu,.content,article,.content aside, h1,h2,h3,p{
padding:0px;
margin: 0px;
}
.menu ul, .menu li{
padding:0px;
margin: 0px;
}
h1,h2,h3{
text-align: center;
}
.header_blog h1{
font-size: 2.25em;
}
h2{
font-size: 2em;
}
h3{
font-size: 1.5em;
}
.menu h3{
margin:15px 0px;
}
p{
font-size: 1em;
}
.menu ul{
width:90%;
margin-left: 10%;
}
.menu li{
list-style: none;
margin-bottom:15px;
font-size: 1.25em;
border: 2px dashed;
border-color: rgba( 20, 8, 8, .1);
width:100%;
padding:5px;
text-align: center;
margin-left:-20px;
}
.post{
border: 1px solid gray;
background-color:rgba( 20, 8, 8, .1);
margin:10% 5%;
}
.post h3, .post p{
margin: 0px;
padding: 2px;
background-color:#ffffff;
}
.align_center{
text-align: center;
background-color:rgba(139,128,128,.1);
}
.tags, .say{
font-size: .80em;
/*color: #140808;
background-color:rgba(139,128,128,.1);*/
font-style:italic;
padding: 1px;
text-align: left;
width:100%;
margin:10px 0px;
text-indent: 25px;
}
.say {
width:90%;
font-size: 1em;
}
header h3{
color:rgba( 20, 8, 8,.7);
}
.header_blog h1{
margin-top:-38px;
margin-left:-600px;
padding:0px;
}
.menu{
background-color:#ffffff;
width:100%;
height:100%;
}
.content{
background-color:#ffffff;;
width:100%;
height:100%;
}
.content header h2{
background-color:#ffffff;
padding: 1px;
font-size: 2em;
margin-left:0px;
}
.content aside{
background-color:gray;
width:100%;
}
.lower_strip{
background-color:rgba( 20, 8, 8,.1);
color:#fffff;
width:100%;
padding:3%;
margin-top:5%;
}
.lower_strip_right{
background-color:rgba( 20, 8, 8,.1);
width:100%;
padding:5%;
margin-top:5%;
}
.post img, .desc{
border: 5px outset black;
margin-bottom:2px;
line-height: 1.5em;
}
.desc{
padding:15px;
}
.error{
font-style: bold;
color:#483D8B;
font-size: 1.25em;
text-align: center;
}
@media screen and (min-width:480px)
{
.menu li{
padding:3px;
}
.menu{
float: left;
width:20%;
/*
position: relative;
margin-right:-20%;
margin-bottom: -2000px;
padding-bottom: 2000px;*/
}
.content{
float:left;
width:80%;
border-right:2px dashed;
border-color: rgba( 20, 8, 8, .1);
}
.content aside{
float:right;
padding:3px;
width:30%;
}
.lower_strip{
float:left;
position: relative;
width:60%;
border-right:2px dashed;
border-color: rgba( 20, 8, 8, .1);
margin-bottom: -500px;
padding-bottom: 500px;
z-index: -99999;
/*
position:relative;
float:left;
background-color:#ffffff;
width: 100%;
margin-bottom:-2000px;
padding-bottom:2000px;*/
}
.lower_strip_right{
postion:relative;
float:left;
width:40%;
/*margin-bottom: -500px;
padding-bottom: 500px;
z-index: -99999;
/*position: relative;
float: left;
width: 125px;
background-color: #f452d5;
margin-right: -125px;
margin-bottom: -2000px;
padding-bottom: 2000px;*/
}
}
</style>
<article>
<header class="header_blog">
<h1>Duke's Blog</h1>
</header>
<section class="content">
<h3 style="margin-top: 50px; margin-left: 15%">Visit Duke's new and improved <a href="https://david.dukesnuz.com/blog/home">Blog.</a></h3>
<?php
/////////////////////////////////////////
//echo '<header><h2>'.$catagory.'</h2></header>';
//grab catagory for header
if(!empty($catagory))
{
$rowc=mysqli_fetch_array($c, MYSQLI_ASSOC);
echo '<header><h2>'.$rowc['catagory'].'</h2></header>';
}else{
echo '<header><h2>All</h2></header>';
}
if(mysqli_num_rows($r) >0)
{
while($row=mysqli_fetch_array($r, MYSQLI_ASSOC))
{
//types Plain_text | HTML_code | URL_link | IMG_link |
if($row['html_type'] ==="Plain_text")
{
echo '<section class="post">';
echo '<header><h3>'.$row['title'].'</h3></header>';
echo '<div class="say">'.$row['teaser'].'</div>';
echo '<div class="align_center">'.$row['html'].'</div>';
echo '<div class="say">'.$row['say'].'</div>';
echo '<div class="tags">catagory: '.$row['catagory'].'</div>';
echo '<div class="tags">tags: '.$row['tags'].'</div>';
echo '<div class="tags">long url: <a href="'.URL.'/blog/blog_long_url.php?post='.$row['url_file'].'">'.$row['url_file'].'</a></div>';
echo '</section>';
}elseif($row['html_type'] ==="HTML_code")
{
echo '<section class="post">';
echo '<header><h3>'.$row['title'].'</h3></header>';
echo '<div class="say">'.$row['teaser'].'</div>';
echo '<div class="align_center">'.$row['html'].'</div>';
echo '<div class="say">'.$row['say'].'</div>';
echo '<div class="tags">catagory: '.$row['catagory'].'</div>';
echo '<div class="tags">tags: '.$row['tags'].'</div>';
echo '<div class="tags">long url: <a href="'.URL.'/blog/blog_long_url.php?post='.$row['url_file'].'">'.$row['url_file'].'</a></div>';
echo '</section>';
}elseif($row['html_type'] === "URL_link")
{
echo '<section class="post">';
echo '<header><h3>'.$row['title'].'</h3></header>';
echo '<div class="say">'.$row['teaser'].'</div>';
echo '<div class="align_center"><a href="http://'.$row['html'].'" target="blank">Read More</a></div>';
echo '<div class="say">'.$row['say'].'</div>';
echo '<div class="tags">catagory: '.$row['catagory'].'</div>';
echo '<div class="tags"> tags: '.$row['tags'].'</div>';
echo '<div class="tags">long url: <a href="'.URL.'/blog/blog_long_url.php?post='.$row['url_file'].'">'.$row['url_file'].'</a></div>';
echo '</section>';
}elseif($row['html_type'] === "IMG_link")
{
echo '<section class="post">';
echo '<header><h3>'.$row['title'].'</h3></header>';
echo '<div class="say">'.$row['teaser'].'</div>';
if($row['gallery_select'] ==="GalleryTwo")
{
echo '<div class="align_center"><a href="http://'.$row['html'].'" target="blank">
<img src="'.$row['img_url'].'" alt="'.$row['alt'].'" style="width:228px;height:300px;">
</a></div>';
//echo '<p style="text-align:center"><img src="'.$row['img_url'].'" alt="'.$row['alt'].'" style="width:228px;height:300px;"></p>';
}else{
echo '<div class="align_center"><a href="http://'.$row['html'].'" target="blank">
<img src="'.$row['img_url'].'" alt="'.$row['alt'].'" style="width:300px;height:228px;">
</a></div>';
//echo '<p style="text-align:center"><img src="'.$row['img_url'].'" alt="'.$row['alt'].'" style="width:300px;height:228px;"></p>';
}
echo '<div class="say">'.$row['say'].'</div>';
echo '<div class="tags">catagory: '.$row['catagory'].'</div>';
echo '<div class="tags"> tags: '.$row['tags'].'</div>';
echo '<div class="tags">long url: <a href="'.URL.'/blog/blog_long_url.php?post='.$row['url_file'].'">'.$row['url_file'].'</a></div>';
echo '</section>';
}else{
}//END IF
}//END while
}else{
$blog = "<p class='error'>OOppss! We apologize. There are currently no blog posts. Please check back later.</p>";
echo $blog;
}
/////////////////////////////////
?>
</section>
<aside class="menu">
<?php
if(mysqli_num_rows($rm) > 0 )
{
echo '<ul>';
echo "<li><a href='/blog/'><h3>Catagories</h3></a></li>";
while($row=mysqli_fetch_array($rm, MYSQLI_ASSOC))
{
//echo "<li><a href='./blog.php?catagory=$row[catagory]'>$row[catagory]</a></li>";
$url_cat= strtolower($row['url_cat']);
//echo "<li><a href='/catagory/blog/$url_file/'>$row[catagory]</a></li>";
echo "<li><a href='/catagory/blog/$url_cat/'>$row[catagory]</a></li>";
}
echo '</ul>';
}
?>
</aside>
<!------bottom section-->
<section class="lower_strip">
<!----Start random picture--------->
<h3>My Pictures</h3>
<?php
if(mysqli_num_rows($rp) >0)
$row_pic = mysqli_fetch_array($rp, MYSQLI_ASSOC);
if($row_pic['gallery_select'] ==="GalleryTwo")
{
echo '<div style="text-align:center">
<a href="/coding/playground/storing-picture-data-php-mysqli-filemaker'.MODWRITE.'" title="'.$row_pic['picture_name'].' | View More Pictures"><img src="'.$row_pic['img_url'].'" alt="'.$row_pic['alt'].'" style=\"width:228px;height:300px;\""></a>
</div>';
}else{
echo '<div style="text-align:center">
<a href="/coding/playground/storing-picture-data-php-mysqli-filemaker'.MODWRITE.'" title="'.$row_pic['picture_name'].' | View More Pictures"><img src="'.$row_pic['img_url'].'" alt="'.$row_pic['alt'].'" style=\"width:300px;height:228px;\""></a>
</div>';
}
?>
<!-----------------END random picture------------------------>
</section>
<section class="lower_strip_right">
<div class="desc">
<p>
This blog will contain posts that seem relevent and interesting to me. I hope you also enjoy them and find this blog useful.
</p>
<br/>
<p>
I am using a model view controller
<a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">(MVC)</a>
pattern for this web page.
I using PHP for the controller, HTML for the view and for the modal mySQL. I also developed a Filemaker solution. The FM solution
stores the blog data. I use the execute SQL script to upload, edit and delete all blog post data. The code can be found on GitHub.
<a href="https://github.com/dukesnuz/Git-DukesNuz/tree/master/blog">PHP files on GitHub</a>.
<a href="https://github.com/dukesnuz/Git-DukesNuz/blob/master/views/blog.html">HTML file on GitHub</a><!--A screen shot of the FM solution
can be found here.-->
</p>
</div>
</section>
</article>