vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - vBISpy - AJAX real-time feed of new posts/threads (https://vborg.vbsupport.ru/showthread.php?t=125947)

kall 09-13-2006 05:30 AM

Nice. :)

Although.. it doesn't seem to like either GARS or the RSS bot feature..

http://www.nzboards.com/forums/nzbpostspy.php

Only the New Post has a 'Forum' entry.

*edit* In Firefox, that is.

nix 09-13-2006 05:59 AM

I'm using it with RSS feeds and its working fine in FF. Same with Gars.

kall 09-13-2006 06:14 AM

Here's the code.. it looks like something is being stripped.
Code:

<td class="alt1Active"><strong><a href="showthread.php?t=30950">Object from 'space' found by chance - Stuff.co.nz</a></strong><br><div class="smallfont"><br><table border="0" cellpadding="2" cellspacing="7" width=""><tbody><tr><t><a... replies="" 0="" views="" (0=""></a...></t><td class="alt1" align="center"><div class="smallfont"><strong><a href="forumdisplay.php?f=76">New Zealand News Feeds</a></strong></div></td></tr></tbody></table></div></td>
I see this in one of the .js files:
Code:

if (e instanceof RangeError) return '...';
Range error for those threads that have 0 replies and are posted by the RSS bot.. in FF?

ForumDog 09-13-2006 10:40 AM

Quote:

Originally Posted by MPDev
The thing I don't like about stylevar is having to explain to everyone that they have to copy those images to all their style directories. This is much more simplistic.

True, it just makes it impossible for people with multiple themes to be consistent. Up to you if you want to do this since it adds a tiny amount of uncached js, but for everyone else wanting to use multiple themed buttons (or having no choice because of multiple style directories)...

In va_spy.js

REMOVE

Code:

function pauseSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "images/misc/play_up.gif";
        playimg.alt = "Click to Play";
        pauseimg.src = "images/misc/pause_down.gif";
        pauseimg.alt = "Paused...";

        pause();
}

function playSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "images/misc/play_down.gif";
        playimg.alt = "Playing...";
        pauseimg.src = "images/misc/pause_up.gif";
        pauseimg.alt = "Click to Pause";

        resume();
}

function pause() {
        play = 0;
}

function resume() {
        play = 1;
}



In vaispy.php

FIND:

Code:

<script language="javascript" type="text/javascript">
<!--
    spymax = 25;
// -->
</script>

Note: I added the js commenting for older browser compatbility and the javascript type for code validation, I'll just assume they'll be added in future versions. If you don't have it as above, replace it.



ADD BELOW:
Code:

<script language="javascript" type="text/javascript">
<!--
function pauseSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "$stylevar[imgdir_misc]/play_up.gif";
        playimg.alt = "Click to Play";
        pauseimg.src = "$stylevar[imgdir_misc]/pause_down.gif";
        pauseimg.alt = "Paused...";

        pause();
}

function playSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "$stylevar[imgdir_misc]/play_down.gif";
        playimg.alt = "Playing...";
        pauseimg.src = "$stylevar[imgdir_misc]/pause_up.gif";
        pauseimg.alt = "Click to Pause";

        resume();
}

function pause() {
        play = 0;
}

function resume() {
        play = 1;
}
// -->
</script>

FIND

Code:

<img id="vaplay" src="images/misc/play_up.gif" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="images/misc/pause_up.gif" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />

REPLACE WITH:
Code:

<img id="vaplay" src="$stylevar[imgdir_misc]/play_down.gif" style="cursor:pointer;" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="$stylevar[imgdir_misc]/pause_up.gif" style="cursor:pointer;" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />

Note: Added CSS to change the mouse to the hand icon when hovering over the buttons as well.

And make sure your Play/Pause buttons are uploaded to the misc directory of each individual theme.

Finis.

ForumDog 09-13-2006 02:39 PM

Quote:

Originally Posted by mini2
For those that use the selective forum fiter, you can have that apply also to this spy by doing this...

After:

Code:

$blockforums = "";
Add:

Code:

$selectivefiltered = $vbulletin->userinfo['excludeforumids'];
After:

Code:

    AND forumid NOT IN (0$blockforums)
With:

Code:

    AND forumid NOT IN (0$blockforums$selectivefiltered)
Could be worth adding this as default, not sure if it will cause errors for those that do not use the selective forum filters, but I doubt it.

Great stuff :D and these instructions also work in exactly the same way with the Andreas's Opt-Out Forums from Get New/Get Daily for 3.5.4 - also works on 3.6 - (https://vborg.vbsupport.ru/showthread.php?t=91025). Just instead of:

Code:

$selectivefiltered = $vbulletin->userinfo['excludeforumids'];
use:

Code:

$gnpoptoutforums = $vbulletin->userinfo['excludeforumsgnp'];

MPDev 09-13-2006 04:31 PM

I'd be curious if the selected forums code works on sites where people do not use that feature; if so, I can add it.

On another note, I've updated vBIspy.com so that it can pull threads using vBulletin's external.php script; so we can aggregate content with vBIspy client (you get some additional features like profile links, forum specific links, views/replies) or with vB's own internal RSS feed.

I am updating the download with a new version that changes the forumpermissions area to include checking for password protected forums.

ForumDog 09-13-2006 04:46 PM

It's not selected forums code, it's deselected forums code to exclude forums from getnew searches. It's not default vBulletin code so I don't see how it could work on those without the appropriate plugin installed but I don't see why it would cause a problem for people without it. Should just be skipped over. I'll try it properly later.

Um, could you possibly not advertise in the hack update feature. :p

MPDev 09-13-2006 05:18 PM

Quote:

Originally Posted by ForumDog
Um, could you possibly not advertise in the hack update feature. :p

Apologies. Given the time invested in the mod and having only sent out one update, I don't think a line about vbispy.com integration is out of place; but that's just me, others might disagree.

theodonnells 09-14-2006 07:58 AM

Quote:

Originally Posted by buro9
Do you have a different language pack from the default installed? It's missing the encoding, which is normally part of the localisation.

Indeed the line in the PHP file is:
PHP Code:

echo '<?xml version="1.0" encoding="' . $stylevar['charset'] . '"?>' . "\r\n";


Ah the language problem again...See i had english and german languages on my forum.When i installed the german it changed some of my english phrases too.Have tried unsuccesfully to fix this..Got querys to run from vb.com etc reinstalled original language but nothing shifts it...So probably is the language that is a problem..

MPDev 09-14-2006 10:21 PM

Quote:

Originally Posted by ForumDog
It's not selected forums code, it's deselected forums code to exclude forums from getnew searches. It's not default vBulletin code so I don't see how it could work on those without the appropriate plugin installed but I don't see why it would cause a problem for people without it. Should just be skipped over. I'll try it properly later.

Um, could you possibly not advertise in the hack update feature. :p

I'd probably say that any code to support other plugins should not be standard; if you use that mod you can add the code as you documented.

soletrader 09-15-2006 03:23 AM

Does anybody know if this hack is server intensive?

buro9 09-15-2006 07:34 AM

Quote:

Originally Posted by soletrader
Does anybody know if this hack is server intensive?

The original version was, it did a full table scan of the thread table. The version currently attached to the thread only scans the last 24 hours of the thread table. If you're on a busy forum you should have it scan less, I scan only the last hour.

Aside from that, take a look... turn on debug mode and add explain=1 to the do=xml querystring for the php file. I'm seeing the page generated in 5 queries, all taking less than 0.01 seconds, and the largest query isn't the spy query, but the ones that fetch the datastore and templates (I'm using the template layer for spy and not the echo'd HTML that spy originally shipped with).

I also reduced the number of refreshes fired by the JavaScript, from 7 seconds down to 20 seconds. As that is the highest rate of posting on my forum around peak time, so it seemed daft to be firing off so many useless AJAX calls. I'm considering dropping it further to 30 seconds, which would be about the maximum on a large forum before you degrade the user experience of the spy.

In summary: Doesn't need to be intensive, but the first version was.

Oh, and the JavaScript is horrible. All kinds of dodgy 1.0 stuff and bizarre splitting of strings. I'm very much inclined to re-write that stuff using proper DOM stuff. vBulletin is largely XHTML, there's not much excuse to break that on this page through the use of innerHTML rather than DOM manipulation. Besides... use one or the other, both are fast, but combined they are cludgy. So I'm going to change most of mine to fully use DOM stuff, and get rid of those arrays of data when objects would be just as good, or using the original responseXML.

Anyway... rambling... low server load if you use the latest version.

ForumDog 09-15-2006 08:03 AM

Quote:

Originally Posted by MPDev
I'd probably say that any code to support other plugins should not be standard; if you use that mod you can add the code as you documented.

Fair enough. :) I've added the hack title and author name to the post so others can find it if they search.

buro9, would you release your improvements? I also moved the code except the inside of the table rows to the templating system and changed the non-IE XHTML to divs and spans with CSS for better markup and to fix the Opera rendering failure, plus some other cosmetic changes/additions. It's currently driving me nuts that the HTML is all inside the JS and I can't use conditionals or anything like that.

It would be really great if I could and the code was vB consistent if I could twist your arm. :)

buro9 09-15-2006 08:19 AM

When I've done the DOM JavaScript stuff I'll post it here. It may be a few weeks though, I'm still running the old javascript on my site, the new stuff I haven't had tested in many browsers (just Firefox on Ubuntu), so I've yet to even get it past IE on Windows ;) And I'm going to be distracted and slow working for a fortnight as my girl is coming to stay for a couple of weeks... this takes a lower priority ;)

As for the basics to make things better now:
In vaispy.php:
REPLACE:
Code:

$daysprune = 1;
WITH:
Code:

$daysprune = 0.04;
That will take one days worth of queries down to 1 hour worth of queries (57.1 minutes to be precise). So even fewer rows in the thread table locked.

In va_spy.js:
REPLACE:
Code:

var xmldelay = 7000;
WITH:
Code:

var xmldelay = 20 * 1000;
AND

REPLACE THE TWO INSTANCES OF:
Code:

setTimeout("getXML()", 5000);
WITH:
Code:

setTimeout("getXML()", xmldelay);
That changes the time between polling for updates from 7 seconds to 20. I prefer doing the math like that as it makes it obvious it's 20 x 1000 milliseconds = 20 seconds.

Changing that you will have taken each users average 10 queries per minute down to 3 queries per minute. Change it to 30 seconds and they'll be down to 2 queries per minute. Any time span higher than this will reduce the beauty and usability of the spy page too much for my liking. But quiet forums could easily get it to 1 minute per poll.

I also don't like * queries in SQL, so I changed in vaispy.php:
Code:

    $getthreads = $db->query_read("
        SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid
        FROM ".TABLE_PREFIX."thread AS thread
        LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
        LEFT JOIN ".TABLE_PREFIX."post AS post ON(post.postid = thread.lastpostid)
        WHERE open <> 10 AND thread.lastpostid > $lastpostid
        AND forumid NOT IN (0$blockforums)
        AND thread.visible = '1'
                AND post.visible = 1
        AND deletionlog.primaryid IS NULL
        $datecut
        ORDER BY lastpost DESC LIMIT 10");

TO:
Code:

    $getthreads = $db->query_read("
      SELECT thread.forumid,
            thread.firstpostid,
            thread.lastpost,
            thread.lastposter,
            thread.lastpostid,
            thread.replycount,
            thread.threadid,
            thread.title,
            thread.views,
            post.pagetext AS preview,
            post.userid AS lastpuserid
        FROM " . TABLE_PREFIX . "thread AS thread
            LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
            LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.lastpostid)
      WHERE open <> 10
        $datecut
        AND forumid NOT IN (0$blockforums)
        AND thread.visible = '1'
        AND thread.lastpostid > $lastpostid
        AND post.visible = 1
        AND deletionlog.primaryid IS NULL
      ORDER BY thread.lastpost DESC LIMIT 10
    ");

The difference on that is neglible on performance, but I prefer to know what my queries return.

bashy 09-15-2006 10:05 AM

Hi peeps

Can someone please take a look at my vaispy.php as the opacity is not working this time. It worked the last time i edited the page to my liking, but then i updated and lot it all, so i have now done it again but the opacity is not working on the last few posts at all....

You can view it here untill i remove for guests http://www.bashys-place.com/forums/vaispy.php

I have enclosed the php for you to check if you have time please?

Also done a quick scout and cannot find how i could stop guests from using this please?
At present guests can only see 10 or so posts, memebsr can see 45, i dont want guests seeing any!

ForumDog 09-15-2006 10:08 AM

Quote:

Originally Posted by bashy
Hi peeps

Can someone please take a look at my vaispy.php as the opacity is not working this time. It worked the last time i edited the page to my liking, but then i updated and lot it all, so i have now done it again but the opacity is not working on the last few posts at all....

You can view it here untill i remove for guests http://www.bashys-place.com/forums/vaispy.php

I have enclosed the php for you to check if you have time please?

Also done a quick scout and cannot find how i could stop guests from using this please?
At present guests can only see 10 or so posts, memebsr can see 45, i dont want guests seeing any!

There's a post near the beginning that says how restrict permissions to member's only, have a search.

The opacity was not correct in the first place, it's one of the fixes I made I'll post it with the rest soon. Thanks buro9 :) great to see people working together on this mod.

MPDev 09-15-2006 11:31 AM

Quote:

Originally Posted by buro9
All kinds of dodgy 1.0 stuff and bizarre splitting of strings.

In the latest version I got rid of that code as well; for IE I just use a string.

I'll change the query in the next update so everyone can benefit from the improvement.

And nice to have others putting in the effort! Thanks.

bashy 09-15-2006 02:22 PM

I did have the opacity working the on 1st install, it was fine :)

Quote:

Originally Posted by ForumDog
There's a post near the beginning that says how restrict permissions to member's only, have a search.

The opacity was not correct in the first place, it's one of the fixes I made I'll post it with the rest soon. Thanks buro9 :) great to see people working together on this mod.


MPDev 09-15-2006 04:03 PM

It works for IE, but not on FF; I assume it's a tag, but haven't had the time to go looking just yet.

MPDev 09-16-2006 01:55 AM

Quote:

Originally Posted by ForumDog
I also moved the code except the inside of the table rows to the templating system and changed the non-IE XHTML to divs and spans with CSS for better markup and to fix the Opera rendering failure, plus some other cosmetic changes/additions.

The Opera fix would be helpful; as I am sure the others would be. Thanks for sharing.

bigtime 09-16-2006 04:04 AM

Hi,

Great add-on!

I would like to show this on a non-vb page as an include.

How can I do that without getting the "Unable to add cookies, header already sent." error?

Thanks!

Tim

ForumDog 09-16-2006 08:42 AM

Quote:

Originally Posted by MPDev
The Opera fix would be helpful; as I am sure the others would be. Thanks for sharing.

Yes, ok ok ok. :D I'm still getting it up to scratch for my own site. But since you'd like to hear now, I'm not done but these are my changes so far, I will include what I already posted that has not yet currently been added for ease of reading.




The default title length as set by vBulletin is actually 85 characters not 80.

In vaispy.php

FIND:
Code:

(unhtmlspecialchars($thread['title']), 80)
REPLACE WITH:
Code:

(unhtmlspecialchars($thread['title']), 85)



I moved the HTML to a vBulletin template, it's easier to separate code from presentation that way and allows use of template caching more flexibility with conditionals and so on so I'll *assume* that's what you'll want to do. It's very easy to do manually as long as this isn't a plugin which for the time being is unnecessary.


FIND:
Code:

// pre-cache templates used by all actions
$globaltemplates = array();

REPLACE WITH:
Code:

// pre-cache templates used by all actions
$globaltemplates = array('vaispy');

Go to AdminCP > Styles & Templates > In the dropdown list for (Your Parent Style) choose 'Add new template' Name it vaispy.

Now we have to tell the page to fetch the template, and we're also going to add a couple of lines to keep the vBulletin breadcrumb going.

In vaispy.php

FIND:
Code:

eval('$navbar = "' . fetch_template('navbar') . '";');

$headinclude = process_replacement_vars($headinclude);
$navbar = process_replacement_vars($navbar);

eval('$footer = "' . fetch_template('footer') . '";');
$footer = process_replacement_vars($footer);


REPLACE WITH:
Code:

$navbits = array();
$navbits[$parent] = 'vaispy';
$navbits = construct_navbits($navbits);

eval('$navbar = "' . fetch_template('navbar') . '";');
$navbar = process_replacement_vars($navbar);

eval('$headinclude = "' . fetch_template('headinclude') . '";');
$headinclude = process_replacement_vars($headinclude);

eval('$footer = "' . fetch_template('footer') . '";');
$footer = process_replacement_vars($footer);

eval('print_output("' . fetch_template('vaispy') . '");');




Looking good! Now let's just transfer it over to the template.

REMOVE:
Code:

echo<<<VAPRINT
AND REMOVE:
Code:

VAPRINT;

?>

Then CUT everything that was between those two tags and PASTE it into your new template. Save the template so you don't lose it before the following template improvements. :D



This will allow Microstats to show up in the footer and whitespace strippers, template caches etc, makes the code valid too.

In template vaispy:

FIND:
Code:

$footer
ADD BELOW:
Code:

</body>
</html>




Because we're now in a template there's no reason not to use style-specific directories to allow people with multiple themes not to be forced to create a new top-level directory for the buttons. You must ensure your buttons are copied to each misc directory for every style you have installed. Also added is code to ensure the mouse changes to the hand icon over a button to show it is a clickable link, plus compatibility commenting for inline javascript code.

In va_spy.js

REMOVE

Code:

function pauseSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "images/misc/play_up.gif";
        playimg.alt = "Click to Play";
        pauseimg.src = "images/misc/pause_down.gif";
        pauseimg.alt = "Paused...";

        pause();
}

function playSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "images/misc/play_down.gif";
        playimg.alt = "Playing...";
        pauseimg.src = "images/misc/pause_up.gif";
        pauseimg.alt = "Click to Pause";

        resume();
}

function pause() {
        play = 0;
}

function resume() {
        play = 1;
}



In vaispy.php

FIND:

Code:

<script language="javascript" type="text/javascript">
<!--
    spymax = 25;
// -->
</script>

ADD BELOW:
Code:

<script language="javascript" type="text/javascript">
<!--
function pauseSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "$stylevar[imgdir_misc]/play_up.gif";
        playimg.alt = "Click to Play";
        pauseimg.src = "$stylevar[imgdir_misc]/pause_down.gif";
        pauseimg.alt = "Paused...";

        pause();
}

function playSpy() {
        var playimg = document.getElementById("vaplay");
        var pauseimg = document.getElementById("vapause");

        playimg.src = "$stylevar[imgdir_misc]/play_down.gif";
        playimg.alt = "Playing...";
        pauseimg.src = "$stylevar[imgdir_misc]/pause_up.gif";
        pauseimg.alt = "Click to Pause";

        resume();
}

function pause() {
        play = 0;
}

function resume() {
        play = 1;
}
// -->
</script>

FIND

Code:

<img id="vaplay" src="images/misc/play_up.gif" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="images/misc/pause_up.gif" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />

REPLACE WITH:
Code:

<img id="vaplay" src="$stylevar[imgdir_misc]/play_down.gif" style="cursor:pointer;" alt="Play" title="Play Comments" onclick="playSpy();" /> &nbsp;
<img id="vapause" src="$stylevar[imgdir_misc]/pause_up.gif" style="cursor:pointer;" alt="Pause" title="Pause Comments" onclick="pauseSpy();" />



Now we're going to make the opacity code which creates the nice fading effect work across all browsers instead of currently very few. I am currently pulling images into the post/thread Spy, so if you/the author decides to do this the fade effect is also already there for them too.

FIND:
Code:

opacity:.XX
(This will be in the last 5 rows of however many rows you chose to have)

REPLACE WITH:
Code:

class="spyfadeX"
(Replace the X with 1-5 for the last 5 rows, in correct numeric order)

FIND:
Code:

$headinclude
ADD AFTER:
Code:

<style type="text/css">
.spyfade1 div, .spyfade1 span,, .spyfade1 td, .spyfade1 img {
opacity:0.90;
filter:alpha(opacity=90);
-moz-opacity:0.90;
}
.spyfade2 div, .spyfade2 span, .spyfade2 td, .spyfade2 img {
opacity:0.80;
filter:alpha(opacity=80);
-moz-opacity:0.80;
}
.spyfade3 div, .spyfade3 span, .spyfade3 td, .spyfade3 img {
opacity:0.70;
filter:alpha(opacity=70);
-moz-opacity:0.70;
}
.spyfade4 div, .spyfade4 span, .spyfade4 td, .spyfade4 img {
opacity:0.50;
filter:alpha(opacity=50);
-moz-opacity:0.50;
}
.spyfade5 div, .spyfade5 span, .spyfade5 td, .spyfade5 img {
opacity:0.30;
filter:alpha(opacity=30);
-moz-opacity:0.30;
}
</style>

In va_spy.js
Code:


FIND:
                        if (i + 5 > spymax) {
                                document.getElementById("spy_table").rows[i].cells[0].className = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                document.getElementById("spy_table").rows[i].cells[1].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                document.getElementById("spy_table").rows[i].cells[2].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                document.getElementById("spy_table").rows[i].cells[3].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                        }

REPLACE WITH (or remove entirely):
Code:

                        // if (i + 5 > spymax) {
                                // document.getElementById("spy_table").rows[i].cells[0].className = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                // document.getElementById("spy_table").rows[i].cells[1].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                // document.getElementById("spy_table").rows[i].cells[2].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                                // document.getElementById("spy_table").rows[i].cells[3].style.filter = 'alpha(opacity=' + (((spymax - i) * 20) + 5) + ')';
                        // }



The reason Opera is failing to render properly is because it does not download elements with {display:none;}, unlike other browsers which download them but don't show them. This is actually quite a bandwidth saver at times and usually A Good Thing, but here it is causing problems because the table cells which the javascript is throwing out have no table row structure due to them having the attribute {display:none;}, so they're just piling up as lone cells without a row.

MPDev seemed to want this now :p, but otherwise it's fine. Since IE is already the one having trouble doing...more or less anything...and it can't handle the non-table code, we're going to continue the slightly painful IE-specific code theme.

I'm afraid I've already heavily optimised and customised the appearance to match my threadbit so I'm sorry to say this is rather vague.

In va_spy.js

FIND:
Code:

text = '<td class="alt1" align="center"><div class="smallfont"><strong>' + what + '</strong></div></td><td class="alt2"><div class="smallfont">' + poster_clip + '</div></td><td class="alt1Active">' + clip + '</td><td align="center" class="alt1"><div class="smallfont">' + where + '</div></td>';
REPLACE WITH:

***Note: I now have this working on any resolution with Opera & Firefox and hopefully every other browser, BUT I only use three cells not four like the default code so you're going to have to use my code as a template to work out the layout for four. Take note of the clears and floats and make sure you assign a % width to the thread/post section and a px width to all the others. Let me know if you need a hand.

Code:

// Did I mention IE is "special"? Help it avoid the scary clever presentation.
        if (is_ie) {
                text = '<td class="alt1 smallfont" align="center">' + ITEM + '</td>';
        } else {
                text = '<span class="alt1 smallfont" style="display:inline-block;float:left;width:30px;text-align:center;clear:left;"><img src="' + iconpath + '" alt="" border="0" /></span><span class="alt1 smallfont" style="display:inline-block;float:left;width:90%;clear:none;"><span class="alt1 smallfont" style="display:inline-block;float:right;width:200px;text-align:right;clear:none;">' + where + '</span>' + clip + '</span>';
        }

Now also surround every clip = in the IF statements above the replaced code with <span></span> tags. The divs are unnecessary for the IE code as long as they're included with the innerHTML below, I've removed them.




Now we have to add the accompanying code to the template to match. Again it's a bit vague because of my template, sorry. This is the general idea. I can only test on Opera, Firefox and IE but it works across all 3, latest release versions, and should be good across other modern browsers as tables are really only used for things like this because IE can't handle anything more complicated.

FIND:
Code:

<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center" id="spy_table">
<thead>
<tr align="center"><td class="thead" width="100">Event</td><td class="thead" width="190">By</td><td class="thead">Thread/Post</td><td class="thead" width="190">Forum</td></tr>
</thead>
<tbody class="alt1">
<tr id="row1" style="display: none;">&nbsp;</tr>
<tr id="row2" style="display: none;">&nbsp;</tr>
<tr id="row3" style="display: none;">&nbsp;</tr>
<tr id="row4" style="display: none;">&nbsp;</tr>
<tr id="row5" style="display: none;">&nbsp;</tr>
<tr id="row6" style="display: none;">&nbsp;</tr>
<tr id="row7" style="display: none;">&nbsp;</tr>
<tr id="row8" style="display: none;">&nbsp;</tr>
<tr id="row9" style="display: none;">&nbsp;</tr>
<tr id="row10" style="display: none;">&nbsp;</tr>
<tr id="row11" style="display: none;">&nbsp;</tr>
<tr id="row12" style="display: none;">&nbsp;</tr>
<tr id="row13" style="display: none;">&nbsp;</tr>
<tr id="row14" style="display: none;">&nbsp;</tr>
<tr id="row15" style="display: none;">&nbsp;</tr>
<tr id="row16" style="display: none;">&nbsp;</tr>
<tr id="row17" style="display: none;">&nbsp;</tr>
<tr id="row18" style="display: none;">&nbsp;</tr>
<tr id="row19" style="display: none;">&nbsp;</tr>
<tr id="row20" style="display: none;">&nbsp;</tr>
<tr id="row21" style="display: none; opacity:.85">&nbsp;</tr>
<tr id="row22" style="display: none; opacity:.65">&nbsp;</tr>
<tr id="row23" style="display: none; opacity:.45">&nbsp;</tr>
<tr id="row24" style="display: none; opacity:.25">&nbsp;</tr>
<tr id="row25" style="display: none; opacity:.05">&nbsp;</tr>
</tbody>
</table>

REPLACE WITH:
Code:

<if condition="is_browser('ie')">

<table class="tborder" cellpadding="6" cellspacing="0" border="0" width="100%" align="center" id="spy_table">
<thead>
<tr align="center"><td class="thead" width="100">Event</td><td class="thead" width="190">By</td><td class="thead">Thread/Post</td><td class="thead" width="190">Forum</td></tr>
</thead>
<tbody class="alt1">
<tr id="row1" style="display:none;"></tr>
<tr id="row2" style="display:none;"></tr>
<tr id="row3" style="display:none;"></tr>
<tr id="row4" style="display:none;"></tr>
<tr id="row5" style="display:none;"></tr>
<tr id="row6" style="display:none;"></tr>
<tr id="row7" style="display:none;"></tr>
<tr id="row8" style="display:none;"></tr>
<tr id="row9" style="display:none;"></tr>
<tr id="row10" style="display:none;"></tr>
<tr id="row11" style="display:none;"></tr>
<tr id="row12" style="display:none;"></tr>
<tr id="row13" style="display:none;"></tr>
<tr id="row14" style="display:none;"></tr>
<tr id="row15" style="display:none;"></tr>
<tr id="row16" style="display:none;"></tr>
<tr id="row17" style="display:none;"></tr>
<tr id="row18" style="display:none;"></tr>
<tr id="row19" style="display:none;"></tr>
<tr id="row20" style="display:none;"></tr>
<tr id="row21" style="display:none;" class="spyfade1"></tr>
<tr id="row22" style="display:none;" class="spyfade2"></tr>
<tr id="row23" style="display:none;" class="spyfade3"></tr>
<tr id="row24" style="display:none;" class="spyfade4"></tr>
<tr id="row25" style="display:none;" class="spyfade5"></tr>
</tbody>
</table>

<else />

<table class="tborder" cellpadding="6" cellspacing="0" border="0" width="100%" align="center" id="spy_table">
<tr><td class="tcat" width="100%">
<span style="display:inline-block;float:left;width:50px;">Event</span><span style="display:inline-block;float:left;width:50px;">By</span><span style="display:inline-block;float:left;width:90%;">Thread/Post</span><span style="display:inline-block;float:left;width:200px%;">Forum</span>
</td></tr>
<tr><td>
<div id="row1" style="display:none;"></div>
<div id="row2" style="display:none;"></div>
<div id="row3" style="display:none;"></div>
<div id="row4" style="display:none;"></div>
<div id="row5" style="display:none;"></div>
<div id="row6" style="display:none;"></div>
<div id="row7" style="display:none;"></div>
<div id="row8" style="display:none;"></div>
<div id="row9" style="display:none;"></div>
<div id="row10" style="display:none;"></div>
<div id="row11" style="display:none;"></div>
<div id="row12" style="display:none;"></div>
<div id="row13" style="display:none;"></div>
<div id="row14" style="display:none;"></div>
<div id="row15" style="display:none;"></div>
<div id="row16" style="display:none;"></div>
<div id="row17" style="display:none;"></div>
<div id="row18" style="display:none;"></div>
<div id="row19" style="display:none;"></div>
<div id="row20" style="display:none;"></div>
<div id="row21" style="display:none;" class="spyfade1"></div>
<div id="row22" style="display:none;" class="spyfade2"></div>
<div id="row23" style="display:none;" class="spyfade3"></div>
<div id="row24" style="display:none;" class="spyfade4"></div>
<div id="row25" style="display:none;" class="spyfade5"></div>
</td></tr>
</table>

</if>



Finally, unless you've looked you won't be aware that the va_effects JS file contains considerably more effects than just the fade-in (called Appear) used by default. I went through most of them, I don't think any consistently worked properly (indeed, neither does the fade-in effect since it doesn't work in IE, this is probably due to the lack of varying opacity code as I mentioned earlier). However, since it's the default and obviously you can only use one effect I removed the other code from the effects file and trimmed it down to just the Appear effect. This saves 20kb from the initial download time.

The file is attached for anyone who wants it, to use it just place the attached file in your clientscript folder with the va_effects.js file and in your vaispy template just replace the words va_effects.js with va_appear.js.

Phew! Hope that helped.

ubblite 09-16-2006 09:18 AM

I'm glad you guys are working on a fix for Opera... once it's done I'll probably install this nice mod.

bashy 09-16-2006 09:41 AM

Cheers, I have added and the opacitiy is working well now, thanks alot :)

I actually have 2 monitors and i use the spu on the other monitor on the active desktop so that i get real time updates without even having to log on to the forum, its great :)

Thanks again peeps!!!!

Quote:

Originally Posted by ForumDog
Yes, ok ok ok. :D I'm still getting it up to scratch for my own site. But since you'd like to hear now, I'm not done but these are my changes so far, I will include what I already posted that has not yet currently been added for ease of reading.


MPDev 09-16-2006 11:56 AM

Thanks, ForumDog; I'll see about incorporating those change shortly. By creating a template, I also have to create a plug-in; which I was sort of trying to avoid, but might be the natural progression to take.

I left the effects javascript in tact, although the copyrights don't say we can't modify for our use. I'll leave the copyrights in place and just use the code from the file that we use.

ForumDog 09-16-2006 12:04 PM

Quote:

Originally Posted by MPDev
Thanks, ForumDog; I'll see about incorporating those change shortly. By creating a template, I also have to create a plug-in; which I was sort of trying to avoid, but might be the natural progression to take.

I left the effects javascript in tact, although the copyrights don't say we can't modify for our use. I'll leave the copyrights in place and just use the code from the file that we use.

I feel that, never yet learned how to create plugins :D but if it's for other people to use it's very difficult to avoid.

Edited the above post slightly, just noticed that removing the style.filter code in the .JS allows the fade out to work in IE.

MPDev 09-16-2006 12:09 PM

Not a problem; I can make one, just liked the easy upload and go way of letting it run. ;)

I'll see what I can come up with - great work!

MPDev 09-16-2006 04:23 PM

Quote:

Originally Posted by ForumDog
***Note: I now have this working on any resolution with Opera & Firefox and hopefully every other browser, BUT I only use three cells not four like the default code so you're going to have to use my code as a template to work out the layout for four.

I am having an issue with the thread width - if I keep it at 80% or 90%, then the display in Opera doesnt adjust well and puts the spans onto different lines.

http://www.vbispy.com

If you narrow your window, you can see how this happens. I have the width at 50%. How do you force Opera to display those span's without any linebreaks?

ForumDog 09-16-2006 04:40 PM

Unfortunately I can't view how you've set it up by viewing the source code. PM me the text line code for non-IE browsers as you have it and I'll take a look when I've got a chance. It's not a high priority for me now since I've got it working for my site.

MPDev 09-16-2006 05:06 PM

I had better success using a table versus the spans; I'll keep playing with it in the meantime.

MPDev 09-16-2006 06:26 PM

Thanks, ForumDog! I have an Opera integration working at:

ViperAlley.Com and at vBispy.com

I'll post an update soon.

pdblizzard 09-16-2006 07:31 PM

*pam clicks install*
Great add on, thank you so much!

Two things, a question, and a suggestion:

Question: Is there way to limit the number of characters in the thread text preview (I'm using the VBAdvanced hack and want to squeeze up the size of each line on the page)

Suggestion: How about the option to play a sound file when a new post/thread is submitted so I can browse away or walk away from the comp and come back when I hear the sound file :cool:

kall 09-16-2006 09:02 PM

Ahh, the issue I was having with Firefox was caused by the Forum in question allowing HTML.

The <br> that the RSS feed started with was translating into a <br> in the vaispy display.

Manually removing the <br> seems to fix it, but it would be grand if it could be stripped before display. :)

MPDev 09-16-2006 09:35 PM

I strip bb code, so adding a strip for html code wouldn't be a problem; I'll do that as well.

The thread preview is set by the , 200); line in vaispy.php

Not sure about a sound.....

furst 09-17-2006 12:20 AM

I would LOVE to see a mix between this and Top X Stats or Cyb's Advanced Forum Statistics.

MPDev 09-17-2006 01:09 AM

Posted changes to fix Opera browsers, improve post parsing, trim javascript effects file and move some javascript into index.php to make using stylevars easier for those who want to stylize their copies.

Adrian Schneider 09-17-2006 01:23 AM

The only thing I'd like to see is checking for new private messages as well. I know it's not really the point of the hack, but then you can just leave the one page open and be updated with everything.

firstrebel 09-17-2006 08:08 AM

Can the second column - By - be made smaller or dynamic. It's too wide.

Bob

MPDev 09-17-2006 12:50 PM

The html for the columns is in va_spy.js at lines 268 and 270; you could modify the columns widths there.

firstrebel 09-17-2006 03:27 PM

That didn't work, so I looked at vaispy.php and removed the width="190" attribute from <td class="thead" width="190">By</td> at line 291.

Bob


All times are GMT. The time now is 03:32 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.02113 seconds
  • Memory Usage 1,995KB
  • 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
  • (46)bbcode_code_printable
  • (1)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete