1. Мы продолжаем публиковать интересные статьи на тему SocialEngine 4. Одна из статей посвящена правильному выбору сервера для вашей социальной сети, а другая содержит советы по увеличению производительности платформы. Также мы добавили большую статью о пользовательских уровнях. Ознакомиться со статьями вы можете в разделе Вопросы и Ответы SocialEngine 4.
  2. Вам кажется, что ваша версия SocialEngine 4, работает медленно?

    Голосуйте. Пишите свою версию системы, железо на чем работает и количество пользователей. Будем увеличивать производительность :-) Подробнее

  3. В связи с участившимися случаями попыток продажи пользователями форума различных "сборок" коммерческих социальных платформ, обычно основанных на SocialEngine 3, вводится новое правило для форума. Запрещается создание тем или размещение в уже созданных предложений о продаже или размещение ссылок на сайты, где происходит продажа "сборок". Пользователи, которые продолжат свою коммерческую деятельность в данном направлении, будут заблокированы. Подробнее.
  4. Мы рады сообщить о выходе первого российского продукта для платформы phpFox 2-3. Продукт Interkassa-Sprypay Gateway Payment, позволит вам начать прием платежей в России без особых проблем. Зарабатывайте на платных подарках или получайте доходы с платной рекламы как на Facebook. Продукт работает со всеми модулями, которые используют платежные шлюзы.

    Все подробности о продукте в этой теме.

3.0.x Уведомления по email как на facebook

Discussion in 'Моды - Mods' started by Vanqa, Nov 3, 2011.

  1. Vanqa Thread starter Banned


    Offline
    • Banned
    Message Count:
    337
    Likes Received:
    41
    My version of phpFox:
    3.0.0
    Топаем сюда - (AdminCP -> Settings -> Add New Setting)
    (Этот мод будет доступен в AdminCP -> Settings -> System Settings -> Module Settings -> Feed)

    Product: phpFox
    Module: feed
    Groups: Content Formatting
    Variable: crop_comment_in_notification_email_to
    Type: Integer
    Value: 255
    Title: Crop comment in notification e-mail to
    Info:
    This is the amount of characters of the original comment that will appear in the content of the notification e-mail.

    2. Добавление фраз (AdminCP -> Extension -> Language -> Add Phrase):
    Product: phpfox
    Module: feed
    Varname: full_name_left_a_comment_on_owner_name_feed_to_view_this_comment
    Text:
    PHP:
    {full_nameleft a comment on {owner_name}'s update.
    {full_name} wrote:
    <blockquote><em>{comment}</em></blockquote>
    To view this comment, follow the link below:
    <a href="{link}">{link}</a>
    Product: phpfox
    Module: feed
    Varname: full_name_left_a_comment_on_owner_name_feed
    Text:
    PHP:
    {full_nameleft a comment on the {owner_name}'s update.
    Product: phpfox
    Module: user
    Varname: someone_added_a_comment_on_owner_name_feed
    Text:
    PHP:
    Another member has commented on one of the <a href="{owner_link}">{owner_name}'s</a> activity <a href="{link}">feed</a>, where you have commented too.
    3. Открый файл /module/feed/include/service/callback.class.php. Ищем:
    PHP:
    public function addComment($aVals$iUserId null$sUserName null)
    Добавить:

    PHP:
    // POSSIBLE SOLUTION BY FERN. This can be a plug-in (if the hook will exist someday) or be added in the next version.
    // CAUTION, as it could generate a lot of e-mails.
    // Get the comment from the database
    $sComment $this->database()->select('ct.text')
                ->
    from(Phpfox::getT('comment_text'), 'ct')
                ->
    where('ct.comment_id = '.$aVals['comment_id'])
                ->
    execute('getField');
    // Get the comment text and crop it according to the feed setting
    $sParsedComment substr($sComment0Phpfox::getParam('feed.crop_comment_in_notification_email_to'));
    // Get the owner's full name and user id of those who have posted a comment in the specific feed
    $aUsersToMail $this->database()->select('u.full_name as owner_name, c.user_id')
                ->
    from(Phpfox::getT('comment'), 'c')
                ->
    join($this->_sTable'f''c.item_id = f.feed_id')
                ->
    join(Phpfox::getT('user'), 'u''u.user_id = f.user_id')
                ->
    where('c.item_id = '.$aFeed['feed_id'])
                ->
    group('c.user_id')
                ->
    execute('getSlaveRows');
    foreach(
    $aUsersToMail as $aUser)
    {
        
    // if the feed owner has posted a comment, there is no need to notify him twice.
        
    if ($aFeed['user_id'] != $aUser['user_id'])
        {
                
    // Send the e-mail to the current user in the list of users that have commented in the feed.
                
    Phpfox::getLib('mail')->to($aUser['user_id'])
                                ->
    subject(array
                                                        (
    'feed.full_name_left_a_comment_on_owner_name_feed', array(
                                                                
    'full_name' => $sUserName,
                                                                
    'owner_name' => $aUser['owner_name'],
                                                                
    'site_title' => Phpfox::getParam('core.site_title')
                                                                )
                                                        )
                                                )
                                ->
    message(array
                                                        (
    'feed.full_name_left_a_comment_on_owner_name_feed_to_view_this_comment', array(
                                                                
    'full_name' => $sUserName,
                                                                
    'owner_name' => $aUser['owner_name'],
                                                                
    'comment' => $sParsedComment,
                                                                
    'site_title' => Phpfox::getParam('core.site_title'),
                                                                
    'link' => $sLink
                                                                
    )
                                                        )
                                                )
                                ->
    notification('comment.add_new_comment')
                                ->
    send();
                
    // Also, add a site notification to the current user in the list of users that have commented in the feed.
                
    Phpfox::getService('notification.process')->add('comment_feed'$aFeed['feed_id'], $aUser['user_id'], $aFeed['user_id']);
        }
    }
    // END OF FERN'S SOLUTION! END__PHPFOX__CODE__SNIPPET ?>
    4. Ищем далее

    PHP:
    public function getCommentNotificationFeed($aRow)
    Заменяем на :

    PHP:
    POSSIBLE SOLUTION BY FERNThis can be a plug-in (if the hook will exist someday) or be added in the next version.
    if(empty(
    $aRow['item_image']) && ($aRow['type_id'] == 'comment_feed') ) // != Phpfox::getUserBy('user_name'))
    {
        
    $aOwner $this->database()->select('u.full_name, u.user_name')
                                                                ->
    from(Phpfox::getT('user'), 'u')
                                                                ->
    join(Phpfox::getT('feed'), 'f''u.user_id = f.user_id')
                                                                ->
    where('f.feed_id = '$aRow['item_id'])
                                                                ->
    execute('getSlaveRow');
        return array(
                
    'message' => Phpfox::getPhrase('user.someone_added_a_comment_on_owner_name_feed', array(
                                                
    'owner_name' => $aOwner['full_name'],
                                                
    'owner_link' => Phpfox::getLib('url')->makeUrl($aOwner['user_name']),
                                                
    'link' => Phpfox::getLib('url')->makeUrl($aOwner['user_name'], array('feed' => $aRow['item_id'])) . '#feed'
                                        
    )
                                ),
                                
    'link' => Phpfox::getLib('url')->makeUrl($aOwner['user_name'], array('feed' => $aRow['item_id'])) . '#feed',
                                
    'path' => 'core.url_user',
                                
    'suffix' => '_50'
                
    );
    }
    else
    {
        return array(
                
    'message' => Phpfox::getPhrase('user.user_link_full_name_commented_on_your_status', array(
                                                
    'user_link' => Phpfox::getLib('url')->makeUrl($aRow['user_name']),
                                                
    'full_name' => $aRow['full_name'],
                                                
    'link' => Phpfox::getLib('url')->makeUrl('profile', array('feed' => $aRow['item_id'])) . '#feed'
                                        
    )
                                ),
                                
    'link' => Phpfox::getLib('url')->makeUrl('profile', array('feed' => $aRow['item_id'])) . '#feed',
                                
    'path' => 'core.url_user',
                                
    'suffix' => '_50'
                
    );
    }
    // END END__PHPFOX__CODE__SNIPPET ?>
    5. Сохраните и закройте файл.

    Все. Пробуем. Отписываемся.

    ---------- Сообщение добавлено в 06:58 ---------- Предыдущее сообщение было в 06:44 ----------

    Спёр это с забугорного форума.. Скрина нет. Что там должно быть не известно. Поставил у себя... Работает, но все тоже самое, обычные текстовые сообщения. Либо это просто добавление функции...
  2. софия86 Banned


    Offline
    • Banned
    Message Count:
    320
    Likes Received:
    74
    My version of SE:
    4.1.8
    My version of phpFox:
    3.0.0
    My version of Oxwall:
    1.2.6
    я согласна что ты его там спер я его видела и пол ночи проковералась не работает я так поняла что у них там кроме Гоблинов нет нечего путёвого выкладывают разную хрень
  3. Vanqa Thread starter Banned


    Offline
    • Banned
    Message Count:
    337
    Likes Received:
    41
    My version of phpFox:
    3.0.0
    Это с официала ))) Я поставил, работает но, админка исчезла))) тоесть она есть,заходишь и ниче не работает))) Пришлось снести)facepalm
  4. софия86 Banned


    Offline
    • Banned
    Message Count:
    320
    Likes Received:
    74
    My version of SE:
    4.1.8
    My version of phpFox:
    3.0.0
    My version of Oxwall:
    1.2.6
    ну я я про что говорю что не работает зачем ты выложил чтоб люди работу лишнею имели или как ты конечно извени но я всегда говорю что думаю
  5. Vanqa Thread starter Banned


    Offline
    • Banned
    Message Count:
    337
    Likes Received:
    41
    My version of phpFox:
    3.0.0
    Выложил за тем что бы было, может у нас не получилось, как говорится руки кривые ))))) Может кто доделает...
  6. WELLEX User


    Offline
    Message Count:
    58
    Likes Received:
    1
    Сначала заинтересовало, прочитав комментарии, решил не мучатся в лишний раз, и дождаться чего-то более доработанного)
  7. Vanqa Thread starter Banned


    Offline
    • Banned
    Message Count:
    337
    Likes Received:
    41
    My version of phpFox:
    3.0.0
    Согласен, но допустим когда ставил все работает, опять же админка не фурычит после этого. Вернул обратно все как было, проблем не возникает после этого
  8. bennington111 Banned


    Offline
    • Banned
    Message Count:
    502
    Likes Received:
    225
    Доделаю, выложу еще один вариант.
  9. WELLEX User


    Offline
    Message Count:
    58
    Likes Received:
    1
    Ждём с нетерпением ;)
  10. bennington111 Banned


    Offline
    • Banned
    Message Count:
    502
    Likes Received:
    225
    Итак, как обещал, делюсь:

    В файле theme/frontend/default/template/email.html.php

    Заменяем код:
    PHP:
    {if $bHtml}    {if $bMessageHeader}    {if isset($sName)}    {phrase var='core.hello_name' name=$sName}    {else}    {phrase var='core.hello'}    {/if},    <br />    <br />{/if}    {$sMessage}    <br />    <br />    {$sEmailSig}    {else}    {if $bMessageHeader}    {if isset($sName)}    {phrase var='core.hello_name' name=$sName}    {else}    {phrase var='core.hello'}    {/if},{/if}        {$sMessage}
        {
    $sEmailSig}    {/if}
    На код:
    PHP:
    {if $bHtml}<html>
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <
    title>{title}</title>
    </
    head><body style="margin: 0; padding: 0;" dir="ltr"><table width="98%" border="0" cellspacing="0" cellpadding="40"><tr><td bgcolor="#f7f7f7" width="100%" style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;"><table cellpadding="0" cellspacing="0" border="0" width="620"><tr>
      <
    td style="background: #3b5998; color: #fff; font-weight: bold; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size: 16px; letter-spacing: -0.03em; text-align: left;">SiteName Network™</td></tr><tr><td style="background-color: #fff; border-bottom: 1px solid #3b5998; border-left: 1px solid #ccc; border-right: 1px solid #ccc;font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; padding: 15px;" valign="top"><table><tr><td width="470px" style="font-size: 12px;" valign="top" align="left"><div style="margin-bottom: 15px; font-size: 13px;"><font size="1">You're receiving this newsletter
                                                      because you or someone else subscribe your email in our site. <br/>
    Having issues viewing this email? <a href="http://sitename.com/"> View it in our site</a>.</font></div><div style="margin-bottom: 15px;"><div style="font-weight: bold; margin-bottom: 15px;">{if $bMessageHeader}
    {if isset($sName)}
    {phrase var='
    core.hello_name' name=$sName}
    {else}
    {phrase var='
    core.hello'}
    {/if}, <br />
                <br />
    {/if}
    {$sMessage} <br />
                <br />
                                                      </div><table><tr><td valign="top" style="padding-right: 15px;"><a href="http://sitename.com/user/browse/"><img src="http://sitename.com/theme/frontend/email/search.gif" alt="" style="border: 0;" /></a></td><td valign="top" style="font-size: 12px; padding: 3px 0 15px 0;"><div><a href="http://sitename.com/user/browse/" style="color: #3b5998; text-decoration: none; display: block; font-weight: bold;">Find Some Friends</a></div>Find people you know using our SiteName Friends Search</td></tr><tr><td valign="top" style="padding-right: 15px;"><a href="http://sitename.com/photo/"><img src="http://sitename.com/theme/frontend/email/photos.gif" alt="" style="border: 0;" /></a></td><td valign="top" style="font-size: 12px; padding: 3px 0 15px 0;"><div><a href="http://sitename.com/photo/" style="color: #3b5998; text-decoration: none; display: block; font-weight: bold;">Upload a Profile Album</a></div>Upload some Photos and get Chance to be a Featured Member</td></tr><tr><td valign="top" style="padding-right: 15px;"><a href="http://sitename.com/user/profile/"><img src="http://sitename.com/theme/frontend/email/edit_profile.gif" alt="" style="border: 0;" /></a></td><td valign="top" style="font-size: 12px; padding: 3px 0 0 0;"><div><a href="http://sitename.com/user/profile/" style="color: #3b5998; text-decoration: none; display: block; font-weight: bold;">Edit Your Profile</a></div>Edit and Customize your Profile as you Wish in a Second</td></tr></table><div style="margin: 15px 0;">If you have any Questions, Read our FAQ or Get Some Support.</div></div><div style="margin-bottom: 15px; margin: 0;">Thank You,<br />
    The SiteName Online Team</div></td><td valign="top" width="150" style="padding-left: 15px;" align="left"><table width="100%" cellspacing="0" cellpadding="0"><tr><td style="background-color: #FFF8CC; border: 1px solid #FFE222; color: #333; padding: 10px; font-size: 12px;"><div style="margin-bottom: 15px;">Login to sitename and start Connecting</div>
                                <table cellspacing="0" cellpadding="0"><tr><td style="border: 1px solid #3b6e22;"><table cellspacing="0" cellpadding="0"><tr>
                                      <td style="padding: 5px 15px;background-color: #67a54b;border-top: 1px solid #95bf82;"><a href="http://sitename.com/" style="color: #fff;font-size: 13px;font-weight: bold;text-decoration: none;">Get Started</a></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td style="color: #999; padding: 10px; font-size: 11px; font-family: '
    lucida grande', tahoma, verdana, arial, sans-serif;">If you can't Understand these Instructions we ProvidedPlease Contact Assistence Service And Get Some <a href="http://sitename.com/" style="color: #999">Support</a>.<br>
                                                
    Copyrights © 2011<a href="http://sitename.com/"SiteName Online</a>. All Rights Reserved.</td></tr></table></td></tr></table></body></html>
                                                {else}
    {if 
    $bMessageHeader}
    {if isset(
    $sName)}
    {
    phrase var='core.hello_name' name=$sName}
    {else}
    {
    phrase var='core.hello'}
    {/if},
    {/if}
    {
    $sMessage}
    {
    $sEmailSig}

    {/if}
    Редактируем под себя, тестируем, ну и говорим "СПАСИБО"!!!

    Ах да, чуть не забыл, вот скрин:

    Attached Files:

Share This Page

All rights reserved SocEngine.ru ©