vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Latest Topics on Your Desktop [SE] (https://vborg.vbsupport.ru/showthread.php?t=36189)

SVTOA 10-26-2002 06:10 AM

This takes all of 10 minutes to install. The directions could be better as far as the templates though. Some novice users may not understand the template instructions...
Even though to you me or whomever, it's obvious what to do...

This is how I'd write the install instructions:

Download the ZIP file for this hack and extract it to a folder of your choosing.

1. Upload "latest.php" to your forums root directory (not the admin directory)

2. Open the TEMPLATES folder that was created in the unzipped dirrectory, where you will find 6 .txt files.
Start with "latest.txt". Open this file in notepad or an HTML editor. Select the text of the file and copy it to your clipboard.

3. Open your vB control panel and scroll down to the TEMPLATES menu, then select "ADD". Paste the text you copied into the template content window.

4. Enter the name of the file in the box above the text area, with no file extension.

5. Click "SAVE"

6. Repeat this process for the remaining 5 templates.

7. Call up the URL of your vB with the latest.php extension added to the URL.

8. Make sure everything appears correctly and works properly.

9. Proceed to the intstructions to add to your active desktop.

The included install instructions outline how to do this on windows 98/ME. For XP, the procedure is very similar:
rigth-click the desktop, select properties/desktop/customizedesktop/web and then continue from step E of the supplied instructions.

This is a very nice hack, nice job!!!

SmartGnome 03-20-2003 10:53 AM

Hi N!ck great hack !!!!

What I was missing is the auto refresh in the box when you are not integrate it in your desktop :D

Here a small addition.


Open template latest

Find </HEAD>

Add directly under that:

Code:

<script>
//refresh time is in "minutes:seconds"
var timer="0:30"

if (document.images){
var TimeParse=timer.split(":")
TimeParse=TimeParse[0]*60+TimeParse[1]*1
}
function refreshtime(){
if (!document.images)
return
if (TimeParse==1)
window.location.reload()
else{
TimeParse-=1
CurMinutes=Math.floor(TimeParse/60)
CurSecs=TimeParse%60
if (CurMinutes!=0)
currenttime=CurMinutes+" minutes and "+CurSecs+" seconds until page refresh!"
else
currenttime=CurSecs+" seconds left until page refresh!"
window.status=currenttime
setTimeout("refreshtime()",1000)
}
}
window.onload=refreshtime
</script>

Safe template and you will have an autorefresh of 30 secs.

For test reason there is a time display on the browser statusline. If you don't want that, remove it from the script :D

Have fun !

Greetzz

dbode 03-26-2003 02:49 PM

Hi ho,

I have some problems with the number of Users online at my forum. At latest.php, it always shows around 1/2 of the users that are shown in the forum itself.

http://www.forumdeluxx.de/forum/latest.php
http://www.forumdeluxx.de/forum

N!ck 03-26-2003 10:59 PM

I haven't been able to solve that problem.

Shepski 03-27-2003 01:40 PM

Right, try again! i took the code form the vb index.php and re-jigged it to fit in with the latest.php so here it is.

Find in latest.php:
Code:

  $datecut = time()-300;
  $aguests = $DB_site->num_rows($DB_site->query("SELECT * FROM session WHERE lastactivity > $datecut AND userid = '0'"));
  $atotal = $DB_site->num_rows($DB_site->query("SELECT * FROM session WHERE lastactivity > $datecut"));
  $amembers = $atotal - $aguests;

and replace it with:
Code:

  $datecut=time()-$cookietimeout;
  $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
  $numberguest=$loggedins['sessions'];
  $loggedinmembers=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid>0 AND lastactivity>$datecut");
  $onlinemembers=$loggedinmembers['sessions'];
  $guestnumber = 0;
  $guestcount = 0;

if ($onlinemembers==0) {
        $guestcount++;
        $guestnumber++;
}
while ($guestcount < $numberguest) {
        $guestcount++;
        $guestnumber++;
        $username = "Guest #$guestnumber";
}
  $numbervisible=0;
  $numberregistered=0;
  $loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
                              FROM session
                              LEFT JOIN user ON (user.userid=session.userid)
                              WHERE session.userid>0 AND session.lastactivity>$datecut
                              ORDER BY invisible ASC, username ASC");

  if ($loggedin=$DB_site->fetch_array($loggedins)) {
    $numberregistered++;
    if ($loggedin['invisible']==0 or $bbuserinfo['usergroupid']==6) {
      $numbervisible++;
      $userid = $loggedin['userid'];
      if ($loggedin['invisible'] == 1) { // Invisible User but show to Admin
        $invisibleuser = '*';
      } else {
        $invisibleuser = '';
      }
    }
    while ($loggedin=$DB_site->fetch_array($loggedins)) {
      $numberregistered++;
      $invisibleuser = '';
      if ($loggedin['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
        continue;
      }
      $numbervisible++;
      $userid=$loggedin['userid'];
      if ($loggedin['invisible'] == 1) { // Invisible User but show to Admin
        $invisibleuser = '*';
      }
    }
  }
  $atotal=$numberregistered+$numberguest;
  $aguests=$guestcount;
  $amembers = $atotal - $aguests;
  $numberinvisible=$numberregistered-$numbervisible;

works for me now fine and dandy :)

dbode 03-30-2003 05:50 PM

Ok, I did something else - i added in latest.php

Code:

if(!isset($time))
{
  $time = 5;
}

and I changed in the template latest :
Code:

var timer="5:00"
to
Code:

var timer="$time:00"
Now, if you call the latest.php, it will set the timer to 5 minutes and reload then. If you call latest.php?time=2, it will reload every two minutes and so on...

msimplay 03-30-2003 07:34 PM

the hack works fine but how do i change the id of the announcments
cuz the default is 1
but the id i have is 4

sabret00the 04-01-2003 03:21 PM

very awesome hack, i'm just a bit interested by the server load, and how this hack effects it?

i should be installing it if my users are still after it that is, nice one

gmarik 05-24-2003 11:31 AM

Will it work on XP and on vB 2.3?

N!ck 05-24-2003 02:36 PM

yes.


All times are GMT. The time now is 12:01 AM.

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.01150 seconds
  • Memory Usage 1,749KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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