1. Приветствуем Вас на неофициальном форуме технической поддержки XenForo на русском языке. XenForo - коммерческий форумный движок от бывших создателей vBulletin, написанный на PHP.

[ajaxboy] AutoUpdater

Тема в разделе "Плагины для XenForo [1.x]", создана пользователем AleX, 19.05.2011.

Загрузка
  1. AleX

    AleX SPQR

    Регистрация:
    28.09.10
    Сообщения:
    434
    Симпатии:
    415
    [ajaxboy] AutoUpdater

    Тема на оф. форуме:
    Код:
    http://xenforo.com/community/threads/ajaxboy-autoupdater.12505/
    Aren't you sick of refreshing the page every one or two minutes?.
    Doesn't it get old?.
    Shouldn't you just have the page open, and see everything that goes on?
    Do you like the facebook feeling that it keeps you updated while you are on the page?.
    You spend alot of time on the forums, and need to keep refreshing the page?

    Here is where AutoUpdater comes in..
    If you answered yes to any of the questions above, this is a must have addon.​
    This is an early release of the AutoUpdater Addon v1.0.​
    This addon updates inbox and alerts messages with ajax without reloading the page.​
    This addon is FREE.​

    Features:
    • Check for new Inbox Messages (pops the red icon).
    • Check for new Alerts (pops the red icon).
    • Ability to set time inverval how often to check for new items. (1 second?, 5 seconds, 1 minute?.. 5 minutes?... etc)
    • 2 internal timer engines - (PHP timer - which puts the a script to sleep, and Javascript timer which sets events for future time to occur.) You maybe use whichever you see fit (facebook uses the php option)
    • Ability to work with group permission. (in case you just want specific folks to have awesome features)
    • Play Sound when new messages arrive or alerts ( click sound ) - this allows you to leave the forums and do other stuff, and if you hear the sound you can go back.. a time saver if you work on the forums..
    This addon is free to use. This is my first xenforo addon ( actual is my second one ) but my first one to public.

    Current Limitations:

    Currently the pop-up control that shows the new messages menu once you hover over it, it caches the menu. AutoUpdater does not update that menu currently like wise with the alerts menu.​

    As mentioned above, this is an early version of this addon, so you can expect more to come.. at least that is the idea at the moment.​

    Additionally it currently only works while on main forums and while browsing threads.​

    That said.. let me know if you run into any problems and I'll try to get you on the right direction.​

    timer engine...​

    If you are concerned about getting things really accurate I recommend the php timer engine option. The JavaScript option sets and caches events for the future, you could experience echo from events that were set in the past from time to time, after a while. For example if you have set the option to play sound, it might repeat it again, though it does not currently means any it would cause problems or other than small rare side effects.​

    System Resources:

    This addon relays on small fast tiny ajax engine called cjax. Cjax is fast reliable ajax engine, that been around since 2007. If any resources​
    are taken at all, it will be by the request itself to the server. Cjax also uses a small javascript library which makes use of mainly two functions. If you are very concerned about system resources make the time interval higher so less requests are made.​

    Updates:

    There are many other places where these kind of operations are needed, for example while during private conversations (check for new messages and if there a new ones, add it to the conversation). While posting, and all these places where it could be given more like "real time" feeling. Also there are immediate updates that could be used to update things like the popups, and the like. Also, updates with the latest threads, without refreshing the page. And facebook like friendly messages to keep you updated of site happenings.. and so on.. all that might fit.​

    Installation:

    There is a template change on this addon. You are going to need to edit template "navigation_visitor_tab", and consequenty add the following:​

    On line 98:
    PHP:
    <xen:else>

    <
    strong class="itemCount" id="ConversationsMenu_Counter" style="display:none">

    </
    strong>

    </
    xen:if>
    On line 132:
    PHP:
    <xen:else />

    <
    strong class="itemCount" id="AlertsMenu_Counter" style="display:none">

    </
    strong>

    </
    xen:if>
    The zip includes "navigation_visitor_tab.tpl" which is the same template, with the changes applied. You may replace the orginal template by this one (In case you read this in the future, the current version of xenforo is 1.0 RC2 so there are not confusions).

    If you run into any problems, post it here, so that we can work it out.

    Usage:

    Make sure to assign the "AutoUpdater" permission to desired group or users.​
    Set the addon's options to suit you better. Set the time interval to a appropriate time.. depending on what you consider appropriate for your site..​

    How do you know it is working?..​

    Send a message to yourself through other browser (and other user) or have someone send you a message.. wait at least the time for which the interval is set for and... it should pop up ..​

    Also when you load the page it displays a small loader indicator. Also, you can use firebug to see the ins and outs. In addition if you would like to see more info you can set it on debug mode.. in file AutoUpdater/Model/Cjax.php line 23, is a commented option to set it on debug mode, this allows for some more details in firebug.​

    Additionally, it has a switch to turn it on and off, it comes as off by default, make sure to turn it on.​

    I don't want to ask for branding feed as this is an early version of this addon, but if you love the idea feel free and donate.
     

    Вложения:

  2. TAIFUN

    TAIFUN Человек

    Регистрация:
    27.09.10
    Сообщения:
    2 258
    Симпатии:
    1 613
    Версия XF:
    1.5.23
    Наверное больше месяца назад думал выложить этот хак с переводом, но на тот момент он работал через одно место. Автору отписывал, чё-т не понравился он мне.
    Насколько я помню там были проблемы со звуковым оповещением и т.д.
    Интересно, исправил он или нет.
     
    Nik нравится это.
  3. Nik

    Nik Read only

    Регистрация:
    19.02.11
    Сообщения:
    160
    Симпатии:
    11
    А можно сейчас с переводом если все ок :)
     
  4. TAIFUN

    TAIFUN Человек

    Регистрация:
    27.09.10
    Сообщения:
    2 258
    Симпатии:
    1 613
    Версия XF:
    1.5.23
    Можно, но позже :)
    Я ведь не перевёл его тогда.. я сначала ставлю на локалку продукт, тестирую его (не глубоко), а потом только перевожу. Нет интереса переводить глючные дополнения :)
     
    AleX и Nik нравится это.
  5. VictorZ

    VictorZ Активный пользователь

    Регистрация:
    10.03.11
    Сообщения:
    39
    Симпатии:
    42
    :(
     
  6. Romchik®

    Romchik® The Power of Dreams Команда форума

    Регистрация:
    26.09.10
    Сообщения:
    5 746
    Симпатии:
    5 311
    Версия XF:
    1.5.18
    Сначала заливаем файлы, потом импортируем плагин.
     
  7. TAIFUN

    TAIFUN Человек

    Регистрация:
    27.09.10
    Сообщения:
    2 258
    Симпатии:
    1 613
    Версия XF:
    1.5.23
    Ребят, сорри, пока что нет времени на перевод продукта.
     
  8. Palych

    Palych Местный

    Регистрация:
    21.12.10
    Сообщения:
    269
    Симпатии:
    59
    Версия XF:
    1.1.1
    А он уже работает нормально? Если да, то тогда переведу, как поставлю.
     
  9. TAIFUN

    TAIFUN Человек

    Регистрация:
    27.09.10
    Сообщения:
    2 258
    Симпатии:
    1 613
    Версия XF:
    1.5.23
    Без понятия. Его переводить и тестить желательно на посещаемом форуме, у меня пока что такой возможности нет, да и времени тоже, хотя там этих строк как кот наплакал.
     
  10. Palych

    Palych Местный

    Регистрация:
    21.12.10
    Сообщения:
    269
    Симпатии:
    59
    Версия XF:
    1.1.1
    Чего-то не получается у меня шаблон обновить, выдает ошибку синтаксиса в строке 110

    при помощи его файлика и какой-то матери, шаблон я обновил, но его плагин у меня не заработал. А переводить там вообще нечего :)
     
  11. AleX

    AleX SPQR

    Регистрация:
    28.09.10
    Сообщения:
    434
    Симпатии:
    415
    На всякий случай, залил версию 1.0а.
     
  12. Herurg

    Herurg Местный

    Регистрация:
    20.03.11
    Сообщения:
    51
    Симпатии:
    34
    У меня работает вроде - бы , чуть позже ещё потестю и отпишусь
     
  13. Ion Armasu

    Ion Armasu Местный

    Регистрация:
    27.06.11
    Сообщения:
    2
    Симпатии:
    0
    Версия XF:
    1.1.0 Final
    проблема с звуком осталось, и в chrome не хочет работать
     
  14. ivankuraev

    ivankuraev Местный

    Регистрация:
    06.08.11
    Сообщения:
    45
    Симпатии:
    21
    xenforo 104
    после установки и включения плагина ошибка
    Код:
    Cannot redeclare class CJAX_FRAMEWORK in /Library/WebServer/revda_su/my/public_html/library/AutoUpdater/cjax/core/classes/cjax.class.php on line 8
     
  15. Senior

    Senior Местный

    Регистрация:
    05.10.10
    Сообщения:
    195
    Симпатии:
    42
    Версия XF:
    1.1.1
    у кого будет когда будет работать нормально - отпишитесь
     
  16. diunex

    diunex Местный

    Регистрация:
    02.08.11
    Сообщения:
    113
    Симпатии:
    1
    Переведите на русский плиз(
     
  17. zby

    zby Активный пользователь

    Регистрация:
    14.08.11
    Сообщения:
    7
    Симпатии:
    32
    Поставил, работает.
    Т.к. в install.txt есть недочет, то небольшой гайд:
    • загружаем папку AutoUpdater в папку library
    • в админке открываем для редактирования шаблон navigation_visitor_tab
    • находим текст
    HTML:
    <xen:if is="{$visitor.conversations_unread}">
                        <strong class="itemCount" id="ConversationsMenu_Counter">{xen:number $visitor.conversations_unread}
                            <span class="arrow"></span>
                        </strong>
    Сразу после него вставляем следующий текст:

    HTML:
    <xen:else />
    <strong class="itemCount" id="ConversationsMenu_Counter" style="display:none">
            </strong>
    • находим текст (чуть ниже)
    HTML:
    <xen:if is="{$visitor.alerts_unread}">
                    <strong class="itemCount" id="AlertsMenu_Counter">{xen:number $visitor.alerts_unread}
                        <span class="arrow"></span>
                    </strong>
    Сразу после него вставляем следующий текст:

    HTML:
    <xen:else />
            <strong class="itemCount" id="AlertsMenu_Counter" style="display:none">
            </strong>
    Сохраняем
    • устанавливаем дополнение addon_AutoUpdater.xml
    • переходим к настройкам дополнения и включаем его (On). После этого дополнение уже работает, но только для администраторов)))
    • переходим к настройкам прав для групп. И в настройках для зарегистрированных пользователей (и кому еще хотите) включаем право на доступ к дополнению
    • Всё.
    Проверял на Opera, Chrome, FireFox - везде работает.
    НО на Chrome и FireFox дополнение при серфинге форума начало выдавать соообщение "Error: Server responded with a unusual response, see available server error logs for details". Судя по англоязычному форуму поддержки, автор в курсе этой ошибки. Но поэтому мне пришлось отключить его((
     
    Mikun Hatsune, AleX, diunex и ещё 1-му нравится это.
  18. diunex

    diunex Местный

    Регистрация:
    02.08.11
    Сообщения:
    113
    Симпатии:
    1
    Ошибка
    PHP:
    Parse errorsyntax errorunexpected T_ELSE in /home/despr348/public_html/Forum/library/XenForo/Template/Abstract.php(262) : eval()'d code on line 1318
     
  19. MAD4RIDER

    MAD4RIDER Местный

    Регистрация:
    22.08.11
    Сообщения:
    11
    Симпатии:
    0
    Версия XF:
    1.1.5
    Как я понял по написанному выше, ставить его не стоит пока?
     
  20. MAD4RIDER

    MAD4RIDER Местный

    Регистрация:
    22.08.11
    Сообщения:
    11
    Симпатии:
    0
    Версия XF:
    1.1.5
    Постаивл его на тестовый форум, вроде все поставилось без ошибок, ставил по инструкции, но что то не работает он, либо я не понимаю что он должен делать. Но на форуме тестовом ошибок не вылезло ни при серфинге нигде.
     

Поделиться этой страницей