forked from jhooey/jacobhooey.com
/
index.php
76 lines (61 loc) · 2.49 KB
/
index.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
<?php
/****************************************************************************
* Title: index.php *
* Author: Jacob Hooey *
* URL: http://www.jacobhooey.com *
* Description: This is the index page for jacobhooey.com, a website *
* use to demonstrate my skill in webdesign as well as *
* a means to digitize my resume, as well as post info *
* relating to projects I am currently working on. *
* Created: March 16th, 2012 *
****************************************************************************/
require( "admin/config.php" );
session_start();
$action = isset( $_GET['action'] ) ? $_GET['action'] : "";
/* each link in the navigation bar of the website will point to a different action,
* the following switch statement uses the $nav variable to store a string relating to the action received.
* This variable will then be used to populate the page with the appropriate content
*/
switch ( $action ) {
case 'home':
$nav = "home";
break;
case 'resume':
$nav = "resume";
break;
case 'artwork':
$nav = "artwork";
break;
case 'thesis':
$nav = "thesis";
break;
case 'programming':
$nav = "programming";
break;
case 'contact':
$nav = "contact";
break;
default:
$nav = "home";
}
/*******************************************************************************
* Summary: This function is used to populate the webpage with content
* relating to the users choice (ie what links he clicks)
*
* Parameters: $nav: String - this holds the users choice
*
*Added: March 16th, 2012
********************************************************************************/
function content($nav) {
$results = array();
//use getList from the Article class to collect all the articles relating to the users choice
$data = Article::getList( 1000, "menu_order ASC", $nav );
//now put the results into our results array
$results['articles'] = $data['results'];
//record the total number of articles (not used, but may be needed in the future
$results['totalRows'] = $data['totalRows'];
//use the content template to output the required html
require( "templates/content.php" );
}
content($nav);
?>