Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Digital Point Spy Details »»
Digital Point Spy
Version: 1.11, by digitalpoint digitalpoint is offline
Developer Last Online: May 2016 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 05-26-2010 Last Update: 09-09-2012 Installs: 404
DB Changes Uses Plugins Auto-Templates
Additional Files  
No support by the author.

About
This is a Digg-style spy for seeing what's going on in your forum in realtime.

This is something I originally made about 4 years ago. Now that I rewrote it for vBulletin 4 (it also now uses the bundled YUI for animation), I decided to also wrap it up as a product package and release it for the world to use.

Installation
  • Put the spy.php file in your forum folder.
  • Put the digitalpoint_spy.js file in your clientscript folder.
  • Install the product-digitalpoint_spy.xml product under AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product
You can see a live version in action here:
http://forums.digitalpoint.com/spy.php


1.1.0 Update
  • Moved JavaScript to external file (works around template parsing bug with early versions of vBulletin 4.0.x).
  • XML generation is done with vBulletin's XML Builder class (let it deal with weird characters).
  • Switched JavaScript library to from YUI to jQuery (for an end user, it means better animations).
  • Changed do=xml to do=feed (works around servers that are overly protective and think they are trying to be hacked and blocking the request).

Download Now

File Type: zip digitalpoint_spy-111.zip (8.3 KB, 399 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
abualjori, Erica1977, farru, Sarah EI, Seductor

Comments
  #42  
Old 06-02-2010, 07:07 AM
sportsbuddys's Avatar
sportsbuddys sportsbuddys is offline
 
Join Date: May 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great thank you!
Reply With Quote
  #43  
Old 06-02-2010, 07:41 AM
digitalpoint's Avatar
digitalpoint digitalpoint is offline
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 502
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by teenage.vn View Post
Yes I have the template "SPY", as well as the template "spy.css" ...

And Im using 4.0.2, does this Add-on support 4.0.2 ?

Thanks for the fast feedback from you ... Still looking forward for the fix ...
Probably has to do with the same as this post.
Reply With Quote
  #44  
Old 06-03-2010, 06:57 AM
teenage.vn teenage.vn is offline
 
Join Date: Mar 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by digitalpoint View Post
Probably has to do with the same as this post.
Firstly, I want to say that I'd appreciate for your quick support.

But ... I did the same thing in the post, means: change the exact words function play_pause() to the Code you gave in the post ... and I got the following warning when I tried to save the template:

Quote:
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected '[', expecting ')' in /home/vitav/public_html/forum/includes/adminfunctions_template.php(4748) : eval()'d code on line 32

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Once again, sorry for bothering you and looking forward to hearing from you ...


------------------------------------------ Updated: ------------------------------------------

I also tried to Continue when facing the above error, and nothing changed ... still nothing to display ...
Reply With Quote
  #45  
Old 06-03-2010, 10:32 AM
Abhik's Avatar
Abhik Abhik is offline
 
Join Date: Jun 2006
Location: Kolkata, India
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good to see Shawn releasing some of his 'custom' modification.
Heard about the Sphinx Search For vBulletin 4 too that you released at DP.
So sad I can't access that.
Reply With Quote
  #46  
Old 06-03-2010, 05:43 PM
digitalpoint's Avatar
digitalpoint digitalpoint is offline
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 502
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by teenage.vn View Post
Firstly, I want to say that I'd appreciate for your quick support.

But ... I did the same thing in the post, means: change the exact words function play_pause() to the Code you gave in the post ... and I got the following warning when I tried to save the template:



Once again, sorry for bothering you and looking forward to hearing from you ...


------------------------------------------ Updated: ------------------------------------------

I also tried to Continue when facing the above error, and nothing changed ... still nothing to display ...
Any plans on upgrading to vBulletin 4.0.3? The problem itself is caused by vBulletin versions before 4.0.2 not able to parse templates properly.

If you have phpmyadmin, go into the templates table and search for the template record with the title of SPY. Edit that record (it should have a styleid of -1) and set the template field (NOT the template_un field) to this:

PHP Code:
$final_rendered '' vB_Template_Runtime::fetchStylevar("htmldoctype") . '
<html xmlns="http://www.w3.org/1999/xhtml" dir="' 
vB_Template_Runtime::fetchStylevar("textdirection") . '" lang="' vB_Template_Runtime::fetchStylevar("languagecode") . '">
<head>
    ' 
$headinclude '
    <link rel="stylesheet" type="text/css" href="' 
$vbcsspath 'spy.css" />
    <script type="text/javascript" src="' 
vB_Template_Runtime::fetchStylevar("yuipath") . '/animation/animation-min.js?v=' $vboptions['simpleversion'] . '"></script>

<script type="text/javascript"> 
var spymax = 25;
var play = 1;
var whats = new Array();
var titles = new Array();
var previews = new Array();
var whos = new Array();
var threadids = new Array();
var postids = new Array();
var userids = new Array();
var spyids = new Array();
var forumids = new Array();
var forumnames = new Array();
var highestid = 0;
var fadetime = .25;
var pushtime = 1500;
var fadetime_end = 1.5;
var pushtime_end = 4000
var initalfill_flag = 0;

function init() {
    getXML();
}

function play_pause() {
    var label = new Array(\'' 
vB_Template_Runtime::parsePhrase("click_to_continue") . '\', \'' vB_Template_Runtime::parsePhrase("click_to_pause") . '\');
    play = Math.abs(1-play);
    document.getElementById("play_pause").innerHTML = label[play];
}

function getXML() {

    if (highestid > 0) {
        var querystring = "do=xml&last=" + highestid;
    } else {
        var querystring = "do=xml";
    }

    if (document.getElementById("subscribed_flag").checked) {
        querystring = querystring + "&subscribed=1";
    }
    querystring = querystring + \'&r=\' + Math.random(); 

    YAHOO.util.Connect.asyncRequest("GET", "spy.php?" + SESSIONURL + "securitytoken=" + SECURITYTOKEN + "&" + querystring, {
        success: processXML,
        failure: vBulletin_AJAX_Error_Handler,
        timeout: vB_Default_Timeout,
        scope: this
    });
}

function processXML (request) {

    var events;
    var event;

    try {
        events = request.responseXML.getElementsByTagName("events")[0];
        event = events.getElementsByTagName("event");
    }
    catch (e) {
        setTimeout("getXML()", 30000);
        return;
    }

    for (i = 0; i < event.length; i++) {
        try {
            whats[i] = event[i].getElementsByTagName("what")[0].firstChild.nodeValue;
        }
        catch (e) {
            whats[i] = "Who Knows";
        }
        try {
            titles[i] = event[i].getElementsByTagName("title")[0].firstChild.nodeValue;
        }
        catch (e) {
            titles[i] = "";
        }    
        try {
            previews[i] = event[i].getElementsByTagName("preview")[0].firstChild.nodeValue;
        }
        catch (e) {
            previews[i] = "";
        }
        try {
            whos[i] = event[i].getElementsByTagName("who")[0].firstChild.nodeValue;
        }
        catch (e) {
            whos[i] = "Anonymous";
        }
        try {
            threadids[i] = event[i].getElementsByTagName("threadid")[0].firstChild.nodeValue;
        }
        catch (e) {
            threadids[i] = "";
        }
        try {
            postids[i] = event[i].getElementsByTagName("postid")[0].firstChild.nodeValue;
        }
        catch (e) {
            postids[i] = "";
        }
        try {
            userids[i] = event[i].getElementsByTagName("userid")[0].firstChild.nodeValue;
        }
        catch (e) {
            userids[i] = "";
        }
        try {
            spyids[i] = event[i].getElementsByTagName("id")[0].firstChild.nodeValue;
        }
        catch (e) {
            spyids[i] = 1;
        }
        try {
            forumids[i] = event[i].getElementsByTagName("forumid")[0].firstChild.nodeValue;
        }
        catch (e) {
            forumids[i] = 1;
        }
        try {
            forumnames[i] = event[i].getElementsByTagName("forumname")[0].firstChild.nodeValue;
        }
        catch (e) {
            forumnames[i] = 1;
        }
    }

    push();

}

function push() {

    if (play == 0) {
        setTimeout("push()", 1000);
        return;
    }

    var cell;
    var cellnext;
    var text;
    var clip;
    var who_clip = \'\';
    var where = \'\';
    var post_url;
    var style = "";
    var what = whats.pop();
    var title = titles.pop();
    var preview = previews.pop();
    var who = whos.pop();
    var threadid = threadids.pop();
    var postid = postids.pop();
    var userid = userids.pop();
    var spyid = spyids.pop();
    var forumid = forumids.pop();
    var forumname = forumnames.pop();

    highestid = Math.max(parseInt(spyid), highestid);

    if (vB_PHP_Emulator.prototype.stripos(what, \'Thread\')) {
        post_url = \'showthread.php?\' + SESSIONURL + \'t=\' + threadid;
    } else {
        post_url = \'showthread.php?\' + SESSIONURL + \'p=\' + postid + \'#post\' + postid ;
    }

    if (what == \'' 
vB_Template_Runtime::parsePhrase("new_user") . '\') {
        clip = \'<span style="font-weight:bold">' 
vB_Template_Runtime::parsePhrase("new_user_registration") . '</span>\';
    } else if(title.length == 0) { // Why??
        clip = \'Unknown\';
    } else {
        clip = \'<a style="font-weight:bold" href="\' + post_url + \'">\' + title + \'</a>\';
    }
    if (preview.length > 0) clip = clip + \'<br /><div>\' + preview + \'</div>\';
    
    if (userid.length > 0) {
        who_clip = \'by <a href="member.php?\' + SESSIONURL + \'u=\' + userid + \'">\' + who + \'</a>\';
    }
    
    if (parseInt(forumname.length) > 0) {
        if (who_clip.length > 0) where = \'<br />\';
        where = where + \'<a style="font-weight:bold" href="forumdisplay.php?\' + SESSIONURL + \'f=\' + forumid + \'">\' + forumname + \'</a>\';
    } else {
        where = \'\';
    }
    text = \'<div class="what">\' + what + \'</div><div class="who">\' + who_clip + where + \'</div><div class="clip">\' + clip + "</div>";

    document.getElementById("row1").style.opacity = 0;
    
    for (i = (spymax - 1); i >= 1; i--) {
        cell = document.getElementById("row" + i);
        cellnext = document.getElementById("row" + (i + 1));
        if (cell.innerHTML != "") {
            cellnext.innerHTML = cell.innerHTML;
            cellnext.style.display = \'\';
        }
    }
    document.getElementById("row1").innerHTML = text;

    FadeIn = new YAHOO.util.Anim("row1", { 
            opacity:{to: 1}
        }, fadetime
    );
    FadeIn.animate();

    if (whats.length > 0) {
        setTimeout("push()", pushtime);
    }
    else {
        fadetime = fadetime_end;
        pushtime = pushtime_end;
        setTimeout("getXML()", 5000);
    }
}
</script>

    <title>' 
$vboptions['bbtitle'] . ' ' vB_Template_Runtime::parsePhrase("spy") . '</title>
$headinclude_bottom '
</head>
<body onload="init()">
    ' 
$header '
    ' 
$navbar '

<ul id="spy_options"> 
    <li><label><input type="checkbox" id="subscribed_flag" value="1"> ' 
vB_Template_Runtime::parsePhrase("include_subscribed") . '</label></li>
    <li><a class="textcontrol" id="play_pause" href="spy.php" onclick="play_pause(); return false;">' 
vB_Template_Runtime::parsePhrase("click_to_pause") . '</a></li>    
</ul>


<div> 
    <span class="spyhead table"> 
        <span class="what td">' 
vB_Template_Runtime::parsePhrase("what") . '</span> 
        <span class="who td">' 
vB_Template_Runtime::parsePhrase("who_where") . '</span> 
        <span class="clip td">' 
vB_Template_Runtime::parsePhrase("thread_post") . '</span> 
    </span> 
</div> 


<ol id="spys">
    <li class="spybit" id="row1"></li>
    <li class="spybit" id="row2" style="display: none;"></li>
    <li class="spybit" id="row3" style="display: none;"></li>
    <li class="spybit" id="row4" style="display: none;"></li>
    <li class="spybit" id="row5" style="display: none;"></li>
    <li class="spybit" id="row6" style="display: none;"></li>
    <li class="spybit" id="row7" style="display: none;"></li>
    <li class="spybit" id="row8" style="display: none;"></li>
    <li class="spybit" id="row9" style="display: none;"></li>
    <li class="spybit" id="row10" style="display: none;"></li>
    <li class="spybit" id="row11" style="display: none;"></li>
    <li class="spybit" id="row12" style="display: none;"></li>
    <li class="spybit" id="row13" style="display: none;"></li>
    <li class="spybit" id="row14" style="display: none;"></li>
    <li class="spybit" id="row15" style="display: none;"></li>
    <li class="spybit" id="row16" style="display: none;"></li>
    <li class="spybit" id="row17" style="display: none;"></li>
    <li class="spybit" id="row18" style="display: none;"></li>
    <li class="spybit" id="row19" style="display: none;"></li>
    <li class="spybit" id="row20" style="display: none;"></li>
    <li class="spybit" id="row21" style="display: none; opacity:.85"></li>
    <li class="spybit" id="row22" style="display: none; opacity:.65"></li>
    <li class="spybit" id="row23" style="display: none; opacity:.45"></li>
    <li class="spybit" id="row24" style="display: none; opacity:.25"></li>
    <li class="spybit" id="row25" style="display: none; opacity:.05"></li>
</ol>
<br clear="both" />
$footer '

</body>
</html> '

That is the parsed template from a version of vBulletin that can parse templates properly. Ultimately the best thing to do would be to upgrade to a version of vBulletin that can parse templates correctly, but if that's not an option manually parsing it like shown above should work.
Reply With Quote
  #47  
Old 06-04-2010, 06:48 AM
teenage.vn teenage.vn is offline
 
Join Date: Mar 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@digitalpoint: ... I will update to version 4.0.3 maybe in the near future but not now ... Btw, thanks for the best help from you .
Reply With Quote
  #48  
Old 06-04-2010, 08:48 AM
Michlerish's Avatar
Michlerish Michlerish is offline
 
Join Date: May 2010
Location: Ontario
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have private forums that not all users can see, is this mod permissions based? Like if a user goes to the spy page, they won't see updates for forums they cannot access, correct?

edit: I just tested it in two different browsers and it seems to work that way! Fantastic mod, I love it!
Reply With Quote
  #49  
Old 06-04-2010, 03:22 PM
Michlerish's Avatar
Michlerish Michlerish is offline
 
Join Date: May 2010
Location: Ontario
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I add a link to the spy.php page in my NavBar or NavTab?
Reply With Quote
  #50  
Old 06-04-2010, 07:13 PM
digitalpoint's Avatar
digitalpoint digitalpoint is offline
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 502
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It currently adds a link to the "Community" drop-down menu in the lower navigation (when you are anywhere within the forums).

If you really want it to have it's own main navbar button could you do something like so (this is off the top of my head, I didn't actually test it to make sure it works, but it should).

Plug-ins To Add
Location: process_templates_complete
PHP Code:
if (THIS_SCRIPT == 'spy'$vbulletin->options['selectednavtab'] = 'spy';
$template_hook['navtab_middle'] .= vB_Template::create('spy_navbar_link')->render(); 
Location: cache_templates
PHP Code:
$cache $cache[] = 'spy_navbar_link'
Template To Add
Location: spy_navbar_link
Code:
<li<vb:if condition="$vboptions['selectednavtab'] == 'spy'"> class="selected"</vb:if>>
	<a class="navtab" href="spy.php{vb:raw session.sessionurl_q}">{vb:rawphrase directory}</a>
</li>
Reply With Quote
  #51  
Old 06-05-2010, 02:15 AM
dezzy94 dezzy94 is offline
 
Join Date: Jun 2010
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works good !
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:57 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.07942 seconds
  • Memory Usage 2,408KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (5)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete