【问题标题】:jomsocial groups and events integrationjomsocial 团体和活动整合
【发布时间】:2012-07-23 05:20:29
【问题描述】:

我正在尝试将 jomsocial 事件与 jomsocial 团体整合。 我想要实现的是在创建事件时自动创建一个组。

有人对此类功能有一些提示吗? 我想到的方法是使用来自 jomsocial API 的 onEventCreate($event) 函数 调用组创建机制。这是正确的做法吗?

【问题讨论】:

  • 由于 JomSocial 是一个商业扩展,您最好联系 JomSocial 的开发人员,因为我没想到这里有很多人拥有它。

标签: joomla joomla-extensions joomla2.5


【解决方案1】:

是的,这就是我要采取的方法。

您可以在 groups.php 控制器中找到方法 save()。您已经获得了实现此功能所需的所有代码。

粗略代码:

$my         =& CFactory::getUser();
$config         =& CFactory::getConfig();
$group          =& JTable::getInstance( 'Group' , 'CTable' );

$group->name        = $name;
$group->description = $description;
$group->categoryid  = $categoryId; // Category Id must not be empty and will cause failure on this group if its empty.
$group->website     = $website;
$group->ownerid     = $my->id;
$group->created     = gmdate('Y-m-d H:i:s');
$group->approvals   = 0;

$params         = new CParameter( '' );
// Here you need some code from private _bindParams()

$group->params      = $params->toString();
$group->published   = ( $config->get('moderategroupcreation') ) ? 0 : 1;
$group->store();

// Other useful stuff:
// - store the creator / admin into the groups members table
// - add into activity stream

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多