/
admin.php
646 lines (605 loc) · 30 KB
/
admin.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
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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<?php //@skip-indexing ?>
<?php
$paths = array(realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR));
set_include_path(implode(PATH_SEPARATOR, $paths));
include_once (dirname(__FILE__) . '/settings.php');
include_once (dirname(__FILE__) . '/admin/util.php');
include_once (dirname(__FILE__) . '/admin/db.php');
require_once 'Zend/Search/Lucene.php';
global $my_email;
global $private_key;
global $server_path;
$all_settings = get_all_settings();
$status = 'forbidden';
$success_msg = '';
$error_msg = '';
$warning_msg = '';
$http_method = strtolower($_SERVER['REQUEST_METHOD']);
$action = array_key_exists('action', $_REQUEST)? $_REQUEST['action'] : '';
if ((strlen(trim($server_path)) == 0)) {
$settings_file_name = dirname(__FILE__) . DIRECTORY_SEPARATOR . "settings.php";
$file = fopen($settings_file_name, 'a');
if ($file) {
fwrite($file, "\n\$server_path='" . $settings_file_name . "';");
fclose($file);
}
}
if ((strlen(trim($private_key)) == 0)) {
if ($http_method == 'get') {
$status = 'private_key_must_be_generated';
} elseif ($http_method == 'post') {
generate_private_key();
$status = 'private_key_generated';
}
} elseif ($_REQUEST['pk'] == $private_key) {
$status = 'display_settings';
if ($http_method == 'get') {
if ($action == 'rsi') {
rebuild_search_indexes();
}
} elseif ($http_method == 'post') {
if ($_POST['submit'] == 'restore') {
$all_settings = restore_settings();
$success_msg = 'The settings were successfully restored.';
} else {
try{
$all_settings = save_custom_settings();
$success_msg = 'The settings were successfully saved.';
}catch (Exception $e) {
$error_msg = $e->getMessage();
}
}
}
}
function generate_private_key()
{
global $my_email;
$private_key = uniqid();
$subject = 'Your Admin Page Private Link';
$headers = "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: $my_email\r\n";
$admin_page_url = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
if (strpos($admin_page_url, '?')) {
$admin_page_url = substr($admin_page_url, 0, strpos($admin_page_url, '?'));
}
$admin_page_url .= '?pk=' . $private_key;
$message = '<html><body>Your admin page private link is <a href="' . $admin_page_url . '">' . $admin_page_url . '</a>.</body></html>';
$file_name = dirname(__FILE__) . DIRECTORY_SEPARATOR . "settings.php";
$file = fopen($file_name, 'a');
if ($file) {
fwrite($file, "\n\$private_key='" . $private_key . "';");
fclose($file);
}
mail($my_email, $subject, $message, $headers);
}
function save_custom_settings()
{
global $all_settings;
$new_settings = array();
$search_result_items = max(1, intval($_POST['search-result-items']));
$public_html_dir = $_POST['public-html-dir'];
$search_indexes_folder = $_POST['search-indexes-folder'];
$search_description_length = $_POST['search-description-length'];
$search_dynamic_pages = encode_dynamic_urls($_POST['search-dynamic-pages']);
$search_exclude_from_indexing = encode_dynamic_urls($_POST['search-exclude-from-indexing']);
check_public_html_existence($public_html_dir);
if (get_setting('public_html_dir', $all_settings) != $public_html_dir) {
$new_settings['public_html_dir'] = $public_html_dir;
}
if (get_setting('search_result_items', $all_settings) != $search_result_items) {
$new_settings['search_result_items'] = $search_result_items;
}
if (get_setting('search_indexes_folder', $all_settings) != $search_indexes_folder) {
$new_settings['search_indexes_folder'] = $search_indexes_folder;
}
if (get_setting('search_description_length', $all_settings) != $search_description_length) {
$new_settings['search_description_length'] = $search_description_length;
}
if (get_setting('search_dynamic_pages', $all_settings) != $search_dynamic_pages) {
$new_settings['search_dynamic_pages'] = $search_dynamic_pages;
}
if (get_setting('search_exclude_from_indexing', $all_settings) != $search_exclude_from_indexing) {
$new_settings['search_exclude_from_indexing'] = $search_exclude_from_indexing;
}
save_settings($new_settings);
$return_array = array();
foreach ($all_settings as $key => $value) {
$return_array[$key] = $value;
}
foreach ($new_settings as $key => $value) {
$return_array[$key]['custom_value'] = $value;
}
return $return_array;
}
function rebuild_search_indexes()
{
global $success_msg;
global $error_msg;
global $warning_msg;
global $all_settings;
global $indexable_folders;
$index_folder = get_setting('search_indexes_folder', $all_settings);
try {
setlocale(LC_CTYPE, LOCALE);
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());
$index = new Zend_Search_Lucene($index_folder, true);
$files_to_index = get_website_files($indexable_folders);
foreach ($files_to_index as $html_file => $page_url) {
if(can_index_website_file($html_file)){
$f1 = strtolower($html_file);
if(end_with($f1, 'html') || end_with($f1, 'htm')){
$file_content = file_get_contents($html_file);
}elseif(end_with($f1, 'php')){
if(is_http_code_200($page_url)){
$file_content = get_url_content($page_url);
}
}
if(isset($file_content)){
$file_content = '<html>'.strstr($file_content, '<head');
$doc = Zend_Search_Lucene_Document_Html::loadHTML($file_content, true, 'UTF-8');
$doc->addField(Zend_Search_Lucene_Field::Text('url', $page_url, 'UTF-8'));
$index->addDocument($doc);
flush();
}
}
}
$broken_urls = array();
foreach (get_dynamic_urls(get_setting('search_dynamic_pages', $all_settings)) as $url) {
if(is_http_code_200($url)){
$content = get_url_content($url);
$content = '<html>'.strstr($content, '<head');
$doc = Zend_Search_Lucene_Document_Html::loadHTML($content, true, 'UTF-8');
$doc->addField(Zend_Search_Lucene_Field::Text('url', $url, 'UTF-8'));
$index->addDocument($doc);
flush();
}else{
array_push($broken_urls, $url);
}
}
if (file_exists($index_folder)) {
if(count($broken_urls)>0){
$warning_msg = '<p>The website was successfully indexed, but the following URL\'s were skipped because they are broken:</p>';
$warning_msg .= '<ul class="disc">';
foreach($broken_urls as $broken_url){
$warning_msg .= '<li><a href="'.$broken_url.'">'.$broken_url.'</a></li>';
}
$warning_msg .= '</ul>';
$warning_msg .= '<p>Please remove them from the "List of dynamic pages" field.</p>';
}else{
$success_msg = 'The website was successfully indexed.';
}
} else {
$error_msg = 'An error occurred during the website indexing. The error message is: the folder that stores the website indexes couldn\'t be created';
}
} catch (Exception $e) {
$error_msg = 'An error occurred during the website indexing. The error message is: ' . $e->getMessage();
}
}
function get_website_files($paths)
{
global $all_settings;
$public_html_dir = '/'.get_setting('public_html_dir', $all_settings).'/';
if(!is_array($paths)){
$paths = array($paths);
}
$html_files = array();
foreach($paths as $path){
$path = rtrim(str_replace("\\", "/", $path), '/') . '/';
if(file_exists($path)){
$entries = array();
$dir = dir($path);
while (false !== ($entry = $dir->read())) {
$entries[] = $entry;
}
$dir->close();
foreach ($entries as $entry) {
$entry1 = strtolower($entry);
if(end_with($entry1, 'html') || end_with($entry1, 'htm') || end_with($entry1, 'php')){
$fullname = $path . $entry;
if ($entry != '.' && $entry != '..' && is_dir($fullname)) {
//$html_files = array_merge($html_files, get_website_files($fullname));
} else if (is_file($fullname)) {
$html_files[$fullname] = get_url_for_html_file($public_html_dir, $path, $entry);
}
}
}
}
}
return $html_files;
}
function get_url_for_html_file($public_html_dir, $path, $entry)
{
$html_file = str_replace("\\", "/", $path . $entry);
$site_url = 'http://' . $_SERVER["HTTP_HOST"];
$i = strrpos($html_file, $public_html_dir);
if ($i && $i >= 0) {
return $site_url . '/' . substr($html_file, $i + strlen($public_html_dir));
} else {
return $site_url . '/' . $entry;
}
}
function can_index_website_file($html_file)
{
global $all_settings;
foreach (get_dynamic_urls(get_setting('search_exclude_from_indexing', $all_settings)) as $excluded_file) {
$excluded_file = rtrim(str_replace("\\", "/", $excluded_file), '/');
$pos = strpos($html_file, $excluded_file);
if($pos && $pos >= 0){
return false;
}
}
$file_content = file_get_contents($html_file);
$pos = strpos($file_content, '@skip-indexing');
if($pos && $pos >= 0){
return false;
}
return true;
}
function get_url_content($url){
$m = HTTP_CALL_METHOD;
if($m == 'curl'){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}else{
return file_get_contents($url);
}
}
function is_http_code_200($url){
$m = HTTP_CALL_METHOD;
if($m == 'curl'){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $http_code == 200;
}else{
$headers = get_headers($url);
if(strrpos($headers[0], '200')){
return true;
}else{
return false;
}
}
}
function end_with($haystack, $needle)
{
$length = strlen($needle);
$start = $length * -1; //negative
return (substr($haystack, $start) === $needle);
}
?>
<!DOCTYPE HTML>
<!--[if IE 8]> <html class="ie8 no-js"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<!-- begin meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9, IE=10">
<meta name="description" content="Finesse is a responsive business and portfolio theme carefully handcrafted using the latest technologies. It features a clean design, as well as extended functionality that will come in very handy.">
<meta name="keywords" content="Finesse, responsive business portfolio theme, HTML5, CSS3, clean design">
<meta name="author" content="Ixtendo">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- end meta -->
<!-- begin CSS -->
<link href="style.css" type="text/css" rel="stylesheet" id="main-style">
<!--[if IE]> <link href="css/ie.css" type="text/css" rel="stylesheet"> <![endif]-->
<link href="css/colors/orange.css" type="text/css" rel="stylesheet" id="color-style">
<!-- end CSS -->
<link href="images/favicon.ico" type="image/x-icon" rel="shortcut icon">
<!-- begin JS -->
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <!-- jQuery -->
<script src="js/ie.js" type="text/javascript"></script> <!-- IE detection -->
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script> <!-- jQuery easing -->
<script src="js/modernizr.custom.js" type="text/javascript"></script> <!-- Modernizr -->
<!--[if IE 8]><script src="js/respond.min.js" type="text/javascript"></script><![endif]--> <!-- Respond -->
<script src="js/jquery.polyglot.language.switcher.js" type="text/javascript"></script> <!-- language switcher -->
<script src="js/ddlevelsmenu.js" type="text/javascript"></script> <!-- drop-down menu -->
<script type="text/javascript"> <!-- drop-down menu -->
ddlevelsmenu.setup("nav", "topbar");
</script>
<script src="js/tinynav.min.js" type="text/javascript"></script> <!-- tiny nav -->
<script src="js/jquery.ui.totop.min.js" type="text/javascript"></script> <!-- scroll to top -->
<script src="js/jquery.validate.min.js" type="text/javascript"></script> <!-- form validation -->
<script src="js/jquery.tweet.js" type="text/javascript"></script> <!-- Twitter widget -->
<script src="js/jquery.touchSwipe.min.js" type="text/javascript"></script> <!-- touchSwipe -->
<script src="js/custom.js" type="text/javascript"></script> <!-- jQuery initialization -->
<!-- end JS -->
<title>Finesse - Administration</title>
</head>
<body>
<!-- begin container -->
<div id="wrap">
<!-- begin header -->
<header id="header" class="container">
<!-- begin header top -->
<section id="header-top" class="clearfix">
<!-- begin header left -->
<div class="one-half">
<h1 id="logo"><a href="index.html"><img src="images/logo.png" alt="Finesse"></a></h1>
<p id="tagline">Responsive Business Theme</p>
</div>
<!-- end header left -->
<!-- begin header right -->
<div class="one-half column-last">
<!-- begin language switcher -->
<div id="polyglotLanguageSwitcher">
<form action="#">
<select id="polyglot-language-options">
<option id="en" value="en" selected>English</option>
<option id="fr" value="fr">Français</option>
<option id="de" value="de">Deutsch</option>
<option id="it" value="it">Italiano</option>
<option id="es" value="es">Español</option>
</select>
</form>
</div>
<!-- end language switcher -->
<!-- begin contact info -->
<div class="contact-info">
<p class="phone">(123) 456-7890</p>
<p class="email"><a href="mailto:info@finesse.com">info@finesse.com</a></p>
</div>
<!-- end contact info -->
</div>
<!-- end header right -->
</section>
<!-- end header top -->
<!-- begin navigation bar -->
<section id="navbar" class="clearfix">
<!-- begin navigation -->
<nav id="nav">
<ul id="navlist" class="clearfix">
<li><a href="index.html" data-rel="submenu1">Home</a>
<ul id="submenu1" class="ddsubmenustyle">
<li><a href="index.html">Home Version 1</a></li>
<li><a href="index-2.html">Home Version 2</a></li>
</ul>
</li>
<li><a href="about-us.html" data-rel="submenu2">Templates</a>
<ul id="submenu2" class="ddsubmenustyle">
<li><a href="about-us.html">About Us</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="testimonials.html">Testimonials</a></li>
<li><a href="sitemap.html">Sitemap</a></li>
<li><a href="404-error-page.html">404 Error Page</a></li>
<li><a href="search-results.html">Search Results</a></li>
<li><a href="full-width-page.html">Full Width Page</a></li>
<li><a href="page-right-sidebar.html">Page with Right Sidebar</a></li>
<li><a href="page-left-sidebar.html">Page with Left Sidebar</a></li>
<li><a href="#">Multi-Level Drop-Down</a>
<ul>
<li><a href="#">Drop-Down Example</a></li>
<li><a href="#">Multi-Level Drop-Down</a>
<ul>
<li><a href="#">Drop-Down Example</a></li>
<li><a href="#">Drop-Down Example</a></li>
<li><a href="#">Drop-Down Example</a></li>
</ul>
</li>
<li><a href="#">Drop-Down Example</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="elements.html" data-rel="submenu3">Features</a>
<ul id="submenu3" class="ddsubmenustyle">
<li><a href="elements.html">Elements</a></li>
<li><a href="grid-columns.html">Grid Columns</a></li>
<li><a href="pricing-tables.html">Pricing Tables</a></li>
<li><a href="images.html">Images</a></li>
<li><a href="video.html">Video</a></li>
</ul>
</li>
<li><a href="portfolio.html" data-rel="submenu4">Portfolio</a>
<ul id="submenu4" class="ddsubmenustyle">
<li><a href="portfolio.html">Portfolio Overview</a></li>
<li><a href="portfolio-item-slider.html">Portfolio Item – Slider</a></li>
<li><a href="portfolio-item-image.html">Portfolio Item – Image</a></li>
<li><a href="portfolio-item-embedded-video.html">Portfolio Item – Embedded Video</a></li>
<li><a href="portfolio-item-self-hosted-video.html">Portfolio Item – Self-Hosted Video</a></li>
</ul>
</li>
<li><a href="blog.html" data-rel="submenu5">Blog</a>
<ul id="submenu5" class="ddsubmenustyle">
<li><a href="blog.html">Blog Overview</a></li>
<li><a href="blog-post.html">Blog Post</a></li>
</ul>
</li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
<!-- end navigation -->
<!-- begin search form -->
<form id="search-form" action="search.php" method="get">
<input id="s" type="text" name="s" placeholder="Search …" style="display: none;">
<input id="search-submit" type="submit" name="search-submit" value="Search">
</form>
<!-- end search form -->
</section>
<!-- end navigation bar -->
</header>
<!-- end header -->
<!-- begin content -->
<section id="content" class="container clearfix">
<!-- begin page header -->
<header id="page-header">
<h1 id="page-title">Administration Dashboard</h1>
</header>
<!-- end page header -->
<!-- begin main content -->
<section id="main" class="three-fourths">
<?php if ($status == 'private_key_must_be_generated') { ?>
<form id="admin-settings-form" class="content-form" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<p>This page is locked. To unlock it, click the button bellow.</p>
<input class="button" type="submit" name="submit" value="Unlock Page">
</form>
<?php } elseif ($status == 'private_key_generated') { ?>
<div class="notification-box notification-box-success">
<p>The link you must use to access the administration page has been successfully sent to your email.</p>
<a href="#" class="notification-close notification-close-success">x</a>
</div>
<?php } elseif ($status == 'display_settings') { ?>
<?php if ($success_msg != '') { ?>
<div class="notification-box notification-box-success">
<p><?php echo $success_msg; ?></p>
<a href="#" class="notification-close notification-close-success">x</a>
</div>
<?php } elseif ($error_msg != '') { ?>
<div class="notification-box notification-box-error">
<p><?php echo $error_msg; ?></p>
<a href="#" class="notification-close notification-close-error">x</a>
</div>
<?php } elseif ($warning_msg != '') { ?>
<div class="notification-box notification-box-warning">
<?php echo $warning_msg; ?>
<a class="notification-close notification-close-warning" href="#">x</a>
</div>
<?php } ?>
<form id="admin-settings-form" class="content-form" method="post" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>">
<p>
<label for="public-html-dir">The name of the folder where the website is located:<span class="note">*</span></label>
<input id="public-html-dir" type="text" name="public-html-dir" value="<?php echo get_setting('public_html_dir', $all_settings); ?>" class="required">
</p>
<p>
<label for="search-indexes-folder">Path to the folder that contains the website indexes:<span class="note">*</span></label>
<input id="search-indexes-folder" type="text" name="search-indexes-folder" value="<?php echo get_setting('search_indexes_folder', $all_settings); ?>" class="required">
</p>
<p>
<label for="search-description-length">The description length:<span class="note">*</span></label>
<input id="search-description-length" size="3" type="text" name="search-description-length" value="<?php echo get_setting('search_description_length', $all_settings); ?>" class="required">
</p>
<p>
<label for="search-result-items">Search results items per page:<span class="note">*</span></label>
<input id="search-result-items" size="3" type="text" name="search-result-items" value="<?php echo get_setting('search_result_items', $all_settings); ?>" class="required">
</p>
<p>
<label for="search-dynamic-pages">List of dynamic pages (Enter one URL per line.):</label>
<textarea id="search-dynamic-pages" rows="3" cols="7" name="search-dynamic-pages"><?php echo base64_decode(get_setting('search_dynamic_pages', $all_settings)); ?></textarea>
</p>
<p>
<label for="search-exclude-from-indexing">List of HTML files or folders which must be excluded from indexing (Enter one per line.):</label>
<textarea id="search-exclude-from-indexing" rows="3" cols="7" name="search-exclude-from-indexing"><?php echo base64_decode(get_setting('search_exclude_from_indexing', $all_settings)); ?></textarea>
</p>
<p>
<label for="search-debug">Debug mode:</label>
<select id="search-debug" name="debug">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</p>
<p>
<input type="hidden" name="pk" value="<?php echo $private_key;?>">
<input id="restore" class="button" type="submit" name="submit" value="Restore Defaults">
<input id="submit" class="button" type="submit" name="submit" value="Save Settings">
</p>
</form>
<?php } else { ?>
<div class="notification-box notification-box-error">
<p>You have no rights to access this page.</p>
<a href="#" class="notification-close notification-close-error">x</a>
</div>
<?php } ?>
</section>
<!-- end main content -->
<!-- begin sidebar -->
<aside id="sidebar" class="one-fourth column-last">
<div class="widget">
<h3>Other Settings</h3>
<nav>
<ul class="menu">
<li><a href="admin.php?action=rsi&pk=<?php echo $private_key;?>">Rebuild search indexes</a></li>
</ul>
</nav>
</div>
</aside>
<!-- end sidebar -->
</section>
<!-- end content -->
<!-- begin footer -->
<footer id="footer">
<div class="container">
<!-- begin footer top -->
<div id="footer-top">
<div class="one-fourth">
<div class="widget">
<h3>About Us</h3>
<p>Finesse is a responsive business and portfolio theme carefully handcrafted using the latest technologies.</p>
<p>It features a clean design, as well as extended functionality that will come in very handy.</p>
</div>
</div>
<div class="one-fourth">
<div class="widget latest-posts">
<h3>Latest Posts</h3>
<ul>
<li>
<a href="blog-post.html">How to Make Innovative Ideas Happen</a>
<span>March 10, 2012</span>
</li>
<li> <a href="blog-post.html">Web Development for the iPhone and iPad</a>
<span>March 10, 2012</span>
</li>
</ul>
</div>
</div>
<div class="one-fourth">
<div class="widget twitter-widget">
<h3>Latest Tweets</h3>
<div class="tweet"></div>
</div>
</div>
<div class="one-fourth column-last">
<div class="widget contact-info">
<h3>Contact Info</h3>
<p class="address"><strong>Address:</strong> 123 Street, City, Country</p>
<p class="phone"><strong>Phone:</strong> (123) 456-7890</p>
<p class="fax"><strong>Fax:</strong> (123) 456-7890</p>
<p class="email"><strong>Email:</strong> <a href="mailto:info@finesse.com">info@finesse.com</a></p>
<div class="social-links">
<h4>Follow Us</h4>
<ul>
<li class="twitter"><a href="#" title="Twitter" target="_blank">Twitter</a></li>
<li class="facebook"><a href="#" title="Facebook" target="_blank">Facebook</a></li>
<li class="google"><a href="#" title="Google+" target="_blank">Google+</a></li>
<li class="youtube"><a href="#" title="YouTube" target="_blank">YouTube</a></li>
<li class="skype"><a href="#" title="Skype" target="_blank">Skype</a></li>
<li class="rss"><a href="#" title="RSS" target="_blank">RSS</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- end footer top -->
<!-- begin footer bottom -->
<div id="footer-bottom">
<div class="one-half">
<p>Copyright © 2012 Finesse. Created by <a href="http://themeforest.net/user/ixtendo">Ixtendo</a>.</p>
</div>
<div class="one-half column-last">
<nav id="footer-nav">
<ul>
<li><a href="index.html">Home</a> ·</li>
<li><a href="about-us.html">Templates</a> ·</li>
<li><a href="elements.html">Features</a> ·</li>
<li><a href="portfolio.html">Portfolio</a> ·</li>
<li><a href="blog.html">Blog</a> ·</li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</div>
<!-- end footer bottom -->
</div>
</footer>
<!-- end footer -->
</div>
<!-- end container -->
</body>
</html>