vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Activity Stream Refresh Code (https://vborg.vbsupport.ru/showthread.php?t=313936)

GenDeathRaiser 08-26-2014 06:55 PM

Activity Stream Refresh Code
 
I'm working on customizing the layout of my activity feed and I wiped pretty much all but {vb:raw activitybits} from the home template. This has definitely stopped the autorefresh from working. I can't figure out which part of the file refreshes. It seems like it loads them into a newactivity area, but I'd really just rather them pour right out into the activitybits as the ones before it.

Thanks for your help.

Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
        {vb:raw headinclude}
        <title>{vb:rawphrase activity_stream} - {vb:raw vboptions.bbtitle}</title>
        <script type="text/javascript" src="clientscript/vbulletin_activitystream.js?v={vb:raw vboptions.simpleversion}"></script>
        <script type="text/javascript">
        <!--
                var activity_stream_options = {
                        'type'        : 'home',
                        'mindateline' : '{vb:raw actdata.mindateline}',
                        'maxdateline' : '{vb:raw actdata.maxdateline}',
                        'minscore'    : '{vb:raw actdata.minscore}',
                        'minid'      : '{vb:raw actdata.minid}',
                        'maxid'      : '{vb:raw actdata.maxid}',
                        'count'      : '{vb:raw actdata.count}',
                        'totalcount'  : '{vb:raw actdata.totalcount}',
                        'perpage'    : '{vb:raw actdata.perpage}',
                        'sortby'      : '{vb:raw actdata.sortby}',
                        'time'        : '{vb:raw actdata.time}',
                        'show'        : '{vb:raw actdata.show}',
                        'newcontent'  : '{vb:raw actdata.new}',
                        'refresh'    : '{vb:raw actdata.refresh}'
                };
        // -->
        </script>
        {vb:cssfile activitystream.css}
        {vb:raw headinclude_bottom}
</head>
<body>

        {vb:raw header}
        {vb:raw navbar}

        <div id="pagetitle"><h1>{vb:rawphrase activity_stream}</h1></div>

        <div class="block activitystream">
                <div class="blockhead">
                        <div class="popupgroup" id="streamfilter">
                                <div class="popupmenu">
                                        <a href="javascript://" class="popupctrl">{vb:rawphrase filter}</a>                                       
                                        <table class="popupbody popuphover filter">
                                                <thead>
                                                        <tr>
                                                                <th>{vb:rawphrase sort_by}</th>
                                                                <th>{vb:rawphrase time}</th>
                                                                <th>{vb:rawphrase show}</th>
                                                        </tr>
                                                </thead>
                                                <tbody>
                                                        <tr>
                                                                <td>
                                                                        <span{vb:raw selected.recent}>{vb:rawphrase recent}</span>
                                                                        <a {vb:raw unselected.recent}href="activity.php?{vb:raw session.sessionurl}sortby=recent&amp;{vb:raw arguments.sortby}">{vb:rawphrase recent}</a>
                                                                        <span{vb:raw selected.popular}>{vb:rawphrase popular}</span>
                                                                        <a {vb:raw unselected.popular}href="activity.php?{vb:raw session.sessionurl}sortby=popular&amp;{vb:raw arguments.sortby}">{vb:rawphrase popular}</a>                                                                       
                                                                </td>
                                                                <td>
                                                                        <span{vb:raw selected.anytime}>{vb:rawphrase anytime}</span>
                                                                        <a {vb:raw unselected.anytime} href="activity.php?{vb:raw session.sessionurl}time=anytime&amp;{vb:raw arguments.time}">{vb:rawphrase anytime}</a>
                                                                        <span{vb:raw selected.today}>{vb:rawphrase last_24_hours}</span>
                                                                        <a {vb:raw unselected.today} href="activity.php?{vb:raw session.sessionurl}time=today&amp;{vb:raw arguments.time}">{vb:rawphrase last_24_hours}</a>       
                                                                        <span{vb:raw selected.week}>{vb:rawphrase last_7_days}</span>
                                                                        <a {vb:raw unselected.week} href="activity.php?{vb:raw session.sessionurl}time=week&amp;{vb:raw arguments.time}">{vb:rawphrase last_7_days}</a>
                                                                        <span{vb:raw selected.month}>{vb:rawphrase last_30_days}</span>
                                                                        <a {vb:raw unselected.month} href="activity.php?{vb:raw session.sessionurl}time=month&amp;{vb:raw arguments.time}">{vb:rawphrase last_30_days}</a>                                                                       
                                                                </td>
                                                                <td>
                                                                        <span{vb:raw selected.all}>{vb:rawphrase all}</span>
                                                                        <a {vb:raw unselected.all} href="activity.php?{vb:raw session.sessionurl}show=all&amp;{vb:raw arguments.show}">{vb:rawphrase all}</a>
                                                                        <span{vb:raw selected.photos}>{vb:rawphrase photos}</span>
                                                                        <a {vb:raw unselected.photos} href="activity.php?{vb:raw session.sessionurl}show=photos&amp;{vb:raw arguments.show}">{vb:rawphrase photos}</a>
                                                                        <span{vb:raw selected.forum}>{vb:rawphrase forum}</span>
                                                                        <a {vb:raw unselected.forum} href="activity.php?{vb:raw session.sessionurl}show=forum&amp;{vb:raw arguments.show}">{vb:rawphrase forums}</a>
                                                                        <vb:if condition="$show['as_cms']">
                                                                                <span{vb:raw selected.cms}>{vb:rawphrase articles}</span>
                                                                                <a {vb:raw unselected.cms} href="activity.php?{vb:raw session.sessionurl}show=cms&amp;{vb:raw arguments.show}">{vb:rawphrase articles}</a>
                                                                        </vb:if>
                                                                        <vb:if condition="$show['as_blog']">
                                                                                <span{vb:raw selected.blog}>{vb:rawphrase blog}</span>
                                                                                <a {vb:raw unselected.blog} href="activity.php?{vb:raw session.sessionurl}show=blog&amp;{vb:raw arguments.show}">{vb:rawphrase blogs}</a>
                                                                        </vb:if>
                                                                        <vb:if condition="$show['as_socialgroup']">
                                                                                <span{vb:raw selected.socialgroup}>{vb:rawphrase social_groups}</span>
                                                                                <a {vb:raw unselected.socialgroup} href="activity.php?{vb:raw session.sessionurl}show=socialgroup&amp;{vb:raw arguments.show}">{vb:rawphrase social_groups}</a>
                                                                        </vb:if>
                                                                        {vb:raw template_hook.activitystream_filter}       
                                                                </td>
                                                        </tr>                                       
                                                </tbody>
                                        </table>
                                </div>
                        </div>       
                </div>
                <div class="blockbody">
                        <vb:if condition="$show['filterbar']">
                        <div class="filterbar">
                                {vb:rawphrase filter_by}
                                <vb:each from="filter" value="stuff">
                                        <span class="filtertype">{vb:raw stuff.phrase}</span> <a href="activity.php?{vb:raw session.sessionurl}&amp;{vb:raw stuff.arguments}"><img src="{vb:stylevar imgdir_siteicons}/x.png" class="closeicon" alt="" title="{vb:rawphrase close}" /></a>
                                </vb:each>
                                <a href="activity.php{vb:raw session.sessionurl_q}">{vb:rawphrase clear_all}</a>
                        </div>
                        </vb:if>

                        <div id="newactivity_container" class="newactivity hidden">
                                <span id="newactivitylink">{vb:rawphrase new_activity, '<span id="newactivitycount"></span>'}</span>
                        </div>       

                        <div id="newactivity_nomore" class="newactivity hidden">
                                <span>{vb:rawphrase please_reload_stream}</span>
                        </div>       

                        <ul id="activitylist">
                                <li id="olderactivity" class="hidden">
                                        <div class="block1"><hr /></div>
                                        <div class="block2">{vb:rawphrase older_activity}</div>
                                        <div class="block3"><hr /></div>
                                </li>
                                {vb:raw activitybits}
                        </ul>
                </div>
        </div>

        <div id="moreactivity_container" class="moreactivity userprof_headers userprof_headers_border">
                <a id="moreactivitylink" <vb:if condition="!$show['moreactivity']">class="hidden" </vb:if>href="activity.php?{vb:raw session.sessionurl}">{vb:rawphrase more_activity}</a>
                <span id="noresults"<vb:if condition="!$show['nomoreresults']"> class="hidden"</vb:if>>{vb:rawphrase no_more_results}</span>
                <span id="noactivity"<vb:if condition="!$show['noactivity']"> class="hidden"</vb:if>>{vb:rawphrase no_recent_activity}</span>
                <img id="moreactivityprogress" class="hidden" src="{vb:stylevar imgdir_misc}/progress3.gif" alt="" />       
        </div>

        {vb:raw footer}
</body>
</html>

is the original code


Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
        {vb:raw headinclude}
        <title>{vb:rawphrase activity_stream} - {vb:raw vboptions.bbtitle}</title>
        <script type="text/javascript" src="clientscript/vbulletin_activitystream.js?v={vb:raw vboptions.simpleversion}"></script>
        <script type="text/javascript">
        <!--
                var activity_stream_options = {
                        'type'        : 'home',
                        'mindateline' : '{vb:raw actdata.mindateline}',
                        'maxdateline' : '{vb:raw actdata.maxdateline}',
                        'minscore'    : '{vb:raw actdata.minscore}',
                        'minid'      : '{vb:raw actdata.minid}',
                        'maxid'      : '{vb:raw actdata.maxid}',
                        'count'      : '{vb:raw actdata.count}',
                        'totalcount'  : '{vb:raw actdata.totalcount}',
                        'perpage'    : '{vb:raw actdata.perpage}',
                        'sortby'      : '{vb:raw actdata.sortby}',
                        'time'        : '{vb:raw actdata.time}',
                        'show'        : '{vb:raw actdata.show}',
                        'newcontent'  : '{vb:raw actdata.new}',
                        'refresh'    : '{vb:raw actdata.refresh}'
                };
        // -->
        </script>
        {vb:cssfile activitystream.css}
        {vb:raw headinclude_bottom}
</head>
<body>

        {vb:raw header}
        {vb:raw navbar}
<div class="activity_wrap">
{vb:raw activitybits}
</div>
        {vb:raw footer}
</body>
</html>

is what I've done to it.

kh99 08-27-2014 10:18 AM

I'm not sure I understand exactly what you want, but I guess the javascript in vbulletin_activitystream.js handles that. I don't have time to look in to it, but I suppose it looks for html tags with a certain id or class.

GenDeathRaiser 08-28-2014 08:47 PM

Sorry about that. I will try to clarify a bit.

Vbulletin 4's Activity Page has a live update feature for people active on the activity streams page. It pulls in information about posts and threads every x minutes (as defined in options).

I seem to have deleted the portion of the template (something like vb_activitystream_home) that allows these live updates to happen. But I cannot figure out which portion of this template does that. I just know that it does not work any longer after the changes I have made.

I am very very gracious for your help. I have not removed the hook to the js that runs which is why this leaves me very puzzled.

I am editing this template because I want to change the layout of how activity is displayed on this page. By default new activity is stored in separate divs and clicks are required to display new content. I just want the activity to constantly stream to the page and be displayed as everything else is.

I will do some more picking around. thank you again very very much.


All times are GMT. The time now is 10:17 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01021 seconds
  • Memory Usage 1,784KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete