Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.00 KB | None | 0 0
  1. defined('_JEXEC') or die('Restricted access');
  2.  
  3. if( $my->isOnline() && $my->id != 0 )
  4. {
  5.     $inboxModel         = CFactory::getModel('inbox');
  6.     $filter             = array();
  7.     $filter['user_id']  = $my->id;
  8.     $friendModel        = CFactory::getModel ( 'friends' );
  9.     $profileid          = JRequest::getVar('userid' , 0 , 'GET');
  10.    
  11.     $params->def('unreadCount', $inboxModel->countUnRead ( $filter ));
  12.     $params->def('pending', $friendModel->countPending( $my->id ));
  13.     $params->def('myLink', CRoute::_('index.php?option=com_community&view=profile&userid='.$my->id));
  14.     $params->def('myName', $my->getDisplayName());
  15.     $params->def('myAvatar', $my->getAvatar());
  16.     $params->def('myId', $my->id);
  17.     $params->def('myKarma', CUserPoints::getPointsImage($my));
  18.     $params->def('enablephotos', $config->get('enablephotos'));
  19.     $params->def('enablevideos', $config->get('enablevideos'));
  20.     $params->def('enablegroups', $config->get('enablegroups'));
  21.     $params->def('enableevents', $config->get('enableevents'));
  22.    
  23.     $enablekarma    = $config->get('enablekarma') ? $params->get('show_karma' , 1 ) : $config->get('enablekarma');
  24.     $params->def('enablekarma', $enablekarma);
  25.  
  26.     $js     = modHelloMeHelper::getHelloMeScript( $my->getStatus() , COwnerHelper::isMine($my->id, $profileid) );
  27.     $document   = JFactory::getDocument();
  28.     $document->addScriptDeclaration($js);
  29.    
  30.     if($params->get('enable_facebookconnect', '1'))
  31.     {
  32.         $params->def('facebookuser', modHelloMeHelper::isFacebookUser());
  33.     }
  34.     else
  35.     {
  36.         $params->def('facebookuser', false);
  37.     }
  38.    
  39.     CFactory::load( 'helpers' , 'string');
  40.    
  41.     $unreadCount    = $params->get('unreadCount', 1);
  42.     $pending        = $params->get('pending', 1);
  43.     $myLink         = $params->get('myLink', 1);
  44.     $myName         = $params->get('myName', 1);
  45.     $myAvatar       = $params->get('myAvatar', 1);
  46.     $myId           = $params->get('myId', 1);
  47.     $myKarma        = $params->get('myKarma', 1);
  48.     $enablephotos   = $params->get('enablephotos', 1);
  49.     $enablevideos   = $params->get('enablevideos', 1);
  50.     $enablegroups   = $params->get('enablegroups', 1);
  51.     $enableevents   = $params->get('enableevents', 1);
  52.     $show_avatar    = $params->get('show_avatar', 1);
  53.     $show_karma     = $params->get('enablekarma', 1);
  54.     $show_myblog    = $params->get('show_myblog', 1);
  55.     $facebookuser   = $params->get('facebookuser', false);
  56.     $config = CFactory::getConfig();
  57.     $uri    = CRoute::_('' , false );
  58.     $uri    = base64_encode($uri);
  59.  
  60.     CFactory::load('helpers' , 'string' );
  61. ?>
  62.     <div style="text-align: center; border-bottom: 1px solid #ccc; margin: 4px 0; padding: 0 0 10px;">
  63.         <div><a href ="<?php echo $myLink; ?>"><?php echo CStringHelper::escape( $myName ); ?></a></div>
  64.         <?php
  65.         if($show_avatar)
  66.         {
  67.         ?>
  68.             <img src="<?php echo $myAvatar; ?>" alt="<?php echo CStringHelper::escape( $myName ); ?>" style="padding: 2px; border: solid 1px #ccc;" />
  69.         <?php
  70.         }
  71.         ?>
  72.         <div>
  73.         <?php  
  74.         if($show_karma)
  75.         {
  76.         ?>
  77.             <img src="<?php echo $myKarma; ?>" alt="<?php echo JText::_('MOD_HELLOME_KARMA'); ?>" width="103" height="19" style="margin: 5px 0 0;" />
  78.         <?php
  79.         }
  80.         ?>
  81.         </div>
  82.         <div class="helloMeStatusText" style="margin-top:5px;">
  83.             <div id="helloMeEdit" style="display: none;">
  84.                 <input name="helloMeStatusText" id="helloMeStatusText" type="text" class="status inputbox" style="width: 90%; margin: 0 auto;" value="" onblur="helloMe.saveStatus();return false;" onkeyup="helloMe.saveChanges(event);return false;" />
  85.             </div>
  86.             <div id="helloMeDisplay">
  87.                 <span href="javascript:void(0);" id="helloMeStatusLink" style="text-decoration: none; cursor: pointer;" onclick="helloMe.changeStatus();">
  88.                     <span id="helloMeStatus" style="text-decoration: none;"></span>
  89.                 </span>
  90.             </div>
  91.         </div>
  92.     </div>
  93.    
  94.     <div style="border-bottom: 1px solid #ecebeb; margin: 4px 0; padding: 0 0 10px;">
  95.         <a href="javascript:void(0);" id="saveLink" style="line-height: 18px; padding: 0 0 0 22px; display: none; background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -440px;" onclick="helloMe.saveStatus();" class="icon-save"><?php echo JText::_('MOD_HELLOME_SAVE_MY_STATUS'); ?></a>
  96.         <a href="javascript:void(0);" id="editLink" style="line-height: 18px; padding: 0 0 0 22px; display: block; background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -419px;" onclick="helloMe.changeStatus();" class="icon-edit"><?php echo JText::_('MOD_HELLOME_EDIT_MY_STATUS'); ?></a>
  97.     </div>
  98.    
  99.     <div style="border-bottom: 1px solid #ecebeb; margin: 4px 0; padding: 0 0 10px;">              
  100.         <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -118px; padding: 0 0 0 22px;">
  101.             <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=inbox'); ?>"><?php echo JText::sprintf( (cIsPlural($unreadCount)) ? 'MOD_HELLOME_NEW_MESSAGE_MANY' : 'MOD_HELLOME_NEW_MESSAGE', $unreadCount); ?></a>
  102.         </div>
  103.         <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -180px; padding: 0 0 0 22px;">
  104.             <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=friends&task=pending'); ?>"><?php echo JText::sprintf( (cIsPlural($pending)) ? 'MOD_HELLOME_NEW_FRIEND_REQUEST_MANY' : 'MOD_HELLOME_NEW_FRIEND_REQUEST', $pending); ?></a>
  105.         </div>
  106.     </div>
  107.    
  108.     <div style="border-bottom: 1px solid #ecebeb; margin: 4px 0; padding: 0 0 10px;">
  109.         <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 0; padding: 0 0 0 22px;">
  110.             <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=friends&userid='.$myId); ?>"><?php echo JText::_('MOD_HELLOME_MY_FRIENDS'); ?></a>
  111.         </div>
  112.         <?php
  113.         if($enablegroups)
  114.         {
  115.         ?>                 
  116.             <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -58px; padding: 0 0 0 22px;">
  117.                 <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=mygroups&userid='.$myId); ?>"><?php echo JText::_('MOD_HELLOME_MY_GROUPS'); ?></a>
  118.             </div>
  119.         <?php
  120.         }
  121.         ?>
  122.         <?php
  123.         if($enablephotos)
  124.         {
  125.         ?>
  126.             <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -356px; padding: 0 0 0 22px;">
  127.                 <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=photos&task=myphotos&userid='.$myId); ?>"><?php echo JText::_('MOD_HELLOME_MY_PHOTOS'); ?></a>
  128.             </div>
  129.         <?php
  130.         }
  131.         ?>
  132.         <?php
  133.         if($enablevideos)
  134.         {
  135.         ?>
  136.             <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -398px; padding: 0 0 0 22px;">
  137.                 <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=videos&task=myvideos&userid='.$myId); ?>"><?php echo JText::_('MOD_HELLOME_MY_VIDEOS'); ?></a>
  138.             </div>
  139.         <?php
  140.         }
  141.         ?>
  142.         <?php
  143.         if($enableevents)
  144.         {
  145.         ?>
  146.             <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icon-calendar.png) no-repeat 0 2px; padding: 0 0 0 22px;">
  147.                 <a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=myevents&userid='.$myId); ?>"><?php echo JText::_('MOD_HELLOME_MY_EVENTS'); ?></a>
  148.             </div>
  149.         <?php
  150.         }
  151.         ?>
  152.         <?php
  153.         if($show_myblog)
  154.         {
  155.             if(file_exists(JPATH_ROOT . DS . "components" . DS . "com_myblog" . DS . "functions.myblog.php"))
  156.             {
  157.                 include_once(JPATH_ROOT . DS . "components" . DS . "com_myblog" . DS . "functions.myblog.php");
  158.                 $myblogItemId   = myGetItemId();
  159.         ?>
  160.                 <div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -338px; padding: 0 0 0 22px;">
  161.                     <a style="line-height: 18px;" href="<?php echo JRoute::_('index.php?option=com_myblog&blogger='. $myName .'&Itemid='.$myblogItemId); ?>"><?php echo JText::_('MOD_HELLOME_MYBLOGS'); ?></a>
  162.                 </div>
  163.         <?php
  164.             }
  165.         }
  166.         ?>
  167.     </div>
  168.  
  169. <?php
  170. }
  171. else
  172. {
  173.     $content = '';
  174.    
  175.     if($params->get('enable_login', '1'))
  176.     {
  177.         $uri    = CRoute::_('index.php?option=com_community&view=profile' , false );
  178.         $uri    = base64_encode($uri);
  179.         $html   = '';
  180.  
  181.         if(JPluginHelper::isEnabled('authentication', 'openid'))
  182.         {
  183.             JHTML::_('script', 'openid');
  184.         }
  185. ?>
  186.         <form action="<?php echo CRoute::_( 'index.php?option='.COM_USER_NAME.'&task='.COM_USER_TAKS_LOGIN ); ?>" method="post" name="form-login" id="form-login" >
  187.             <?php echo $params->get('pretext'); ?>
  188.             <fieldset class="input">
  189.             <p id="form-login-username">
  190.                 <label for="username">
  191.                     <?php echo JText::_('COM_COMMUNITY_USERNAME') ?><br />
  192.                     <input name="username" id="username" type="text" class="inputbox" alt="username" size="18" />
  193.                 </label>
  194.             </p>
  195.             <p id="form-login-password">
  196.                 <label for="passwd">
  197.                     <?php echo JText::_('COM_COMMUNITY_PASSWORD') ?><br />
  198.                     <input type="password" name="<?php echo COM_USER_PASSWORD_INPUT;?>" id="passwd" class="inputbox" size="18" alt="password" />
  199.                 </label>
  200.             </p>
  201.             <?php
  202.             if(JPluginHelper::isEnabled('system', 'remember'))
  203.             {
  204.             ?>
  205.             <p id="form-login-remember">
  206.                 <label for="remember">
  207.                     <?php echo JText::_('Angemeldet bleiben') ?>
  208.                     <input type="checkbox" name="remember" id="remember" value="yes" alt="Remember Me" />
  209.                 </label>
  210.             </p>
  211.             <?php
  212.             }
  213.             ?>
  214.             <input type="submit" name="Submit" class="button" value="<?php echo JText::_('LOGIN') ?>" />
  215.             </fieldset>
  216.             <div style="margin-left:5px;">
  217.                 <div>
  218.                     <a href="<?php echo JRoute::_( 'index.php?option='.COM_USER_NAME.'&view=reset' ); ?>">
  219.                     <?php echo JText::_('MOD_HELLOME_FORGOT_YOUR_PASSWORD'); ?>
  220.                     </a>
  221.                 </div>
  222.                 <div>
  223.                     <a href="<?php echo JRoute::_( 'index.php?option='.COM_USER_NAME.'&view=remind' ); ?>">
  224.                     <?php echo JText::_('MOD_HELLOME_FORGOT_YOUR_USERNAME'); ?>
  225.                     </a>
  226.                 </div>
  227.                 <div>
  228.                     <a href="<?php echo CRoute::_( 'index.php?option=com_community&view=register&task=activation' ); ?>" class="login-forgot-username">
  229.                         <span><?php echo JText::_('MOD_HELLOME_RESEND_ACTIVATION_CODE'); ?></span>
  230.                     </a>
  231.                 </div>
  232.                 <?php
  233.                 $usersConfig = &JComponentHelper::getParams( 'com_users' );
  234.                 if ($usersConfig->get('allowUserRegistration'))
  235.                 {
  236.                 ?>
  237.                 <div>
  238.                     <a href="<?php echo CRoute::_( 'index.php?option=com_community&view=register' ); ?>">
  239.                         <?php echo JText::_('MOD_HELLOME_REGISTER'); ?>
  240.                     </a>
  241.                 </div>
  242.                 <?php
  243.                 }
  244.                 ?>
  245.             </div>
  246.             <?php echo $params->get('posttext'); ?>
  247.        
  248.             <input type="hidden" name="option" value="<?php echo COM_USER_NAME;?>" />
  249.             <input type="hidden" name="task" value="<?php echo COM_USER_TAKS_LOGIN;?>" />
  250.             <input type="hidden" name="return" value="<?php echo $uri; ?>" />
  251.             <?php echo JHTML::_( 'form.token' ); ?>
  252.         </form>
  253. <?php
  254.     }
  255.    
  256.     if($params->get('enable_facebookconnect', '1'))
  257.     {
  258.         if( $my->id == 0 )
  259.         {
  260.             if( $config->get('fbconnectkey') && $config->get('fbconnectsecret') )
  261.             {
  262.         ?>
  263.             <div id="fb-root"></div>
  264.             <script type="text/javascript">
  265.             var count   = 1;
  266.             window.fbAsyncInit = function() {
  267.                 FB.init({appId: '<?php echo $config->get('fbconnectkey');?>', status: false, cookie: true, xfbml: true});
  268.            
  269.                 /* All the events registered */
  270.                 FB.Event.subscribe('auth.login', function(response) {
  271.                     if( count == 1 )
  272.                         joms.connect.update();
  273.                        
  274.                     count++;
  275.                 });
  276.             };
  277.             (function() {
  278.                 var e = document.createElement('script');
  279.                 e.type = 'text/javascript';
  280.                 e.src = document.location.protocol +
  281.                     '//connect.facebook.net/en_US/all.js';
  282.                 e.async = true;
  283.                 document.getElementById('fb-root').appendChild(e);
  284.             }());
  285.             </script>
  286.             <fb:login-button autologoutlink="true" perms="read_stream,publish_stream,offline_access,email,user_birthday,status_update,user_status"><?php echo JText::_('COM_COMMUNITY_SIGN_IN_WITH_FACEBOOK');?></fb:login-button>
  287.         <?php
  288.             }
  289.         }
  290.     }
  291. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement