Расширяем функционал плагина Приглашения в Группы и События как В Контакте. Теперь ваши пользователи смогут приглашать людей прямо со страниц списка групп и событий - user_group.php и user_event.php.
Открываем файл templates/user_group.tpl, ищем:
HTML:
<div class='button' style='float: left; padding-left: 20px;'>
<a href="javascript:TB_show('{lang_print id=2000160}', 'user_group_manage.php?group_id={$groups[group_loop].group->group_info.group_id}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">
<img src='./images/icons/group_leave16.gif' border='0' class='button' />
{lang_print id=2000160}
</a>
</div>
Ниже вставляем:
HTML:
{literal}
<script type="text/javascript">
<!--
document.addEvent('domready', function () {
var ginvite =$$('a#group_invite{/literal}{$groups[group_loop].group->group_info.group_id}{literal}');
ginvite.addEvent('click', function(event) {
event.preventDefault();
var get_title = this.get('title');
var get_url= this.get("href");
var get_id= get_url.replace('/group_invite.php?group_id=','');
window.parent.TB_show(get_title, get_url+'&TB_iframe=true&height=325&width=450', '_facebox', get_id);
});
});
//-->
</script>
{/literal}
<div class='button' style='float: left; padding-left: 20px;'>
<a id="group_invite{$groups[group_loop].group->group_info.group_id}" href="group_invite.php?group_id={$groups[group_loop].group->group_info.group_id}" title="{lang_print id=2000174}"><img src='./images/icons/group_invite16.gif' border='0' class='icon' />{lang_print id=2000174}</a>
</div>
Всё, с группами разобрались
Теперь события.
Открываем файл templates/user_event.tpl, ищем:
HTML:
{* LEAVE *}
<div class="seEventOption1 seEventUserOptionLeave"{if $events[event_loop].event->user_rank==3 || !$events[event_loop].event->is_member} style="display:none;"{/if}>
<a href='javascript:void(0);' onclick="SocialEngine.Event.leaveShow({$events[event_loop].event->event_info.event_id});">
<img src='./images/icons/event_remove16.gif' border='0' class='button' />
{lang_print id=3000219}
</a>
</div>
Ниже вставляем:
HTML:
{* JOIN *}
{literal}
<script type="text/javascript">
<!--
document.addEvent('domready', function () {
var ginvite =$$('a#group_invite{/literal}{$events[event_loop].event->event_info.event_id}{literal}');
ginvite.addEvent('click', function(event) {
event.preventDefault();
var get_title = this.get('title');
var get_url= this.get("href");
var get_id= get_url.replace('/group_invite.php?group_id=','');
window.parent.TB_show(get_title, get_url+'&TB_iframe=true&height=325&width=450', '_facebox', get_id);
});
});
//-->
</script>
{/literal}
<div class='seEventOption1 seEventUserOptionLeave'>
<a id="group_invite{$events[event_loop].event->event_info.event_id}" href="event_invite.php?event_id={$events[event_loop].event->event_info.event_id}" title="{lang_print id=3000145}"><img src='./images/icons/group_invite16.gif' border='0' class='button' />{lang_print id=3000145}</a>
</div>
Готово!