gteigland VIP
Total posts: 159
22 Июль 2015 15:30

Hope its ok to post this here but since you've been so helpful to me I want to post other integrations that might be helpful to others.

On my default_user_block.php (personalization home page for cobalt section recores) I wanted a link to that same users Easyblog page... where they can access that same users blog pages.

On top I put this for reference

require_once(JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php');

And then my code to render that users pages link:

<a href="/../<?php echo EB::user($current_user->id)->getPermalink();?>" img or text here </a>

Последние изменения: 04 Сен 2015



pepperstreet VIP
Total posts: 3,837
23 Июль 2015 02:41

+1

That's the joomla spirit! ;)
Maybe worth to collect and put everything into the Cobalt Docs.


gteigland VIP
Total posts: 159
23 Июль 2015 11:46

Sure.. Ill do that once I get all my integrations done and you can overlook the code to make sure it's clean, I'm no expert.. :)


Sergey
Total posts: 13,748
23 Июль 2015 16:11

+1


gteigland VIP
Total posts: 159
23 Июль 2015 18:50

Here's another important code that has been tested and works. A little background For EasySocial I have a plugin that syncs my EasyBlog biography a custom field(User Profile) in EasySocial. http://stackideas.com/apps/item/44-easyblog-biography That way my user doesn't have to write it twice. For the case of my site is the "Artist Statement" of each user.

My guess is that this will also work if you just have Easyblog (but not 100% certain) if you want to display the biography information from Easyblog into your Cobalt user page.

<?php
   $userobj2 = JFactory::getUser();
   $guserid2 = $userobj2->get('id');
   $dbobj2   = JFactory::getDBO();
   $query2   = $dbobj2->getQuery(true);
   $query2->select('biography');
   $query2->from('#__easyblog_users');
   $query2->where('id = ' .$guserid2 );
   $dbobj2->setQuery($query2);
   $biography_ar   = $dbobj2->loadRowList();
   foreach($biography_ar as $temp_biography):        
        if(count($temp_biography)>0) echo JText::_($temp_biography[0]);
   endforeach;
?>

gteigland VIP
Total posts: 159
27 Июль 2015 20:00

The code above will show that easyblog bio ONLY if a user is logged in. Below will show that info with public AND registered users.

<?php

   $$userId = JFactory::getApplication()->input->getInt('user_id');
   $guserid2=  $$userId;

   $dbobj2         = JFactory::getDBO();
   $query2  = $dbobj2->getQuery(true);
   $query2->select('biography');
   $query2->from('#__easyblog_users');
   $query2->where('id = ' .$guserid2 );
   $dbobj2->setQuery($query2);
   $biography_ar   = $dbobj2->loadRowList();
   foreach($biography_ar as $temp_biography):        
        if(count($temp_biography)>0) echo JText::_($temp_biography[0]);
   endforeach;
?>

pepperstreet VIP
Total posts: 3,837
01 Авг 2015 01:50

gteigland For EasySocial I have a plugin that syncs my EasyBlog biography a custom field(User Profile) in EasySocial. http://stackideas.com/apps/item/44-easyblog-biography That way my user doesn't have to write it twice. For the case of my site is the "Artist Statement" of each user.

Just out of curiosity, isn't "biography" part of the user profile... isn't it a "field" that you can read/set through ES API ? In other posts, you have alread used their "foundry" to get users values. The unique fieldID seems to allow to set/write values as well. That would eliminate any additional Database queries.

(just loud thinking, you are the ES-pro ;) )


gteigland VIP
Total posts: 159
01 Авг 2015 03:13

LOL.. I'm not pro. But yes Biography is a part of Easyblog but not integrated with Easysocial without their plugin. The idea is to update it in ONE PLACE versus both EasySocial and Easyblog. So then Easysocial is the central point pushing that to Easyblog and now Cobalt with this key.

Hope that helps to explain.


pepperstreet VIP
Total posts: 3,837
01 Авг 2015 23:58

gteigland LOL.. I'm not pro. But yes Biography is a part of Easyblog but not integrated with Easysocial without their plugin.

Sorry, I have missed the important part "Blog" in EasyBlog ;) :) Simply confused it with EasySocial. Too many "Easy"'s in their productnames :)


clowride VIP
Total posts: 1,022
02 Сен 2015 14:20

On top I put this for reference

require_once(JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php'); And then my code to render that users pages link:

a href="/../<?php echo EB::user($current_user->id)->getPermalink();?>" img or text here

Please in what file, i put this code file ?

Thank you


gteigland VIP
Total posts: 159
04 Сен 2015 16:20

You put in on top of the same file your are editing. So if you are editing a specific view then put that code in it so it has a reference. HOpe that helps.

Работает на Cobalt