Benachrichtigungen
Alles löschen
Hey, ich dachte mir, dass die beiden Plugins noch Like&Kommeentar Support gebrauchen können. Deshalb ich's mal bei beiden hinzugefügt 🙂
knujsregisteractivity.php
Spoiler
params->get( 'activitymessage' , '{actor} hat sich gerade neu registriert' );
$act->cmd = 'members.register';
$act->actor = $my->id;
$act->target = 0;
$act->title = JText::_( $message );
$act->content = '';
$act->app = 'members';
$act->cid = $my->id;
$act->comment_id = $my->id;
$act->comment_type = 'profile.register';
$act->like_id = $my->id;
$act->like_type = 'profile.register';
CActivityStream::add( $act );
}
}
function onUserAfterSave($user, $isnew, $succes, $msg) {
$this->onAfterStoreUser($user, $isnew, $succes, $msg);
}
}
und
knujsupdateactivity.php
Spoiler
params->get( 'fieldname' );
$male = $this->params->get( 'malewert' );
$gender = $my->getInfo($fieldname);
if ($gender = $gender == $male ? JText::sprintf('KNU_JS_UPDATE_ACTIVITY_MALEVERB') : JText::sprintf('KNU_JS_UPDATE_ACTIVITY_FEMALEVERB')) {
}
else {
$gender = JText::sprintf('KNU_JS_UPDATE_ACTIVITY_UNKNOWNVERB');
}
$url = CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id );
$act = new stdClass();
$act->cmd = 'profile.save';
$act->actor = $my->id;
$act->target = 0;
$act->title = JText::sprintf('KNU_JS_UPDATE_ACTIVITY_ACTIVITYMESSAGE', $gender, $url );
$act->content = '';
$act->app = 'members';
$act->cid = 0;
$act->comment_id = $my->id;
$act->comment_type = 'profile.update';
$act->like_id = $my->id;
$act->like_type = 'profile.update';
CActivityStream::add( $act );
}
function onUserDetailsUpdate($userid)
{
//Activity hinzufuegen
CFactory::load( 'libraries' , 'activities');
$my =& CFactory::getUser();
$fieldname = $this->params->get( 'fieldname' );
$male = $this->params->get( 'malewert' );
$gender = $my->getInfo($fieldname);
if ($gender = $gender == $male ? JText::sprintf('KNU_JS_UPDATE_ACTIVITY_MALEVERB') : JText::sprintf('KNU_JS_UPDATE_ACTIVITY_FEMALEVERB')) {
}
else {
$gender = JText::sprintf('KNU_JS_UPDATE_ACTIVITY_UNKNOWNVERB');
}
$url = CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id );
$act = new stdClass();
$act->cmd = 'profile.save';
$act->actor = $my->id;
$act->target = 0;
$act->title = JText::sprintf('KNU_JS_UPDATE_ACTIVITY_ACTIVITYMESSAGE', $gender, $url );
$act->content = '';
$act->app = 'members';
$act->cid = 0;
$act->comment_id = $my->id;
$act->comment_type = 'profile.update';
$act->like_id = $my->id;
$act->like_type = 'profile.update';
CActivityStream::add( $act );
}
}
Einfach die jeweiligen Dateien überschreiben 🙂
Themenstarter Veröffentlicht : 6. Oktober 2012 22:53
Vielen Dank für Deine Verbesserung!
Ich werde es bei Gelegenheit mal testen und dann mit einbauen.
Veröffentlicht : 7. Oktober 2012 05:33
