Example #1
0
 function display($tpl = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $dispatcher = JDispatcher::getInstance();
     $this->print = JRequest::getBool('print');
     $this->state = $this->get('State');
     $this->user = $user;
     $this->user = ideary::getUserInfoById($this->user->id);
     $userextra = Ideary::getExtraUserData($_GET["id"]);
     $this->assignRef('userextra', $userextra);
     $this->userDatafinal = Ideary::getuserData($this->user->id);
     $this->userDatafinal = $this->userDatafinal[0];
     $this->userExtraData = Ideary::getExtraUserData($this->user->id);
     $this->period = isset($_POST['period']) ? $_POST['period'] : 'LAST-WEEK';
     $this->messages = Ideary::getUserMessages($this->user->id);
     $user_followers = Ideary::getUserFollowers($this->user->id);
     $followers = array();
     foreach ($user_followers as $follower) {
         $followers[] = $follower->follower_id;
     }
     $this->user_followers = $followers;
     $this->messages_sent = Ideary::getUserMessagesSent($this->user->id);
     $this->inbox_messages = Ideary::getMessagesOfFollowedUsersByUserId($this->user->id);
     $this->unknown_users_messages = Ideary::getMessagesOfNoFollowedUsersByUserId($this->user->id);
     $this->sent_messages = Ideary::getMessagesSentByUserId($this->user->id);
     Ideary::setAllMailsAsReaded($this->user->id);
     //$this->_prepareDocument();
     parent::display($tpl);
 }
Example #2
0
 function display($tpl = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $dispatcher = JDispatcher::getInstance();
     $user_id = $this->get('id');
     $loggedUser = JFactory::getUser();
     $loggedUserId = $loggedUser->get('id');
     if (isset($_GET["id"])) {
         $user = ideary::getUserById($_GET["id"], $loggedUserId);
         $userextra = Ideary::getExtraUserData($_GET["id"]);
         $this->assignRef('userextra', $userextra);
     }
     $texts = ideary::getTextsByUserId($_GET["id"], $loggedUserId);
     $yes_clapped_texts = ideary::getUserPermission('clap_texts_visib', $_GET["id"], $loggedUserId);
     $this->assignRef('texts', $texts);
     $this->assignRef('yes_clapped_texts', $yes_clapped_texts);
     $this->assignRef('return', $return);
     $this->assignRef('user', $user);
     $this->assignRef('loggedUser', $loggedUser);
     $this->assignRef('lgid', $loggedUserId);
     $this->document->setTitle($user->name);
     parent::display($tpl);
 }
Example #3
0
            }
            $authorLink = $comment->user_id != $user->id ? JRoute::_('index.php?option=com_contact&view=public&id=' . $comment->user_id) : JRoute::_('index.php?option=com_users&view=profile&user_id=' . $comment->user_id);
            ?>

                <div class="comment">
                    <a name="comment-<?php 
            echo $comment->id;
            ?>
"></a>
                    <div class="commentator-img">
						<a href="<?php 
            echo $authorLink;
            ?>
">
							<?php 
            echo Ideary::getUserImage($comment->user_id, "50", $comment->author_name);
            ?>
						</a>
                    </div>

                    <div class="comment-data">
                        <a href="<?php 
            echo $authorLink;
            ?>
" class="author-name-link">
                            <div class="author-name"><?php 
            echo $comment->author_name;
            ?>
</div>
                        </a>
                        <div class="comment-text" data-comment-id="<?php 
Example #4
0
        <?php 
if (count($this->sent_messages) > 0) {
    ?>
            <div class="messages-list">
                <?php 
    foreach ($this->sent_messages as $inbox_message) {
        ?>

                    <div class="message-item" data-message-id="<?php 
        echo $inbox_message->message_id;
        ?>
">

                        <div class="message-user-img">
                            <?php 
        echo Ideary::getUserImage($inbox_message->id, 50, null, null, null);
        ?>
                        </div>

                        <div class="message-container">

                            <div class="message-header">
                                <div class="message-title"><?php 
        echo str_replace('{USER}', '<span class="msg-user-link"><a href="index.php?option=com_contact&view=public&id=' . $inbox_message->id . '">' . $inbox_message->name . '</a></span>', JTEXT::_('MESSAGE_SENT_TO'));
        ?>
</div>
                                <div class="message-delete" title="<?php 
        echo JTEXT::_('DELETE_MESSAGE');
        ?>
" data-message-id="<?php 
        echo $inbox_message->message_id;
Example #5
0
 public function save_message()
 {
     $app = JFactory::getApplication();
     $loggedUser = JFactory::getUser()->get('id');
     $user_id = JRequest::getInt('user_id');
     $message = JRequest::getString('message');
     $result = Ideary::sendMessage($loggedUser, $user_id, $message);
     $message_id = $result;
     $result = $result == 0 ? false : true;
     $notificationType = Ideary::getNotificationTypeByType('message');
     if ($result) {
         Ideary::saveNotification($notificationType->id, $user_id, 'null', $loggedUser, $message_id);
         $sentMessagesList = Ideary::getMessagesSentByUserId($loggedUser);
         $sentMessagesListHtml = Ideary::getMessageListContent($sentMessagesList);
         echo json_encode(array('success' => $result, 'sentMessagesListHtml' => $sentMessagesListHtml));
     } else {
         echo json_encode(array('success' => $result));
     }
     $app->close();
 }
Example #6
0
				
			<?php 
} else {
    $session = JFactory::getSession();
    //$user_picture = $session->get('user_picture');
    $user_picture = Ideary::getUserImage($user->id, "50", $user->get('name'));
    ?>

			<div id="user-logo">
				<?php 
    echo $user_picture;
    ?>
			</div>
			<div id="username">
				<?php 
    echo Ideary::getUserName($user->id);
    ?>
			</div>

			<?php 
}
?>
		</div>


        <?php 
if (!$user->id) {
    ?>
			<div id="login-container" class="menu-slider" style="width: 190px; padding: 17px 20px 20px 20px;">
                <jdoc:include type="modules" name="loginpopupbox" style="beezDivision" headerLevel="3" />
            </div>
Example #7
0
        echo $i;
        ?>
</div>
                    <div class="user-ranking-index-right"></div>
                </div>

                <div class="user-ranking-img-container">
					<a href="<?php 
        echo JRoute::_('index.php?option=com_contact&view=public&id=' . $author->id);
        ?>
" title="<?php 
        echo $author->name;
        ?>
">
						<?php 
        $user_picture = Ideary::getUserImage($author->id, "200", $author->name, 'style="width:104px;height:104px;"', JURI::base() . "templates/beez_20/images/no-user-image.png");
        echo $user_picture;
        ?>
					</a>
                </div>

                <div class="user-ranking-name">
					<a href="<?php 
        echo JRoute::_('index.php?option=com_contact&view=public&id=' . $author->id);
        ?>
" title="<?php 
        echo $author->name;
        ?>
">
						<?php 
        echo $author->name;
Example #8
0
$imageName = ideary::getUserImageName($this->user->id);
?>
                        <?php 
if ($imageName && ideary::existAllImagesOfUser($this->user->id)) {
    ?>

                            <div id="edit-profile-img">
                                <div id="edit-profile-img-data">
                                    <div id="edit-profile-img-name">Cambiar Imagen</div>
                                    <div id="edit-profile-img-delete" data-has-img="true" title="<?php 
    echo JText::_('DELETE_IMAGE');
    ?>
"></div>
                                </div>
                                <img src="<?php 
    echo Ideary::getUserImagePath($this->user->id, 200);
    ?>
">
                            </div>

                        <?php 
} else {
    ?>
                            <div id="edit-profile-no-img">
                                <div id="edit-profile-no-img-icon"></div>
                                <div id="edit-profile-no-img-text"><?php 
    echo JText::_('SELECT_IMAGE');
    ?>
</div>
                            </div>
Example #9
0
 /**
  * Method to save a user's profile data.
  *
  * @return	void
  * @since	1.6
  */
 public function save()
 {
     // Check for request forgeries.
     //JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $app = JFactory::getApplication();
     $app->setUserState('users.editinterest', 0);
     $model = $this->getModel('Profile', 'UsersModel');
     $user = JFactory::getUser();
     $userId = (int) $user->get('id');
     $useridd = $userId;
     $error = false;
     $profileImageErrors = array();
     if (isset($_POST["fromwhere"]) && $_POST["fromwhere"] == "editprofile") {
         $editProfileVersion = 2 - $userId % 2;
         ideary::logUserExperience(UserExperience::EditProfile, $userId, $editProfileVersion);
         $jform['name'] = $_POST['jform']['name'];
         $jform['profile']['dob'] = $_POST['jform']['profile']['dob'];
         $jform['profile']['country'] = $_POST['jform']['profile']['country'];
         $jform['profile']['region'] = $_POST['jform']['profile']['region'];
         $jform['profile']['city'] = $_POST['jform']['profile']['city'];
         $jform['profile']['phone'] = $_POST['jform']['profile']['phone'];
         $jform['profile']['address1'] = $_POST['jform']['profile']['address1'];
         $jform['profile']['address2'] = $_POST['jform']['profile']['address2'];
         $jform['profile']['website'] = $_POST['jform']['profile']['website'];
         $jform['profile']['aboutme'] = $_POST['jform']['profile']['aboutme'];
         $app->setUserState('jform', $jform);
         $app->setUserState('juser_interests', $_POST['juser_interests']);
         $file['error'] = $_FILES['jform']['error']['profilepicture']['file'];
         $file['size'] = $_FILES['jform']['size']['profilepicture']['file'];
         $file['type'] = $_FILES['jform']['type']['profilepicture']['file'];
         $file['name'] = $_FILES['jform']['name']['profilepicture']['file'];
         $file['tmp_name'] = $_FILES['jform']['tmp_name']['profilepicture']['file'];
         $profileImageErrors = Ideary::validateUploadedImage($file, 200, 200);
         $app->setUserState('profile-image-errors', $profileImageErrors);
         if (count($profileImageErrors)) {
             $error = true;
         }
         if ($error) {
             $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id=' . $userId, false));
             return false;
         } else {
             //subo imagen de perfil
             $profileImg = $_FILES['jform'];
             if ($profileImg['error']['profilepicture']['file'] == 0) {
                 $profileImg['error']['profilepicture']['file'];
                 $folder = "templates/beez_20/images/user_profile/" . $userId . "/";
                 ideary::rrmdir($folder);
                 if (!file_exists($folder)) {
                     mkdir($folder, 0777, true);
                 }
                 $original_folder = $folder . 'original/';
                 if (!file_exists($original_folder)) {
                     mkdir($original_folder, 0777, true);
                 }
                 $cincuenta_folder = $folder . '50/';
                 if (!file_exists($cincuenta_folder)) {
                     mkdir($cincuenta_folder, 0777, true);
                 }
                 $doscientos_folder = $folder . '200/';
                 if (!file_exists($doscientos_folder)) {
                     mkdir($doscientos_folder, 0777, true);
                 }
                 $ext = "." . pathinfo($profileImg['name']['profilepicture']['file'], PATHINFO_EXTENSION);
                 $randName = rand(1, getrandmax());
                 $fullRandName = $original_folder . $randName . $ext;
                 while (file_exists($fullRandName)) {
                     $randName = rand(1, getrandmax());
                     $fullRandName = $original_folder . $randName . $ext;
                 }
                 $ok = move_uploaded_file($profileImg['tmp_name']['profilepicture']['file'], $fullRandName);
                 if ($ok) {
                     Ideary::image_resize($fullRandName, $cincuenta_folder . $randName . $ext, 50, 50, true);
                     Ideary::image_resize($fullRandName, $doscientos_folder . $randName . $ext, 200, 200, true);
                     Ideary::saveProfileImage($userId, $randName . $ext);
                 }
             }
             $result = Ideary::saveInterests($userId, $_POST["juser_interests"]);
             // aca guardo los intereses
             //subo imagen de fondo
             $backgroundImg = $_FILES['background-img'];
             if ($backgroundImg['error'] == 0) {
                 $folder = "templates/beez_20/images/user_backgrounds/" . $userId . "/";
                 if (!file_exists($folder)) {
                     mkdir($folder, 0777, true);
                 }
                 $ext = "." . pathinfo($backgroundImg['name'], PATHINFO_EXTENSION);
                 $randName = rand(1, getrandmax());
                 $fullRandName = $folder . $randName . $ext;
                 while (file_exists($fullRandName)) {
                     $randName = rand(1, getrandmax());
                     $fullRandName = $folder . $randName . $ext;
                 }
                 $ok = move_uploaded_file($backgroundImg["tmp_name"], $fullRandName);
                 if ($ok) {
                     ideary::saveBgImage($userId, $randName . $ext);
                 }
             }
         }
     } elseif (isset($_POST["fromwhere"]) && $_POST["fromwhere"] == "editconfiguration") {
         $data_notif = JRequest::getVar('privacidad_notificaciones', array(), 'post', 'array');
         $result = Ideary::saveUserNotif($userId, $data_notif);
         // aca guardo los intereses
     }
     // Get the user data.
     $data = JRequest::getVar('jform', array(), 'post', 'array');
     //var_dump($data);
     // Force the ID to this user.
     $data['id'] = $userId;
     // Validate the posted data.
     $form = $model->getForm();
     if (!$form) {
         JError::raiseError(500, $model->getError());
         return false;
     }
     // Validate the posted data.
     //$data = $model->validate($form, $data);
     //var_dump($data);die;
     // Check for errors.
     if ($data === false) {
         // Get the validation messages.
         $errors = $model->getErrors();
         // Push up to three validation messages out to the user.
         for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
             if ($errors[$i] instanceof Exception) {
                 $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
             } else {
                 $app->enqueueMessage($errors[$i], 'warning');
             }
         }
         // Save the data in the session.
         $app->setUserState('com_users.edit.profile.data', $data);
         // Redirect back to the edit screen.
         $userId = (int) $app->getUserState('com_users.edit.profile.id');
         //			$this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id='.$userId, false));
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&user_id=' . $userId, false));
         return false;
     }
     mysql_set_charset("utf8");
     // Attempt to save the data.
     $return = $model->save($data);
     if (isset($data["params"]["language"])) {
         $currentuserlang = $data["params"]["language"];
         $currentuserlang = substr($currentuserlang, 0, 2);
     } else {
         $currentuserlang = "es";
     }
     // Check for errors.
     if ($return === false) {
         // Save the data in the session.
         $app->setUserState('com_users.edit.profile.data', $data);
         // Redirect back to the edit screen.
         $userId = (int) $app->getUserState('com_users.edit.profile.id');
         $this->setMessage(JText::sprintf('COM_USERS_PROFILE_SAVE_FAILED', $model->getError()), 'warning');
         //	$this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id='.$userId, false));
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&user_id=' . $useridd . '&lang=' . $currentuserlang));
         return false;
     }
     // Redirect the user and adjust session state based on the chosen task.
     switch ($this->getTask()) {
         case 'apply':
             // Check out the profile.
             $app->setUserState('com_users.edit.profile.id', $return);
             $model->checkout($return);
             // Redirect back to the edit screen.
             $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
             $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&layout=edit&hidemainmenu=1', false));
             break;
         default:
             // Check in the profile.
             $userId = (int) $app->getUserState('com_users.edit.profile.id');
             if ($userId) {
                 $model->checkin($userId);
             }
             // Clear the profile id from the session.
             $app->setUserState('com_users.edit.profile.id', null);
             // Redirect to the list screen.
             $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
             $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&user_id=' . $return, false));
             break;
     }
     // Flush the data from the session.
     $app->setUserState('com_users.edit.profile.data', null);
 }
Example #10
0
 public function add_tag()
 {
     // Get the application object.
     $app = JFactory::getApplication();
     $tag_id = JRequest::getString("tag_id");
     $tag_name = JRequest::getString("tag_name");
     $text_id = JRequest::getString("text_id");
     //$article_model = $this->getModel('article');
     //$tagId = $article_model->addTag($tag_id, $tag_name, $text_id);
     $tagId = Ideary::addTag($tag_id, $tag_name, $text_id);
     echo json_encode(array('tag_id' => $tagId));
     $app->close();
 }
Example #11
0
 /**
  * Method to display the view.
  *
  * @param	string	$tpl	The template file to include
  * @since	1.6
  */
 public function display($tpl = null)
 {
     // Get the view data.
     $this->data = $this->get('Data');
     $this->form = $this->get('Form');
     $this->state = $this->get('State');
     $this->params = $this->state->get('params');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Check if a user was found.
     if (!$this->data->id) {
         JError::raiseError(404, JText::_('JERROR_USERS_PROFILE_NOT_FOUND'));
         return false;
     }
     $app = JFactory::getApplication();
     $this->user2 = JFactory::getUser();
     $getUserId = $_GET['user_id'] ? $_GET['user_id'] : $this->user2->id;
     if ($getUserId != $this->user2->id) {
         $app->redirect(JRoute::_('index.php'));
     }
     // Check for layout override
     $active = JFactory::getApplication()->getMenu()->getActive();
     if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
     }
     $this->user = ideary::getUserInfoById($this->user2->id);
     $this->userData = ideary::getUserById($this->user2->id);
     $resultEN = strpos($this->user->params, 'en-GB');
     $resultES = strpos($this->user->params, 'es-ES');
     $resultPT = strpos($this->user->params, 'pt-BR');
     $userextra = Ideary::getExtraUserData($_GET["id"]);
     if ($resultEN != false && $resultEN != null) {
         $currentlang = 'en-GB';
     } elseif ($resultES != false && $resultES != null) {
         $currentlang = 'es-ES';
     } elseif ($resultPT != false && $resultPT != null) {
         $currentlang = 'pt-BR';
     }
     $this->assignRef('userextra', $userextra);
     $this->assignRef('currentlang', $currentlang);
     $this->userDatafinal = Ideary::getuserData($this->user->id);
     $this->userDatafinal = $this->userDatafinal[0];
     $this->userExtraData = Ideary::getExtraUserData($this->user->id);
     $this->cant_pub = Ideary::getUserCantTexts($this->user->id, 1);
     $this->cant_draft = Ideary::getUserCantTexts($this->user->id, 0);
     if ($_GET["layout"] == "edit") {
         $this->categories = Ideary::getCategories();
         $this->user_interests = Ideary::getUserInterests($this->user->id);
     }
     if ($_GET["layout"] == "userconfiguration") {
         $this->UserNotifSettings = Ideary::getUserNotifSettings($this->user->id);
         if (count($this->UserNotifSettings) > 0) {
             $this->UserNotifSettings = $this->UserNotifSettings[0];
         }
     }
     $pub = $_GET['draft'] == 1 ? 0 : 1;
     $text_type = $pub ? 'published' : 'draft';
     $texts = ideary::getTextsOfUser($this->user->id, $pub, 0, 10);
     $countAlltexts = ideary::getCountTextsByUserId($this->user->id, $pub);
     $this->assignRef('texts', $texts);
     $this->assignRef('countAlltexts', $countAlltexts);
     $this->assignRef('text_type', $text_type);
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));
     $this->prepareDocument();
     parent::display($tpl);
 }
Example #12
0
            if ($user1->id == $user->get('id')) {
                $user_url = JRoute::_('index.php?option=com_users&view=profile');
            } else {
                $user_url = JRoute::_('index.php?option=com_contact&view=public&id=' . $user1->id);
            }
            ?>

                <a href="<?php 
            echo $user_url;
            ?>
" title="<?php 
            echo $user1->name;
            ?>
">
                    <?php 
            echo Ideary::getUserImage($user1->id, "200", $user1->name, 'style="width:110px;height:110px;"');
            ?>
                </a>
            </div>

            <div class="user-box-content">

                <div class="user-name">
                    <a href="<?php 
            echo $user_url;
            ?>
" title="<?php 
            echo $user1->name;
            ?>
">
                        <?php 
Example #13
0
 /**
  * Method to save the form data.
  *
  * @param	array		The form data.
  * @return	mixed		The user id on success, false on failure.
  * @since	1.6
  */
 public function register($temp)
 {
     $config = JFactory::getConfig();
     $db = $this->getDbo();
     $params = JComponentHelper::getParams('com_users');
     // Initialise the table with JUser.
     $user = new JUser();
     $data = (array) $this->getData();
     // Merge in the registration data.
     foreach ($temp as $k => $v) {
         $data[$k] = $v;
     }
     // Prepare the data for the user object.
     $data['email'] = $data['email1'];
     $data['password'] = $data['password1'];
     $useractivation = $params->get('useractivation');
     $sendpassword = $params->get('sendpassword', 1);
     // Check if the user needs to activate their account.
     // if (($useractivation == 1) || ($useractivation == 2)) {
     // 	$data['activation'] = JApplication::getHash(JUserHelper::genRandomPassword());
     // 	$data['block'] = 1;
     // }
     // Bind the data.
     if (!$user->bind($data)) {
         $this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError()));
         return false;
     }
     // Load the users plugin group.
     JPluginHelper::importPlugin('user');
     // Store the data.
     if (!$user->save()) {
         $this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError()));
         return false;
     }
     // Compile the notification mail values.
     $data = $user->getProperties();
     $data['fromname'] = $config->get('fromname');
     $data['mailfrom'] = $config->get('mailfrom');
     $data['sitename'] = $config->get('sitename');
     $data['siteurl'] = JUri::root();
     // Handle account activation/confirmation emails.
     if ($useractivation == 2) {
         // Set the link to confirm the user email.
         $uri = JURI::getInstance();
         $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
         $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         if ($sendpassword) {
             $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl']);
         } else {
             $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $data['username']);
         }
     } elseif ($useractivation == 1) {
         // Set the link to activate the user account.
         $uri = JURI::getInstance();
         $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
         $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         if ($sendpassword) {
             $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl']);
         } else {
             $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $data['username']);
         }
     } else {
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_BODY', $data['name'], $data['sitename'], $data['siteurl']);
     }
     // Send the registration email.
     //$emailBody = Ideary::emailBody($data['name'],$data['sitename'],$data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],$data['siteurl']);
     $emailBody = Ideary::emailBodyTable($data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl']);
     //$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
     /*Rodrigo cambio esto para que funcione*/
     $headers = 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     //$headers .= 'To: '.$data['email'].' <'.$data['email'].'>' . "\r\n";
     $headers .= 'From: ' . $data['fromname'] . ' <' . $data['mailfrom'] . '>' . "\r\n";
     $return = mail($data['email'], $emailSubject, $emailBody, $headers);
     //	$return2 = mail("*****@*****.**", $emailSubject, $emailBody,$headers);
     //Send Notification mail to administrators
     if ($params->get('useractivation') < 2 && $params->get('mail_to_admin') == 1) {
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         $emailBodyAdmin = JText::sprintf('COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY', $data['name'], $data['username'], $data['siteurl']);
         // get all admin users
         $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE sendEmail=1';
         $db->setQuery($query);
         $rows = $db->loadObjectList();
         // Send mail to all superadministrators id
         foreach ($rows as $row) {
             $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin);
             // Check for an error.
             if ($return !== true) {
                 $this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED'));
                 return false;
             }
         }
     }
     // Check for an error.
     if ($return !== true) {
         $this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED'));
         // Send a system message to administrators receiving system mails
         $db = JFactory::getDBO();
         $q = "SELECT id\n\t\t\t\tFROM #__users\n\t\t\t\tWHERE block = 0\n\t\t\t\tAND sendEmail = 1";
         $db->setQuery($q);
         $sendEmail = $db->loadColumn();
         if (count($sendEmail) > 0) {
             $jdate = new JDate();
             // Build the query to add the messages
             $q = "INSERT INTO " . $db->quoteName('#__messages') . " (" . $db->quoteName('user_id_from') . ", " . $db->quoteName('user_id_to') . ", " . $db->quoteName('date_time') . ", " . $db->quoteName('subject') . ", " . $db->quoteName('message') . ") VALUES ";
             $messages = array();
             foreach ($sendEmail as $userid) {
                 $messages[] = "(" . $userid . ", " . $userid . ", '" . $jdate->toSql() . "', '" . JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT') . "', '" . JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username']) . "')";
             }
             $q .= implode(',', $messages);
             $db->setQuery($q);
             $db->query();
         }
         return false;
     }
     if ($useractivation == 1) {
         return "useractivate";
     } elseif ($useractivation == 2) {
         return "adminactivate";
     } else {
         return $user->id;
     }
 }
Example #14
0
    ?>
">
						<?php 
    echo Ideary::getUserImage($this->writer->id, "50", $this->writer->name);
    ?>
				
					</a>
				<?php 
} else {
    ?>
					<a href="<?php 
    echo JRoute::_('index.php?option=com_users&view=profile');
    ?>
">
						<?php 
    echo Ideary::getUserImage($this->writer->id, "50", $this->writer->name);
    ?>
				
					</a>
				<?php 
}
?>
            </div>
            <div style="clear: both;"></div>
        </div>

        <?php 
if ($this->item->created_by != $this->user->get('id') && $this->user->get('id') != 0) {
    ?>
        <div id="author-buttons-container">
            <div id="follow-button2-container">
Example #15
0
 public function generateUsersForMsgCombo($users)
 {
     $html = '';
     if (count($users)) {
         foreach ($users as $user) {
             $html .= '<div class="user-item" data-user-id="' . $user->id . '" data-user-name="' . $user->name . '">';
             $html .= '<div class="user-item-img">';
             $html .= Ideary::getUserImage($user->id, 50, null, 'style="width: 24px; height: 24px;"', null);
             $html .= '</div>';
             $html .= '<div class="user-item-name">' . $user->name . '</div>';
             $html .= '</div>';
         }
     } else {
         $html .= 'No hay usuarios';
     }
     return $html;
 }
Example #16
0
<?php 
if (JFactory::getUser()->id == $this->data->id) {
    ?>

<div id="public-profile-containers">

	<div id="public-profile-left-container">

		<div id="public-profile-left-border">
			<div id="public-profile-left-content">

				<div id="public-profile">
					<div id="public-profile-img">
						<?php 
    echo Ideary::getUserImage($this->user->id, "200", $this->user->name, 'style="width:100px;height:100px;"');
    ?>
					</div>
					
					<div id="public-profile-data">
						<div id="public-profile-username"><?php 
    echo $this->user->name;
    ?>
</div>
					</div>
					<div style="clear: both;"></div>
					<div id="public-profile-legend"><?php 
    echo $frasepersonal;
    ?>
</div>
				</div>
Example #17
0
<script type="text/javascript">
    resize();
</script>

<div id="no-texts-author-box" class="no-texts-box">

    <div id="no-texts-icon" class="no-texts-box-icon"></div>

    <div class="no-texts-box-text" style="width: 314px; margin-left: 47px;">Por el momento, <?php 
echo $this->user->name;
?>
 no posee textos redactados.</div>
    <div id="invited-to-write-button-container" style="text-align: center;">

        <?php 
if (Ideary::writerInvitedToWrite(JFactory::getUser()->get('id'), $this->user->id)) {
    ?>
            <div id="thanks-button" class="simple-button">Gracias</div>
        <?php 
} else {
    ?>
            <div id="invited-to-write-button" class="simple-button">Invitar a escribir</div>
        <?php 
}
?>

    </div>
</div>

<div id="no-applauded-texts-author-box" class="no-texts-box">