baijianpeng VIP
Total posts: 239
28 Фев 2017 11:52

I think we can show a module of "latest subscriptions" at Joomla frontend, to show "who had joined which plan on which date/time", this will encourage other users/visitors to join the same plan or other plans.

But Emerald has no such a module.

Could you please make one to do this job?

For such a module, the "username" and the "plan name" can be plain text, or be HyperLinks, to link to "user profile page" and "plan detail page" respectively. Of course, the site Admin can choose which "user profile" to show, for example: Joomla core profile page, or Kunena forum profile page, or EasySocial profile or CB profile or JomSocial, etc..

In order to show "plan detail page", I think you need to add a new layout "single plan detail page" to the Emerald component.

And, don't forget to allow site Admin to adjust the langauge ordering in this module, because Chinese people always use different language ordering than western people, for example:

You say:

Peter Vank joined the "Paid Member" plan 5 minutes ago

But we say:

Five minutes ago Peter Vank joined the "Paid Member" plan.

So you need to use different variables (%1s , %2s, %3s ) in this sentence to ensure their ordering can be changed without being wrongly interpreted.

Thank you.

Последние изменения: 04 Май 2017


Sergey
Total posts: 13,748
16 Март 2017 14:15

I understand what you want. I can dive you SQL code that extract last success subscription. You can insert it into custom layout of custom HTML module.


pepperstreet VIP
Total posts: 3,837
17 Март 2017 14:26

+1

Following…


Sergey
Total posts: 13,748
29 Март 2017 12:32

@baijianpeng are ok to go with the code?


baijianpeng VIP
Total posts: 239
23 Апр 2017 00:52

Ok, I can try to apply your code. Please post your code here.

If you have some time to develop such a NATIVE module, it will be better.

Thank you.


pepperstreet VIP
Total posts: 3,837
23 Апр 2017 01:03

Would be cool to have such notifications in Activity Streams of CB, JS, ES ;)


Sergey
Total posts: 13,748
24 Апр 2017 13:14

I do not know how to convert date to "Five minuts ago" and such. There is no library in Joomla.


pepperstreet VIP
Total posts: 3,837
25 Апр 2017 01:08

@Sergey

PHP or JS? Does this help?


Sergey
Total posts: 13,748
04 Май 2017 16:05

That might work, but it is not an SQL already. It is whole PHP script.

$db = JFactory::getDbo();
$db->setQuery("SELECT s.ctime, u.name FROM #__emerald_subscriptions AS s 
LEFT JOIN #__users AS u ON u.id = s.user_id ORDER BY ctime DESC LIMIT 1");
$result = $db->loadResult();

$timeago = time_ago_function($result->ctime);
echo $result->name . 'have subscribed ' + $timeago;

Of couse you have to include function that will convert time to corect string.

Работает на Cobalt