-
Notifications
You must be signed in to change notification settings - Fork 35
/
example.php
217 lines (176 loc) · 10.8 KB
/
example.php
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
<?php
require_once("cn_api.php");
$entry = cn_api_get_entry();
//$template = 'bootstrap'; // for test
// Play with settings --------------------------------------------------
$pw = REQ('pw');
$theme = 'cosmo'; // default theme
if (isset($pw['PHP_SELF']) && $pw['PHP_SELF']) $PHP_SELF = $pw['PHP_SELF'];
if (isset($pw['template']) && $pw['template']) $template = $pw['template'];
if (isset($pw['theme']) && $pw['theme']) $theme = $pw['theme'];
if (isset($pw['start_from']) && $pw['start_from']) $start_from = $pw['start_from'];
if (isset($pw['number']) && $pw['number']) $number = $pw['number'];
if (isset($pw['archive']) && $pw['archive']) $archive = $pw['archive'];
if (isset($pw['category']) && $pw['category']) $category = $pw['category'];
if (isset($pw['ucat']) && $pw['ucat']) $ucat = $pw['ucat'];
if (isset($pw['sortby']) && $pw['sortby']) $sortby = $pw['sortby'];
if (isset($pw['dir']) && $pw['dir']) $dir = $pw['dir'];
if (isset($pw['page_alias']) && $pw['page_alias']) $page_alias = $pw['page_alias'];
if (isset($pw['tag']) && $pw['tag']) $tag = $pw['tag'];
if (isset($pw['user_by']) && $pw['user_by']) $user_by = $pw['user_by'];
if (isset($pw['static']) && $pw['static']) $static = $pw['static'];
if (isset($pw['reverse']) && $pw['reverse']) $reverse = $pw['reverse'];
if (isset($pw['only_active']) && $pw['only_active']) $only_active = $pw['only_active'];
if (isset($pw['no_prev']) && $pw['no_prev']) $no_prev = $pw['no_prev'];
if (isset($pw['no_next']) && $pw['no_next']) $no_next = $pw['no_next'];
// ---------------------------------------------------------------------
if (isset($_GET['do'])&& $_GET['do'] == "rss") include("rss.php");
?>
<html>
<head>
<title><?php echo ($entry) ? $entry['t'] : 'Example page'; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php if ($entry) { echo '<meta name="description" content="'. $entry['tg']. '" />'; } ?>
<!-- **CSS - stylesheets** -->
<link href="libs/css/<?php echo $theme;?>.min.css" rel="stylesheet">
<link href="libs/css/font-awesome.min.css" rel="stylesheet">
<!-- **JS Javascripts** -->
<script src="libs/js/jquery.js"></script>
<script src="libs/js/bootstrap.min.js"></script>
<script>
window.onload = function() {
var edt_comm_mode = document.getElementById('edt_comm_mode');
if (edt_comm_mode != null) {
window.scrollTo(0,9999);
}
}
</script>
<style>
img { max-width: 100%; }
td, th { vertical-align: top; padding: 5px; }
</style>
</head>
<body>
<section>
<div class="container">
<div class="row">
<div class="col-sm-5">
<img src="<?php echo getoption('http_script_dir'); ?>/skins/images/cutenews-logo.png"/>
</div>
<div class="col-sm-7">
<h1>Put here your title</h1>
<div>and this is your description</div>
</div>
</div>
</div>
<div style="clear: both"></div>
</section>
<section id="blog">
<div class="container">
<div class="col-sm-8">
<div class="nav nav-tabs">
<?php
$_self_page = explode('/', PHP_SELF);
$_self_page = $_self_page[count($_self_page)-1];
if ($_self_page[0] === '/') { $_self_page = substr($_self_page, 1); }
$_self_page = getoption('http_script_dir') . '/' . $_self_page;
?>
<div style="float: right"><a href="<?php echo getoption('http_script_dir'); ?>/rss.php"><img src="<?php echo getoption('http_script_dir'); ?>/skins/images/rss_icon.gif" alt="RSS"></a></div>
<b>Navigation</b>:
<a href="<?php echo $_self_page; ?>">Main page</a> |
<a href="<?php echo $_self_page; ?>?do=archives">Archives</a> |
<a href="<?php echo $_self_page; ?>?do=rss">RSS</a> |
<a href="<?php echo $_self_page; ?>?do=stats">Stats</a> |
<a href="#">Link 1</a> |
<a href="#">Link 2</a> | ...
</div>
<!-- MAIN CONTENT, FIRST -->
<?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we decide what page to include
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if (isset($_GET['search']) && $_GET['search']) {
include ("search.php");
}
else if (isset($_GET['do']) && $_GET['do'] == 'archives') {
include ("show_archives.php");
}
else if (isset($_GET['do']) && $_GET['do'] == "stats") {
echo "You can download the stats addon and include it here to show how many news, comments ... you have"; // include("$path/stats.php");
} else {
include ("show_news.php");
}
?>
</div>
<div class="col-sm-4">
<!-- SECTION: WIDGETS -->
<h3>Widgets</h3>
<div>Plugin widgets there.</div>
<?php cn_widget('calendar'); ?>
<br/>
<!-- SECTION: SEARCH -->
<h3>Quick search</h3>
<form action="<?php echo PHP_SELF; ?>" method="GET">
<input type="hidden" name="dosearch" value="Y" />
<div>
<input style="width: 200px; padding: 4px;" class="text" type="text" name="search" value="<?php echo cn_htmlspecialchars(REQ('search')); ?>" />
<input style="width: 75px; padding: 4px;" class="submit" type="submit" value="search it!" />
</div>
</form>
<!-- SECTION: LIVE EXAMPLE -->
<h3>Play with parameters</h3>
<form action="<?php echo PHP_SELF; ?>" method="POST">
<table>
<tr><td>$PHP_SELF</td> <td><input type="text" name="pw[PHP_SELF]" value="<?php echo cn_htmlspecialchars($pw['PHP_SELF'] ? $pw['PHP_SELF'] : PHP_SELF); ?>" /></td></tr>
<tr><td>$template</td> <td><input type="text" name="pw[template]" value="<?php echo cn_htmlspecialchars($pw['template'] ? $pw['template'] : 'Default'); ?>" /></td></tr>
<tr><td>$start_from</td> <td><input type="text" name="pw[start_from]" value="<?php echo intval($pw['start_from']); ?>" /></td></tr>
<tr><td>$number</td> <td><input type="text" name="pw[number]" value="<?php echo intval($pw['number']); ?>" /></td></tr>
<tr><td>$archive</td> <td><input type="text" name="pw[archive]" value="<?php echo intval($pw['archive']); ?>" /></td></tr>
<tr><td>$user_by</td> <td><input type="text" name="pw[user_by]" value="<?php echo cn_htmlspecialchars($pw['user_by']); ?>" /></td></tr>
<tr><td>$category</td> <td><input type="text" name="pw[category]" value="<?php echo cn_htmlspecialchars($pw['category']); ?>" /></td></tr>
<tr><td>$ucat</td> <td><input type="text" name="pw[ucat]" value="<?php echo cn_htmlspecialchars($pw['ucat']); ?>" /></td></tr>
<tr>
<td>$sortby</td> <td><select name="pw[sortby]">
<option value="">latest</option>
<option <?php if ($pw['sortby'] == 'date') echo 'selected'; ?>>date</option>
<option <?php if ($pw['sortby'] == 'title') echo 'selected'; ?>>title</option>
<option <?php if ($pw['sortby'] == 'comments') echo 'selected'; ?>>comments</option>
<option <?php if ($pw['sortby'] == 'author') echo 'selected'; ?>>author</option>
</select>
</td>
</tr>
<tr>
<td>$dir</td> <td>
<select name="pw[dir]">
<option value="">as is</option>
<option <?php if ($pw['dir'] == 'D') echo 'selected'; ?> value="D">desc</option>
<option <?php if ($pw['dir'] == 'A') echo 'selected'; ?> value="A">asc</option>
</select>
</td>
</tr>
<tr><td>$page_alias</td> <td><input type="text" name="pw[page_alias]" value="<?php echo (isset($pw['page_alias'])?cn_htmlspecialchars($pw['page_alias']):''); ?>"></td></tr>
<tr><td>$tag</td> <td><input type="text" name="pw[tag]" value="<?php echo (isset($pw['tag'])?cn_htmlspecialchars($pw['tag']):''); ?>"></td></tr>
<tr><td>$static</td> <td><input type="checkbox" name="pw[static]" value="Y" <?php if (isset($pw['static'])&&$pw['static']) echo ' checked="checked" '; ?> /></td></tr>
<tr><td>$reverse</td> <td><input type="checkbox" name="pw[reverse]" value="Y" <?php if (isset($pw['reverse'])&&$pw['reverse']) echo ' checked="checked" '; ?> /></td></tr>
<tr><td>$only_active</td> <td><input type="checkbox" name="pw[only_active]" value="Y" <?php if (isset($pw['only_active'])&&$pw['only_active']) echo ' checked="checked" '; ?> /></td></tr>
<tr><td>$no_prev</td> <td><input type="checkbox" name="pw[no_prev]" value="Y" <?php if (isset($pw['no_prev'])&&$pw['no_prev']) echo ' checked="checked" '; ?> /></td></tr>
<tr><td>$no_next</td> <td><input type="checkbox" name="pw[no_next]" value="Y" <?php if (isset($pw['no_next'])&&$pw['no_next']) echo ' checked="checked" '; ?> /></td></tr>
<tr><td> </td><td><input type="submit" value="Check result" /><td></tr>
</table>
</form>
<br/>
<!-- SECTION: BANNER -->
<h3>Banners / Sponsors</h3>
<div>put some banners here and another banners here</div>
<br/>
<!-- SECTION: FRIENDS -->
<h3>Friends</h3>
<div><a target="_blank" href="http://cutephp.com">CutePHP Scripts</a></div>
<div><a target="_blank" href="http://news.google.com">Google News</a></div>
<div><a target="_blank" href="http://mozilla.org">Mozilla.org</a></div>
</div>
</div>
</section>
<div id="footer"> © your site, put your footer and copyright here </div>
</body>
</html>