View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Feb 16, 2003 6:35 pm Post subject: |
|
|
Hi all,
I have made a lot of changes in this one. The GUI is different, BBCode is removed, and it is possible to check which people are on the forum. And if one of the people from your 'friends' list comes online, you'll see a pop-up!
Another thing to was bottering me was that I wasn't able to click the pop-up away, so when you now right-click on the pop-up, it disapears...
I'm really sorry Mac, but it doesn't work with VDS 3.5... You can try to let it work by removing the gradient that I've used, and by changing some 'while' loops into 'repeats'...
Code: | rem version 2.3.0.0.1
rem big thanks to Protected Programs for plenty of help
rem works in VDS 4.
title VDSWORLD Check-Up
option scale,96
option decimalsep,.
directory change,@path(%0)
external vdsipp.dll
internet http,create,1
internet http,threads,1,off
internet http,protocol,1,1
internet http,useragent,1,"VDSWORLD Forum Check-Up"
%%maxmessage = 150
%%maxmessagelines = 4
%%maxsubject = 24
%%maxuser = 26
%%launch = @regread(default,,launch,)
%%interval = @regread(default,,interval,5)
%%lastpost = @regread(default,,lastpost,)
%%lastfile = @regread(default,,lastfile,)
%%lastdevpost = @regread(default,,lastdevpost,)
%%forumnotify = @regread(default,,forumnotify,1)
%%filenotify = @regread(default,,filenotify,1)
%%devforumnotify = @regread(default,,devforumnotify,1)
%%onlineuserlist = @regread(default,,onlineuserlist)
%%warnonline = @regread(default,,warnonline,1)
%%icon = %0
if @equal(@ext(%%icon),dsc)
%%icon =
end
DIALOG CREATE,VDSWORLD Check-Up,-1,0,313,286
DIALOG ADD,TASKICON,taIcon,%%icon,VDSWORLD Check-Up
DIALOG ADD,GROUP,gSettings,4,0,304,160,Settings
DIALOG ADD,CHECK,chAutoLaunch,24,16,280,16,&Launch with Windows
DIALOG ADD,CHECK,chForumNotify,48,16,280,16,Notify on &forum updates
DIALOG ADD,CHECK,chFileNotify,72,16,280,16,Notify on f&ile updates
DIALOG ADD,CHECK,chDevForumNotify,96,16,280,16,Notify on DLL &developer forum updates
DIALOG ADD,TEXT,tInterval,120,16,,,Update interval:
DIALOG ADD,COMBO,cInterval,136,16,56,21,cInterval,,LIST
DIALOG ADD,TEXT,tMinutes,140,88,,,minutes
DIALOG ADD,BUTTON,bOK,260,130,80,24,&OK,,DEFAULT
DIALOG ADD,BUTTON,CANCEL,260,216,80,24,&Cancel
DIALOG ADD,GROUP,gOnline,166,0,304,90
DIALOG ADD,LIST,lOnline,186,8,172,64
DIALOG ADD,EDIT,eAddOnline,186,184,116,19
DIALOG ADD,BUTTON,bAddOnline,207,184,116,20,Add user to online list
DIALOG ADD,BUTTON,bRemoveOnline,229,184,116,20,Remove user
DIALOG ADD,CHECK,chWarnOnline,168,16,235,18,Warn me if one of the following users is online:,%%warnonline
list assign,lOnline,%%onlineuserlist
list add,cInterval,1
list add,cInterval,2
list add,cInterval,5
list add,cInterval,10
list add,cInterval,30
goto timer
:evloop
wait event,@fmul(%%interval,60)
%%event = @event()
goto %%event
:View Last Postmenu
%%index =
gosub getdata
if %%topic
%%new =
gosub getpost
end
goto evloop
:View Last Filemenu
%%index =
gosub getdata
if %%topic
%%new =
gosub getfile
end
goto evloop
:View Last Developer Postmenu
%%index = 1
gosub getdata
if %%topic
%%new =
gosub getpost
end
goto evloop
:Check Nowmenu
:timer
%%index =
gosub getdata
if %%topic
%%update =
if %%lastpost
if @not(@equal(%%post,%%lastpost))
if %%forumnotify
%%new = 1
gosub getpost
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastpost = %%post
registry write,default,,lastpost,%%lastpost
end
%%update =
if %%lastfile
if @not(@equal(%%file,%%lastfile))
if %%filenotify
%%new = 1
gosub getfile
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastfile = %%file
registry write,default,,lastfile,%%lastfile
end
%%index = 1
gosub getdata
if %%topic
%%update =
if %%lastdevpost
if @not(@equal(%%post,%%lastdevpost))
if %%devforumnotify
%%new = 1
gosub getpost
end
%%update = 1
end
else
%%update = 1
end
if %%update
%%lastdevpost = %%post
registry write,default,,lastdevpost,%%lastdevpost
end
end
end
gosub Check Online Users
goto evloop
:taIconclick
if @equal(@click(B),left)
goto timer
else
dialog popup,&Check Now|-|View Last &Post|View Last &Developer Post|View Last &File|-|Open &Forum|Open &Developer Forum|Open &VDSWORLD|-|View Online Users|-|&Settings|-|C&lose
goto evloop
end
:Open Forummenu
%%link = http://forum.vdsworld.com/
gosub newbrowserwindow
goto evloop
:Open Developer Forummenu
%%link = http://developer.vdsworld.com/
gosub newbrowserwindow
goto evloop
:Open VDSWORLDmenu
%%link = http://www.vdsworld.com/
gosub newbrowserwindow
goto evloop
:View Online UsersMenu
gosub Online Users
if @equal(%%guests,1)
%%message = Following user(s) are online:@cr()@cr()%%onlineusers@cr()And %%guests guest...
else
%%message = Following user(s) are online:@cr()@cr()%%onlineusers@cr()And %%guests guests...
end
%%link = "http://www.vdsworld.com/forum/viewonline.php"
gosub message
goto evloop
:Settingsmenu
dialog set,chAutoLaunch,%%launch
dialog set,chForumNotify,%%forumnotify
dialog set,chFileNotify,%%filenotify
dialog set,chDevForumNotify,%%devforumnotify
dialog set,chWarnOnline,%%warnonline
%x = @match(cInterval,%%interval)
dialog show
wait event
%e = @event()
if @equal(%e,bOKbutton)
dialog hide
%%onlineuserlist =
%z = 0
if @not(@null(@text(lOnline)))
repeat
if @not(@null(%%onlineuserlist))
%%onlineuserlist = %%onlineuserlist@cr()@chr(10)@item(lOnline,%z)
else
%%onlineuserlist = @item(lOnline,%z)
end
%z = @succ(%z)
until @equal(%z,@count(lOnline))
end
registry write,default,,onlineuserlist,%%onlineuserlist
goto %e
end
if @equal(%e,bAddOnlinebutton)@equal(%e,bRemoveOnlinebutton)
goto %e
end
dialog hide
goto evloop
end
:bOKbutton
%%launch = @dlgtext(chAutoLaunch)
%%forumnotify = @dlgtext(chForumNotify)
%%filenotify = @dlgtext(chFileNotify)
%%devforumnotify = @dlgtext(chDevForumNotify)
%%interval = @dlgtext(cInterval)
%%warnonline = @dlgtext(chWarnOnline)
registry write,default,,launch,%%launch
registry write,default,,forumnotify,%%forumnotify
registry write,default,,filenotify,%%filenotify
registry write,default,,devforumnotify,%%devforumnotify
registry write,default,,interval,%%interval
registry write,default,,warnonline,%%warnonline
if %%launch
if @not(@equal(@ext(%0),dsc))
registry write,local,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,VCheckUp,%0
end
else
registry delete,local,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,VCheckUp
end
goto evloop
:getdata
if @equal(%%index,1)
internet http,get,1,http://www.vdsworld.com/~developer/data.php
parse "%%topic;%%post",@trim(@internet(http,content,1))
else
internet http,get,1,http://www.vdsworld.com/data.php
parse "%%topic;%%post;%%file;%%filetitle;%%fileauthor",@trim(@internet(http,content,1))
end
exit
:getpost
if @equal(%%index,1)
%%parturl = http://www.vdsworld.com/~developer/data.php
%%developer = "developer "
else
%%parturl = http://www.vdsworld.com/data.php
%%developer =
end
internet http,get,1,%%parturl?request=text&id=%%post&count=%%maxmessage
list create,7
list assign,7,@internet(http,content,1)
list delete,7
%%lastuser = @item(7,0)
list delete,7
%%lasttopic = @item(7,0)
list delete,7
%%lastsubject = @item(7,0)
list delete,7
if @greater(@count(7),%%maxmessagelines)
list seek,7,%%maxmessagelines
repeat
list delete,7
until @greater(@succ(%%maxmessagelines),@count(7))
end
%%lastmessage = @text(7)
if @greater(@len(%%lastmessage),%%maxmessage)
%%lastmessage = @substr(%%lastmessage,1,%%maxmessage)...
end
list close,7
if @not(%%lastsubject)
%%lastsubject = Reply to %%lasttopic
end
if @greater(@len(%%lastsubject),%%maxsubject)
%%lastsubject = @substr(%%lastsubject,1,%%maxsubject)...
end
if @greater(@len(%%lastuser),%%maxuser)
%%lastuser = @substr(%%lastuser,1,%%maxuser)...
end
if %%new
%%message = There's a new post on the VDSWORLD %%developer""forum:
else
%%message = This is the last post on the VDSWORLD %%developer""forum:
end
%%message = %%message@cr()@chr(10)@cr()@chr(10)By: %%lastuser@cr()@chr(10)Subj: %%lastsubject@cr()@chr(10)@cr()@chr(10)%%lastmessage
if @equal(%%index,1)
%%link = "http://www.vdsworld.com/~developer/viewtopic.php?t="%%topic"#"%%post
else
%%link = "http://www.vdsworld.com/forum/viewtopic.php?t="%%topic"#"%%post
end
%%download =
gosub message
exit
:getfile
if %%new
%%message = There's a new file posted at VDSWORLD.
else
%%message = This is the last file posted at VDSWORLD.
end
%%message = %%message Click here to download:@cr()@chr(10)@cr()@chr(10)%%filetitle@cr()@chr(10)@cr()@chr(10)by %%fileauthor
%%download = "http://www.vdsworld.com/index.php?page=download&fileid="%%file
%%link =
gosub message
exit
:parsefilename
%i = 0
%q =
repeat
%i = @succ(%i)
%c = @substr(%%filename,%i)
if @equal(%c,@chr(34))
if %q
%q = 2
else
%q = 1
end
else
if @not(%q)
if @equal(%c," ")
%q = 3
end
end
end
until @equal(%i,@len(%%filename))@equal(%q,2)@equal(%q,3)
if @equal(%q,3)
%%filename1 = @substr(%%filename,1,@pred(%i))
else
if @equal(%q,2)
%%filename1 = @substr(%%filename,2,@pred(%i))
else
%%filename1 = %%filename
end
end
exit
:message
repeat
if @greater(@pos([,%%message),0)
if @greater(@pos(],%%message),@pos([,%%message))
%%message = @strdel(%%message,@pos([,%%message),@pos(],%%message))
else
%%message = @strdel(%%message,@pos([,%%message),@len(%%message))
end
end
until @equal(@pos([,%%message),0)
DIALOG CREATE,Check-Up Message Window,300,300,220,148,CLASS VDSMESSAGE,NOTITLE,ONTOP
DIALOG ADD,STYLE,sMessage,,8,BC,,WHITE
DIALOG ADD,GROUP,GROUP1,0,0,221,149
DIALOG ADD,GRADIENT,gBackground,4,4,212,140,NAVY,0080FF,,BOTTOMTOTOP,CLICK,HAND
DIALOG ADD,TEXT,tMessage,8,12,200,132,%%message,,TRANSPARENT,sMessage,CLICK,HAND
DIALOG ADD,BITMAP,bIcon,6,6,30,30,%0
%T = @winpos(#Shell_TrayWnd,T)
%L = @winpos(#Shell_TrayWnd,L)
%H = @winpos(#Shell_TrayWnd,H)
%W = @winpos(#Shell_TrayWnd,W)
%%screenheight = @sysinfo(screenheight)
%%upperT = @diff(%%screenheight,@dlgpos(,H))
%L = @diff(@sysinfo(screenwidth),@dlgpos(,W))
if @equal(%T,0)
rem taskbar is positioned at top, left or right
if @equal(%L,0)
rem taskbar is positioned at left; no problem
else
rem taskbar is positioned at top or right
if @equal(%H,%%screenheight)
rem taskbar is positioned at right
%L = @diff(%L,%W)
else
rem taskbar is positioned at top; no problem
end
end
else
rem taskbar is positioned at bottom
%%upperT = @diff(%%upperT,%H)
end
%%lowerT = %%screenheight
DIALOG SETPOS,,%%lowerT,%L
DIALOG SHOW
while @not(@equal(@dlgpos(,T),%%upperT))
dialog setpos,,@pred(@dlgpos(,T))
gosub sleep
wend
repeat
wait event,10
%e = @event()
until @equal(%e,timer)@equal(%e,tMessageclick)@equal(%e,taIconclick)@equal(%e,gBackgroundclick)
if @equal(@click(B),LEFT)
if @equal(%e,tMessageclick)@equal(%e,gBackgroundclick)
if %%link
gosub newbrowserwindow
else
shell open,%%download
end
else
while @not(@equal(@dlgpos(,T),%%lowerT))
dialog setpos,,@succ(@dlgpos(,T))
gosub sleep
wend
end
end
dialog close
rem clear the "CLOSE" event from the event buffer
%x = @event()
exit
:sleep
%i = 0
repeat
%i = @succ(%i)
until @equal(%i,10)
exit
:newbrowserwindow
%%filename = @regread(root,http\shell\open\command,)
if %%filename
gosub parsefilename
run @shortname(%%filename1) %%link
end
exit
:Closemenu
:close
internet http,destroy,1
exit
:Online Users
internet http,create,5
internet http,threads,5,off
internet http,protocol,5,1
internet http,useragent,5,"VDSWORLD Forum Check-Up"
list create,1
%%searchfor1 = @chr(34) class=@chr(34)gen@chr(34)>
%%searchfor2 = <b style=@chr(34)color:#FFA34F@chr(34)>
internet http,get,5,http://www.vdsworld.com/forum/viewonline.php
%%data = @trim(@internet(http,content,5))
%%guests = @substr(%%data,@sum(@pos(Guest user,%%data),-10),@sum(@pos(Guest user,%%data),-2))
%%guests = @strdel(%%guests,1,@fadd(@pos(is,%%guests),2))
if @not(@equal(@len(%%guests),1))
%%guests = @strdel(%%guests,1,@fadd(@pos(are,%%guests),3))
end
repeat
%%data = @strdel(%%data,1,@sum(@pos(%%searchfor1,%%data),@len(%%searchfor1),-1))
%%user = @substr(%%data,1,@sum(@pos(</a>,%%data),-1))
if @greater(@pos(>,%%user),0)
%%user = @strdel(%%user,1,@pos(>,%%user))
%%user = @strdel(%%user,@pos(<,%%user),@len(%%user))
end
if @not(@equal(%%user,"Viewing who is online"))
if @not(@equal(%%user,"Forum index"))
if @not(@equal(%%user,"News/Announcements"))
if @not(@equal(%%user,"Product Support"))
if @not(@equal(%%user,"General Help"))
if @not(@equal(%%user,"Wish List"))
if @not(@equal(%%user,"Bug Reports"))
if @not(@equal(%%user,"Miscellaneous"))
if @not(@equal(%%user,"Non-English Help"))
if @not(@equal(%%user,"Other Product Support/Announcements"))
if @not(@equal(%%user,"Visual DialogScript Open Source Projects"))
if @not(@equal(%%user,"Visual DialogScript Knowledge Base"))
if @not(@equal(%%user,"Visual DialogScript 2 Source Code"))
if @not(@equal(%%user,"Visual DialogScript 3 Source Code"))
if @not(@equal(%%user,"Visual DialogScript 4 Source Code"))
if @not(@equal(%%user,"Message Archives"))
if @not(@equal(%%user,"Posting a message"))
list add,1,%%user
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
until @equal(@pos(%%searchfor1,%%data),0)
%%onlineusers = @text(1)
list close,1
internet http,destroy,5
exit
:bAddOnlinebutton
list add,lOnline,@dlgtext(eAddOnline)
dialog set,eAddOnline,
goto Settingsmenu
:bRemoveOnlinebutton
if @not(@equal(@index(lOnline),-1))
list delete,lOnline,@index(lOnline)
else
info Please select one of the names
end
goto Settingsmenu
:Check Online Users
if @equal(@dlgtext(chWarnOnline),1)
gosub Online Users
%%online =
%%temp =
list create,1
list assign,1,%%onlineusers
%z = 0
repeat
if @greater(@pos(@item(1,%z),@text(lOnline)),0)
if @not(@null(%%online))
%%online = %%online"," @item(1,%z)
else
%%online = @item(1,%z)
end
end
%z = @succ(%z)
until @equal(%z,@count(1))@greater(%z,@count(1))
list close,1
if @not(@equal(%%oldonline,%%online))
if @not(@null(%%online))
%%message = Online users that are specified in the online list: @cr()@cr()%%online
%%link = "http://www.vdsworld.com/forum/viewonline.php"
gosub message
end
end
end
%%oldonline = %%online
exit
|
Edit1: Remove a little bug which showed 'Posting a message' as a online user...
Last edited by Skit3000 on Mon Feb 17, 2003 8:45 pm; edited 1 time in total |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Feb 17, 2003 12:14 am Post subject: |
|
|
I like it. Especially with the gradient background.
Skit3000 wrote: | I'm really sorry Mac, but it doesn't work with VDS 3.5... You can try to let it work by removing the gradient that I've used, and by changing some 'while' loops into 'repeats'... |
Perhaps you could compile the EXE so that Mac and other VDS 3.5 users
could use it too. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 17, 2003 12:15 am Post subject: |
|
|
Skit3000 wrote: |
I'm really sorry Mac, but it doesn't work with VDS 3.5... You can try to let it work by removing the gradient that I've used, and by changing some 'while' loops into 'repeats'...
|
No prob Skit,
I use a small one I wrote anyway.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Feb 17, 2003 8:42 pm Post subject: |
|
|
Oops, I found a bug....
When the script checks for online users, it will be counted as a guest itself... I will look into it, and I'll try to make something like the data.php file Tommy made. Until then... |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Feb 18, 2003 3:48 pm Post subject: |
|
|
That isn't the problem, the problem is that everyone that has the check-up tool running, will be counted as a visitor of the forum... |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Tue Feb 18, 2003 4:56 pm Post subject: |
|
|
A server-side PHP file is probably not the best solution. It is the client
that creates the problem. For example, here's a quote from the
"Who's Online":
Quote: | Registered Users:
Skit3000 18 Feb 2003 12:36 pm Forum index ###.###.###.###
Other Users:
Guest 18 Feb 2003 12:40 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:39 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:38 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:36 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:36 pm Viewing who is online ###.###.###.### |
The script seems to create a lot of "guest" usage, all by the same IP.
A solution such as the one above may help, however, it will not in your
case. That is only for using .htaccess/.htpasswd password gates and
related techniques.
However, if you want to add in a file like one that will hold all of the users
online, a PHP script could be a pretty good solution. Something like the
following might be good:
Code: | <?php
// First post the username to the PHP script using the vdsipp.dll
// Then put the posted vars into a neater variable in the PHP script
$user = $HTTP_POST_VARS['user'];
// Then do some processing below, perhaps store the online users in
// a plain-text database file or use another database format.
// When a user closes the checkup script you should post again to the
// script with the username and if it already exists remove it. Of course
// it could be forged that a user is logged on etc., but you could also add
// in some more security.
?> |
If you want help in making a full PHP script for this, PM me. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Tue Feb 25, 2003 11:12 pm Post subject: |
|
|
This is caused by the script not reusing the session id. As long as the session id
is valid, the script should try to supply it. Otherwise every other minute a new session
would be created.
FreezingFire wrote: | A server-side PHP file is probably not the best solution. It is the client
that creates the problem. For example, here's a quote from the
"Who's Online":
Quote: | Registered Users:
Skit3000 18 Feb 2003 12:36 pm Forum index ###.###.###.###
Other Users:
Guest 18 Feb 2003 12:40 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:39 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:38 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:36 pm Viewing who is online ###.###.###.###
Guest 18 Feb 2003 12:36 pm Viewing who is online ###.###.###.### |
The script seems to create a lot of "guest" usage, all by the same IP.
A solution such as the one above may help, however, it will not in your
case. That is only for using .htaccess/.htpasswd password gates and
related techniques.
However, if you want to add in a file like one that will hold all of the users
online, a PHP script could be a pretty good solution. Something like the
following might be good:
Code: | <?php
// First post the username to the PHP script using the vdsipp.dll
// Then put the posted vars into a neater variable in the PHP script
$user = $HTTP_POST_VARS['user'];
// Then do some processing below, perhaps store the online users in
// a plain-text database file or use another database format.
// When a user closes the checkup script you should post again to the
// script with the username and if it already exists remove it. Of course
// it could be forged that a user is logged on etc., but you could also add
// in some more security.
?> |
If you want help in making a full PHP script for this, PM me. |
|
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Mar 06, 2003 12:32 pm Post subject: |
|
|
Hi Tommy.
That program is really neat
Is there any chance of looking at the PHP source of the data.php file?
Would love to have something like this for my sites. _________________
|
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Mar 06, 2003 12:43 pm Post subject: |
|
|
Hi GeoTrail,
I run the VDSWORLD DLL Developer Forum over at http://developer.vdsworld.com/
and while I can't give the script out without permission from Tommy (seeing as
he wrote it) I can give you a general idea of how it works.
Basically connects to a MySQL database and queries it for the latest post(s). _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Mar 06, 2003 12:48 pm Post subject: |
|
|
Yeah, I understand.
I know how the database querying works.
I was just wondering how the data is outputed.
Using while for each record ? And what format is it echo'ed out in? _________________
|
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Mar 06, 2003 12:57 pm Post subject: |
|
|
It retreives the latest post and the actual checkup script will check the
data against it's last post record in the registry. If it doesn't match then
it will display the popup. The raw data is such as:
Quote: | 475|8210|61|Alloy|PGWARE |
Where its format is something like
TOPIC#|POST#|USERNAME|FILENAME|AUTHORNAME
The checkup script can also request titles from the data.php script and
the PHP script will fetch the data.
I hope that helps. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Mar 06, 2003 1:04 pm Post subject: |
|
|
Aaa yeah, I get the idea now.
Thanks alot FreezingFire.
So it basically just reads the last post on the board, the program checks the post id against the post id in the registry and displays the dialog if the new post has a higher id #?
Very very nice. I love it. _________________
|
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Mar 06, 2003 1:33 pm Post subject: |
|
|
Here's a little tip for the code that Skit3000 uploaded.
The modifications below will take you to the latest post on the forum instead of to the first post in the thread.
Replace
Code: | %%link = "http://www.vdsworld.com/~developer/viewtopic.php?t="%%topic"#"%%post |
with
Code: | %%link = "http://www.vdsworld.com/~developer/viewtopic.php?p="%%post"#"%%post |
on line 299
and replace
Code: | %%link = "http://www.vdsworld.com/forum/viewtopic.php?t="%%topic"#"%%post |
with
Code: | %%link = "http://www.vdsworld.com/forum/viewtopic.php?p="%%post"#"%%post |
on line 301
Edit: I've fixed it now so you will now be taken to the last post in the topic.
Here's how it should be from line 298:
Code: | if @equal(%%index,1)
%%link = "http://www.vdsworld.com/~developer/viewtopic.php?p="%%post"#"%%post
else
%%link = "http://www.vdsworld.com/forum/viewtopic.php?p="%%post"#"%%post
end |
_________________
|
|
Back to top |
|
|
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sat Mar 08, 2003 3:36 am Post subject: |
|
|
Very nice Geotrail, thank you for the additions
For everyone interested in using a similar script on their server, here's the PHP source code:
Code: |
<?php
function stripslashesruntime($string)
{
if (get_magic_quotes_runtime() > 0)
return stripslashes($string);
else
return $string;
}
function stripslashesgpc($string)
{
if (get_magic_quotes_gpc() > 0)
return stripslashes($string);
else
return $string;
}
function addslashesruntime($string)
{
return addslashes(stripslashesruntime($string));
}
function addslashesgpc($string)
{
return addslashes(stripslashesgpc($string));
}
header("Content-Type: text/plain");
require("connect.inc");
if ($request == "posts")
{
$limit = "";
$mindate = addslashesgpc($mindate);
if (preg_match("/....-..-../", $mindate))
$limit = "(post_time >= '".gmmktime(0, 0, 0, substr($mindate, 5, 2), substr($mindate, 8, 2), substr($mindate, 0, 4))."')";
$maxdate = addslashesgpc($maxdate);
if (preg_match("/....-..-../", $maxdate))
{
if ($limit)
$limit .= " AND ";
$limit .= "(post_time <= '".gmmktime(0, 0, 0, substr($maxdate, 5, 2), substr($maxdate, 8, 2), substr($maxdate, 0, 4))."')";
}
if ($limit)
$limit = "WHERE $limit ";
$result = mysql_query("SELECT post_id, topic_id, post_time, post_edit_time FROM phpbb_posts ".$limit."ORDER BY post_time;");
$rowcount = @mysql_num_rows($result);
if (isset($rowcount))
if ($rowcount > 0)
while ($record = mysql_fetch_object($result))
{
print($record->topic_id."|".$record->post_id);
if ($date)
{
$edit = $record->post_edit_time;
if ($edit > 0)
$edit = gmdate("Y-m-d H:i:s", $edit);
else
$edit = "";
print("|".gmdate("Y-m-d H:i:s", $record->post_time)."|$edit");
}
print("\r\n");
}
}
elseif ($request == "text")
{
$result = mysql_query("SELECT topic_id, poster_id, post_subject, post_text FROM phpbb_posts, phpbb_posts_text WHERE phpbb_posts.post_id = phpbb_posts_text.post_id AND phpbb_posts.post_id = '".addslashesgpc($id)."';");
$rowcount = @mysql_num_rows($result);
if (isset($rowcount))
if ($rowcount > 0)
{
$record = mysql_fetch_object($result);
$topicid = $record->topic_id;
$posterid = $record->poster_id;
$subject = stripslashesruntime($record->post_subject);
$text = substr(stripslashesruntime($record->post_text), 0, $count);
$result = mysql_query("SELECT topic_title FROM phpbb_topics WHERE topic_id = '$topicid';");
$record = mysql_fetch_object($result);
$title = stripslashesruntime($record->topic_title);
$result = mysql_query("SELECT username FROM phpbb_users WHERE user_id = '$posterid';");
$record = mysql_fetch_object($result);
$username = stripslashesruntime($record->username);
print("\r\n$username\r\n$title\r\n$subject\r\n$text");
}
}
else
{
$result = mysql_query("SELECT post_id, topic_id FROM phpbb_posts ORDER BY post_time DESC LIMIT 0, 1;");
$record = mysql_fetch_object($result);
print($record->topic_id."|".$record->post_id);
$result = mysql_query("SELECT vds_files.id, title, name FROM vds_files, vds_authors WHERE authorid = vds_authors.id AND enabled <> '0' AND hide = '0' ORDER BY date DESC LIMIT 0, 1;");
$record = mysql_fetch_object($result);
print("|".$record->id."|".stripslashesruntime($record->title)."|".stripslashesruntime($record->name));
}
?>
|
All sensitive connection information is contained in a separate file, connect.inc. If you do the same, make sure to block downloads of *.inc files using a .htaccess file, or rename the file to .php.
Code: |
<?php
$mysql_host = '';
$mysql_user = '';
$mysql_password = '';
$mysql_database = '';
mysql_select_db($mysql_database, mysql_connect($mysql_host, $mysql_user, $mysql_password));
?>
|
Last edited by Tommy on Sat Mar 08, 2003 3:47 am; edited 1 time in total |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|