-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchallengesOpen.php
executable file
·297 lines (287 loc) · 18.4 KB
/
challengesOpen.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
<?php
include_once 'challengesOpen.inc.php';
include_once 'functions/extract_keywords.php';
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php chOpen_title($challenge_page_title); ?></title>
<meta name="author" content="Anil">
<!-- for Google -->
<meta name="description" content="<?= $obj->getDiscription(); ?>" />
<meta name="keywords" content="<?php echo extract_keywords($obj->stmt); ?>" />
<meta name="author" content="<?= $obj->first_name.$obj->last_name; ?>" />
<meta name="copyright" content="true" />
<meta name="application-name" content="Article" />
<!-- for Facebook -->
<meta property="og:title" content="<?= $obj->challenge_title; ?>" />
<meta name="og:author" content="<?= $obj->first_name.$obj->last_name; ?>" />
<meta property="og:type" content="article"/>
<meta name="p:domain_verify" content="c336f4706953c5ce54aa851d2d3da4b5"/>
<?php
if($obj->video == 0) {
echo "<meta property=\"og:image\" content='".$obj->url."' />\n" ;
}
else{
echo "<meta property=\"og:image\" content=\"http://img.youtube.com/vi/".str_replace(' ', '',explode("/embed/", $obj->url)[1])."/hqdefault.jpg\" />\n" ;
echo "<meta property=\"og:video\" content=\"http://www.youtube.com/v/".explode("/embed/", $obj->url)[1]."\" />\n" ;
}
?>
<meta property="og:url" content="<?= "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] ?>" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:description" content="<?= $obj->getDiscription(); ?>" />
<!-- for Twitter -->
<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@collap">
<meta name="twitter:creator" content="<?= "@".$obj->first_name.$obj->last_name; ?>">
<meta name="twitter:url" content="<?= "http://collap.com/challengesOpen.php?challenge_id=".$_GET['challenge_id'] ?>" />
<meta name="twitter:title" content="<?= $obj->challenge_title; ?>" />
<meta name="twitter:description" content="<?= $obj->getDiscription(); ?>" />
<meta name="twitter:image" content="<?= $obj->url; ?>" />
<?php include_once 'lib/htmt_inc_headers.php'; ?>
</head>
<body>
<?php include_once 'html_comp/navbar_homepage.php'; ?>
<div class="row-fluid" style='margin-top: 50px;'>
<div class="span7 offset1">
<?php
challenge_display($db_handle, $challengeSearchID);
?>
<!--//Soical media buttons: https://github.com/kni-labs/rrssb (More examples) -->
<div class="list-group" style="margin: 20px 0px;">
<div class="list-group-item" style="padding: 0px;">
<?php
$data = "" ;
$userinfo = mysqli_query($db_handle, "SELECT * from user_info where user_id = '$challengeSearch_user_ID' ;") ;
$userinfoRow = mysqli_fetch_array($userinfo) ;
$usersFirstname = $userinfoRow['first_name'] ;
$usersLastname = $userinfoRow['last_name'] ;
$usersUsername = $userinfoRow['username'] ;
$usersRank = $userinfoRow['rank'] ;
$usersEmail = $userinfoRow['email'] ;
$usersPhone = $userinfoRow['contact_no'] ;
echo " <div id='demo10' class='row-fluid' style='height:auto;word-wrap: break-word;'>
<div class='span2' style='margin: 4px 4px 4px 4px;'>
<img src='uploads/profilePictures/$ch_username.jpg' style='width:150px; height:150px;' onError=this.src='img/default.gif' class='img-circle img-responsive'>
</div>
<div class='span9' style=' padding-left:5px;'>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<span class='icon-user'></span>
<strong>
<a href='profile.php?username=".$usersUsername."' > ".ucfirst($usersFirstname)." ".ucfirst($usersLastname)."</a>
</strong>
<i>( ".$usersRank." )</i>
</div>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<span class='icon-envelope' id='email_auth' style='cursor: pointer;'> ".$usersEmail."</span>" ;
if($usersPhone != 1) {
echo " <span class='icon-phone' id='phone' style='cursor: pointer'> ".$usersPhone."</span>";
}
$usersSkills = mysqli_query($db_handle, "SELECT b.skill_name, a.skill_id from user_skills as a join skill_names as b WHERE
a.user_id = '$challengeSearch_user_ID' AND a.skill_id = b.skill_id ;");
while($usersSkillsRow = mysqli_fetch_array($usersSkills)) {
$usersSkillname = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $usersSkillsRow['skill_name'])))) ;
$usersSkillid = $usersSkillsRow['skill_id'] ;
$data .= "<span class='btn-success'>
<a href='ninjaSkills.php?skill_id=".$usersSkillid."' style='color: #fff;font-size:14px;font-style: italic;font-family:verdana;'> ".$usersSkillname."</a> 
</span> ";
}
$usersAbout = mysqli_query($db_handle, "SELECT * FROM about_users WHERE user_id = '$challengeSearch_user_ID' ;") ;
$usersAboutRow = mysqli_fetch_array($usersAbout);
if (mysqli_num_rows($usersAbout) != 0) {
echo "</div>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<span class='icon-briefcase'></span> ".str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $usersAboutRow['organisation_name']))))."
<span class='icon-home'></span> ".str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $usersAboutRow['living_town']))))."
</div><br/>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<i class='icon-screenshot'></i>Skills : ".$data."
</div><br/>
<div class='row-fluid' style ='text-align:justify;font-size: 14px;word-wrap: break-word;'>
<span class='icon-comment'></span> ".str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $usersAboutRow['about_user']))))."
</div>" ;
}
else {
echo "</div>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<span class='icon-briefcase'></span> No Information Available
<span class='icon-home'></span> No Information Available
</div><br/>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<i class='icon-screenshot'></i>Skills : ".$data."
</div><br/>
<div class='row-fluid' style ='text-align:justify;word-wrap: break-word;'>
<span class='icon-comment'></span> No Information Available
</div>";
}
echo "</div>
</div><br/>" ;
?>
</div>
</div>
<div class="tabbable custom-tabs tabs-animated flat flat-all hide-label-980 shadow track-url auto-scroll">
<ul class="nav nav-tabs">
<li class="active"><a href="#" data-toggle="tab" class="active ">About Collap :</a></li>
</ul>
<div class="tab-content">
<div class="box">
<p>Collap is a powerful online platform which enables you to take a dig at problems, big or small, and collaborate with like minded people to make the world a better place.</p>
<p>Identify any problem you want solved and let the world know about it. Assemble your team and have a go at it. Interested Collapers can join your quest and contribute which ever way they can.
Collap provides you a wide range of helpful tools which enable hassle-free collaboration. Create and manage projects and be in control with our Project Dashboard all through the process. Share ideas freely and come up with innovative solutions.</p>
<p>Make your realm private and work on that secret project you’ve long been planning.
Participate in projects and upgrade your Level. Earn a special place in Collap for each incremental step. Sharpen your skills while lending them to do good. </p>
<p> Challenges to solve your technical problems and help change the world! . Meet people, allows everybody to share their ideas, views, challenges and achievements with the like minded for mutual benefits. In this collap v1 release, we are going to limit to some functionality due to technically liabilities and available resources.</p>
</div>
</div>
</div><br/><br/>
<div class="tabbable custom-tabs tabs-animated flat flat-all hide-label-980 shadow track-url auto-scroll">
<ul class="nav nav-tabs">
<li class="active"><a href="#" data-toggle="tab" class="active ">Top Projects :</a></li>
</ul>
<div class="tab-content">
<div class="row-fluid">
<?php
$projects = mysqli_query($db_handle, "(SELECT DISTINCT project_id, project_title, LEFT(stmt, 250) as stmt FROM projects
WHERE project_type = '1' AND blob_id = '0')
UNION
(SELECT DISTINCT a.project_id, a.project_title, LEFT(b.stmt, 250) as stmt FROM projects as a JOIN blobs as b
WHERE a.blob_id = b.blob_id AND project_type= '1' ) ORDER BY rand() LIMIT 4 ;");
while($projectsRow = mysqli_fetch_array($projects)) {
$project_id = $projectsRow['project_id'];
$project_title_display = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $projectsRow['project_title']))));
$project_title_stmt = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $projectsRow['stmt']))));
echo "
<div class ='span6 box' style=' margin: 4px ;min-height: 200px;'>
<a href='project.php?project_id=".$project_id."'>
<div class='panel-heading'>
<b>
<p style=' font-size:14px;word-wrap: break-word;color:#3B5998;'>"
.ucfirst($project_title_display)."
</p>
</b>
</div>
<div class='panel-content'>
<p style='word-wrap: break-word;'>"
.$project_title_stmt."....
</p><br>
</div>
</a>
</div>";
}
?>
</div></div></div>
</div>
<div class="span3">
<div class="tabbable custom-tabs tabs-animated flat flat-all hide-label-980 shadow track-url auto-scroll" style="margin: 20px -15px;">
<ul class="nav nav-tabs">
<li class="active" >
<a style='padding-top: 4px; padding-bottom: 4px;'> <span><b>Explore More </b></span></a>
</li>
</ul>
<div class="tab-content" >
<div role="tabpanel" class="row tab-pane active">
<?php
$challenge_user = mysqli_query($db_handle, "(SELECT DISTINCT challenge_id, challenge_title, LEFT(stmt, 250) as stmt FROM challenges
WHERE challenge_type != '2' and challenge_type != '5' and challenge_type != '6' and challenge_type != '9' AND challenge_status !='3' AND challenge_status != '7' AND
challenge_id != $challengeSearchID AND blob_id = '0')
UNION
(SELECT DISTINCT a.challenge_id, a.challenge_title, LEFT(b.stmt, 250) as stmt FROM challenges as a JOIN blobs as b
WHERE a.blob_id = b.blob_id and challenge_type != '5' and challenge_type != '6' and challenge_type != '9' AND a.challenge_type != '2' AND a.challenge_status !='3' AND a.challenge_status != '7'
AND a.challenge_id != $challengeSearchID) ORDER BY rand() LIMIT 10 ;");
while($challenge_userRow = mysqli_fetch_array($challenge_user)) {
$challenge_user_chID = $challenge_userRow['challenge_id'];
$challenge_user_title = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $challenge_userRow['challenge_title']))));
$challenge_user_stmt = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $challenge_userRow['stmt']))));
if(substr($challenge_user_stmt, 0, 4) == '<img') {
$ProjectPic = strstr($challenge_user_stmt, '<br/>' , true) ;
$ProjectLink = strstr($challenge_user_stmt, '<br/>') ;
$ProjectPicLink =explode("\"",$ProjectPic)['1'] ;
$ProjectPic2 = "<img src='".resize_image($ProjectPicLink, 280, 280, 2)."' onError=this.src='img/default.gif' style='width:100%;height:280px;'>" ;
$ProjectStmt = $ProjectPic2." ".str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $ProjectLink)))) ;
}
else {
$ProjectStmt = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $challenge_user_stmt)))) ;
}
echo "
<div class ='row' style='border-width: 1px; border-style: solid;margin: 10px 0px 10px 0px;background : rgb(240, 241, 242); color:rgba(69, 69, 69, 0);'>
<a href='challengesOpen.php?challenge_id=$challenge_user_chID'>
<b>
<p style='font-size:14px; word-wrap: break-word;color:#3B5998;'>"
.ucfirst($challenge_user_title)."
</p>
</b>
<p style='word-wrap: break-word;'>"
.$ProjectStmt."
</p>
</a>
</div>";
}
echo "
</div>
</div>
</div>
<div class='tabbable custom-tabs tabs-animated flat flat-all hide-label-980 shadow track-url auto-scroll' style='margin: 20px -15px;'>
<ul class='nav nav-tabs'>
<li class='active' >
<a style='padding-top: 4px; padding-bottom: 4px;'> <span><b>Explore Public Pojects </b></span></a>
</li>
</ul>
<div class='tab-content' >
<div role='tabpanel' class='row tab-pane active'>
<div>";
$projects = mysqli_query($db_handle, "(SELECT DISTINCT project_id, project_title, LEFT(stmt, 250) as stmt FROM projects
WHERE project_type = '1' AND blob_id = '0')
UNION
(SELECT DISTINCT a.project_id, a.project_title, LEFT(b.stmt, 250) as stmt FROM projects as a JOIN blobs as b
WHERE a.blob_id = b.blob_id AND project_type= '1' ) ORDER BY rand() LIMIT 3 ;");
while($projectsRow = mysqli_fetch_array($projects)) {
$project_id = $projectsRow['project_id'];
$project_title_display = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $projectsRow['project_title']))));
$project_title_stmt = str_replace("<s>", " ",str_replace("<r>", "'",str_replace("<a>", "&",str_replace("<an>", "+", $projectsRow['stmt']))));
echo "
<div class ='row' style='border-width: 1px; border-style: solid;margin: 10px 0px 10px 0px;background : rgb(240, 241, 242); color:rgba(69, 69, 69, 0);'>
<a href='project.php?project_id=".$project_id."'>
<div class='panel-heading' style='padding-left: 0px;'>
<b>
<p style=' font-size:14px;word-wrap: break-word;color:#3B5998;'>"
.ucfirst($project_title_display)."
</p>
</b>
</div>
<div class='panel-content'>
<p style='word-wrap: break-word;'>"
.$project_title_stmt."....
</p><br>
</div>`
</a>
</div>";
}
echo "
</div>";
?>
</div>
</div>
</div>
</div>
</div>
<?php
if(isset($_SESSION['user_id'])) {
include_once 'html_comp/friends.php';
}
?>
<?php include_once 'html_comp/signup.php' ;
include_once 'lib/html_inc_footers.php';
include_once 'html_comp/check.php';
include_once 'html_comp/login_signup_modal.php'; ?>
<script>
$(".text").show();
$(".editbox").hide();
$(".editbox").mouseup(function(){
return false
});
</script>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-54a9978c1d02a7b3" async="async"></script>
<?php include_once 'html_comp/insert_time.php'; ?>
</body>
</html>