-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent-data.php
198 lines (171 loc) · 6.41 KB
/
component-data.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
<?php
$tab = 0;
include 'classes/classes.php';
session_start();
include 'vars/overview.php';
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
$type = filter_var($_GET['type'], FILTER_SANITIZE_STRING);
$id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
$vars['editmode'] = filter_var($_GET['editmode'],FILTER_SANITIZE_STRING);
if($vars['editmode']){
if(!isset($_SESSION['user']) || $_SESSION['user']->role<1)
$vars['editmode'] = false;
}
$vars['errorID'] = filter_var($_GET['errorID'],FILTER_SANITIZE_NUMBER_INT);
if($vars['errorID']){
$errorID = new Error();
$errorID->getByID($vars['errorID']);
if(!$errorID->id){
$errorID = false;
}
}
$component = new Component();
$component->getPageByType(0,$type);
$holder = new Component();
$components = $holder->getByCommunity(0);
$hl_sub = $component->position+1;
$search = new Search();
$search->community = new Community();
$search->community->id = 0;
$search->community->shortName='SciCrunch';
if($id){
$data = new Component_Data();
$data->getByID($id);
$data->addView();
$title = $data->title;
$locationPage = '/page/'.$component->text2.'/'.$id;
} else {
$title = $component->text1;
$locationPage = '/page/'.$component->text2;
}
?>
<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en"> <!--<![endif]-->
<head>
<title>SciCrunch | <?php echo $title?></title>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Favicon -->
<link rel="shortcut icon" href="/favicon.ico">
<!-- CSS Global Compulsory -->
<link rel="stylesheet" href="/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/assets/plugins/summernote/summernote.css"/>
<link rel="stylesheet" href="/assets/plugins/sky-forms/version-2.0.1/css/custom-sky-forms.css">
<!-- CSS Implementing Plugins -->
<link rel="stylesheet" href="/assets/plugins/line-icons/line-icons.css">
<link rel="stylesheet" href="/assets/plugins/font-awesome/css/font-awesome.min.css">
<!-- CSS Page Style -->
<link rel="stylesheet" href="/assets/css/pages/feature_timeline1.css">
<link rel="stylesheet" href="/assets/css/pages/feature_timeline2.css">
<!-- CSS Theme -->
<link rel="stylesheet" href="/assets/css/themes/default.css" id="style_color">
<link rel="stylesheet" href="/assets/css/pages/blog.css">
<link rel="stylesheet" href="/assets/css/pages/page_log_reg_v2.css">
<!-- CSS Customization -->
<link rel="stylesheet" href="/assets/css/custom.css">
<style>
.column-search {
display:none;
position: absolute;
top:100%;
left:-1px;
width:300px;
background: #fff;
border: 1px solid #999;
z-index: 21;
}
.column-search-form {
padding:20px;
}
.column-search p {
margin:10px 20px;
}
.search-header:hover {
cursor: pointer;
text-decoration: underline;
}
.panel>.table-bordered>thead>tr:last-child>th, .panel>.table-responsive>.table-bordered>thead>tr:last-child>th {
border-bottom: 1px solid #999;
}
</style>
</head>
<body>
<?php echo \helper\noscriptHTML(); ?>
<div class="wrapper" <?php if($vars['editmode']) echo 'style="margin-top:30px;"'?>>
<!--=== Header ===-->
<?php include 'ssi/header.php' ?>
<!--=== Breadcrumbs ===-->
<?php
$community = new Community();
$community->portalName = 'SciCrunch';
$community->id = 0;
if (!$id) {
include 'components/scicrunch-html/list.php';
} else {
include 'components/scicrunch-html/single.php';
}?>
<!--=== Footer ===-->
<?php include 'ssi/footer.php' ?>
<!--=== End Footer ===-->
<!--=== End Copyright ===-->
<div class="background"></div>
</div>
<!--/wrapper-->
<!-- JS Global Compulsory -->
<script type="text/javascript" src="/assets/plugins/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/assets/plugins/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="/assets/plugins/jquery-ui.min.js"></script>
<script type="text/javascript" src="/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/assets/plugins/summernote/summernote.js"></script>
<script src="/assets/plugins/sky-forms/version-2.0.1/js/jquery.validate.min.js"></script>
<script src="/assets/plugins/scrollbar/src/perfect-scrollbar.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
<script type="text/javascript" src="/js/profile.js"></script>
<script type="text/javascript" src="/js/jquery.truncate.js"></script>
<!-- JS Implementing Plugins -->
<script type="text/javascript" src="/assets/plugins/back-to-top.js"></script>
<!-- JS Page Level -->
<script type="text/javascript" src="/assets/js/app.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
App.init();
<?php if(isset($_SESSION['user'])){?>
setTimeout(updateLogin,<?php if($_SESSION['user']->last_check > time()) echo 1000*($_SESSION['user']->last_check-time()); else echo 1000 ?>);
<?php } ?>
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('td').truncate({max_length: 200});
$('.content-load-btn').click(function(){
var cid = $(this).attr('cid');
var type = $(this).attr('type');
var num = $(this).attr('num');
var comp = $(this).attr('comp');
$('.'+type+' .clearfix').remove();
$('.content-load-div').load('/php/content-loader.php?cid='+cid+'&num='+num+'&comp='+comp,function(){
$('.'+type).append($('.content-load-div').html());
if(type=='timeline-v1')
$('.'+type).append('<li class="clearfix" style="float: none;"></li>');
});
$('.content-load-btn').attr('num',parseInt(num)+10);
});
});
</script>
<!--[if lt IE 9]>
<script src="/assets/plugins/respond.js"></script>
<script src="/assets/plugins/html5shiv.js"></script>
<![endif]-->
</body>
</html>