File indexing completed on 2025-05-04 05:29:30
0001 <?php 0002 /** 0003 * ocs-webserver 0004 * 0005 * Copyright 2016 by pling GmbH. 0006 * 0007 * This file is part of ocs-webserver. 0008 * 0009 * This program is free software: you can redistribute it and/or modify 0010 * it under the terms of the GNU Affero General Public License as 0011 * published by the Free Software Foundation, either version 3 of the 0012 * License, or (at your option) any later version. 0013 * 0014 * This program is distributed in the hope that it will be useful, 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 * GNU Affero General Public License for more details. 0018 * 0019 * You should have received a copy of the GNU Affero General Public License 0020 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0021 **/ 0022 0023 $this->headTitle("{$this->member['username']}'s Profile - ", Zend_View_Helper_Placeholder_Container_Abstract::PREPEND); 0024 0025 $helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme(); 0026 $helpTruncate = new Default_View_Helper_Truncate(); 0027 $helpPrintDate = new Default_View_Helper_PrintDate(); 0028 0029 $modelProject = new Default_Model_Project(); 0030 $this->userProducts = $modelProject->fetchAllProjectsForMember($this->member['member_id'], null, null, true); 0031 0032 $modelMember = new Default_Model_Member(); 0033 $this->earnings = $modelMember->fetchProjectsSupported($this->member['member_id']); 0034 $this->cntSupporter = $modelMember->fetchCntSupporters($this->member['member_id']); 0035 $this->mainProject = $modelProject->fetchMainProject($this->member['member_id']); 0036 $this->cntPageViewsOverall = $modelProject->fetchOverallPageViewsByMember($this->member['member_id']); 0037 $this->contributedProjects = $modelMember->fetchContributedProjectsByCat($this->member['member_id']); 0038 $this->lastActiveTime = $modelMember->fetchLastActiveTime($this->member['member_id']); 0039 0040 $paginationComments = $modelMember->fetchComments($this->member['member_id']); 0041 0042 if ($paginationComments) { 0043 $paginationComments->setItemCountPerPage(15); 0044 $paginationComments->setCurrentPageNumber($this->currentPageOffset); 0045 $this->comments = $paginationComments; 0046 } 0047 0048 $textCountryCity = $this->member['city']; 0049 $textCountryCity .= $this->member['country'] ? ', ' . $this->member['country'] : ''; 0050 0051 ?> 0052 <style> 0053 .info-social { 0054 margin-top: .5em; 0055 } 0056 .info-stat, .info-text { 0057 margin-top: .3em; 0058 } 0059 .badge-info { 0060 background-color: #3a87ad; 0061 } 0062 .badge-primary { 0063 background-color: #337ab7; 0064 } 0065 .badge-super { 0066 vertical-align: super; 0067 } 0068 .badge { 0069 margin-left: .3em; 0070 } 0071 .details h3 { 0072 line-height: 2em; 0073 font-size: 1em; 0074 margin: 0; 0075 color: #a3a2a2; 0076 border-bottom: 1px solid #e1e1e1; 0077 margin-bottom: 0.5em; 0078 } 0079 .profile-nav { 0080 color: #4e4e4e 0081 } 0082 .profile-nav .profile-label { 0083 color: #4e4e4e 0084 } 0085 .profile-nav .profile-value { 0086 font-size: 75%; 0087 } 0088 </style> 0089 <main class="about-me-page"> 0090 0091 <section class="head-wrap"> 0092 0093 <!-- HEADER --> 0094 <div style="height:400px;background-image: url(/images/system/1-opendesktop-bg.png); background-position: bottom 0px left 0px;"> </div> 0095 <div class="container-fluid"> 0096 <div class="row-fluid" style="transform: translateY(-40px);"> 0097 <div class="col-xs-1 col-sm-1 col-md-3"></div> 0098 <div class="col-xs-10 col-sm-10 col-md-7"> 0099 <div style="border-radius: 50%;width: 6.9em;height:6.9em;overflow: hidden;border: 4px solid white;background-color: white;float: left;"> 0100 <img src="<?=$this->member['profile_image_url']?>" style="height:6.8em;width:6.8em;"/> 0101 </div> 0102 <div style="transform: translateY(20px);padding-left: 7.5em;"> 0103 <h1><?=$this->member['username']?><?php echo ($this->member['paypal_mail']) ? '<span class="badge badge-info badge-super">P</span>' : '' ?><?php // echo ($this->member['subscription']) ? '<span class="badge badge-info badge-super">S</span>' : '' ?></h1> 0104 </div> 0105 <div style="transform: translateY(20px);"> 0106 <ul class="nav nav-pills profile-nav"> 0107 <li role="presentation"><span class="label center-block profile-label">Products</span><span class="center center-block profile-value"><?=count($this->userProducts->toArray())?></span></li> 0108 <li role="presentation"><span class="label center-block profile-label">Comments</span><span class="center center-block profile-value"><?=$this->comments->getTotalItemCount()?></span></li> 0109 <li role="presentation"><span class="label center-block profile-label">Page views</span><span class="center center-block profile-value"><?=$this->cntPageViewsOverall?></span></li> 0110 <li role="presentation"><span class="label center-block profile-label">Supporters</span><span class="center center-block profile-value"><?=$this->cntSupporter?></span></li> 0111 <li role="presentation"><span class="label center-block profile-label">Last time active</span><span class="center center-block profile-value"><?=$helpPrintDate->printDate($this->lastActiveTime)?></span></li> 0112 <li role="presentation"><span class="label center-block profile-label">Joined</span><span class="center center-block profile-value"><?=$helpPrintDate->printDate($this->member['created_at']);?></span></li> 0113 </ul> 0114 </div> 0115 </div> 0116 <div class="col-xs-1 col-sm-1 col-md-2"></div> 0117 </div> 0118 </div> 0119 0120 <!-- /HEADER --> 0121 0122 </section> 0123 0124 <section class="body-wrap"> 0125 0126 <div class="container-fluid"> 0127 <div class="row"> 0128 <div class="col-lg-8 col-md-8 col-xs-12"> 0129 <ul class="nav nav-tabs" role="tablist"> 0130 <li role="presentation" class="active"> 0131 <a href="#products" aria-controls="products" role="tab" data-toggle="tab"> 0132 Products<?php echo (count($this->userProducts->toArray())>0?' <span class="badge badge-primary badge-super">'.count($this->userProducts->toArray()).'</span> ':'')?> 0133 </a> 0134 </li> 0135 <li role="presentation"> 0136 <a href="#earnings" aria-controls="supported" role="tab" data-toggle="tab"> 0137 Supported by<?php echo ($this->cntSupporter>0?' <span class="badge badge-primary badge-super">'.$this->cntSupporter.'</span> ':'')?> 0138 </a> 0139 </li> 0140 <li role="presentation"> 0141 <a href="#supporter" aria-controls="supporter" role="tab" data-toggle="tab"> 0142 Supporter of<?php echo (count($this->contributedProjects)>0?' <span class="badge badge-primary badge-super">'.count($this->contributedProjects).'</span> ':'')?> 0143 </a> 0144 </li> 0145 <li role="presentation"> 0146 <a href="#comments" aria-controls="comments" role="tab" data-toggle="tab"> 0147 Comments <?php echo ($this->comments->getTotalItemCount() >0) ? '<span class="badge badge-primary badge-super">'.$this->comments->getTotalItemCount() .'</span> ':''?> 0148 </a> 0149 </li> 0150 </ul> 0151 0152 <div class="tab-content" style="margin-top: 2em;"> 0153 <div role="tabpanel" class="tab-pane fade in active" id="products"> 0154 <?php echo $this->render('user/partials/aboutProducts.phtml'); ?> 0155 </div> 0156 <div role="tabpanel" class="tab-pane fade" id="earnings"> 0157 <?php if (count($this->cntSupporter) > 0) { ?> 0158 <?php echo $this->render('user/partials/loopProductEarnings.phtml'); ?> 0159 <?php } else { ?> 0160 <?= $this->translate('No supporter yet.') ?> 0161 <?php } ?> 0162 </div> 0163 <div role="tabpanel" class="tab-pane fade" id="supporter"> 0164 <?php if (count($this->contributedProjects) > 0) { ?> 0165 <?= $this->render('user/partials/loopContributedProducts.phtml') ?> 0166 <?php } else { ?> 0167 <?= $this->translate('No supported products.') ?> 0168 <?php } ?> 0169 </div> 0170 <div role="tabpanel" class="tab-pane fade" id="comments"> 0171 <?php echo $this->render('user/partials/loopMyComments.phtml'); ?> 0172 </div> 0173 </div> 0174 </div> 0175 <div class="col-lg-4 col-md-4 col-xs-12" style="margin-top: 3em;"> 0176 0177 <div class="col-container"> 0178 <div class="well details about"> 0179 <h3>Contribution</h3> 0180 0181 <div class="box-content"> 0182 <div class="info-text"> 0183 I am xxx and my goal is to xxx. 0184 </div> 0185 <div class="info-text"> 0186 <button type="button" class="btn btn-warning btn-sm"><span class="glyphicon glyphicon-usd"></span> pling me</button> 0187 </div> 0188 </div> 0189 0190 </div> 0191 </div> 0192 0193 <?php if (false === empty($this->mainProject['description'])): ?> 0194 <div class="col-container"> 0195 <div class="well details about"> 0196 <h3>About me</h3> 0197 0198 <div class="box-content"> 0199 <?php if($this->member['firstname']) :?> 0200 <div class="info-text"> 0201 <span class="glyphicon glyphicon-user"></span> 0202 <span class="text"><?php echo $this->member['firstname']; ?> <?php echo $this->member['lastname']; ?> </span> 0203 </div> 0204 <?php endif; ?> 0205 <?php if($textCountryCity):?> 0206 <div class="info-text"> 0207 <span class="glyphicon glyphicon-map-marker"></span> 0208 <span class="text"><?php echo $textCountryCity ?></span> 0209 </div> 0210 <?php endif; ?> 0211 <div class="info-text"> 0212 <?php echo nl2br(strip_tags($this->mainProject['description'])); ?> 0213 </div> 0214 </div> 0215 </div> 0216 </div> 0217 <?php endif; ?> 0218 0219 <div class="col-container"> 0220 <div class="well details about"> 0221 <h3>Connected Accounts</h3> 0222 0223 <div class="box-content"> 0224 0225 <?php if (false === empty($this->member['link_website'])): ?> 0226 <div class="info-social"> 0227 <div class="text"> 0228 <span class="glyphicon glyphicon-globe" style="color:#000; width: 20px;"></span> 0229 <a href="<?php echo $helpAddDefaultScheme->addDefaultScheme($this->member['link_website']); ?>" 0230 target="_NEW" 0231 title="<?php echo $helpAddDefaultScheme->addDefaultScheme($this->member['link_website']); ?>" 0232 ><?php echo $this->member['link_website']; ?></a> 0233 </div> 0234 </div> 0235 <?php endif; ?> 0236 0237 <?php if (false === empty($this->member['link_github'])): ?> 0238 <div class="info-social"> 0239 <div class="text"> 0240 <i class="fa fa-github" aria-hidden="true" style="color:#000; width: 20px;"></i> 0241 <a href="<?php echo 'https://github.com/'.$this->member['link_github']; ?>" target="_NEW"><?php echo $this->member['link_github']; ?></a> 0242 </diV> 0243 </div> 0244 <?php endif; ?> 0245 0246 <?php if (false === empty($this->member['link_facebook'])): ?> 0247 <div class="info-social"> 0248 <div class="text"> 0249 <i class="fa fa-facebook-official" aria-hidden="true" style="color:#000; width: 20px;"></i> 0250 <a href="<?php echo $this->member['link_facebook']; ?>" target="_NEW"><?php echo $helpTruncate->truncate($this->member['link_facebook'],50); ?></a> 0251 </div> 0252 </div> 0253 <?php endif; ?> 0254 0255 <?php if (false === empty($this->member['link_twitter'])): ?> 0256 <div class="info-social"> 0257 <div class="text"> 0258 <i class="fa fa-twitter" aria-hidden="true" style="color:#000; width: 20px;"></i> 0259 <a href="<?php echo $this->member['link_twitter']; ?>" target="_NEW"><?php echo $helpTruncate->truncate($this->member['link_twitter'], 50); ?></a> 0260 </div> 0261 </div> 0262 <?php endif; ?> 0263 0264 <?php if (false === empty($this->member['link_google'])): ?> 0265 <div class="info-social"> 0266 <div class="text"> 0267 <i class="fa fa-google" aria-hidden="true" style="color:#000; width: 20px;"></i> 0268 <a href="<?php echo $this->member['link_google']; ?>" target="_NEW"><?php echo $helpTruncate->truncate($this->member['link_google'],50); ?></a> 0269 </diV> 0270 </div> 0271 <?php endif; ?> 0272 0273 </div> 0274 </div> 0275 </div> 0276 0277 <div class="col-container"> 0278 <div class="well details about"> 0279 <h3>Statistics</h3> 0280 0281 <div class="box-content"> 0282 <div class="info-stat"> 0283 <span class="cnt"><?=count($this->userProducts->toArray())?> </span> Products 0284 </div> 0285 <div class="info-stat"> 0286 <span class="cnt"><?=$this->comments->getTotalItemCount()?> </span> Comments 0287 </div> 0288 <div class="info-stat"> 0289 <span class="cnt"><?=$this->cntPageViewsOverall?> </span> Pageviews 0290 </div> 0291 <div class="info-stat"> 0292 <span class="cnt"><?=$this->cntSupporter?> </span> Supporters 0293 </div> 0294 <div class="info-stat"> 0295 <span class="">Last time active : <?=$helpPrintDate->printDate($this->lastActiveTime)?> </span> 0296 </div> 0297 <div class="info-stat"> 0298 <span class="text">Joined : <?=$helpPrintDate->printDate($this->member['created_at']);?></span> 0299 </div> 0300 </div> 0301 0302 </div> 0303 </div> 0304 0305 <?php 0306 $helperUserRole = new Backend_View_Helper_UserRole(); 0307 $userRoleName = $helperUserRole->userRole(); 0308 if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?> 0309 <div class="col-container"> 0310 <div class="well details about"> 0311 <h3>Admin Panel</h3> 0312 <div class="box-content"> 0313 <div><a id="linktohive" target="_blank" href="http://cp1.hive01.com/usermanager/search.php?username=<?= $this->member['username'] ?>">link to hive</a></div> 0314 <div><a id="delete-this" href="/backend/user/delete?member_id=<?= $this->member['member_id'] ?>">delete user</a></div> 0315 <script> 0316 $('#delete-this').on('click', function (event) { 0317 0318 event.stopPropagation(); 0319 var target = $(this).attr('href'); 0320 0321 $.ajax({ 0322 url: target, 0323 success: function (results) { 0324 alert('User deleted successfully'); 0325 }, 0326 error: function() { 0327 alert('Service is temporarily unavailable.'); 0328 } 0329 }); 0330 0331 return false; 0332 }); 0333 </script> 0334 </div> 0335 </div> 0336 </div> 0337 <?php endif; ?> 0338 0339 </div> 0340 </div> 0341 </div> 0342 0343 </section> 0344 0345 </main>