public function renderImage($attributes, $parameters) { // Get CAPTCHA parameters from the module form's preferences. $pref = ModuleService::getInstance()->getPreferencesDocument('form'); if (!is_null($pref)) { foreach ($pref->getCaptchaParameters() as $name => $value) { // Parameters defined in the template overload the preferences' parameters. if (!isset($parameters[$name])) { $parameters[$name] = $value; } } } self::generateCaptchaCode($parameters); $url = htmlentities(LinkHelper::getUrl('form', 'Captcha', $parameters), ENT_COMPAT, "utf-8"); $code = "<script type=\"text/javascript\">\n//<![CDATA[\nCAPTCHA.imageURL = \"" . $url . "\";\n//]]>\n</script>\n"; $code .= '<span class="captcha"><input type="image" src="' . $url . '"'; if (!isset($attributes['title'])) { $attributes['title'] = f_Locale::translate("&modules.form.bo.general.Captcha-click-to-have-another-one;"); } if (!isset($attributes['onclick'])) { $attributes['onclick'] = 'CAPTCHA.reload(this); return false;'; } foreach ($attributes as $name => $value) { $code .= ' ' . $name . '="' . str_replace('"', '\\"', $value) . '"'; } return $code . '/></span>'; }
/** * @param block_BlockContext $context * @param block_BlockRequest $request */ public function execute($context, $request) { $form = $this->getParameter('form'); $confirmpage = $form->getConfirmpage(); if ($confirmpage instanceof website_persistentdocument_page && $confirmpage->isPublished()) { HttpController::getInstance()->redirectToUrl(LinkHelper::getUrl($confirmpage, $context->getLang(), array('formParam[id]' => $form->getId()))); } $this->setTemplateName('Form-Success'); $user = $context->getGlobalContext()->getUser(); $attr = 'form_success_parameters_' . $form->getId(); $parameters = $user->getAttribute($attr); $user->removeAttribute($attr); $message = $form->getConfirmMessage(); foreach ($parameters as $k => $v) { $message = str_replace('{' . $k . '}', htmlspecialchars($v), $message); } $this->setAttribute("receiverLabels", $this->getParameter("receiverLabels")); $this->setAttribute('message', $message); if ($form->getUseBackLink()) { $this->setAttribute('back', array('url' => $parameters[form_FormConstants::BACK_URL_PARAMETER], 'label' => f_Locale::translate('&modules.form.frontoffice.Back;'))); } else { $this->setAttribute('back', false); } $this->setAttribute('form', $form); }
/** * @param form_persistentdocument_hidden $field * @param DOMElement $fieldElm * @param mixed $rawValue * @return string */ public function buildXmlElementResponse($field, $fieldElm, $rawValue) { switch ($field->getIsRecommand()) { case 'site': return website_WebsiteModuleService::getInstance()->getCurrentWebsite()->getUrl(); break; case 'page': try { return LinkHelper::getUrl(DocumentHelper::getDocumentInstance($rawValue)); } catch (Exception $e) { Framework::exception($e); } return website_WebsiteModuleService::getInstance()->getCurrentWebsite()->getUrl(); } return parent::buildXmlElementResponse($field, $fieldElm, $rawValue); }
/** * @param form_persistentdocument_form $form * @param f_mvc_Request $request * @return String */ protected function getSuccessView($form, $request) { $confirmpage = $form->getConfirmpage(); if ($confirmpage instanceof website_persistentdocument_page && $confirmpage->isPublished()) { HttpController::getInstance()->redirectToUrl(LinkHelper::getDocumentUrl($confirmpage, $this->getLang(), array('formParam[id]' => $form->getId()))); return website_BlockView::NONE; } $user = $this->getContext()->getGlobalContext()->getUser(); $attr = 'form_success_parameters_' . $form->getId(); $parameters = $user->getAttribute($attr); $user->removeAttribute($attr); $message = $form->getConfirmMessage(); foreach ($parameters as $key => $value) { $message = str_replace('{' . $key . '}', htmlspecialchars($value), $message); } $request->setAttribute('message', $message); if ($form->getUseBackLink()) { $request->setAttribute('back', array('url' => $parameters['backUrl'], 'label' => f_Locale::translate('&modules.form.frontoffice.Back;'))); } else { $request->setAttribute('back', false); } return $this->getSuccessTemplateByFullName($form); }
echo $link_view; ?> "><?php echo $row->service_title; ?> </a></div> <?php $attrib = ' style="max-width:38px;" class="pull-left logo img-circle "'; $avatar = JblanceHelper::getLogo($row->user_id, $attrib); echo !empty($avatar) ? LinkHelper::GetProfileLink($row->user_id, $avatar) : ' '; ?> <?php $attrib2 = '"class="logo-name"'; echo LinkHelper::GetProfileLink($row->user_id, $sellerInfo->username, $attrib2); ?> </div> </div> </div> </div> <?php } ?> </div> </div> <?php } else { ?> <div class="alert alert-info"> <?php
public static function getServices($token) { $service_ary = array(); //插入基础功能 $opened_funcs = session('opened_funcs'); $sys_basic_function = array('shouye' => '微网站', 'huiyuanka' => '会员卡', 'dingdan' => '预约\\报名\\预定', 'xiangce' => '微相册', 'panorama' => '全景相册', 'wifi' => '微路由'); $sys_basic_function_tags = array(); Log::write("basic open funcs:" . print_r($opened_funcs, true)); foreach ($sys_basic_function as $key => $value) { //若用户没开通该功能则不显示 if (!empty($opened_funcs) && in_array($key, $opened_funcs)) { array_push($sys_basic_function_tags, array('tag' => $key, 'name' => $value)); } } if ($sys_basic_function_tags && count($sys_basic_function_tags) > 0) { array_push($service_ary, array('name' => '功能模块', 'functions' => $sys_basic_function_tags)); } //插入行业功能 $sys_industry_function = array('shangcheng' => '微商城', 'canyin' => '微餐饮', 'car' => '微汽车'); foreach ($sys_industry_function as $key => $value) { $sys_industry_function_tags = array(); if (!empty($opened_funcs) && in_array($key, $opened_funcs)) { if ($key == 'car') { //汽车行业有多个入口 $sys_industry_function_tags = array(array('tag' => 'car-car', 'name' => '微汽车-所有车型'), array('tag' => 'car-drive', 'name' => '微汽车-预约试驾'), array('tag' => 'car-maintain', 'name' => '微汽车-预约保养'), array('tag' => 'car-tools', 'name' => '微汽车-实用工具'), array('tag' => 'car-care', 'name' => '微汽车-车主关怀'), array('tag' => 'car-sales', 'name' => '微汽车-销售服务')); } else { array_push($sys_industry_function_tags, array('tag' => $key, 'name' => $value)); } array_push($service_ary, array('name' => '行业-' . $value, 'functions' => $sys_industry_function_tags)); } } if (!empty($opened_funcs) && in_array('shouye', $opened_funcs)) { $sys_web_function_tags = array(); //获取微网站可显示栏目信息 $classify_db = D('Classify'); $where['token'] = session('token'); $where['status'] = 1; $where['linktype'] = 'articles'; $classifies = $classify_db->where($where)->order('sorts desc')->select(); foreach ($classifies as $key => $value) { array_push($sys_web_function_tags, array('tag' => "shouye-classify-" . $value['id'], 'name' => '栏目-' . $value['name'])); } //获取微网站可显示文章信息 $sql = 'select a.id,a.title,a.content,c.`name` as classfy_name ' . ' from tp_article as a LEFT JOIN tp_classify as c on a.c_id = c.id ' . " where a.token='{$token}' and a.`status`=1 and a.linktype='articles' and c.`status`=1;"; $Model = new Model(); $articles = $Model->query($sql); foreach ($articles as $key => $value) { array_push($sys_web_function_tags, array('tag' => 'shouye-article-' . $value['id'], 'name' => '文章(' . $value['classfy_name'] . ')-' . $value['title'])); } if ($sys_web_function_tags && count($sys_web_function_tags) > 0) { array_push($service_ary, array('name' => '微网站内容', 'functions' => $sys_web_function_tags)); } } // 插入互动功能 $sys_activities = array('dazhuanpan', 'guaguaka', 'youhuiquan', 'toupiao', 'zajindan'); $sys_activity_tags = array(); foreach ($sys_activities as $act) { if (!empty($opened_funcs) && !in_array($act, $opened_funcs)) { continue; } $details; switch ($act) { case 'dazhuanpan': $details = LinkHelper::getLotteryList($token, 1); $name = '大转盘'; break; case 'guaguaka': $details = LinkHelper::getLotteryList($token, 2); $name = '刮刮卡'; break; case 'youhuiquan': $details = LinkHelper::getLotteryList($token, 3); $name = '优惠券'; break; case 'zajindan': $details = LinkHelper::getLotteryList($token, 4); $name = '砸金蛋'; break; case 'toupiao': $details = LinkHelper::getVoteList($token); $name = '投票'; break; } if ($details != false && is_array($details) && count($details) > 0) { foreach ($details as $key => $value) { array_push($sys_activity_tags, array('tag' => $act . "--" . $value['id'], 'name' => $name . '-' . $value['keyword'])); } } } if ($sys_activity_tags && count($sys_activity_tags) > 0) { array_push($service_ary, array('name' => '互动营销', 'functions' => $sys_activity_tags)); } //插入宾馆行业 $hotels = LinkHelper::getHotels($token); $sys_hotel_tags = array(); if ($hotels && is_array($hotels)) { foreach ($hotels as $key => $value) { $sys_hotel_tags[$key] = array('tag' => 'hotel' . "--" . $value['id'], 'name' => '宾馆-' . $value['keyword']); } } if ($sys_hotel_tags && count($sys_hotel_tags) > 0) { array_push($service_ary, array('name' => '行业-微宾馆', 'functions' => $sys_hotel_tags)); } Log::write("service_ary:" . print_r($service_ary, true)); return $service_ary; }
$link_retract_bid = JRoute::_('index.php?option=com_jblance&task=project.retractbid&id=' . $row->id . '&' . JSession::getFormToken() . '=1'); $link_edit_bid = JRoute::_('index.php?option=com_jblance&view=project&layout=placebid&id=' . $row->project_id); $link_invoice = JRoute::_('index.php?option=com_jblance&view=membership&layout=invoice&id=' . $row->project_id . '&tmpl=component&print=1&type=project&usertype=freelancer'); $link_pay_comp = JRoute::_('index.php?option=com_jblance&task=project.paymentcomplete&id=' . $row->project_id . '&' . JSession::getFormToken() . '=1'); $link_progress = JRoute::_('index.php?option=com_jblance&view=project&layout=projectprogress&id=' . $row->id); // id is the bid id and NOT project id ?> <div id="mybids" class="col-md-4"> <?php echo $model->getLabelProjectStatus($row->proj_status); ?> <div class="thumbnail"> <h5> <?php echo LinkHelper::getProjectLink($row->project_id, $row->project_title); ?> <?php if ($row->status == 'COM_JBLANCE_ACCEPTED') { ?> <span class="label label-primary"><?php echo !empty($row->p_status) ? JText::_($row->p_status) : JText::_('COM_JBLANCE_NOT_YET_STARTED'); ?> </span> <?php } ?> <?php if ($row->assigned_userid == $user->id) { if ($row->status == '') { ?>
?> <img src="components/com_jblance/images/tooltip.png" class="hasTooltip" title="<?php echo $tipmsg; ?> "/> <div class="lineseparator"></div> <?php foreach ($this->projfiles as $projfile) { ?> <label class="checkbox"> <input type="checkbox" name=file-id[] value="<?php echo $projfile->id; ?> " /> <?php echo LinkHelper::getDownloadLink('project', $projfile->id, 'project.download'); ?> </label> <?php } ?> </div> </div> </div> </div> </fieldset> <?php $fields = JblanceHelper::get('helper.fields'); // create an instance of the class fieldsHelper $parents = array();
<?php if ($row->buyer_commission > 0 && $row->status == 'COM_JBLANCE_CLOSED') { ?> <a rel="{handler: 'iframe', size: {x: 650, y: 500}}" href="<?php echo $link_invoice; ?> " class="jb-modal btn btn-link btn-sm"><?php echo JText::_('COM_JBLANCE_PRINT_INVOICE'); ?> </a> <?php if (!empty($bidInfo->attachment)) { ?> <div style="display: inline;"> <?php echo LinkHelper::getDownloadLink('nda', $bidInfo->bidid, 'project.download', 'btn btn-primary btn-small'); ?> </div> <?php } ?> <?php } ?> <ul class="promotions" style="margin-top: 5px;"> <?php if ($row->is_featured) { ?> <li data-promotion="featured"><?php echo JText::_('COM_JBLANCE_FEATURED');
public function getLink() { if ($this->komentoprofile) { return JRoute::_('index.php?option=com_komento&view=profile&id=' . $this->profile->id); } return LinkHelper::GetProfileLink($this->profile->id); }
/** * Returns the URL of the page tagged with the following contextual tag: * contextual_website_website_modules_form_recommand-page * @return String * @deprecated use sharethis module instead. */ public function getRecommandFormUrl() { try { $page = TagService::getInstance()->getDocumentByContextualTag('contextual_website_website_modules_form_recommand-page', website_WebsiteModuleService::getInstance()->getCurrentWebsite()); $parameters = array('formParam[recommandFeature]' => website_WebsiteModuleService::getInstance()->getCurrentPageId()); return LinkHelper::getUrl($page, null, $parameters); } catch (Exception $e) { Framework::exception($e); } return null; }
private function contructClassifyHyperLink($classify) { $token = $classify['token']; $linktype = $classify['linktype']; $link_param_l1 = $classify['link_param_l1']; $link_param_l2 = $classify['link_param_l2']; switch ($linktype) { case 'articles': return U('Wap/Index/lists', array('classid' => $classify['id'], 'token' => $token, 'wxref' => 'mp.weixin.qq.com', 'wecha_id' => $this->wecha_id)); break; case 'subClassifies': return U('Wap/Index/lists', array('classid' => $classify['id'], 'token' => $token, 'wxref' => 'mp.weixin.qq.com', 'wecha_id' => $this->wecha_id)); break; default: return LinkHelper::constructHyperLink($token, $this->wecha_id, $linktype, $link_param_l1, $link_param_l2); } }
public function edit() { $where['id'] = $this->_get('id', 'intval'); $where['token'] = $this->token; $res = D('Flash')->where($where)->find(); $this->assign('info', $res); $this->assign('linktypes', $this->getLinkTypes()); $this->assign('allActivities', LinkHelper::getActivities()); $this->assign('allModules', LinkHelper::getModules()); $this->assign('carModules', LinkHelper::getCarModules()); $home = M('vweb_setting')->where(array('token' => $this->token))->find(); $allTmpls = C('web_homepage_tmpl'); $this->assign('homepage_template', $allTmpls[$home['tmpl_id']]); $this->display(); }
?> </td> <td data-title="<?php echo JText::_('COM_JBLANCE_PROJECT_NAME'); ?> "> <?php echo LinkHelper::getProjectLink($bproject->id, $bproject->project_title); ?> </td> <td data-title="<?php echo JText::_('COM_JBLANCE_RATED_BY'); ?> "> <?php echo LinkHelper::GetProfileLink($bproject->assigned_userid, $freelancer->{$nameOrUsername}); ?> </td> <td data-title="<?php echo JText::_('COM_JBLANCE_RATING_FROM_FREELANCER'); ?> "> <?php $rate = JblanceHelper::getUserRateProject($bproject->publisher_userid, $bproject->id); JblanceHelper::getRatingHTML($rate); ?> </td> <td data-title="<?php echo JText::_('COM_JBLANCE_COMMENTS'); ?> ">
<?php LinkHelper::url('Widget 1 Details', 'Product', 'view', '1'); ?> </div> </div> </div> <div class="unit size1of3"> <h3 class="tcenter">Widget2</h3> <img class="center" src="img/widget02.png" alt="Widget 2" /> <div class="innerColWrap"> <p>This paragraph describes how awesome widget2 is. You know you want it.</p> <div class="action center"> <?php LinkHelper::url('Widget 2 Details', 'Product', 'view', '2'); ?> </div> </div> </div> <div class="unit size1of3"> <h3 class="tcenter">Widget3</h3> <img class="center" src="img/widget03.png" alt="Widget 3" /> <div class="innerColWrap"> <p>This paragraph describes how awesome widget3 is. You know you want it.</p> <div class="action center"> <?php LinkHelper::url('Widget 3 Details', 'Product', 'view', '3'); ?> </div> </div> </div> </div>
public function edit() { $cls_id = $this->_get('id', 'intval'); $where['id'] = $cls_id; $where['token'] = session('token'); $where['status'] = array('in', array('1', '0')); $classify_db = M('Classify'); $info = $classify_db->where($where)->find(); if ($info) { $this->assign('info', $info); $other_where['token'] = session('token'); $other_where['status'] = array('in', array('1', '0')); $other_where['parent'] = array('neq', $cls_id); $other_cls = $classify_db->where($other_where)->select(); $this->assign('otherCls', $other_cls); $this->assign('linktypes', $this->getLinkTypes()); $this->assign('allActivities', LinkHelper::getActivities()); $this->assign('allModules', LinkHelper::getModules()); $this->assign('carModules', LinkHelper::getCarModules()); $this->assign('sub_cls', $this->getSubClassifies($cls_id)); $home = M('vweb_setting')->where(array('token' => session('token')))->find(); $allTmpls = C('web_homepage_tmpl'); $this->assign('homepage_template', $allTmpls[$home['tmpl_id']]); $all_cls_tmpls = C('web_classify_tmpl'); $this->assign('classify_tmpls', $all_cls_tmpls); $this->display(); } else { $this->error('该栏目不存在', U(MODULE_NAME . '/index')); } }
<ul class="nav center ptl"> <li class="action"> <?php LinkHelper::url('Browse Widgets', 'Product'); ?> </li> </ul> <div class="ptl"> <?php if (!isset($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO'] != '/Cart') { $linkImg = '<img class="center" src="' . WEBPATH . 'img/cart.png" alt="cart" width="45" height="39" />'; if (isset($_SESSION['cart']) && !empty($_SESSION['cart'])) { LinkHelper::url($linkImg, 'Cart'); echo '<div class="action center ptl">'; LinkHelper::url('View your cart', 'Cart'); echo '</div>'; } else { echo $linkImg; echo '<div class="center ptl">'; echo 'Your cart is empty'; echo '</div>'; } } ?> </div> </div> <div class="main"> <div class="innerCol ptm pbm"> <?php
<p> <?php if ($message->approved == 1) { echo $message->message; } else { echo '<small>' . JText::_('COM_JBLANCE_PRIVATE_MESSAGE_WAITING_FOR_MODERATION') . '</small>'; } ?> </p> <?php if (!empty($message->attachment) && $message->approved == 1) { ?> <span> <i class="icon-download"></i> <?php echo LinkHelper::getDownloadLink('message', $message->id, 'message.download'); ?> </span> <?php } ?> </div> </li> <?php } ?> </ul> </div> <?php } ?>
echo !empty($avatar) ? LinkHelper::GetProfileLink($row->user_id, $avatar, '', '', ' pull-left') : ' '; ?> <div class="media-body"> <h5 class="media-heading"> <?php $stats = $status ? 'online' : 'offline'; ?> <span class="online-status <?php echo $stats; ?> " title="<?php echo JText::_('COM_JBLANCE_' . strtoupper($stats)); ?> "></span> <?php echo LinkHelper::GetProfileLink($row->user_id, $row->name); ?> <small><?php echo $row->username; ?> </small> <span id="fav-msg-<?php echo $row->user_id; ?> " class="pull-right"> <?php if ($isFavourite > 0) { ?> <a onclick="favourite('<?php echo $row->user_id; ?>
?> "></div> <div id="file-attached-portfolioattachment<?php echo $i; ?> "></div> </div> <div class="col-md-6"> <?php if (!empty($this->row->{$attachmentColumnNum})) { ?> <div class=""><em><?php echo JText::_('COM_JBLANCE_OLD_FILE'); ?> : </em><?php echo LinkHelper::getPortfolioDownloadLink('portfolio', $this->row->id, 'user.download', $attachmentColumnNum); //echo LinkHelper::GetHrefLink($fileUrl, $showName); ?> </div> <?php } ?> </div> </li> <?php } ?> </ul> </div>
function pathway() { global $mainframe; $Itemid = $this->getItemid(); require_once JPATH_SITE . DS . 'components' . DS . 'com_properties' . DS . 'helpers' . DS . 'link.php'; $breadcrumbs =& $mainframe->getPathWay(); $link = 'index.php?option=com_properties&view=properties&Itemid=' . $Itemid; if (JRequest::getVar('cyid')) { $cyid = JRequest::getVar('cyid', 0, '', 'int'); $query = ' SELECT cy.*, ' . ' CASE WHEN CHAR_LENGTH(cy.alias) THEN CONCAT_WS(":",cy.id, cy.alias) ELSE cy.id END as CYslug' . ' FROM #__properties_country as cy ' . ' WHERE cy.id = ' . $cyid; $this->_db->setQuery($query); $this->_dataCountry = $this->_db->loadObject($query); $link .= '&cyid=' . $this->_dataCountry->CYslug; $breadcrumbs->addItem($this->_dataCountry->name, JRoute::_($link)); } if (JRequest::getVar('sid')) { $sid = JRequest::getVar('sid', 0, '', 'int'); $query = ' SELECT s.*, ' . ' CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(":",s.id, s.alias) ELSE s.id END as Sslug' . ' FROM #__properties_state as s ' . ' WHERE s.id = ' . $sid; $this->_db->setQuery($query); $this->_dataState = $this->_db->loadObject($query); $link .= '&sid=' . $this->_dataState->Sslug; $breadcrumbs->addItem($this->_dataState->name, JRoute::_($link)); } if (JRequest::getVar('lid')) { $lid = JRequest::getVar('lid', 0, '', 'int'); $query = ' SELECT l.*, ' . ' CASE WHEN CHAR_LENGTH(l.alias) THEN CONCAT_WS(":",l.id, l.alias) ELSE l.id END as Lslug' . ' FROM #__properties_locality as l ' . ' WHERE l.id = ' . $lid; $this->_db->setQuery($query); $this->_dataLocality = $this->_db->loadObject($query); $link .= '&lid=' . $this->_dataLocality->Lslug; $breadcrumbs->addItem($this->_dataLocality->name, JRoute::_($link)); } if (JRequest::getVar('cid')) { $cid = JRequest::getVar('cid', 0, '', 'int'); $query = ' SELECT c.*, ' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":",c.id, c.alias) ELSE c.id END as Cslug' . ' FROM #__properties_category as c ' . ' WHERE c.id = ' . $cid; $this->_db->setQuery($query); $this->_dataCategory = $this->_db->loadObject($query); $query2 = ' SELECT c.*, ' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":",c.id, c.alias) ELSE c.id END as Cslug' . ' FROM #__properties_category as c ' . ' WHERE c.id = ' . $this->_dataCategory->parent; $this->_db->setQuery($query2); $this->_dataParentCategory = $this->_db->loadObject($query2); if ($this->_dataParentCategory) { $link2 = $link .= '&cid=' . $this->_dataParentCategory->Cslug; $link = LinkHelper::getLink('properties', 'showcategory', '', '', '', '', $this->_dataParentCategory->Cslug, '', ''); $breadcrumbs->addItem($this->_dataParentCategory->name, JRoute::_($link)); } $link3 = $link .= '&cid=' . $this->_dataCategory->Cslug; $link = LinkHelper::getLink('properties', 'showcategory', '', '', '', '', $this->_dataParentCategory->Cslug, '', ''); $breadcrumbs->addItem($this->_dataCategory->name, JRoute::_($link)); } if (JRequest::getVar('tid')) { $tid = JRequest::getVar('tid', 0, '', 'int'); $query = ' SELECT t.*, ' . ' CASE WHEN CHAR_LENGTH(t.alias) THEN CONCAT_WS(":",t.id, t.alias) ELSE t.id END as Tslug' . ' FROM #__properties_type as t ' . ' WHERE t.id = ' . $tid; $this->_db->setQuery($query); $this->_dataType = $this->_db->loadObject($query); $link .= '&tid=' . $this->_dataType->Tslug; $link = LinkHelper::getLink('properties', 'showcategory', '', '', '', '', $this->_dataParentCategory->Cslug, $this->_dataType->Tslug, ''); $breadcrumbs->addItem($this->_dataType->name, JRoute::_($link)); } }
<?php } ?> <?php if ($show_publisher == 1) { ?> <td data-title="<?php echo JText::_('MOD_JBLANCE_PUBLISHER'); ?> "> <?php $attrib = 'class="img-thumbnail" style="width: auto; height: 45px;"'; echo JblanceHelper::getLogo($row->publisher_userid, $attrib); ?> <?php echo LinkHelper::GetProfileLink($row->publisher_userid, $buyer->{$nameOrUsername}); ?> </td> <?php } ?> </tr> <?php $k = 1 - $k; } ?> </tbody> </table> </div> <p class="text-center"> <a href="<?php
function getViewProfile() { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $user = JFactory::getUser(); $userid = $app->input->get('id', $user->id, 'int'); //get the user id from 'get' variable; else default is current user id $isUserBlocked = JFactory::getUser($userid)->block; //redirect the user to dashboard if the user is blocked. if ($isUserBlocked == 1) { $msg = JText::_('COM_JBLANCE_USER_ACCOUNT_BANNED_VIEWING_PROFILE_NOT_POSSIBLE'); $link_dash = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false); $app->enqueueMessage($msg, 'error'); $app->redirect($link_dash); } //redirect to the appropriate extension based on integration $profileInteg = JblanceHelper::getProfile(); if (!$profileInteg instanceof JoombriProfileJoombri) { $url = LinkHelper::GetProfileURL($userid, false); if ($url) { $app->redirect($url); } } $jbuser = JblanceHelper::get('helper.user'); // create an instance of the class UserHelper $userInfo = $jbuser->getUser($userid); $jbfields = JblanceHelper::get('helper.fields'); // create an instance of the class FieldsHelper $fields = $jbfields->getUserGroupTypeFields($userInfo->ug_id); //freelancer projects $query = "SELECT p.*,r.comments FROM #__jblance_project p " . "LEFT JOIN #__jblance_rating r ON r.project_id=p.id " . "WHERE p.assigned_userid =" . $db->quote($userid) . " AND p.status='COM_JBLANCE_CLOSED' AND r.target=" . $db->quote($userid) . " " . "ORDER BY p.id DESC LIMIT 10"; $db->setQuery($query); $fprojects = $db->loadObjectList(); //freelancer rating $query = "SELECT AVG(quality_clarity) quality_clarity,AVG(communicate) communicate,AVG(expertise_payment) expertise_payment, " . "AVG(professional) professional,AVG(hire_work_again) hire_work_again FROM #__jblance_rating " . "WHERE target=" . $db->quote($userid) . " AND quality_clarity<>0 AND rate_type='COM_JBLANCE_FREELANCER'"; $db->setQuery($query); $frating = $db->loadObject(); //buyer projects $query = "SELECT p.*,r.comments FROM #__jblance_project p " . "LEFT JOIN #__jblance_rating r ON r.project_id=p.id " . "WHERE p.publisher_userid =" . $db->quote($userid) . " AND r.target=" . $db->quote($userid) . " " . "ORDER BY p.id DESC LIMIT 10"; $db->setQuery($query); $bprojects = $db->loadObjectList(); //buyer rating $query = "SELECT AVG(quality_clarity) quality_clarity,AVG(communicate) communicate,AVG(expertise_payment) expertise_payment, " . "AVG(professional) professional,AVG(hire_work_again) hire_work_again FROM #__jblance_rating " . "WHERE target=" . $db->quote($userid) . " AND quality_clarity <> 0 AND rate_type='COM_JBLANCE_BUYER'"; $db->setQuery($query); $brating = $db->loadObject(); $query = "SELECT * FROM #__jblance_portfolio WHERE user_id =" . $db->quote($userid) . " AND published=1"; $db->setQuery($query); $portfolios = $db->loadObjectList(); $return[0] = $userInfo; $return[1] = $fields; $return[2] = $fprojects; $return[3] = $frating; $return[4] = $bprojects; $return[5] = $brating; $return[6] = $portfolios; return $return; }
public function edit() { $id = $this->_get('id', 'intval'); $uid = session('uid'); $token = session('token'); $db = D('article'); $where['uid'] = $uid; $where['token'] = $token; $where['id'] = $id; $where['status'] = 1; $article = $db->where($where)->find(); $this->assign('article', $article); $where = array(); $where['token'] = $token; $where['status'] = 1; // 只显示链接类型为文章列表的栏目, 其他栏目不能包含文章 $where['linktype'] = 'articles'; $db = M('Classify'); $cls = $db->where($where)->select(); $this->assign('cls', $cls); $this->assign('linktypes', $this->getLinkTypes()); $this->assign('allActivities', LinkHelper::getActivities()); $this->assign('allModules', LinkHelper::getModules()); $this->assign('carModules', LinkHelper::getCarModules()); $this->display(); }
} else { for ($i = 0, $n = count($this->bids); $i < $n; $i++) { $bid = $this->bids[$i]; ?> <div class="row"> <div class="col-sm-4 col-md-1"> <?php $attrib = 'width=auto height=auto class="img-thumbnail"'; $avatar = JblanceHelper::getLogo($bid->user_id, $attrib); echo !empty($avatar) ? LinkHelper::GetProfileLink($bid->user_id, $avatar) : ' '; ?> </div> <div class="col-sm-4 col-md-7"> <h5 class="media-heading"> <?php echo LinkHelper::GetProfileLink(intval($bid->user_id), $this->escape($bid->{$nameOrUsername})); ?> </h5> <p><?php echo $bid->details ? $bid->details : JText::_('COM_JBLANCE_DETAILS_NOT_PROVIDED'); ?> </p> <?php $rate = JblanceHelper::getAvarageRate($bid->user_id, true); ?> </div> <div class="col-sm-4 col-md-4"> <div class="text-center"> <span class="font20"><?php
?> </p> <p> <span title="<?php echo JText::_('COM_JBLANCE_BID_DATE'); ?> "><i class="material-icons">event</i> <?php echo JHtml::_('date', $row->bid_date, $dformat); ?> </span> <!-- Show attachment if found --> <?php if (!empty($row->attachment)) { ?> | <span><?php echo LinkHelper::getDownloadLink('nda', $row->id, 'project.download'); ?> </span> <?php } ?> </p> </div> <div class="col-md-2"> <?php $rate = JblanceHelper::getAvarageRate($row->user_id, true); ?> </div> <div class="col-md-4"> <div class="text-center"> <span class="font20">
?> <div class="col-md-2 col-sm-4 col-xs-6"> <div class="thumbnail"> <a class="thumbnail" href= "<?php echo $link_detail; ?> "> <?php if ($show_logo) { $attrib = 'class="img-responsive"'; echo JblanceHelper::getLogo($row->user_id, $attrib); } ?> </a> <div class="media-body"> <h5 class="text-center"> <?php echo LinkHelper::GetProfileLink($row->user_id, $row->{$nameOrUsername}); ?> </h5> <?php if ($show_rating == 1) { JblanceHelper::getAvarageRate($row->user_id, 1); } ?> </div> </div> </div> <?php }
} } elseif ($show_type == 'message') { if (count($rows)) { for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $userDtl = JFactory::getUser($row->idFrom); ?> <div class="media jb-borderbtm-dot"> <?php $attribs = 'class="pull-left img-thumbnail" style="width: auto; height: 60px;"'; $avatar = JblanceHelper::getLogo($row->idFrom, $attribs); echo $avatar; ?> <div class="media-body"> <?php echo LinkHelper::GetProfileLink($row->idFrom, $userDtl->username); ?> <br> <?php if ($row->approved == 1) { echo $row->message; } else { echo '<small>' . JText::_('COM_JBLANCE_PRIVATE_MESSAGE_WAITING_FOR_MODERATION') . '</small>'; } ?> <div> <i class="material-icons">date_range</i> <?php echo JHtml::_('date', $row->date_sent, $dformat, true); ?> </div> </div>
$rate = JblanceHelper::getUserRating($rating->target, $rating->order_id, 'COM_JBLANCE_SERVICE'); $rateDate = JFactory::getDate($rating->rate_date); ?> <div class="media"> <div class="col-md-1 col-xs-3 col-sm-3"> <?php $attrib = 'width=56px; height=56px; class="img-responsive"'; $avatar = JblanceHelper::getLogo($rating->actor, $attrib); echo !empty($avatar) ? LinkHelper::GetProfileLink($rating->actor, $avatar, '', '', ' pull-left') : ' '; ?> </div> <div class="media-body"> <span class="media-heading boldfont"><?php echo LinkHelper::GetProfileLink($rating->actor); ?> </span> <span class="dis-inl-blk"><?php echo JblanceHelper::getRatingHTML($rate); ?> </span> <span class="dis-inl-blk font12"><?php echo JblanceHelper::showTimePastDHM($rateDate, 'SHORT'); ?> </span> <div><?php echo $rating->comments; ?> </div> </div>
/** * Get model * * @param null|string $model */ public static function setModel($model) { self::$model = Inflector::singularize($model); }