-
Notifications
You must be signed in to change notification settings - Fork 0
/
newblog.php
208 lines (188 loc) · 8.44 KB
/
newblog.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
<!DOCTYPE html>
<?php
ob_start();
require_once("includes/UserClass.php");
require_once("includes/BlogClass.php");
$auth = new Auth();
$blog = new Blog();
$check=$auth->checkSession();
if($check == 0) {
header("Location: index.php");
exit;
}
ob_end_clean();
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BlogIn : Create new Blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="/assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="/assets/ico/favicon.png">
</head>
<body>
<!-- DO NOT EDIT THIS DIV -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">BlogIn</a>
<div class="nav-collapse collapse">
<p class="navbar-text pull-right">
<img src="<?php $grav_url = "http://www.gravatar.com/avatar/".md5(strtolower(trim($auth->getEmail())))."?s=30"; echo $grav_url; ?>" height="30" width="30"></img>
Logged in as <a href="#" class="navbar-link"><?php echo $auth->getUser(); ?></a>
</p>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about" role="button" data-toggle="modal">About</a></li>
<li><a href="#contact" role="button" data-toggle="modal">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<!-- Do not edit this div except marking any list item as active -->
<div class="span3 affix">
<div class="well sidebar-nav">
<ul class="nav nav-list bs-docs-sidenav">
<li><a href="dashboard.php">Overview</a></li>
<li class="nav-header">Settings</li>
<li><a href="profile.php">Profile</a></li>
<li><a href="readlist.php">Reading list</a></li>
<li class="nav-header">Your blogs</li>
<li class="active"><a href="#">Create new blog</a></li>
<?php
$result=$blog->getallblogs();
while($row = mysqli_fetch_array($result))
{
echo '<li><a href="/'.$row['b_name'].'">'.$row['b_name']."</a></li>";
}
?>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span9 well pull-right">
<h2>Create new blog</h2>
</div><!--/span-->
<div class="span9 well pull-right">
<form class="form-horizontal well" action="blognew.php" method="POST">
<fieldset>
<legend>Details for new blog</legend>
<div class="control-group <?php if(isset($_GET['error'])) echo 'error'; ?>">
<label class="control-label" for="input01">Blog name</label>
<div class="controls">
<input type="text" class="input span5" id="input01" name="blogname"/>
<?php if(isset($_GET['error'])) echo '<span class="help-inline">Seems like blog name is not available.</span>'; ?>
</div>
</div>
<div class="control-group">
<label class="control-label" for="select01">Choose layout</label>
<div class="controls">
<select id="select01" class="span5" name="layout">
<option value="2">Widgets at right</option>
<option value="1">Widgets at left</option>
<option value="3">Widgets at bothsides</option>
<option value="0">No widgets</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="textarea">Blog description</label>
<div class="controls">
<textarea class="input-xlarge span9" id="textarea" rows="5" name="blog_desc"></textarea>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Create »</button>
<button type="reset" class="btn">Cancel</button>
</div>
</fieldset>
</form>
</div>
</div><!--/row-->
<hr>
<!-- DO NOT EDIT BELOW -->
<footer>
<p>© MSU IT students 2013</p>
</footer>
</div><!--/.fluid-container-->
<!-------------------------------------------------------------------------------->
<!-- About dialog box design. -->
<!-------------------------------------------------------------------------------->
<div id="about" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="aboutLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="aboutLabel">About</h3>
</div>
<div class="modal-body well">
<blockquote>
<p>A blog (a portmanteau of the term web log) is a discussion or informational site published on the World Wide Web and consisting of discrete entries typically displayed in reverse chronological order.</p>
<small>Wikipedia</small>
</blockquote>
<p>Here we introduce easier blogging site! As described in just 3 simple steps you can easily create your own blog with us</p>
<p>Our reference for this blogging site was Blogger, Wordpress and Tumblr.</p>
<p>Thanks to Twitter for bootstrap library, our project guide : Mr. Parth Gandhi, and Others..</p>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close this dialog</button>
</div>
</div>
<!-------------------------------------------------------------------------------->
<!-- Contact dialog box design. -->
<!-------------------------------------------------------------------------------->
<div id="contact" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="contactLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="contactLabel">Contact us</h3>
</div>
<div class="modal-body well">
<p>Bhushan Shah : <a href="mailto:[email protected]">[email protected]</a>
<p>Aazam Khatri : <a href="mailto:[email protected]">[email protected]</a>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Okay</button>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/assets/js/jquery.js"></script>
<script src="/assets/js/bootstrap-transition.js"></script>
<script src="/assets/js/bootstrap-alert.js"></script>
<script src="/assets/js/bootstrap-modal.js"></script>
<script src="/assets/js/bootstrap-dropdown.js"></script>
<script src="/assets/js/bootstrap-scrollspy.js"></script>
<script src="/assets/js/bootstrap-tab.js"></script>
<script src="/assets/js/bootstrap-tooltip.js"></script>
<script src="/assets/js/bootstrap-popover.js"></script>
<script src="/assets/js/bootstrap-button.js"></script>
<script src="/assets/js/bootstrap-collapse.js"></script>
<script src="/assets/js/bootstrap-carousel.js"></script>
<script src="/assets/js/bootstrap-typeahead.js"></script>
</body>
</html>