Esempio n. 1
0
 /**
  * Draws a form posting to $getParams with CSS class $cssClass around $settings with $warnings at top, and $formHiddens hidden elements. Also add validation languages into head.
  *
  * @param  string        $settings
  * @param  string        $warning
  * @param  string[]      $formHiddens
  * @param  string|array  $getParams
  * @param  string|null   $cssClass
  * @return string
  */
 public function drawForm($settings, $warning, $formHiddens, $getParams, $cssClass = null)
 {
     $html = '';
     if ($warning) {
         $html .= '<div class="alert alert-danger">' . $warning . '</div>' . "\n";
     }
     if (is_array($getParams)) {
         $postUrl = 'index.php';
         if ($getParams && count($getParams) > 0) {
             foreach ($getParams as $k => $v) {
                 $getParams[$k] = $k . '=' . htmlspecialchars(urlencode($v));
             }
             $postUrl .= '?' . implode('&', $getParams);
         }
     } else {
         $postUrl = $getParams;
     }
     if ($formHiddens !== null) {
         cbValidator::loadValidation();
         $html .= '<form enctype="multipart/form-data" action="' . cbSef($postUrl) . '" method="post" name="adminForm" id="cbAdminFormForm" class="cb_form form-auto cbValidation cbregfrontendform' . ($cssClass ? ' ' . $cssClass : '') . '">' . "\n";
     }
     if ($formHiddens !== null) {
         foreach ($formHiddens as $k => $v) {
             $html .= "\t" . '<input type="hidden" name="' . htmlspecialchars($k) . '" value="' . htmlspecialchars($v) . '" />' . "\n";
         }
         $html .= cbGetSpoofInputTag('plugin');
     }
     $html .= $settings;
     if ($formHiddens !== null) {
         $html .= "</form>\n";
     }
     return $html;
 }
Esempio n. 2
0
 public function getInboxURL()
 {
     $userid = $this->getCBUserid();
     if ($userid === null) {
         return null;
     }
     $itemid = getCBprofileItemid();
     return cbSef('index.php?option=com_comprofiler&task=userProfile&user=' . $userid . $itemid);
 }
Esempio n. 3
0
	public function getProfileURL($user, $task='', $xhtml = true)
	{
		$user = KunenaFactory::getUser($user);
		if ($user->userid == 0) return false;
		// Get CUser object
		$cbUser = CBuser::getInstance( $user->userid );
		if($cbUser === null) return false;
		return cbSef( 'index.php?option=com_comprofiler&task=userProfile&user=' . $user->userid. getCBprofileItemid(), $xhtml );
	}
Esempio n. 4
0
 static function getReturnURL($params, $type)
 {
     global $cbSpecialReturnAfterLogin, $cbSpecialReturnAfterLogout;
     static $returnUrl = null;
     if (!isset($returnUrl)) {
         $returnUrl = Application::Input()->get('get/return', '', GetterInterface::BASE64);
         if ($returnUrl) {
             $returnUrl = base64_decode($returnUrl);
             if (!JUri::isInternal($returnUrl)) {
                 // The URL isn't internal to the site; reset it to index to be safe:
                 $returnUrl = 'index.php';
             }
         } else {
             $isHttps = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
             $returnUrl = 'http' . ($isHttps ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];
             if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
                 $returnUrl .= $_SERVER['REQUEST_URI'];
             } else {
                 $returnUrl .= $_SERVER['SCRIPT_NAME'];
                 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
                     $returnUrl .= '?' . $_SERVER['QUERY_STRING'];
                 }
             }
         }
         $returnUrl = cbUnHtmlspecialchars(preg_replace('/[\\\\"\\\'][\\s]*javascript:(.*)[\\\\"\\\']/', '""', preg_replace('/eval\\((.*)\\)/', '', htmlspecialchars(urldecode($returnUrl)))));
         if (preg_match('/index.php\\?option=com_comprofiler&task=confirm&confirmCode=|index.php\\?option=com_comprofiler&view=confirm&confirmCode=|index.php\\?option=com_comprofiler&task=login|index.php\\?option=com_comprofiler&view=login/', $returnUrl)) {
             $returnUrl = 'index.php';
         }
     }
     $secureForm = (int) $params->get('https_post', 0);
     if ($type == 'login') {
         $loginReturnUrl = $params->get('login', $returnUrl);
         if (isset($cbSpecialReturnAfterLogin)) {
             $loginReturnUrl = $cbSpecialReturnAfterLogin;
         }
         $url = cbSef($loginReturnUrl, true, 'html', $secureForm);
     } elseif ($type == 'logout') {
         $logoutReturnUrl = $params->get('logout', 'index.php');
         if ($logoutReturnUrl == '#') {
             $logoutReturnUrl = $returnUrl;
         }
         if (isset($cbSpecialReturnAfterLogout)) {
             $logoutReturnUrl = $cbSpecialReturnAfterLogout;
         }
         $url = cbSef($logoutReturnUrl, true, 'html', $secureForm);
     } else {
         $url = $returnUrl;
     }
     return base64_encode($url);
 }
Esempio n. 5
0
	public function getInboxLink ($text) {
		if (!$text) $text = JText::_('COM_KUNENA_PMS_INBOX');
		global $_CB_framework;

		$cbpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
		if (file_exists($cbpath)) require_once($cbpath);
		else return;

		$userid = $_CB_framework->myId();

		$cbUser =& CBuser::getInstance( (int) $userid );
		if($cbUser === null) return;

		$itemid = getCBprofileItemid();

		return CKunenaLink::GetHrefLink ( cbSef ('index.php?option=com_comprofiler&task=userProfile&user='******'', 'follow');
	}
Esempio n. 6
0
 public function showIcon($userid)
 {
     global $_CB_framework, $_CB_PMS;
     $myid = $_CB_framework->myId();
     // Don't send messages from/to anonymous and to yourself
     if ($myid == 0 || $userid == 0 || $userid == $myid) {
         return '';
     }
     outputCbTemplate($_CB_framework->getUi());
     $resultArray = $_CB_PMS->getPMSlinks($userid, $myid, '', '', 1);
     $html = '';
     if (count($resultArray) > 0) {
         $linkItem = '<span class="pm" alt="' . JText::_('COM_KUNENA_VIEW_PMS') . '" />';
         foreach ($resultArray as $res) {
             if (is_array($res)) {
                 $html .= '<a href="' . cbSef($res["url"]) . '" title="' . getLangDefinition($res["tooltip"]) . '">' . $linkItem . '</a> ';
             }
         }
     }
     return $html;
 }
 /**
  * USED by XML interface ONLY !!! Renders url for the product
  *
  * @param  string           $value    Variable value ( 'massexpire' )
  * @param  ParamsInterface  $params
  * @return string                     HTML to display
  */
 public function renderUrlOfAutoExpiry($value, $params)
 {
     $url = 'index.php?option=com_comprofiler&amp;task=pluginclass&amp;plugin=cbpaidsubscriptions&amp;do=' . htmlspecialchars($value) . '&amp;key=' . md5($params->get('license_number'));
     $url = cbSef($url, true, 'raw');
     return '<a href="' . $url . '" target="_blank">' . $url . '</a>';
 }
Esempio n. 8
0
 /**
  * Reformats a PHP array of links into $output format
  *
  * @param  FieldTable         $field
  * @param  array              $links
  * @param  string             $output    'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist', 'htmledit'
  * @return string|array|null
  */
 protected function _linksArrayToFormat($field, $links, $output)
 {
     $values = array();
     switch ($output) {
         case 'xml':
             foreach ($links as $link) {
                 if (isset($link['url'])) {
                     $values[] = '<link>' . '<url>' . cbSef($link['url']) . '</url>' . '<title>' . htmlspecialchars($link['title']) . '</title>' . '<tooltip>' . htmlspecialchars(CBTxt::T($link['tooltip'])) . '</tooltip>' . '</link>';
                 }
             }
             return '<' . htmlspecialchars($field->name) . '>' . implode('', $values) . '</' . htmlspecialchars($field->name) . '>';
             break;
         case 'json':
             foreach ($links as $link) {
                 if (isset($link['url'])) {
                     $values[] = array('url' => cbSef($link['url']), 'link' => $link['title'], 'tooltip' => CBTxt::T($link['tooltip']));
                 }
             }
             return "'" . addslashes($field->name) . "' : " . json_encode($values, JSON_FORCE_OBJECT);
             break;
         case 'csv':
             foreach ($links as $link) {
                 if (isset($link['url'])) {
                     $values[] = cbSef($link['url']);
                 }
             }
             return $this->_formatFieldOutput($field->name, implode(',', $values), $output, false);
             break;
         default:
             foreach ($links as $link) {
                 if (isset($link['url'])) {
                     $values[] = '<a href="' . cbSef($link['url']) . '" title="' . htmlspecialchars(CBTxt::T($link['tooltip'])) . '">' . $link['title'] . '</a>';
                 }
             }
             return $this->_arrayToFormat($field, $values, $output, ' ', '', false);
             break;
     }
 }
	/**
	 * Generates HTML for favorites in forum tab
	 *
	 * @param object  $template
	 * @param object  $forum
	 * @param object  $model
	 * @return mixed
	 */
	function ShowFavorites( $template, $forum, $model ) {
		$html					=	null;
		$oneOrTwo				=	1;
	
		if ( $template->favorites ) {
			$html				.=	'<br /><table width="100%" cellspacing="0" cellpadding="3" border="0">'
								.	'<thead>'
								.		'<tr class="sectiontableheader">'
								.			'<th colspan="4">' . CBTxt::T( 'Your Favorites' ) . '</th>'
								.		'</tr>'
								.		'<tr class="sectiontableheader">'
								.			'<th width="20%">' . $template->titles->date . '</th>'
								.			'<th width="45%">' . $template->titles->subject . '</th>'
								.			'<th width="25%">' . $template->titles->category . '</th>'
								.			'<th width="10%">' . CBTxt::T( 'Action' ) . '</th>'
								.		'</tr>'
								.	'</thead>'
								.	'<tbody>';
			
			foreach ( $template->favorites as $item ) {
				$unsubURL		=	cbSef( $template->unFavThreadURL . $item->thread );
				$postURL		=	cbSef( 'index.php?option=' . $forum->component . $forum->itemid . '&amp;func=view&amp;catid='. $item->catid . '&amp;id=' . $item->id );
				$catURL			=	cbSef( 'index.php?option=' . $forum->component . $forum->itemid . '&amp;func=' . ( $forum->component == 'com_kunena' ? 'showcat' : 'view' ) . '&amp;catid='. $item->catid );
					
				$html			.=	'<tr class="sectiontableentry' . $oneOrTwo . '">'
								.		'<td>' . getFieldValue( 'date', date( 'Y-m-d, H:i:s', $item->time ) ) . '</td>'
								.		'<td><a href="' . $postURL . '">' . htmlspecialchars( stripslashes( $item->subject ) ) . '</a></td>'
								.		'<td><a href="' . $catURL . '">' . htmlspecialchars( stripslashes( $item->catname ) ) . '</a></td>'
								.		'<td><a href="javascript:void(0);" onclick="javascript:if ( confirm(\'' . CBTxt::T( "Are you sure you want to remove this favorite thread?" ) . '\') ) { location.href=\'' . $unsubURL . '\'; }">' . CBTxt::T( 'Remove' ) . '</a></td>'
								.	'</tr>';
				$oneOrTwo		=	( $oneOrTwo == 1 ? 2 : 1 );
			}
	
			$html				.=	'</tbody>'
								.	'</table>';
								
			if ( $template->showPaging ) {
				$html			.=	'<br /><div style="width:95%;text-align:center;">' . $template->paging . '</div>';
			}
								
			$html				.=	'<br /><div style="width:95%;text-align:center;"><input type="button" class="button" onclick="javascript:if ( confirm(\'' . CBTxt::T( "Are you sure you want to remove all your favorite threads?" ) . '\') ) { location.href=\'' . $template->unFavAllURL . '\'; }" value="' . CBTxt::T( 'Remove All' ) . '" /></div>';		
		} else {
			$html				.=	'<br /><div>' . CBTxt::T( 'No favorites found for you.' ) . '</div>';
		}
		
		return $html;
	}
Esempio n. 10
0
 public function getEditURL()
 {
     return cbSef('index.php?option=com_comprofiler&task=userAvatar' . getCBprofileItemid());
 }
Esempio n. 11
0
	/**
	 * @param  int|OrderedTable  $row
	 * @param  boolean           $htmlspecialchars
	 * @return string
	 */
	static public function getUrl( $row, $htmlspecialchars = true )
	{
		if ( is_object( $row ) ) {
			$id		=	$row->get( 'id' );
		} else {
			$id		=	$row;
		}

		return cbSef( 'index.php?option=com_comprofiler&view=pluginclass&plugin=cbconsultations&action=consultations&func=show&id=' . (int) $id, $htmlspecialchars );
	}
	/**
	 * Generates icon for PM link
	 *
	 * @param moscomprofilerUser $user
	 * @param string             $mode
	 * @return mixed
	 */
	function getPMIcon( $user, $mode = 'kunena' ) {
		global $_CB_PMS, $_CB_framework;
		
		$url												=	null;
		
		if ( $user->id ) {
			$resultArray									=	$_CB_PMS->getPMSlinks( $user->id, $_CB_framework->myId(), null, null, 1 );
			
			if ( count( $resultArray ) > 0 ) {
				foreach ( $resultArray as $res ) {
					if ( is_array( $res ) ) {
						$url								=	cbSef( $res['url'] );
					}
				}
			}
			
			if ( $url ) {
				$icon										=	$this->getFieldIcon( $user->username, CBTxt::T( 'Send Private Message: ' ), 'pm.gif', null, $mode );
				$format										=	'<a href="' . $url . '">' . $icon . '</a>';
			}
		}
		
		return ( $url ? $format : null );
	}
Esempio n. 13
0
 /**
  * output points field html display
  *
  * @param  FieldTable  $field
  * @param  UserTable   $user
  * @param  string      $reason
  * @param  boolean     $ajax
  * @return string
  */
 private function getPointsHTML(&$field, &$user, $reason, $ajax = false)
 {
     global $_CB_framework;
     static $JS_loaded = 0;
     $userId = (int) $user->get('id');
     $fieldName = $field->get('name');
     $value = (int) $user->get($fieldName);
     $readOnly = $this->_isReadOnly($field, $user, $reason);
     $maxPoints = (int) $field->params->get('integer_maximum', '1000000');
     $pointsLayout = $field->params->get('points_layout', '');
     $userlistIncrement = (int) $field->params->get('points_list', 0);
     $userlistAccess = false;
     if ($reason == 'list') {
         $fieldName = $fieldName . $userId;
         if ($userlistIncrement) {
             $userlistAccess = true;
         }
     }
     $canIncrement = !$readOnly && $this->getIncrementAccess($field, $user) && ($reason == 'list' && $userlistAccess || $reason != 'list');
     if ($canIncrement) {
         $plusCSS = $field->params->get('points_plus_class', '');
         $minusCSS = $field->params->get('points_minus_class', '');
         $plusIcon = '<span class="' . ($plusCSS ? htmlspecialchars($plusCSS) : 'fa fa-plus-circle fa-lg') . '"></span>';
         $minusIcon = '<span class="' . ($minusCSS ? htmlspecialchars($minusCSS) : 'fa fa-minus-circle fa-lg') . '"></span>';
         $replace = array('[plus]' => $value < $maxPoints ? '<span class="cbPointsFieldIncrement cbPointsFieldIncrementPlus" data-value="plus" data-field="' . $field->get('name') . '" data-target="' . $userId . '">' . $plusIcon . '</span>' : null, '[minus]' => $value > 0 ? '<span class="cbPointsFieldIncrement cbPointsFieldIncrementMinus" data-value="minus" data-field="' . $field->get('name') . '" data-target="' . $userId . '">' . $minusIcon . '</span>' : null, '[value]' => '<span class="cbPointsFieldValue">' . $value . '</span>');
         if ($pointsLayout) {
             $pointsLayout = CBTxt::Th($pointsLayout, null, $replace);
         } else {
             $pointsLayout = CBTxt::Th('POINTS_FIELD_LAYOUT_VALUE_PLUS_MINUS', '[value] [plus] [minus]', $replace);
         }
         if ($ajax) {
             $return = $pointsLayout;
         } else {
             $return = '<span id="' . $fieldName . 'Container" class="cbPointsField' . ($userlistAccess ? ' cbClicksInside' : null) . '">' . $pointsLayout . '</span>';
             if (!$JS_loaded++) {
                 cbGetRegAntiSpamInputTag();
                 $cbGetRegAntiSpams = cbGetRegAntiSpams();
                 $js = "\$( '.cbPointsField' ).on( 'click', '.cbPointsFieldIncrement', function ( e ) {" . "var points = \$( this ).parents( '.cbPointsField' );" . "var increment = \$( this ).data( 'value' );" . "var field = \$( this ).data( 'field' );" . "var target = \$( this ).data( 'target' );" . "\$.ajax({" . "type: 'POST'," . "url: '" . addslashes(cbSef('index.php?option=com_comprofiler&view=fieldclass&function=savevalue&reason=' . urlencode($reason), false, 'raw')) . "'," . "data: {" . "field: field," . "user: target," . "value: increment," . cbSpoofField() . ": '" . addslashes(cbSpoofString(null, 'fieldclass')) . "'," . cbGetRegAntiSpamFieldName() . ": '" . addslashes($cbGetRegAntiSpams[0]) . "'" . "}" . "}).done( function( data, textStatus, jqXHR ) {" . "points.html( data );" . "});" . "});";
                 $_CB_framework->outputCbJQuery($js);
             }
         }
     } else {
         $return = parent::getField($field, $user, 'html', $reason, 0);
     }
     return $return;
 }
Esempio n. 14
0
	/**
	* Generates the menu and user status to display on the user profile by calling back $this->addMenu
	* @param  moscomprofilerTab   $tab       the tab database entry
	* @param  moscomprofilerUser  $user      the user being displayed
	* @param  int                 $ui        1 for front-end, 2 for back-end
	* @return boolean                        either true, or false if ErrorMSG generated
	*/
	function getMenuAndStatus( $tab, $user, $ui ) {
		global $_CB_framework, $_CB_database, $ueConfig,$_REQUEST,$_POST;

		$params				=	$this->params;

		$Itemid				=	getCBprofileItemid( 0 );

		// Build basic menu:
		$ue_base_url		 = "index.php?option=com_comprofiler";
		if ( $Itemid ) {
			$ue_base_url	.= "&amp;Itemid=" . $Itemid;	// Base URL string
		}
		$ue_credits_url		 = $ue_base_url."&amp;task=teamCredits";
		$ue_userdetails_url	 = $ue_base_url."&amp;task=userDetails" . $this->_addUid( $user );
		$ue_useravatar_url	 = $ue_base_url."&amp;task=userAvatar" . $this->_addUid( $user );
		$ue_deleteavatar_url = $ue_base_url."&amp;task=userAvatar&amp;do=deleteavatar" . $this->_addUid( $user );
		$ue_unbanrequest_url = $ue_base_url."&amp;task=banProfile&amp;act=2&amp;reportform=1&amp;uid=".$user->id;
		$ue_banhistory_url   = $ue_base_url."&amp;task=moderateBans&amp;act=2&amp;uid=".$user->id;
		$ue_ban_url 		 = $ue_base_url."&amp;task=banProfile&amp;act=1&amp;uid=".$user->id;
		$ue_unban_url 		 = $ue_base_url."&amp;task=banProfile&amp;act=0&amp;reportform=0&amp;uid=".$user->id;
		$ue_reportuser_url	 = $ue_base_url."&amp;task=reportUser&amp;uid=".$user->id;
		$ue_viewuserreports_url = $ue_base_url."&amp;task=viewReports&amp;uid=".$user->id;
		$ue_viewOlduserreports_url = $ue_base_url."&amp;task=viewReports&amp;act=1&amp;uid=".$user->id;
		$ue_approve_image_url= $ue_base_url."&amp;task=approveImage&amp;flag=1&amp;avatars=".$user->id;
		$ue_reject_image_url = $ue_base_url."&amp;task=approveImage&amp;flag=0&amp;avatars=".$user->id;
		$ue_userprofile_url	 = $ue_base_url."";
		$adminimagesdir		=	$_CB_framework->getCfg( 'live_site' ) . '/components/com_comprofiler/images/';

		// $this->menuBar->set("class", "mainlevel");		//BB: hardcoded to check >RC2.

		$firstMenuName		= $params->get('firstMenuName', '_UE_MENU_CB');
		$firstSubMenuName	= $params->get('firstSubMenuName', '_UE_MENU_ABOUT_CB');
		$firstSubMenuHref	= $params->get('firstSubMenuHref', $ue_credits_url);
		$secondSubMenuName	= $params->get('secondSubMenuName', '');
		$secondSubMenuHref	= $params->get('secondSubMenuHref', '');
		if ($firstMenuName != "") {
			$mi = array(); $mi[$firstMenuName]='';
		//	$this->_addMenuItem( $mi,$firstMenuName,"javascript:void(0)" );		// Community
			if ($firstSubMenuName != "") {
				unset($mi);
				if ($firstSubMenuHref == "") $firstSubMenuHref = "javascript:void(0)";
				$mi = array(); $mi[$firstMenuName]["_UE_TEAMCREDITS_CB"]='';
				$this->_addMenuItem( $mi,getLangDefinition($firstSubMenuName),cbSef($firstSubMenuHref) );		// About...
				if ($secondSubMenuName != "") {
					if ($secondSubMenuHref == "") $secondSubMenuHref = "javascript:void(0)";
					$mi = array(); $mi[$firstMenuName]["_UE_SECOND"]='';
					$this->_addMenuItem( $mi,getLangDefinition($secondSubMenuName),cbSef($secondSubMenuHref) );		// Free...
				}
			}
		}
		// ----- VIEW MENU - BEFORE EDIT MENU IF NOT VIEWING A PROFILE -----
		if ( $_CB_framework->myId() > 0 ) {
			// View My Profile:
			if ( $_CB_framework->displayedUser() === null ) {
				$mi = array(); $mi["_UE_MENU_VIEW"]["_UE_MENU_VIEWMYPROFILE"]=null;
				$this->_addMenuItem( $mi, _UE_MENU_VIEWMYPROFILE,cbSef($ue_userprofile_url), "",
				"","", _UE_MENU_VIEWMYPROFILE_DESC,"" );
			}
		}
		// ----- EDIT MENU -----
		if ( ! cbCheckIfUserCanPerformUserTask( $user->id, 'allowModeratorsUserEdit') ) {
			if ( $user->id == $_CB_framework->myId() ) {
				$menuTexts	=	array(	'_UE_UPDATEPROFILE'				=>	_UE_UPDATEPROFILE,
										'_UE_MENU_UPDATEPROFILE_DESC'	=>	_UE_MENU_UPDATEPROFILE_DESC,
										'_UE_UPDATEAVATAR'				=>	_UE_UPDATEAVATAR,
										'_UE_MENU_UPDATEAVATAR_DESC'	=>	_UE_MENU_UPDATEAVATAR_DESC,
										'_UE_DELETE_AVATAR'				=>	_UE_DELETE_AVATAR,
										'_UE_MENU_DELETE_AVATAR_DESC'	=>	_UE_MENU_DELETE_AVATAR_DESC
									);
			} else {
				$menuTexts	=	array(	'_UE_UPDATEPROFILE'				=>	_UE_MOD_MENU_UPDATEPROFILE,
										'_UE_MENU_UPDATEPROFILE_DESC'	=>	_UE_MOD_MENU_UPDATEPROFILE_DESC,
										'_UE_UPDATEAVATAR'				=>	_UE_MOD_MENU_UPDATEAVATAR,
										'_UE_MENU_UPDATEAVATAR_DESC'	=>	_UE_MOD_MENU_UPDATEAVATAR_DESC,
										'_UE_DELETE_AVATAR'				=>	_UE_MOD_MENU_DELETE_AVATAR,
										'_UE_MENU_DELETE_AVATAR_DESC'	=>	_UE_MOD_MENU_DELETE_AVATAR_DESC
									);
			}
			// Update Profile:
			$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEPROFILE"]=null;
			$this->_addMenuItem( $mi, $menuTexts['_UE_UPDATEPROFILE'],cbSef($ue_userdetails_url), "",
			"<img src=\"".$adminimagesdir."updateprofile.gif\" alt='' />","", $menuTexts['_UE_MENU_UPDATEPROFILE_DESC'],"" );
			// Update Avatar:
			if($ueConfig['allowAvatar']==1 && ($ueConfig['allowAvatarUpload']==1 || $ueConfig['allowAvatarGallery']==1)) {
				$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEAVATAR"]=null;
				$this->_addMenuItem( $mi, $menuTexts['_UE_UPDATEAVATAR'],cbSef($ue_useravatar_url), "",
				"<img src=\"".$adminimagesdir."newavatar.gif\" alt='' />","", $menuTexts['_UE_MENU_UPDATEAVATAR_DESC'],"" );
				// Delete Avatar:
				if($user->avatar!='' && $user->avatar!=null) {
					$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null;
					$this->_addMenuItem( $mi, $menuTexts['_UE_DELETE_AVATAR'],cbSef($ue_deleteavatar_url), "",
					"<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />","", $menuTexts['_UE_MENU_DELETE_AVATAR_DESC'],"" );
				}
			}
		}
		// ----- VIEW MENU - AFTER EDIT IF VIEWING A PROFILE -----
		if ( $_CB_framework->myId() > 0 ) {
			// View My Profile:
			if ( ( $_CB_framework->myId() != $user->id ) && ( $_CB_framework->displayedUser() !== null ) ) {
				$mi = array(); $mi["_UE_MENU_VIEW"]["_UE_MENU_VIEWMYPROFILE"]=null;
				$this->_addMenuItem( $mi, _UE_MENU_VIEWMYPROFILE,cbSef($ue_userprofile_url), "",
				"","", _UE_MENU_VIEWMYPROFILE_DESC,"" );
			}
		}
		// ----- MESSAGES MENU -----
		// Send PMS
		if ( $_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0 ) {
			global $_CB_PMS;
			$resultArray = $_CB_PMS->getPMSlinks($user->id, $_CB_framework->myId(), "", "", 1);
			if (count($resultArray) > 0) {
				foreach ($resultArray as $res) {
				 	if (is_array($res)) {
						$mi = array(); $mi["_UE_MENU_MESSAGES"][$res["caption"]]=null;
						$this->_addMenuItem( $mi, getLangDefinition($res["caption"]),cbSef($res["url"]), "",
						"","", getLangDefinition($res["tooltip"]),"" );
				 	}
				}
			}
		}

		// Send Email
		$emailHtml=getFieldValue('primaryemailaddress',$user->email,$user);
		if ($ueConfig['allow_email_display']!=4 && $_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0) {
			switch ($ueConfig['allow_email_display']) {
				case 1:	// Display Email only
					$caption = $emailHtml;
					$url = "javascript:void(0);";
					$desc = _UE_MENU_USEREMAIL_DESC;
					break;
				case 2:	// Display Email with link:
					$caption = null;
					$url = $emailHtml;
					$desc = _UE_MENU_SENDUSEREMAIL_DESC;
					break;
				case 3:	// Display Email-to text with link to web-form:
					$caption = _UE_MENU_SENDUSEREMAIL;
					$url = $emailHtml;
					$desc = _UE_MENU_SENDUSEREMAIL_DESC;
					break;
			}
			$mi = array(); $mi["_UE_MENU_MESSAGES"]["_UE_MENU_SENDUSEREMAIL"]=null;
			$this->_addMenuItem( $mi, $caption, $url, "", "", "", $desc, "" );
		}
		// ----- CONNECTIONS MENU -----
		IF ($ueConfig['allowConnections'] && $_CB_framework->myId() > 0) {
			$ue_addConnection_url = $ue_base_url."&amp;act=connections&amp;task=addConnection&amp;connectionid=".$user->id;
			$ue_removeConnection_url = $ue_base_url."&amp;act=connections&amp;task=removeConnection&amp;connectionid=".$user->id;
			$ue_manageConnection_url = $ue_base_url."&amp;task=manageConnections";
			
			// Manage My Connections
			$mi = array(); $mi["_UE_MENU_CONNECTIONS"]["_UE_MENU_MANAGEMYCONNECTIONS"]=null;
			$this->_addMenuItem( $mi, _UE_MENU_MANAGEMYCONNECTIONS,cbSef($ue_manageConnection_url), "",
			"","", _UE_MENU_MANAGEMYCONNECTIONS_DESC,"" );
			
			if ( $_CB_framework->myId() != $user->id ) {
				$_CB_database->setQuery("SELECT COUNT(*) FROM #__comprofiler_members WHERE referenceid=" . (int) $_CB_framework->myId() . " AND memberid=" . (int) $user->id);
				$isConnection = $_CB_database->loadResult();
				if ($isConnection) {
					$_CB_database->setQuery("SELECT COUNT(*) FROM #__comprofiler_members WHERE referenceid=" . (int) $_CB_framework->myId() . " AND memberid=" . (int) $user->id." AND pending=0");
					$isApproved = $_CB_database->loadResult();
					$_CB_database->setQuery("SELECT COUNT(*) FROM #__comprofiler_members WHERE referenceid=" . (int) $_CB_framework->myId() . " AND memberid=" . (int) $user->id." AND accepted=1");
					$isAccepted = $_CB_database->loadResult();
				}
				if($isConnection==0) {
					$connectionurl=cbSef($ue_addConnection_url);
					if ( $ueConfig['useMutualConnections'] == 1 ) {
						$fmsg	  = "_UE_ADDCONNECTIONREQUEST";
						$fmsgdesc = _UE_ADDCONNECTIONREQUEST_DESC;
					} else {
						$fmsg	  = "_UE_ADDCONNECTION";
						$fmsgdesc = _UE_ADDCONNECTION_DESC;
					}
					if($ueConfig['conNotifyType']!=0) {
						$connectionurl="javascript:void(0)\" onclick=\"return overlib('"
						. str_replace(array("<",">"), array("&lt;","&gt;"),
						_UE_CONNECTIONINVITATIONMSG."<br /><form action=&quot;".$connectionurl
						."&quot; method=&quot;post&quot; id=&quot;connOverForm&quot; name=&quot;connOverForm&quot;>"._UE_MESSAGE
						."<br /><textarea cols=&quot;40&quot; rows=&quot;8&quot; name=&quot;message&quot;></textarea><br />"
						. "<input type=&quot;button&quot; class=&quot;inputbox&quot; onclick=&quot;cbConnSubmReq();&quot; value=&quot;"
						._UE_SENDCONNECTIONREQUEST."&quot; />&nbsp;&nbsp;"
						."<input type=&quot;button&quot; class=&quot;inputbox&quot; onclick=&quot;cClick();&quot;  value=&quot;"
						._UE_CANCELCONNECTIONREQUEST."&quot; /></form>")
						."', STICKY, CAPTION,'"
						.sprintf(_UE_CONNECTTO,htmlspecialchars(str_replace("'","&#039;",getNameFormat($user->name,$user->username,$ueConfig['name_format'])),ENT_QUOTES))
						."', CENTER,CLOSECLICK,CLOSETEXT,'"._UE_CLOSE_OVERLIB."',WIDTH,350, ANCHOR,'cbAddConn',CENTERPOPUP,'LR','UR');";
						// $flink="<a href=\"".$connectionurl."\" id=\"cbAddConn\" name=\"cbAddConn\" title=\"".$fmsgdesc."\">".getLangDefinition($fmsg)."</a>";
						$flink = $connectionurl."\" name=\"cbAddConn";	//BBTRYREMOVED: "\" title=\"".$fmsgdesc."\">".getLangDefinition($fmsg)."</a>";
					} else {
						$flink=$connectionurl;
					}
				} else {
					if ($isAccepted) {
						$connectionurl=cbSef($ue_removeConnection_url);
						if ($isApproved) {
							$fmsg = "_UE_REMOVECONNECTION";
							$fmsgdesc=_UE_REMOVECONNECTION_DESC;
						} else {
							$fmsg = "_UE_REVOKECONNECTIONREQUEST";
							$fmsgdesc=_UE_REVOKECONNECTIONREQUEST_DESC;
						}
						// $flink="<a href=\"".$connectionurl."\" onclick=\"return confirmSubmit();\" title=\"".$fmsgdesc."\">".getLangDefinition($fmsg)."</a>";
						$flink = $connectionurl."\" onclick=\"return confirmSubmit();"; //BBTRYREMOVED: \" title=\"".$fmsgdesc."\">".getLangDefinition($fmsg)."</a>";
					} else {
						/*
						$connectionurl=cbSef($ue_manageConnection_url);
						$fmsg = "_UE_MANAGECONNECTIONS";				//BB this is wrong here, unless non-accepted connections are also displayed there
						$fmsgdesc=_UE_MENU_MANAGEMYCONNECTIONS_DESC;
						$flink=$connectionurl;
						*/
						$fmsg = null;		// manage connections is already above, no need to repeat here !
					}
				}
				// Request/Add/Remove/Revoke Connection
				if ( $fmsg ) {
					$mi = array(); $mi["_UE_MENU_CONNECTIONS"][$fmsg]=null;
					$this->_addMenuItem( $mi, getLangDefinition($fmsg), $flink /*$connectionurl*/, "",
					"","", $fmsgdesc,"" );
				}
			}

		}
		// ----- MODERATE MENU -----
		if ( $_CB_framework->myId() == $user->id ) {
			// Request to unban:
			if($user->banned==1 && $this->cbUserIsModerator==0 && $ueConfig['allowUserBanning']==1) {
				$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_REQUESTUNBANPROFILE"]=null;
				$this->_addMenuItem( $mi, _UE_REQUESTUNBANPROFILE,cbSef($ue_unbanrequest_url), "",
				"","", _UE_MENU_REQUESTUNBANPROFILE_DESC,"" );
			}
		} else {
			// Report User:
			if($ueConfig['allowUserReports']==1 && $this->cbUserIsModerator==0 && $_CB_framework->myId() > 0) {
				$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_REPORTUSER"]=null;
				$this->_addMenuItem( $mi, _UE_REPORTUSER,cbSef($ue_reportuser_url), "",
				"","", _UE_MENU_REPORTUSER_DESC,"" );
			}
			// Approve/Reject Avatar & Ban/Unban profile & View User Reports:
			if($this->cbMyIsModerator==1 && $this->cbUserIsModerator==0) {

				$query = "SELECT COUNT(*) FROM #__comprofiler_userreports  WHERE reportedstatus=0 AND reporteduser="******"SELECT COUNT(*) FROM #__comprofiler_userreports  WHERE reporteduser="******"_UE_MENU_MODERATE"]["_UE_APPROVE_IMAGE"]=null;
						$this->_addMenuItem( $mi, _UE_APPROVE_IMAGE,cbSef($ue_approve_image_url), "",
						"","", _UE_MENU_APPROVE_IMAGE_DESC,"" );
					}
					// Reject Image
					$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_REJECT_IMAGE"]=null;
					$this->_addMenuItem( $mi, _UE_REJECT_IMAGE,cbSef($ue_reject_image_url), "",
					"","", _UE_MENU_REJECT_IMAGE_DESC,"" );
				}
				if($ueConfig['allowUserBanning']==1) {
					if($user->banned!=0 ) {
						// unban profile
						$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_UNBANPROFILE"]=null;
						$this->_addMenuItem( $mi, _UE_UNBANPROFILE,cbSef($ue_unban_url), "",
						"","", _UE_MENU_UNBANPROFILE_DESC,"" );
					} else {
						// ban profile
						$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_BANPROFILE"]=null;
						$this->_addMenuItem( $mi, _UE_BANPROFILE,cbSef($ue_ban_url), "",
						"","", _UE_MENU_BANPROFILE_DESC,"" );
					}
					if( $user->bannedby ) {
						// ban history
						$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_MENU_BANPROFILE_HISTORY"]=null;
						$this->_addMenuItem( $mi, _UE_MENU_BANPROFILE_HISTORY,cbSef($ue_banhistory_url), "",
						"","", _UE_MENU_BANPROFILE_HISTORY_DESC,"" );
					}
				}
				if($ueConfig['allowUserReports']==1 && $userreports>0) {
					// view user reports
					$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_VIEWUSERREPORTS"]=null;
					$this->_addMenuItem( $mi, _UE_VIEWUSERREPORTS,cbSef($ue_viewuserreports_url), "",
					"","", _UE_MENU_VIEWUSERREPORTS_DESC,"" );
				} elseif($ueConfig['allowUserReports']==1 && $userreportsAllTimes>0) {
					// view user reports
					$mi = array(); $mi["_UE_MENU_MODERATE"]["_UE_VIEWUSERREPORTS"]=null;
					$this->_addMenuItem( $mi, _UE_MOD_MENU_VIEWOLDUSERREPORTS,cbSef($ue_viewOlduserreports_url), "",
					"","", _UE_MOD_MENU_VIEWOLDUSERREPORTS_DESC,"" );
				}
			}
		}
		// Test example:
		/*
		$mi = array(); $mi["_UE_MENU_CONNECTIONS"]["duplique"]=null;
		$this->addMenu( array(	"position"	=> "menuBar" ,		// "menuBar", "menuList"
									"arrayPos"	=> $mi ,
									"caption"	=> _UE_MENU_MANAGEMYCONNECTIONS ,
									"url"		=> cbSef($ue_manageConnection_url) ,		// can also be "<a ....>" or "javascript:void(0)" or ""
									"target"	=> "" ,	// e.g. "_blank"
									"img"		=> null ,	// e.g. "<img src='plugins/user/myplugin/images/icon.gif' width='16' height='16' alt='' />"
									"alt"		=> null ,	// e.g. "text"
									"tooltip"	=> _UE_MENU_MANAGEMYCONNECTIONS_DESC ,
									"keystroke"	=> null ) );	// e.g. "P"
		*/
	}
Esempio n. 15
0
function processConnectionActions($connectionids) {
	global $_CB_framework, $ueConfig, $_POST;

	// simple spoof check security
	cbSpoofCheck( 'manageConnections' );

	if(!$ueConfig['allowConnections']) {
		echo _UE_FUNCTIONALITY_DISABLED;
		return;
	}
	if ( ! ( $_CB_framework->myId() > 0 ) ) {
		cbNotAuth();
		return;
	}
	$cbCon	=	new cbConnection( $_CB_framework->myId() );

	if (is_array($connectionids)) {
		foreach($connectionids AS $cid) {
			$action		=	cbGetParam( $_POST, $cid . 'action' );
			if ( $action== 'd' ) {
				$cbCon->denyConnection( $_CB_framework->myId(), $cid );
			} elseif ( $action == 'a' ) {
				$cbCon->acceptConnection( $_CB_framework->myId(), $cid );
			}
		}
	}
	$error				=	$cbCon->getErrorMSG();
	if ( $error ) {
		cbRedirect( cbSef( 'index.php?option=com_comprofiler&amp;task=manageConnections' . getCBprofileItemid(), false ), $error, 'error' );
	} else {
		cbRedirect( cbSef( 'index.php?option=com_comprofiler&amp;task=manageConnections' . getCBprofileItemid(), false ),
							( is_array($connectionids) ) ? _UE_CONNECTIONACTIONSSUCCESSFULL : null );
	}
	return;
}
Esempio n. 16
0
 /**
  * returns href limitstart url
  *
  * @param $value
  * @return string
  */
 public function limitstartUrl($value)
 {
     return cbSef($this->getBaseURL() . (strpos($this->getBaseURL(), '?') !== false ? '&' : '?') . 'limit=' . (int) $this->limit . '&' . urlencode($this->fieldName('limitstart')) . '=' . (int) $value);
 }
Esempio n. 17
0
	public function getRemindURL() {
		return cbSef( 'index.php?option=com_comprofiler&task=lostPassword' );
	}
 /**
  * Generates the HTML to display the user profile tab
  * @param  moscomprofilerTab   $tab       the tab database entry
  * @param  moscomprofilerUser  $user      the user being displayed
  * @param  int                 $ui        1 for front-end, 2 for back-end
  * @return mixed                          either string HTML for tab content, or false if ErrorMSG generated
  */
 function getDisplayTab($tab, $user, $ui)
 {
     global $_CB_framework, $_CB_database, $ueConfig;
     $return = null;
     if (!$ueConfig['allowConnections'] || isset($ueConfig['connectionDisplay']) && $ueConfig['connectionDisplay'] == 1 && $_CB_framework->myId() != $user->id) {
         return null;
     }
     $params = $this->params;
     $con_ShowTitle = $params->get('con_ShowTitle', '1');
     $con_ShowSummary = $params->get('con_ShowSummary', '0');
     $con_SummaryEntries = $params->get('con_SummaryEntries', '4');
     $con_pagingenabled = $params->get('con_PagingEnabled', '1');
     $con_entriesperpage = $params->get('con_EntriesPerPage', '10');
     $pagingParams = $this->_getPaging(array(), array("connshow_"));
     $showall = $this->_getReqParam("showall", false);
     if ($con_ShowSummary && !$showall && $pagingParams["connshow_limitstart"] === null) {
         $summaryMode = true;
         $showpaging = false;
         $con_entriesperpage = $con_SummaryEntries;
     } else {
         $summaryMode = false;
         $showpaging = $con_pagingenabled;
     }
     $isVisitor = null;
     if ($_CB_framework->myId() != $user->id) {
         $isVisitor = "\n AND m.pending=0 AND m.accepted=1";
     }
     if ($showpaging || $summaryMode) {
         //select a count of all applicable entries for pagination
         if ($isVisitor) {
             $contotal = $this->_getUserNumberOfConnections($user);
         } else {
             $query = "SELECT COUNT(*)" . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor . "\n ";
             $_CB_database->setQuery($query);
             $contotal = $_CB_database->loadResult();
             if (!is_numeric($contotal)) {
                 $contotal = 0;
             }
         }
     }
     if (!$showpaging || $pagingParams["connshow_limitstart"] === null || $con_entriesperpage > $contotal) {
         $pagingParams["connshow_limitstart"] = "0";
     }
     $query = "SELECT m.*,u.name,u.email,u.username,c.avatar,c.avatarapproved, u.id " . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "" . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor . "\n ORDER BY m.membersince DESC, m.memberid ASC";
     $_CB_database->setQuery($query, (int) ($pagingParams["connshow_limitstart"] ? $pagingParams["connshow_limitstart"] : 0), (int) $con_entriesperpage);
     $connections = $_CB_database->loadObjectList();
     if (!count($connections) > 0) {
         $return .= _UE_NOCONNECTIONS;
         return $return;
     }
     if ($con_ShowTitle) {
         if ($_CB_framework->myId() == $user->id) {
             $return .= "<h3 class=\"cbConTitle\">" . _UE_YOURCONNECTIONS . "</h3>";
         } else {
             $return .= "<h3 class=\"cbConTitle\">" . sprintf(_UE_USERSNCONNECTIONS, getNameFormat($user->name, $user->username, $ueConfig['name_format'])) . "</h3>";
         }
     }
     $return .= $this->_writeTabDescription($tab, $user);
     $live_site = $_CB_framework->getCfg('live_site');
     $boxHeight = $ueConfig['thumbHeight'] + 46;
     $boxWidth = $ueConfig['thumbWidth'] + 28;
     foreach ($connections as $connection) {
         $conAvatar = getFieldValue('image', $connection->avatar, $connection);
         $emailIMG = getFieldValue('primaryemailaddress', $connection->email, $connection, null, 1);
         $pmIMG = getFieldValue('pm', $connection->username, $connection, null, 1);
         $onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', null, $connection, null, 1) : "";
         if ($connection->accepted == 1 && $connection->pending == 1) {
             $actionIMG = '<img src="' . $live_site . '/components/com_comprofiler/images/pending.png" border="0" alt="' . _UE_CONNECTIONPENDING . "\" title=\"" . _UE_CONNECTIONPENDING . "\" /> <a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid) . "\" onclick=\"return confirmSubmit();\" ><img src=\"" . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
         } elseif ($connection->accepted == 1 && $connection->pending == 0) {
             $actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid) . "\" onclick=\"return confirmSubmit();\" ><img src=\"" . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
         } elseif ($connection->accepted == 0) {
             $actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=acceptConnection&amp;connectionid=" . $connection->memberid) . '"><img src="' . $live_site . "/components/com_comprofiler/images/tick.png\" border=\"0\" alt=\"" . _UE_ACCEPTCONNECTION . "\" title=\"" . _UE_ACCEPTCONNECTION . "\" /></a> <a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid) . '"><img src="' . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_DECLINECONNECTION . "\" /></a>";
         }
         $tipField = "<b>" . _UE_CONNECTEDSINCE . "</b> : " . dateConverter($connection->membersince, 'Y-m-d', $ueConfig['date_format']);
         if (getLangDefinition($connection->type) != null) {
             $tipField .= "<br /><b>" . _UE_CONNECTIONTYPE . "</b> : " . getConnectionTypes($connection->type);
         }
         if ($connection->description != null) {
             $tipField .= "<br /><b>" . _UE_CONNECTEDCOMMENT . "</b> : " . htmlspecialchars($connection->description);
         }
         $tipTitle = _UE_CONNECTEDDETAIL;
         $htmltext = $conAvatar;
         $style = "style=\"padding:5px;\"";
         $tooltipAvatar = cbFieldTip($ui, $tipField, $tipTitle, '250', '', $htmltext, '', $style, '', false);
         if ($_CB_framework->myId() == $user->id) {
             $return .= "<div class=\"connectionBox\" style=\"position:relative;height:" . ($boxHeight + 24) . "px;width:" . $boxWidth . "px;\">" . "<div style=\"position:absolute; top:3px; width:auto;left:5px;right:5px;\">" . $actionIMG . '</div>' . "<div style=\"position:absolute; top:18px; width:auto;left:5px;right:5px;\">" . $tooltipAvatar . '</div>' . "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">" . $onlineIMG . " " . getNameFormat($connection->name, $connection->username, $ueConfig['name_format']) . "<br /><a href=\"" . cbSef("index.php?option=com_comprofiler&amp;task=userProfile&amp;user="******"><img src="' . $live_site . "/components/com_comprofiler/images/profiles.gif\" border=\"0\" alt=\"" . _UE_VIEWPROFILE . "\" title=\"" . _UE_VIEWPROFILE . "\" /></a> " . $emailIMG . " " . $pmIMG . "\n";
         } else {
             $return .= "<div class=\"connectionBox\" style=\"position:relative;height:" . $boxHeight . "px;width:" . $boxWidth . "px;\">" . "<div style=\"position:absolute; top:10px; width:auto;left:5px;right:5px;\">" . $tooltipAvatar . '</div>' . "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">" . $onlineIMG . " " . getNameFormat($connection->name, $connection->username, $ueConfig['name_format']) . "\n";
         }
         $return .= "</div></div>\n";
     }
     $return .= "<div style=\"clear:both;\">&nbsp;</div>";
     // Add paging control at end of list if paging enabled
     if ($showpaging && $con_entriesperpage < $contotal) {
         $return .= "<div style='width:95%;text-align:center;'>" . $this->_writePaging($pagingParams, "connshow_", $con_entriesperpage, $contotal) . "</div>";
     }
     if ($con_ShowSummary && $_CB_framework->myId() == $user->id || $summaryMode && $con_entriesperpage < $contotal) {
         $return .= "<div class=\"connSummaryFooter\" style=\"width:100%;clear:both;\">";
         if ($_CB_framework->myId() == $user->id) {
             // Manage connections link:
             $return .= "<div id=\"connSummaryFooterManage\" style=\"float:left;\">" . "<a href=\"" . cbSef('index.php?option=com_comprofiler&amp;task=manageConnections') . "\" >[" . _UE_MANAGECONNECTIONS . "]</a>" . "</div>";
         }
         if ($summaryMode && $con_entriesperpage < $contotal) {
             // See all of user's ## connections
             $return .= "<div id=\"connSummaryFooterSeeConnections\" style=\"float:right;\">" . "<a href=\"" . $this->_getAbsURLwithParam(array("showall" => "1")) . "\">";
             if ($_CB_framework->myId() == $user->id) {
                 $return .= sprintf(_UE_SEEALLNCONNECTIONS, $contotal);
             } else {
                 $return .= sprintf(_UE_SEEALLOFUSERSNCONNECTIONS, getNameFormat($user->name, $user->username, $ueConfig['name_format']), "<strong>" . $contotal . "</strong>");
             }
             $return .= "</a>" . "</div>";
         }
         $return .= "&nbsp;</div>" . "<div style=\"clear:both;\">&nbsp;</div>";
     }
     return $return;
 }
Esempio n. 19
0
 public function getEditProfileURL($userid, $xhtml = true)
 {
     return cbSef('index.php?option=com_comprofiler&task=userDetails' . getCBprofileItemid(), $xhtml);
 }
Esempio n. 20
0
	function drawUrl( $cbUri, &$sourceElem, &$data, $id, $htmlspecialchars = true, $inPage = true ) {
		global $_CB_framework;

		$ui						=	$_CB_framework->getUi();
		if ( substr( $cbUri, 0, 4 ) == 'cbo:' ) {
			$subTaskValue	=	substr( $cbUri, 4 );
			switch ( $subTaskValue ) {
				case 'newrow':
					$id	=	0;
					// fallthrough: no break on purpose.
				case 'rowedit':				//TBD this is duplicate of below
					$baseUrl	=	'index.php';
					$baseUrl	.=		'?option=' . $this->_options['option'] . '&task=' . $this->_options['task'] . '&cid=' . $this->_options['pluginid'];
					$url	= $baseUrl . '&table=' . $this->_tableBrowserModel->attributes( 'name' ) . '&action=editrow';		// below: . '&tid=' . $id;
					break;
				case 'saveorder':
				case 'editrows':
				case 'deleterows':
				case 'copyrows':
				case 'updaterows':
				case 'publish':
				case 'unpublish':
				case 'enable':
				case 'disable':
				default:
					$url	= 'javascript:cbDoListTask(this, '				// cb					//TBD: this is duplicate of pager.
					. "'" . $this->taskName( false ). "','" 				// task
					. $this->subtaskName( false ). "','" 					// subtaskName
					. $this->subtaskValue( $subTaskValue, false ) . "','" 	// subtaskValue
					. $this->fieldId( 'id', null, false ) . "'"				// fldName
					. ");";
					break;
			}

		} elseif ( substr( $cbUri, 0, 10 ) == 'cb_action:' ) {

			$actionName				=	substr( $cbUri, 10 );
			$action					=&	$this->_actions->getChildByNameAttr( 'action', 'name', $actionName );
			if ( $action ) {
				$requestNames		=	explode( ' ', $action->attributes( 'request' ) );
				$requestValues		=	explode( ' ', $action->attributes( 'action' ) );
				$parametersValues	=	explode( ' ', $action->attributes( 'parameters' ) );

				$baseUrl			=	'index.php';
				$baseUrl			.=	'?';
				$baseRequests		=	array( 'option' => 'option', 'task' => 'task', 'cid' => 'pluginid' );
				$urlParams			=	array();
				foreach ( $baseRequests as $breq => $breqOptionsValue ) {
					if ( ( ! ( in_array( $breq, $requestNames ) || in_array( $breq, $parametersValues ) ) ) && isset( $this->_options[$breqOptionsValue] ) ) {
						$urlParams[$breq]	=	$breq . '=' . $this->_options[$breqOptionsValue];
					}
				}

				$url		= $baseUrl;
				for ( $i = 0, $n = count( $requestNames ); $i < $n; $i++ ) {
					$urlParams[$requestNames[$i]]	=	$requestNames[$i] . '=' . $requestValues[$i];				// other parameters = paramvalues added below
				}
				$url		=	$baseUrl . implode( '&', $urlParams );
			} else {
				$url = "#action_not_defined:" . $actionName;
			}

		} else {

			$url = $cbUri;

		}

		if ( ! cbStartOfStringMatch( $url, 'javascript:' ) ) {
			// get the parameters of action/link from XML :
			$parametersNames				=	explode( ' ', $sourceElem->attributes( 'parameters' ) );
			$parametersValues				=	explode( ' ', $sourceElem->attributes( 'paramvalues' ) );
			$parametersValuesTypes			=	explode( ' ', $sourceElem->attributes( 'paramvaluestypes' ) );

			// add currently activated filters to the parameters:
			if ( count( $this->_filters ) > 0 ) {
				foreach ( $this->_filters as $k => $v ) {
					$filterName				=	$this->fieldName( $k );
					if ( ( $v['value'] != $v['default'] ) && ( ! in_array( $filterName, $parametersNames ) ) ) {
						$parametersNames[]	=	$filterName;
						$parametersValues[]	=	"'" . $v['value'] . "'";		//TBD: check this.
					}
				}
			}

			// add current search string, if any:
			$searchName						=	$this->fieldName( 'search' );
			$searchValue					=	$this->fieldValue( 'search' );
			if ( $searchValue && ( ! in_array( $searchName, $parametersNames ) ) ) {
				$parametersNames[]			=	$searchName;
				$parametersValues[]			=	"'" . $searchValue . "'";
			}

			// generate current action (and parameters ?) as cbprevstate
			$cbprevstate					=	array();
			foreach ( $this->_options as $req => $act ) {
				if ( $req && $act && ! in_array( $req, array( 'cbprevstate' ) ) ) {
					$cbprevstate[]			=	$req . '=' . $act;
				}
			}
			$parametersNames[]				=	'cbprevstate';
			$parametersValues[]				=	"'" . base64_encode( implode( '&', $cbprevstate ) ) . "'";

			// finally generate URL:
			for ( $i = 0, $n = count( $parametersNames ); $i < $n; $i++ ) {
				$nameOfVariable				=	$parametersValues[$i];
				if ( $nameOfVariable ) {

					if ( isset( $parametersValuesTypes[$i] ) && $parametersValuesTypes[$i] ) {
						if ( $parametersValuesTypes[$i] == 'sql:field' ) {
							$nameOfVariable	=	$data->$nameOfVariable;
						} else {
							// $nameOfVariable untouched
						}
					} elseif ( ( substr( $nameOfVariable, 0, 1 ) == "'" ) && ( substr( $nameOfVariable, -1 ) == "'" ) ) {
						$nameOfVariable		=	substr( $nameOfVariable, 1, -1 );
					} else {
						$nameOfVariable		=	$data->$nameOfVariable;
					}
					$url					.=	'&' . $parametersNames[$i] . '=' . urlencode( $nameOfVariable );
				}
			}

			if ( $ui == 2 ) {
				$url						=	$_CB_framework->backendUrl( $url, $htmlspecialchars, ( $inPage ? 'html' : 'component' ) );
			} else {
				$url						=	cbSef( $url, $htmlspecialchars, ( $inPage ? 'html' : 'component' ) );
			}
		} elseif ( $htmlspecialchars ) {
			$url							=	htmlspecialchars( $url );
		}
		return $url;
	}
Esempio n. 21
0
	/**
	 * Notifies connection changes
	 *
	 * @param  int      $userId
	 * @param  int      $connectionId
	 * @param  string   $msg
	 * @param  string   $subject
	 * @param  string   $messageHTML
	 * @param  string   $messageText
	 * @param  string   $userMessage
	 * @return boolean
	 */
	protected function _notifyConnectionChange( $userId, $connectionId, $msg, $subject, $messageHTML, $messageText, $userMessage = null )
	{
		global $_CB_framework, $ueConfig;

		$rowFrom				=	new UserTable();
		$rowFrom->load( (int) $userId );

		$fromName				=	getNameFormat( $rowFrom->name, $rowFrom->username, $ueConfig['name_format'] );
		$fromURL				=	'index.php?option=com_comprofiler&amp;view=userprofile&amp;user='******'&amp;tab=1' . getCBprofileItemid(true);
		$fromURL				=	cbSef( $fromURL );

		if ( strncasecmp( 'http', $fromURL, 4 ) != 0 ) {
			$fromURL			=	$_CB_framework->getCfg( 'live_site' ) . '/' . $fromURL;
		}

		$subject				=	sprintf( $subject, $fromName );

		if ( $userMessage != null ) {
			$messageHTML		.=	sprintf( str_replace( "\n", "\n<br />", CBTxt::T( 'UE_CONNECTIONMSGPREFIX', "  %s included the following personal message:\n\n%s" ) ),
											 htmlspecialchars( $fromName ),
											 '<strong>' . htmlspecialchars( $userMessage ) . '</strong>' );
			$messageText		.=	sprintf( str_replace( "\n", "\r\n", CBTxt::T( 'UE_CONNECTIONMSGPREFIX', "  %s included the following personal message:\n\n%s" ) ),
											 $fromName,
											 $userMessage );
		}

		$notificationMsgHTML	=	sprintf( $messageHTML, '<strong><a href="' . $fromURL . '">' . htmlspecialchars( $fromName ) . '</a></strong>' );
		$notificationMsgText	=	sprintf( $messageText, $fromName );

		$manageURL				=	'index.php?option=com_comprofiler&amp;view=manageconnections' . getCBprofileItemid( true );
		$manageURL				=	cbSef( $manageURL );

		if ( strncasecmp( 'http', $manageURL, 4 ) != 0 ) {
			$manageURL			=	$_CB_framework->getCfg( 'live_site' ) . '/' . $manageURL;
		}

		$notificationMsgHTML	=	$notificationMsgHTML
								.	"\n<br /><br /><a href=\"" . $manageURL . '">'
								.	CBTxt::T( 'UE_MANAGECONNECTIONS_LINK UE_MANAGECONNECTIONS', 'Manage Connections' )
								.	"</a>\n";

		$notificationMsgText	=	$notificationMsgText
								.	"\r\n\r\n\r\n" . $fromName . ' '
								.	CBTxt::T( 'CONNECTION_PROFILE UE_PROFILE', 'Profile' )
								.	': '
								.	cbUnHtmlspecialchars( $fromURL );

		$notificationMsgText	=	$notificationMsgText
								.	"\r\n\r\n"
								.	CBTxt::T( 'UE_MANAGECONNECTIONS_URL_LABEL UE_MANAGECONNECTIONS', 'Manage Connections' )
								.	': '
								.	cbUnHtmlspecialchars( $manageURL )
								.	"\r\n";

		$notificationMsgHTML	=	'<div style="padding: 4px; margin: 4px 3px 6px 0px; background: #C44; font-weight: bold;" class="cbNotice">'
			. CBTxt::T( 'UE_SENDPMSNOTICE', 'NOTE: This is a message generated automatically by the Connections system. It has the connecting user\'s address, so you can conveniently reply if you wish to.' )
			. "</div>\n\n"
			. $notificationMsgHTML;

		$cbNotification			=	new cbNotification();
		$cbNotification->sendFromUser( $connectionId, $userId, $subject, $notificationMsgHTML, $notificationMsgText );

		$this->_setUserMSG( $msg );

		return true;
	}
Esempio n. 22
0
 public function getLink()
 {
     if ($this->komentoprofile) {
         return JRoute::_('index.php?option=com_komento&view=profile&id=' . $this->profile->id);
     }
     return cbSef('index.php?option=com_comprofiler&amp;task=userProfile&amp;user=' . $this->profile->id);
 }
Esempio n. 23
0
 /**
  * @param  \CB\Database\Table\TabTable   $tab       the tab database entry
  * @param  \CB\Database\Table\UserTable  $user      the user being displayed
  * @param  int                           $ui        1 for front-end, 2 for back-end
  * @return boolean
  */
 public function getMenuAndStatus($tab, $user, $ui)
 {
     global $_CB_framework, $_CB_database, $ueConfig, $_REQUEST, $_POST;
     $params = $this->params;
     $userId = $user->id && $_CB_framework->myId() == $user->id ? null : $user->id;
     $firstMenuName = $params->get('firstMenuName', '');
     // CBTxt::T( '_UE_MENU_CB', 'Community' )
     $firstSubMenuName = $params->get('firstSubMenuName', '');
     // CBTxt::T( '_UE_MENU_ABOUT_CB', 'About Community Builder...' )
     $firstSubMenuHref = $params->get('firstSubMenuHref', '');
     $secondSubMenuName = $params->get('secondSubMenuName', '');
     $secondSubMenuHref = $params->get('secondSubMenuHref', '');
     // ----- CUSTOM MENU -----
     if ($firstMenuName != '') {
         $customMenu = array();
         $customMenu['arrayPos'] = $firstMenuName;
         $customMenu['position'] = 'menuBar';
         $customMenu['caption'] = CBTxt::T($firstMenuName);
         $this->addMenu($customMenu);
         if ($firstSubMenuName != '') {
             // Custom 1:
             $first = array();
             $first['arrayPos'] = array($firstMenuName => array('_UE_FIRST' => null));
             $first['position'] = 'menuBar';
             $first['caption'] = CBTxt::T($firstSubMenuName);
             $first['url'] = $firstSubMenuHref == '' ? "javascript: void( 0 );" : cbSef($firstSubMenuHref);
             $first['target'] = '';
             $first['img'] = '';
             $first['tooltip'] = '';
             $this->addMenu($first);
             if ($secondSubMenuName != '') {
                 // Custom 2:
                 $second = array();
                 $second['arrayPos'] = array($firstMenuName => array('_UE_SECOND' => null));
                 $second['position'] = 'menuBar';
                 $second['caption'] = CBTxt::T($secondSubMenuName);
                 $second['url'] = $secondSubMenuHref == '' ? "javascript: void( 0 );" : cbSef($secondSubMenuHref);
                 $second['target'] = '';
                 $second['img'] = '';
                 $second['tooltip'] = '';
                 $this->addMenu($second);
             }
         }
     }
     // ----- VIEW MENU -----
     $viewMenu = array();
     $viewMenu['arrayPos'] = '_UE_MENU_VIEW';
     $viewMenu['position'] = 'menuBar';
     $viewMenu['caption'] = CBTxt::T('_UE_MENU_VIEW', 'View');
     $this->addMenu($viewMenu);
     if ($_CB_framework->myId() > 0) {
         if ($_CB_framework->displayedUser() === null || $_CB_framework->myId() != $user->id && $_CB_framework->displayedUser() !== null) {
             // View My Profile:
             $myProfile = array();
             $myProfile['arrayPos'] = array('_UE_MENU_VIEW' => array('_UE_MENU_VIEWMYPROFILE' => null));
             $myProfile['position'] = 'menuBar';
             $myProfile['caption'] = CBTxt::T('UE_MENU_VIEWMYPROFILE', 'View Your Profile');
             $myProfile['url'] = $_CB_framework->userProfileUrl();
             $myProfile['target'] = '';
             $myProfile['img'] = '<span class="fa fa-home"></span> ';
             $myProfile['tooltip'] = CBTxt::T('UE_MENU_VIEWMYPROFILE_DESC', 'View your own profile');
             $this->addMenu($myProfile);
         }
     }
     // ----- EDIT MENU -----
     $editMenu = array();
     $editMenu['arrayPos'] = '_UE_MENU_EDIT';
     $editMenu['position'] = 'menuBar';
     $editMenu['caption'] = CBTxt::T('_UE_MENU_EDIT', 'Edit');
     $this->addMenu($editMenu);
     if (!cbCheckIfUserCanPerformUserTask($user->id, 'allowModeratorsUserEdit')) {
         if ($user->id == $_CB_framework->myId()) {
             $menuTexts = array('_UE_UPDATEPROFILE' => CBTxt::T('UE_UPDATEPROFILE', 'Update Your Profile'), '_UE_MENU_UPDATEPROFILE_DESC' => CBTxt::T('UE_MENU_UPDATEPROFILE_DESC', 'Change your profile settings'));
         } else {
             $menuTexts = array('_UE_UPDATEPROFILE' => CBTxt::T('UE_MOD_MENU_UPDATEPROFILE', 'Update user profile'), '_UE_MENU_UPDATEPROFILE_DESC' => CBTxt::T('UE_MOD_MENU_UPDATEPROFILE_DESC', 'Change profile settings of this user profile'));
         }
         // Update Profile:
         $updateProfile = array();
         $updateProfile['arrayPos'] = array('_UE_MENU_EDIT' => array('_UE_UPDATEPROFILE' => null));
         $updateProfile['position'] = 'menuBar';
         $updateProfile['caption'] = $menuTexts['_UE_UPDATEPROFILE'];
         $updateProfile['url'] = $_CB_framework->userProfileEditUrl($userId);
         $updateProfile['target'] = '';
         $updateProfile['img'] = '<span class="fa fa-edit"></span> ';
         $updateProfile['tooltip'] = $menuTexts['_UE_MENU_UPDATEPROFILE_DESC'];
         $this->addMenu($updateProfile);
     }
     // ----- MESSAGES MENU -----
     $messagesMenu = array();
     $messagesMenu['arrayPos'] = '_UE_MENU_MESSAGES';
     $messagesMenu['position'] = 'menuBar';
     $messagesMenu['caption'] = CBTxt::T('_UE_MENU_MESSAGES', 'Messages');
     $this->addMenu($messagesMenu);
     if ($_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0) {
         global $_CB_PMS;
         $resultArray = $_CB_PMS->getPMSlinks($user->id, $_CB_framework->myId(), '', '', 1);
         if (count($resultArray) > 0) {
             foreach ($resultArray as $res) {
                 if (is_array($res)) {
                     // Send Private Message:
                     $sendMessage = array();
                     $sendMessage['arrayPos'] = array('_UE_MENU_MESSAGES' => array('_UE_PM_USER' => null));
                     $sendMessage['position'] = 'menuBar';
                     $sendMessage['caption'] = $res['caption'];
                     // Already translated in CB Menu
                     $sendMessage['url'] = cbSef($res['url']);
                     $sendMessage['target'] = '';
                     $sendMessage['img'] = '<span class="fa fa-comment"></span> ';
                     $sendMessage['tooltip'] = $res['tooltip'];
                     // Already translated in CB Menu
                     $this->addMenu($sendMessage);
                 }
             }
         }
     }
     if ($ueConfig['allow_email_display'] != 4 && $_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0) {
         switch ($ueConfig['allow_email_display']) {
             case 1:
                 // Display Email only
                 $caption = moscomprofilerHTML::emailCloaking(htmlspecialchars($user->email), 0);
                 $url = "javascript: void( 0 );;";
                 $desc = CBTxt::T('UE_MENU_USEREMAIL_DESC', 'Email address of this user');
                 break;
             case 2:
                 // Display Email with link
                 $caption = moscomprofilerHTML::emailCloaking(htmlspecialchars($user->email), 1);
                 $url = "javascript: void( 0 );;";
                 $desc = CBTxt::T('UE_MENU_SENDUSEREMAIL_DESC', 'Send an Email to this user');
                 break;
             case 3:
                 // Display Email-to text with link to web-form
             // Display Email-to text with link to web-form
             default:
                 $caption = CBTxt::T('UE_MENU_SENDUSEREMAIL', 'Send Email to User');
                 $url = $_CB_framework->viewUrl('emailuser', true, array('uid' => $userId));
                 $desc = CBTxt::T('UE_MENU_SENDUSEREMAIL_DESC', 'Send an Email to this user');
                 break;
         }
         // Send Email:
         $sendEmail = array();
         $sendEmail['arrayPos'] = array('_UE_MENU_MESSAGES' => array('_UE_MENU_SENDUSEREMAIL' => null));
         $sendEmail['position'] = 'menuBar';
         $sendEmail['caption'] = $caption;
         $sendEmail['url'] = $url;
         $sendEmail['target'] = '';
         $sendEmail['img'] = '<span class="fa fa-envelope"></span> ';
         $sendEmail['tooltip'] = $desc;
         $this->addMenu($sendEmail);
     }
     // ----- CONNECTIONS MENU -----
     $connectionsMenu = array();
     $connectionsMenu['arrayPos'] = '_UE_MENU_CONNECTIONS';
     $connectionsMenu['position'] = 'menuBar';
     $connectionsMenu['caption'] = CBTxt::T('_UE_MENU_CONNECTIONS', 'Connections');
     $this->addMenu($connectionsMenu);
     if ($ueConfig['allowConnections'] && $_CB_framework->myId() > 0) {
         // Manage My Connections:
         $manageConnections = array();
         $manageConnections['arrayPos'] = array('_UE_MENU_CONNECTIONS' => array('_UE_MENU_MANAGEMYCONNECTIONS' => null));
         $manageConnections['position'] = 'menuBar';
         $manageConnections['caption'] = CBTxt::T('UE_MENU_MANAGEMYCONNECTIONS', 'Manage Your Connections');
         $manageConnections['url'] = $_CB_framework->viewUrl('manageconnections');
         $manageConnections['target'] = '';
         $manageConnections['img'] = '<span class="fa fa-users"></span> ';
         $manageConnections['tooltip'] = CBTxt::T('UE_MENU_MANAGEMYCONNECTIONS_DESC', 'Manage your existing connections and pending connections actions');
         $this->addMenu($manageConnections);
         if ($_CB_framework->myId() != $user->id) {
             $cbConnection = new cbConnection((int) $_CB_framework->myId());
             $cbUser =& CBuser::getInstance((int) $user->id, false);
             $connClass = null;
             $connLink = null;
             $connDesc = null;
             $connMsg = null;
             $connImg = null;
             $isConnection = $cbConnection->isConnected((int) $user->id);
             if ($isConnection) {
                 $isApproved = $cbConnection->isConnectionApproved((int) $user->id);
                 $isAccepted = $cbConnection->isConnectionAccepted((int) $user->id);
             } else {
                 $isApproved = false;
                 $isAccepted = false;
             }
             if (!$isConnection) {
                 $connUrl = $_CB_framework->viewUrl('addconnection', true, array('connectionid' => (int) $user->id));
                 if ($ueConfig['useMutualConnections'] == 1) {
                     $connClass = 'UE_ADDCONNECTIONREQUEST';
                     $connMsg = CBTxt::T('UE_ADDCONNECTIONREQUEST', 'Request Connection');
                     $connDesc = CBTxt::T('UE_ADDCONNECTIONREQUEST_DESC', 'Request a Connection to that user');
                 } else {
                     $connClass = 'UE_ADDCONNECTION';
                     $connMsg = CBTxt::T('UE_ADDCONNECTION', 'Add Connection');
                     $connDesc = CBTxt::T('UE_ADDCONNECTION_DESC', 'Add a Connection to that user');
                 }
                 if ($ueConfig['conNotifyType'] != 0) {
                     cbValidator::loadValidation();
                     $tooltipTitle = sprintf(CBTxt::T('UE_CONNECTTO', 'Connect to %s'), $cbUser->getField('formatname', null, 'html', 'none', 'profile', 0, true));
                     $connectionInvitationMsg = CBTxt::T('UE_CONNECTIONINVITATIONMSG', 'Personalize your invitation to connect by adding a message that will be included with your connection.');
                     $tooltip = null;
                     if ($connectionInvitationMsg) {
                         $tooltip .= '<div class="form-group cb_form_line clearfix">' . $connectionInvitationMsg . '</div>';
                     }
                     $tooltip .= '<form action="' . $connUrl . '" method="post" id="connOverForm" name="connOverForm" class="cb_form cbValidation">' . '<div class="form-group cb_form_line clearfix">' . '<label for="message" class="control-label">' . CBTxt::T('UE_MESSAGE', 'Message') . '</label>' . '<div class="cb_field">' . '<textarea cols="40" rows="8" name="message" class="form-control"></textarea>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbConnReqSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_SENDCONNECTIONREQUEST', 'Request Connection')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" id="cbConnReqCancel" class="btn btn-default cbConnReqCancel cbTooltipClose" value="' . htmlspecialchars(CBTxt::Th('UE_CANCELCONNECTIONREQUEST', 'Cancel')) . '" />' . '</div>' . '</form>';
                     $connLink = cbTooltip($ui, $tooltip, $tooltipTitle, 400, null, '<span class="fa fa-heart"></span> ' . CBTxt::Th($connMsg), 'javascript: void( 0 );', 'data-hascbtooltip="true" data-cbtooltip-modal="true"');
                 } else {
                     $connLink = $connUrl;
                     $connImg = '<span class="fa fa-heart"></span> ';
                 }
             } else {
                 if ($isAccepted) {
                     $connUrl = $_CB_framework->viewUrl('removeconnection', true, array('connectionid' => (int) $user->id));
                     if ($isApproved) {
                         $connClass = 'UE_REMOVECONNECTION';
                         $connMsg = CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection');
                         $connDesc = CBTxt::T('UE_REMOVECONNECTION_DESC', 'Remove Connection to that user');
                     } else {
                         $connClass = 'UE_REVOKECONNECTIONREQUEST';
                         $connMsg = CBTxt::T('UE_REVOKECONNECTIONREQUEST', 'Revoke Connection Request');
                         $connDesc = CBTxt::T('UE_REVOKECONNECTIONREQUEST_DESC', 'Cancel the Connection Request to that user');
                     }
                     $js = "if ( typeof confirmSubmit != 'function' ) {" . "function confirmSubmit() {" . "if ( confirm( '" . addslashes(CBTxt::T('UE_CONFIRMREMOVECONNECTION', 'Are you sure you want to remove this connection?')) . "' ) ) {" . "return true;" . "} else {" . "return false;" . "}" . "};" . "}";
                     $_CB_framework->document->addHeadScriptDeclaration($js);
                     $connLink = $connUrl . '" onclick="return confirmSubmit();';
                     $connImg = '<span class="fa fa-heart-o"></span> ';
                 } else {
                     $connClass = null;
                     $connMsg = null;
                 }
             }
             if ($connMsg) {
                 // Request/Add/Remove/Revoke Connection:
                 $connectionRequest = array();
                 $connectionRequest['arrayPos'] = array('_UE_MENU_CONNECTIONS' => array($connClass => null));
                 $connectionRequest['position'] = 'menuBar';
                 $connectionRequest['caption'] = $connMsg;
                 $connectionRequest['url'] = $connLink;
                 $connectionRequest['target'] = '';
                 $connectionRequest['img'] = $connImg;
                 $connectionRequest['tooltip'] = $connDesc;
                 $this->addMenu($connectionRequest);
             }
         }
     }
     // ----- MODERATE MENU -----
     $moderateMenu = array();
     $moderateMenu['arrayPos'] = '_UE_MENU_MODERATE';
     $moderateMenu['position'] = 'menuBar';
     $moderateMenu['caption'] = CBTxt::T('_UE_MENU_MODERATE', 'Moderate');
     $this->addMenu($moderateMenu);
     if ($_CB_framework->myId() == $user->id) {
         if ($user->banned == 1 && $this->cbUserIsModerator == 0 && $ueConfig['allowUserBanning'] == 1) {
             // Request Unban:
             $requestUnban = array();
             $requestUnban['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_REQUESTUNBANPROFILE' => null));
             $requestUnban['position'] = 'menuBar';
             $requestUnban['caption'] = CBTxt::T('UE_REQUESTUNBANPROFILE', 'Submit Unban Request');
             $requestUnban['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 2, 'reportform' => 1, 'uid' => (int) $user->id));
             $requestUnban['target'] = '';
             $requestUnban['img'] = '<span class="fa fa-envelope"></span> ';
             $requestUnban['tooltip'] = CBTxt::T('UE_MENU_REQUESTUNBANPROFILE_DESC', 'Submit a request to the site moderator to unban your profile');
             $this->addMenu($requestUnban);
         }
     } else {
         if ($ueConfig['allowUserReports'] == 1 && $this->cbUserIsModerator == 0 && $_CB_framework->myId() > 0) {
             // Report User:
             $reportUser = array();
             $reportUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_REPORTUSER' => null));
             $reportUser['position'] = 'menuBar';
             $reportUser['caption'] = CBTxt::T('UE_REPORTUSER', 'Report User');
             $reportUser['url'] = $_CB_framework->viewUrl('reportuser', true, array('uid' => (int) $user->id));
             $reportUser['target'] = '';
             $reportUser['img'] = '<span class="fa fa-bullhorn"></span> ';
             $reportUser['tooltip'] = CBTxt::T('UE_MENU_REPORTUSER_DESC', 'Report this user to the site moderator so that he can take appropriate action');
             $this->addMenu($reportUser);
         }
         if ($this->cbMyIsModerator == 1 && $this->cbUserIsModerator == 0) {
             $query = 'SELECT COUNT(*)' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_userreports') . "\n WHERE " . $_CB_database->NameQuote('reporteduser') . " = " . (int) $user->id . "\n AND " . $_CB_database->NameQuote('reportedstatus') . " = 0";
             $_CB_database->setQuery($query);
             $pendingReports = $_CB_database->loadResult();
             $query = 'SELECT COUNT(*)' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_userreports') . "\n WHERE " . $_CB_database->NameQuote('reporteduser') . " = " . (int) $user->id;
             $_CB_database->setQuery($query);
             $processedReports = $_CB_database->loadResult();
             if ($ueConfig['allowUserBanning'] == 1) {
                 if ($user->banned != 0) {
                     // Unban Profile:
                     $unbanUser = array();
                     $unbanUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_UNBANPROFILE' => null));
                     $unbanUser['position'] = 'menuBar';
                     $unbanUser['caption'] = CBTxt::T('UE_UNBANPROFILE', 'Unban Profile');
                     $unbanUser['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 0, 'reportform' => 0, 'uid' => (int) $user->id));
                     $unbanUser['target'] = '';
                     $unbanUser['img'] = '<span class="fa fa-check-circle-o"></span> ';
                     $unbanUser['tooltip'] = CBTxt::T('UE_MENU_UNBANPROFILE_DESC', 'As Site Moderator: Unban this profile, making it visible to other users');
                     $this->addMenu($unbanUser);
                 } else {
                     // Ban Profile:
                     $banUser = array();
                     $banUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_BANPROFILE' => null));
                     $banUser['position'] = 'menuBar';
                     $banUser['caption'] = CBTxt::T('UE_BANPROFILE', 'Ban Profile');
                     $banUser['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 1, 'uid' => (int) $user->id));
                     $banUser['target'] = '';
                     $banUser['img'] = '<span class="fa fa-ban"></span> ';
                     $banUser['tooltip'] = CBTxt::T('UE_MENU_BANPROFILE_DESC', 'As Site Moderator: Ban this profile, making it invisible to other users');
                     $this->addMenu($banUser);
                 }
                 if ($user->bannedby) {
                     // Ban History:
                     $banHistory = array();
                     $banHistory['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_MENU_BANPROFILE_HISTORY' => null));
                     $banHistory['position'] = 'menuBar';
                     $banHistory['caption'] = CBTxt::T('UE_MENU_BANPROFILE_HISTORY', 'Ban history');
                     $banHistory['url'] = $_CB_framework->viewUrl('moderatebans', true, array('act' => 2, 'uid' => (int) $user->id));
                     $banHistory['target'] = '';
                     $banHistory['img'] = '<span class="fa fa-book"></span> ';
                     $banHistory['tooltip'] = CBTxt::T('UE_MENU_BANPROFILE_HISTORY_DESC', 'As Site Moderator: See ban history of this profile');
                     $this->addMenu($banHistory);
                 }
             }
             if ($ueConfig['allowUserReports'] == 1 && $pendingReports > 0) {
                 // View Pending Reports:
                 $userReports = array();
                 $userReports['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_VIEWUSERREPORTS' => null));
                 $userReports['position'] = 'menuBar';
                 $userReports['caption'] = CBTxt::T('UE_VIEWUSERREPORTS', 'View User Reports');
                 $userReports['url'] = $_CB_framework->viewUrl('viewreports', true, array('uid' => (int) $user->id));
                 $userReports['target'] = '';
                 $userReports['img'] = '<span class="fa fa-warning"></span> ';
                 $userReports['tooltip'] = CBTxt::T('UE_MENU_VIEWUSERREPORTS_DESC', 'As Site Moderator: View User Reports for this user');
                 $this->addMenu($userReports);
             } elseif ($ueConfig['allowUserReports'] == 1 && $processedReports > 0) {
                 // View Processed Reports:
                 $userReports = array();
                 $userReports['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_VIEWUSERREPORTS' => null));
                 $userReports['position'] = 'menuBar';
                 $userReports['caption'] = CBTxt::T('UE_MOD_MENU_VIEWOLDUSERREPORTS', 'View processed user reports');
                 $userReports['url'] = $_CB_framework->viewUrl('viewreports', true, array('act' => 1, 'uid' => (int) $user->id));
                 $userReports['target'] = '';
                 $userReports['img'] = '<span class="fa fa-warning"></span> ';
                 $userReports['tooltip'] = CBTxt::T('UE_MOD_MENU_VIEWOLDUSERREPORTS_DESC', 'As site moderator: View processed user reports for this user');
                 $this->addMenu($userReports);
             }
         }
     }
 }
 /**
  * Writes the html links for sorting as headers
  * @param array: paging parameters. ['limitstart'] is the record number to start dislpaying from will be ignored
  * @param string postfix for identifying multiple pagings/search/sorts (optional)
  * @param string sorting parameter added as &sortby=... if NOT NULL
  * @param string Name to display as column heading/hyperlink
  * @param boolean true if it is the default sorting field to not output sorting
  * @param string class/style html for the unselected sorting header
  * @param string class/style html for the selected sorting header
  * @param string cb task to link to (default: userProfile)
  * @return string html text displaying paging
  */
 function _writeSortByLink($pagingParams, $postfix, $sortBy, $sortName, $defaultSort = false, $unselectedClass = 'class="cbSortHead"', $selectedClass = 'class="cbSortHeadSelected"', $task = "userProfile")
 {
     $url = $this->_getAbsURLwithParam($pagingParams, $task, false, array($postfix . "sortby", $postfix . "limitstart"));
     $prefix = $this->_getPrefix();
     //done in _getAbsURLwithParam: foreach ($pagingParams as $k => $v) if ($v && $k!=$postfix."sortby")  $url .= "&amp;".htmlentities($prefix.$k)."=".htmlentities($v);
     if (!$defaultSort) {
         $url .= "&amp;" . htmlentities($prefix . $postfix) . "sortby=" . htmlentities($sortBy);
     }
     $class = !$pagingParams[$postfix . "sortby"] && $defaultSort || $pagingParams[$postfix . "sortby"] == $sortBy ? " " . $selectedClass : " " . $unselectedClass;
     return '<a href="' . cbSef($url) . '"' . $class . ' title="' . sprintf(_UE_CLICKTOSORTBY, htmlspecialchars($sortName, ENT_QUOTES)) . '">' . htmlspecialchars($sortName, ENT_QUOTES) . '</a>';
 }
Esempio n. 25
0
 /**
  * @param  string             $cbUri             The CB-URI (cbo;,,,)
  * @param  SimpleXMLElement   $sourceElem        The XML element from which the URL is computed
  * @param  TableInterface     $data              The data of the object for dynamic URL request values
  * @param  int                $id                The id of the current row
  * @param  bool               $htmlspecialchars  If htmlspecialchars should be made for this
  * @param  bool               $inPage            URL target: true: html (full page), false: raw (only center component content)
  * @return string                                The URL
  */
 function drawUrl($cbUri, SimpleXMLElement $sourceElem, $data, $id, $htmlspecialchars = true, $inPage = true)
 {
     global $_CB_framework;
     if (!Access::authorised($sourceElem)) {
         return null;
     }
     $ui = $_CB_framework->getUi();
     $actionName = null;
     if (substr($cbUri, 0, 4) == 'cbo:') {
         $subTaskValue = substr($cbUri, 4);
         switch ($subTaskValue) {
             /** @noinspection PhpMissingBreakStatementInspection */
             case 'newrow':
                 // $id	=	0;
                 // fallthrough: no break on purpose.
             // $id	=	0;
             // fallthrough: no break on purpose.
             case 'rowedit':
                 //TBD this is duplicate of below
                 $baseUrl = 'index.php';
                 if ($this->_options['view'] == 'editPlugin') {
                     $task = $this->_options['view'];
                 } else {
                     $task = 'editrow';
                 }
                 $baseUrl .= '?option=' . $this->_options['option'] . '&view=' . $task;
                 if (isset($this->_options['pluginid'])) {
                     $baseUrl .= '&cid=' . $this->_options['pluginid'];
                 }
                 $url = $baseUrl . '&table=' . $this->_tableBrowserModel->attributes('name') . '&action=editrow';
                 // below: . '&tid=' . $id;
                 break;
             case 'saveorder':
             case 'editrows':
             case 'deleterows':
             case 'copyrows':
             case 'updaterows':
             case 'publish':
             case 'unpublish':
             case 'enable':
             case 'disable':
             default:
                 $url = 'javascript:cbDoListTask(this, ' . "'" . addslashes($this->taskName(false)) . "','" . addslashes($this->subtaskName(false)) . "','" . addslashes($this->subtaskValue($subTaskValue, false)) . "','" . addslashes($this->fieldId('id', null, false)) . "'" . ");";
                 break;
         }
     } elseif (substr($cbUri, 0, 10) == 'cb_action:') {
         $actionName = substr($cbUri, 10);
         $action = $this->_actions->getChildByNameAttr('action', 'name', $actionName);
         if ($action) {
             if (!Access::authorised($action)) {
                 return null;
             }
             $requestNames = explode(' ', $action->attributes('request'));
             $requestValues = explode(' ', $action->attributes('action'));
             $parametersValues = explode(' ', $action->attributes('parameters'));
             $baseUrl = 'index.php';
             $baseUrl .= '?';
             $baseRequests = array('option' => 'option', 'view' => 'view', 'cid' => 'pluginid');
             $urlParams = array();
             foreach ($baseRequests as $breq => $breqOptionsValue) {
                 if (!(in_array($breq, $requestNames) || in_array($breq, $parametersValues)) && isset($this->_options[$breqOptionsValue])) {
                     $urlParams[$breq] = $breq . '=' . $this->_options[$breqOptionsValue];
                 }
             }
             for ($i = 0, $n = count($requestNames); $i < $n; $i++) {
                 $urlParams[$requestNames[$i]] = $requestNames[$i] . '=' . $requestValues[$i];
                 // other parameters = paramvalues added below
             }
             $url = $baseUrl . implode('&', $urlParams);
         } else {
             $url = "#action_not_defined:" . $actionName;
         }
     } else {
         $url = cbUnHtmlspecialchars($cbUri);
     }
     if (cbStartOfStringMatch($url, 'index.php')) {
         // get the parameters of action/link from XML :
         $parametersNames = explode(' ', $sourceElem->attributes('parameters'));
         $parametersValues = explode(' ', $sourceElem->attributes('paramvalues'));
         $parametersValuesTypes = explode(' ', $sourceElem->attributes('paramvaluestypes'));
         // generate current action (and parameters ?) as cbprevstate
         $cbprevstate = array();
         foreach ($this->_options as $req => $act) {
             if ($req && $act && !in_array($req, array('cbprevstate'))) {
                 $cbprevstate[] = $req . '=' . $act;
             }
         }
         $parametersNames[] = 'cbprevstate';
         $parametersValues[] = "'" . base64_encode(implode('&', $cbprevstate)) . "'";
         // finally generate URL:
         for ($i = 0, $n = count($parametersNames); $i < $n; $i++) {
             $nameOfVariable = $parametersValues[$i];
             if ($nameOfVariable != '') {
                 if (isset($parametersValuesTypes[$i]) && $parametersValuesTypes[$i]) {
                     if ($parametersValuesTypes[$i] == 'sql:field') {
                         if (is_callable(array($data, 'get'))) {
                             $nameOfVariable = $data->get($nameOfVariable);
                         } else {
                             $nameOfVariable = $data->{$nameOfVariable};
                         }
                     } else {
                         // $nameOfVariable untouched
                     }
                 } elseif (substr($nameOfVariable, 0, 1) == "'" && substr($nameOfVariable, -1) == "'") {
                     $nameOfVariable = substr($nameOfVariable, 1, -1);
                 } else {
                     if (is_callable(array($data, 'get'))) {
                         $nameOfVariable = $data->get($nameOfVariable);
                     } else {
                         $nameOfVariable = $data->{$nameOfVariable};
                     }
                 }
                 $url .= '&' . $parametersNames[$i] . '=' . urlencode($nameOfVariable);
             }
         }
         if ($ui == 2) {
             $url = $_CB_framework->backendUrl($url, $htmlspecialchars, $inPage ? 'html' : 'component');
         } else {
             $url = cbSef($url, $htmlspecialchars, $inPage ? 'html' : 'component');
         }
     } elseif ($htmlspecialchars) {
         $url = htmlspecialchars($url);
     }
     return $url;
 }
	/**
	 * Draws a form posting to $getParams with CSS class $cssClass around $settings with $warnings at top, and $formHiddens hidden elements. Also add validation languages into head.
	 *
	 * @param  string        $settings
	 * @param  string        $warning
	 * @param  string[]      $formHiddens
	 * @param  string|array  $getParams
	 * @param  string|null   $cssClass
	 * @return string
	 */
	public function drawForm( $settings, $warning, $formHiddens, $getParams, $cssClass = null ) {
		global $_CB_framework;

		$html				=	'';
		if ( $warning ) {
			$html			.=	'<div class="error">' . $warning . '</div>' . "\n";
		}
		if ( is_array( $getParams ) ) {
			$postUrl		=	'index.php';
			if ( $getParams && ( count( $getParams ) > 0 ) ) {
				foreach ( $getParams as $k => $v ) {
				 	$getParams[$k]	=	$k . '=' . htmlspecialchars( urlencode( $v ) );
				 }
				 $postUrl	.=	'?' . implode( '&', $getParams );
			}
		} else {
			$postUrl		=	$getParams;
		}
		if ( $formHiddens !== null ) {
			$html			.=	'<form enctype="multipart/form-data" action="' . cbSef( $postUrl ) . '" method="post" name="adminForm" id="cbAdminFormForm" class="cb_form cbregfrontendform' . ( $cssClass ? ' ' . $cssClass : '' ) . '">' . "\n";
		}
		if ( $formHiddens !== null ) {
			foreach ( $formHiddens as $k => $v ) {
				$html		.=	"\t" . '<input type="hidden" name="' . htmlspecialchars( $k ) . '" value="' . htmlspecialchars( $v ) . '" />' . "\n";
			}
			$html			.=	cbGetSpoofInputTag( 'plugin' );
		}
		$html				.=	$settings;
		if ( $formHiddens !== null ) {
			$html			.=	"</form>\n";
		}

		cbimport( 'language.cbteamplugins' );

		ob_start();
?>
$.extend(jQuery.validator.messages, {
		required: "<?php echo addslashes( CBPTXT::T("This field is required.") ); ?>",
		remote: "<?php echo addslashes( CBPTXT::T("Please fix this field.") ); ?>",
		email: "<?php echo addslashes( CBPTXT::T("Please enter a valid email address.") ); ?>",
		url: "<?php echo addslashes( CBPTXT::T("Please enter a valid URL.") ); ?>",
		date: "<?php echo addslashes( CBPTXT::T("Please enter a valid date.") ); ?>",
		dateISO: "<?php echo addslashes( CBPTXT::T("Please enter a valid date (ISO).") ); ?>",
		number: "<?php echo addslashes( CBPTXT::T("Please enter a valid number.") ); ?>",
		digits: "<?php echo addslashes( CBPTXT::T("Please enter only digits.") ); ?>",
		creditcard: "<?php echo addslashes( CBPTXT::T("Please enter a valid credit card number.") ); ?>",
		equalTo: "<?php echo addslashes( CBPTXT::T("Please enter the same value again.") ); ?>",
		accept: "<?php echo addslashes( CBPTXT::T("Please enter a value with a valid extension.") ); ?>",
		maxlength: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter no more than {0} characters.") ); ?>"),
		minlength: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter at least {0} characters.") ); ?>"),
		rangelength: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter a value between {0} and {1} characters long.") ); ?>"),
		range: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter a value between {0} and {1}.") ); ?>"),
		max: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter a value less than or equal to {0}.") ); ?>"),
		min: $.validator.format("<?php echo addslashes( CBPTXT::T("Please enter a value greater than or equal to {0}.") ); ?>")
});
$('#cbAdminFormForm').validate( {
		errorClass: 'cb_result_warning',
		// debug: true,
		cbIsOnKeyUp: false,

		highlight: function( element, errorClass ) {
			$( element ).parents('.fieldCell').parent().addClass( 'cbValidationError' );	// tables		// .parents('tab-page').sibblings('tab-row');
			$( element ).parents('.cb_form_line').addClass( 'cbValidationError' );				// divs
		},
		unhighlight: function( element, errorClass ) {
			$( element ).parents('.fieldCell').parent().removeClass( 'cbValidationError' );	// tables
			$( element ).parents('.cb_form_line').removeClass( 'cbValidationError' );			// divs
		},
		errorElement: 'span',
		errorPlacement: function(error, element) {
			element.parent().append( error[0] );		// tables
			element.parent().append( error[0] );			// divs
		},

		onkeyup: function(element) {
			if ( element.name in this.submitted || element == this.lastElement ) {
				// avoid remotejhtml rule onkeyup
				this.cbIsOnKeyUp = true;
				this.element(element);
				this.cbIsOnKeyUp = false;
			}
        }
} );
$('#cbAdminFormForm input:checkbox,#cbAdminFormForm input:radio').click( function() {
	$('#cbAdminFormForm').validate().element( $(this) );
} );
<?php
		
		$cbjavascript	=	ob_get_contents();
		ob_end_clean();
		$_CB_framework->outputCbJQuery( $cbjavascript, array( 'metadata', 'validate' ) );

		return $html;
	}
    /**
     * Gives credits display for frontend and backend
     */
    function teamCredits()
    {
        global $_CB_framework, $ueConfig;
        $ui = $_CB_framework->getUi();
        outputCbTemplate($ui);
        outputCbJs($ui);
        ?>
		<div class="cbTeamCredits cb_template cb_template_<?php 
        echo selectTemplate('dir');
        ?>
">
			<div class="container-fluid">
				<div class="row text-center">
					<p>
						<?php 
        if ($ui == 2) {
            ?>
							<a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits" target="_blank">
								<img src="<?php 
            echo $_CB_framework->getCfg('live_site');
            ?>
/components/com_comprofiler/images/smcblogo.gif" class="img-responsive-inline" />
							</a>
							<?php 
            echo cbUpdateChecker();
            ?>
						<?php 
        } else {
            ?>
							<strong><?php 
            echo CBTxt::Th('UE_SITE_POWEREDBY TEAM_CREDITS_SITE_POWEREDBY', 'This site\'s community features are powered by Community Builder');
            ?>
</strong>
							<br />
							<a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits" target="_blank">
								<img src="<?php 
            echo $_CB_framework->getCfg('live_site');
            ?>
/components/com_comprofiler/images/smcblogo.gif" class="img-responsive-inline" />
							</a>
						<?php 
        }
        ?>
					</p>
				</div>
				<br />
				<div class="row">
					<?php 
        $w = "<p><strong>Community Builder</strong>&trade; (CB) is the complete <strong>Social Networking software</strong> solution for <strong>Joomla</strong>&trade; that is used by this website to support its <strong>membership management</strong>.</p>\n\t\t\t\t\t\t\t\t<p>This <strong>Joomla extension</strong> is the <strong>most popular Joomla social network component on the Joomla Extensions Directory</strong>.</p>\n\t\t\t\t\t\t\t\t<p>It comes with a built-in CB template, but more cool and fast <strong>Joomla and CB templates</strong> are available.</p>\n\t\t\t\t\t\t\t\t<p>Community Builder has <strong>many CB add-ons</strong>, both free and commercial that can extend the functionality of any Joomla website. One of these is the <strong>paid memberships software</strong> solution, CBSubs&trade;, that can manage <strong>paid subscriptions</strong> to access your website content. Many more exciting CB plugins are in our <strong>CB incubator</strong>.</p>\n\t\t\t\t\t\t\t\t<p>Finally, for those wanting a turnkey <strong>Online Social Network</strong>, Joomlapolis.com offers business-class <strong>Joomla hosting</strong>, including a one-click social networking website installer.</p>";
        echo str_replace('</strong>', '</a>', preg_replace_callback('/<strong>/', 'teamCreditsReplacer', $w));
        ?>
					<p><strong>Software: Copyright 2004-2016 joomlapolis.com. This component is released under the GNU/GPL version 2 License. All copyright statements must be kept. Derivate work must prominently duly acknowledge original work and include visible online links. Official site:</strong></p>
					<p class="text-center"><strong><a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits">www.joomlapolis.com</a></strong></p>
					<?php 
        if ($ui == 1) {
            ?>
						<p><strong>Please note that the authors and distributors of this software are not affiliated nor related in any way with the site owners using this free software here, and declines any warranty regarding the content and functions of this site.</strong></p>
					<?php 
        }
        ?>
				</div>
				<br />
				<div class="row text-center">
					<strong>Credits:</strong>
					<script type="text/javascript">//<!--
						/*
						 Fading Scroller- By DynamicDrive.com
						 For full source code, and usage terms, visit http://www.dynamicdrive.com
						 This notice MUST stay intact for use
						 fcontent[4]="<h3>damian caynes<br />inspired digital<br /></h3>Logo Design";
						 */
						var delay=1000; //set delay between message change (in miliseconds)
						var fcontent=[];
						begintag=''; //set opening tag, such as font declarations
						fcontent[0]="<h3>CBJoe/JoomlaJoe/MamboJoe<br /></h3>Founder &amp; First Developer";
						fcontent[1]="<h3>DJTrail<br /></h3>Co-Founder";
						fcontent[2]="<h3>Nick A.<br /></h3>Documentation and Public Relations";
						fcontent[3]="<h3>Beat B.<br /></h3>Lead Developer";
						fcontent[4]="<h3>Kyle L.<br /></h3>Developer and Support";
						fcontent[5]="<h3>Lou Griffith<br /></h3>Logo Design";
						closetag='';

						var fwidth='100%';	//'250px' //set scroller width
						var fheight='80px'; //set scroller height

						var fadescheme=0<?php 
        echo $ui == 2 || $ueConfig['templatedir'] != 'dark' ? 0 : 1;
        ?>
; //set 0 to fade text color from (white to black), 1 for (black to white)
						var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes.

						///No need to edit below this line/////////////////

						var hex=(fadescheme==0)? 255 : 0;
						var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)";
						var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(255,255,255)";

						var ie4=document.all&&!document.getElementById;
						var ns4=document.layers;
						var DOM2=document.getElementById;
						var faderdelay=0;
						var index=0;
						var linksobj=null;

						if (DOM2)
							faderdelay=2000;

						//function to change content
						function changecontent(){
							if (index>=fcontent.length)
								index=0;
							if (DOM2){
								document.getElementById("fscroller").style.color=startcolor;
								document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag;
								linksobj=document.getElementById("fscroller").getElementsByTagName("A");
								if (fadelinks)
									linkcolorchange(linksobj);
								colorfade();
							}
							index++;
							setTimeout("changecontent()",delay+faderdelay);
						}

						// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
						// Modified by Dynamicdrive.com

						var frame=20, i;

						function linkcolorchange(obj){
							if (obj.length>0){
								for (i=0;i<obj.length;i++)
									obj[i].style.color="rgb("+hex+","+hex+","+hex+")";
							}
						}

						function colorfade() {
							// 20 frames fading process
							if(frame>0) {
								hex=(fadescheme==0)? hex-12 : hex+12; // increase or decrease color value depd on fadescheme
								document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; // Set color value.
								if (fadelinks)
									linkcolorchange(linksobj);
								frame--;
								setTimeout("colorfade()",20);
							} else {
								document.getElementById("fscroller").style.color=endcolor;
								frame=20;
								hex=(fadescheme==0)? 255 : 0;
							}
						}

						if (ie4||DOM2)
							document.write('<div id="fscroller" style="border:0 solid black;width:'+fwidth+';height:'+fheight+';padding:2px"></div>');
						window.onload=changecontent;
						//-->
					</script>
				</div>
				<?php 
        if ($ui == 2) {
            ?>
					<br />
					<div class="row text-center">
						<p><strong>Please note there is a free installation document, as well as a full documentation subscription for this free component available at <a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits">www.joomlapolis.com</a></strong></p>
					</div>
					<br />
					<div class="row text-center">
						<p>If you like the services provided by this free component, <a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits">please consider making a small donation to support the team behind it</a></p>
					</div>
				<?php 
        } elseif ($_CB_framework->myId()) {
            ?>
					<br />
					<div class="row text-center">
						<p><a href="<?php 
            echo cbSef('index.php?option=com_comprofiler' . getCBprofileItemid(true));
            ?>
"><?php 
            echo CBTxt::Th('TEAM_CREDITS_BACK_TO_YOUR_PROFILE UE_BACK_TO_YOUR_PROFILE', 'Back to your profile');
            ?>
</a></p>
					</div>
				<?php 
        }
        ?>
				<br />
				<table class="table table-bordered table-responsive">
					<tr>
						<th colspan="<?php 
        echo $ui == 2 ? 3 : 2;
        ?>
">Community Builder includes following components</th>
					</tr>
					<tr>
						<th>Application</th>
						<?php 
        if ($ui == 2) {
            ?>
							<th>Version</th>
						<?php 
        }
        ?>
						<th>License</th>
					</tr>
					<tr>
						<td>
							<a href="http://www.foood.net" target="_blank">Icons (old icons)</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>N/A</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.foood.net/agreement.htm" target="_blank">License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://nuovext.pwsp.net/" target="_blank">Icons</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>2.2</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">GNU Lesser General Public License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://webfx.eae.net" target="_blank">Tabs</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.02</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://www.dynarch.com/projects/calendar" target="_blank">Calendar</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.1</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">GNU Lesser General Public License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm" target="_blank">Jason&#039;s Calendar</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>2005-09-05</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://dynamicdrive.com/notice.htm" target="_blank">Dynamic Drive terms of use License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://docs.guzzlephp.org/en/guzzle4/index.html" target="_blank">Guzzle</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>4.1.3</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://opensource.org/licenses/MIT" target="_blank">MIT</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="https://github.com/php-fig/log" target="_blank">Psr/Log</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.0.0</td>
						<?php 
        }
        ?>
						<td>
							<a href="https://github.com/php-fig/log/blob/master/LICENSE" target="_blank">MIT</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="https://github.com/avalanche123/Imagine" target="_blank">Imagine</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>0.6.1</td>
						<?php 
        }
        ?>
						<td>
							<a href="https://github.com/avalanche123/Imagine/blob/develop/LICENSE" target="_blank">MIT and third-party licenses</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://snoopy.sourceforge.net/" target="_blank">Snoopy</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.2.3</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">GNU Lesser General Public License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://www.phpclasses.org/browse/package/2189.html" target="_blank">PHPMailer</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>5.2.8</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">GNU Lesser General Public License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://www.phpclasses.org/browse/package/2189.html" target="_blank">PHP Input Filter</a>
							<a href="http://freshmeat.net/projects/inputfilter/" target="_blank">(forge)</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.2.2+</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" target="_blank">GNU General Public License</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits" target="_blank">BestMenus</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td>1.0</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=credits" target="_blank">Open Source GPL (GNU General Public License) v2</a>
						</td>
					</tr>
					<tr>
						<td>
							<a href="http://jquery.com/" target="_blank">jQuery</a>
						</td>
						<?php 
        if ($ui == 2) {
            ?>
							<td><?php 
            echo _CB_JQUERY_VERSION;
            ?>
</td>
						<?php 
        }
        ?>
						<td>
							<a href="http://docs.jquery.com/" target="_blank">MIT license</a>
						</td>
					</tr>
				</table>
			</div>
		</div>
	<?php 
    }
Esempio n. 28
0
 private static function communitybuilder($profile, $isThumb = true)
 {
     $files = JPATH_ROOT . '/administrator/components/com_comprofiler/plugin.foundation.php';
     if (!JFile::exists($files)) {
         return false;
     }
     require_once $files;
     cbimport('cb.database');
     cbimport('cb.tables');
     cbimport('cb.tabs');
     $user = CBuser::getInstance($profile->id);
     if (!$user) {
         $user = CBuser::getInstance(null);
     }
     // Prevent CB from adding anything to the page.
     ob_start();
     $source = $user->getField('avatar', null, 'php');
     $reset = ob_get_contents();
     ob_end_clean();
     unset($reset);
     $avatarLink = $source['avatar'];
     if (!$isThumb) {
         $avatarLink = str_ireplace('tn', '', $avatarLink);
     }
     $profileLink = cbSef('index.php?option=com_comprofiler&amp;task=userProfile&amp;user=' . $profile->id);
     return array($avatarLink, $profileLink);
 }
Esempio n. 29
0
                    <?php 
        }
    }
    ?>

                <?php 
    if ($registerType == "communitybuilder" && file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
        include_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
        global $_CB_framework;
        echo '<input type="hidden" name="option" value="com_comprofiler" />' . "\n";
        echo '<input type="hidden" name="task" value="login" />' . "\n";
        echo '<input type="hidden" name="op2" value="login" />' . "\n";
        echo '<input type="hidden" name="lang" value="' . $_CB_framework->getCfg('lang') . '" />' . "\n";
        echo '<input type="hidden" name="force_session" value="1" />' . "\n";
        // makes sure to create joomla 1.0.11+12 session/bugfix
        echo '<input type="hidden" name="return" value="B:' . base64_encode(cbSef(base64_decode($jLoginUrl))) . '"/>';
        echo cbGetSpoofInputTag('login');
    } else {
        echo '<input type="hidden" name="option" value="com_users"/>';
        echo '<input type="hidden" name="task" value="user.login"/>';
        echo '<input type="hidden" name="return" value="' . $jLoginUrl . '"/>';
    }
    echo '<input type="hidden" name="mod_id" value="' . $module->id . '"/>';
    echo JHTML::_('form.token');
    echo $helper->getForgotLinks();
    ?>
            </fieldset>
        </form>
    </div>
    <?php 
    if ($orientation == 'bottom') {
Esempio n. 30
0
	/**
	 * Replace relative non-sefed link with absolute sefed links
	 *
	 * @param array $matches
	 * @return string
	 */
	function _cbadmin_parse_a_link( &$matches ) {
		$url		=	cbUnHtmlspecialchars( $matches[2] );
	
		if ( ( substr( $url, 0, 6 ) == 'mailto' ) || ( substr( $url, 0, 1 ) == '#' ) || ( substr( $url, 0, 4 ) == 'http' ) ) {
			//mailto link or anchor inside mail or already absolute URL, do nothing..
			return $matches[0];
		}
	 
		//TODO: substitute mailing link for tracking and make a mailing stats:
		// find $url (remove absolute link case from above exception) in known links for id, otherwise insert
		// find linkid + mailing id in links_stats table, otherwise create, and re-create a specific url
	
		$url		=	cbSef( $url, true );
	  
		return '<a ' . $matches[1] . 'href="' . $url . '"' . $matches[3] . '>';
	}