forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VDSWorld Check Forum Script

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 04, 2002 1:17 pm    Post subject: VDSWorld Check Forum Script Reply with quote

Could someone add to the VDSWorld Check forum script the ability
to have and email sent when a new file or topic is posted. The reason
I ask is because I just got a new cell phone that can send and recieve
email and it also has a web browser. I would like to have and email
sent to my phone when there is a new file or post. I would do it myself
but I'm at work and I don't have VDS available. It shouldn't be hard to
do at all, the same dll can be used.

Thanks,

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Oct 04, 2002 1:25 pm    Post subject: Reply with quote

Put this in the script, right before the line that opens the info with the message:
Code:

%%email = "nobody@here.com"
%%server = smtp.nowhere.com
%%port = 25

INTERNET SMTP,CREATE,2
INTERNET SMTP,THREADS,2,OFF
INTERNET SMTP,CONNECT,2,%%server,%%port
INTERNET SMTP,USERAGENT,2,VDSWORLD MAILER
INTERNET SMTP,FROM,2,"forum@vdsworld.com"
INTERNET SMTP,TO,2,email
INTERNET SMTP,SUBJECT,2,New post on VDSWORLD Forum
INTERNET SMTP,BODY,2,There is a new post on the VDSWORLD Forum
INTERNET SMTP,PRIORITY,2,3
INTERNET SMTP,SEND,2
INTERNET SMTP,DISCONNECT,2
INTERNET SMTP,DESTROY,2


Somebody else must compile it for Chris, cause I can't.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 04, 2002 1:38 pm    Post subject: Reply with quote

hey, it turns out that I had a copy of VDS on a CD here.. Embarassed
That code didn't work. Confused It should have thought. I get an error
saying that there is an invalid command on the SMTP, BODY line.
If I remove that it looks like it works, but, I don't get an email... Question

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Oct 04, 2002 1:46 pm    Post subject: Reply with quote

Well, it should work...

Maybe you can try it again, by changing "New post on..." into "empty".

If that doesn't work, I don't know any other way...
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 04, 2002 1:49 pm    Post subject: Reply with quote

Yes, it should work. Maybe it's the network we have here at work.
I'll see if I can get it to work. Thanks for your help.

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 04, 2002 2:06 pm    Post subject: Reply with quote

I found out why, I was using the wrong server. Embarassed Confused
It works now, I'm going to post the code after I make a few more
adjustments.

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 04, 2002 2:23 pm    Post subject: Reply with quote

Here is the modified script. I added the email option and it can
be configured through the settings dialog.

Code:

  rem version 2.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,)
  %%forumnotify = @regread(default,,forumnotify,1)
  %%filenotify = @regread(default,,filenotify,1)
  %%emailnotify = @regread(default,,emailnotify)
  %%Address = @regread(default,,address)
  %%smtp = @regread(default,,smtp)
  %%port = @regread(default,,port)
  %%username = @regread(default,,username)
  %%password = @regread(default,,password)
  %%sendemail = @regread(default,,sendemail)
  %%icon = %0
  if @equal(@ext(%%icon),dsc)
    %%icon =
  end
  DIALOG CREATE,VDSWORLD Check-Up,-1,0,289,396
  DIALOG ADD,TASKICON,taIcon,,VDSWORLD Check-Up
  DIALOG ADD,GROUP,gSettings,4,4,280,144,Settings
  DIALOG ADD,CHECK,chAutoLaunch,24,16,256,16,&Launch with Windows
  DIALOG ADD,CHECK,chForumNotify,48,16,256,16,Notify on &forum updates
  DIALOG ADD,CHECK,chFileNotify,72,16,176,16,Notify on f&ile updates
  DIALOG ADD,TEXT,tInterval,96,16,,,Update interval:
  DIALOG ADD,COMBO,cInterval,116,16,56,21,cInterval,,LIST
  DIALOG ADD,TEXT,tMinutes,120,88,,,minutes
  DIALOG ADD,BUTTON,bOK,366,94,80,24,&OK,,DEFAULT
  DIALOG ADD,BUTTON,CANCEL,366,186,80,24,&Cancel
  DIALOG ADD,GROUP,Email,150,4,280,210,Email Settings
  DIALOG ADD,CHECK,emailnotify,166,12,180,18,Notify Via E-Mail.
  DIALOG ADD,TEXT,TEXT1,195,12,57,13,To Address:
  DIALOG ADD,EDIT,address,192,74,202,19
  DIALOG ADD,TEXT,TEXT2,227,12,84,13,SMTP Hostname:
  DIALOG ADD,EDIT,SMTP,223,98,178,19
  DIALOG ADD,TEXT,TEXT3,254,12,116,13,Port (leave blank for 25):
  DIALOG ADD,EDIT,port,252,132,142,19
  DIALOG ADD,GROUP,GROUP1,276,10,270,76,SMTP Authentication
  DIALOG ADD,TEXT,TEXT4,294,18,51,13,Username:
  DIALOG ADD,TEXT,TEXT5,321,18,49,13,Password:
  DIALOG ADD,EDIT,Username,292,74,198,19,
  DIALOG ADD,EDIT,password,319,73,198,19,,,PASSWORD
rem  DIALOG SHOW
  list add,cInterval,2
  list add,cInterval,5
  list add,cInterval,10
  list add,cInterval,30
:evloop
  wait event,@fmul(%%interval,60)
  goto @event()
:View Last Postmenu
  gosub getdata
  if %%topic
    %%new =
    gosub getpost
  end
  goto evloop
:View Last Filemenu
  gosub getdata
  if %%topic
    %%new =
    gosub getfile
  end
  goto evloop
:Check Nowmenu
:timer
  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
  end
  goto evloop
:taIconclick
  if @equal(@click(B),left)
    goto timer
  else
    dialog popup,&Check Now|View Last &Post|View Last &File|-|Open &Forum|Open &VDSWORLD|-|&Settings|-|C&lose
    goto evloop
  end
:Open Forummenu
  %%link = http://forum.vdsworld.com/
  gosub newbrowserwindow
  goto evloop
:Open VDSWORLDmenu
  %%link = http://www.vdsworld.com/
  gosub newbrowserwindow
  goto evloop
:Settingsmenu
  dialog set,chAutoLaunch,%%launch
  dialog set,chForumNotify,%%forumnotify
  dialog set,chFileNotify,%%filenotify
  dialog set,address,%%address
  dialog set,smtp,%%smtp
  dialog set,port,%%port
  dialog set,username,%%username
  dialog set,password,%%password
  dialog set,emailnotify,%%emailnotify
  %x = @match(cInterval,%%interval)
  dialog showmodal
  %e = @event()
  if @equal(%e,bOKbutton)
    goto %e
  else
    goto evloop
  end
:bOKbutton
  %%launch = @dlgtext(chAutoLaunch)
  %%forumnotify = @dlgtext(chForumNotify)
  %%filenotify = @dlgtext(chFileNotify)
  %%interval = @dlgtext(cInterval)
  %%emailnotify = @dlgtext(emailnotify)
  %%smtp = @dlgtext(smtp)
  %%port = @dlgtext(port)
  %%username = @dlgtext(username)
  %%password = @dlgtext(password)
  %%address = @dlgtext(address)
  registry write,default,,launch,%%launch
  registry write,default,,forumnotify,%%forumnotify
  registry write,default,,filenotify,%%filenotify
  registry write,default,,interval,%%interval
  registry write,default,,emailnotify,%%emailnotify
  registry write,default,,smtp,%%smtp
  registry write,default,,port,%%port
  registry write,default,,username,%%username
  registry write,default,,password,%%password
  registry write,default,,address,%%address
  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
  internet http,get,1,http://www.vdsworld.com/data.php
  parse "%%topic;%%post;%%file;%%filetitle;%%fileauthor",@trim(@internet(http,content,1))
  exit
:getpost
  internet http,get,1,http://www.vdsworld.com/data.php?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 forum:
  else
    %%message = This is the last post on the VDSWORLD forum:
  end
  %%message = %%message@cr()@chr(10)@cr()@chr(10)By: %%lastuser@cr()@chr(10)Subj: %%lastsubject@cr()@chr(10)@cr()@chr(10)%%lastmessage
  %%link = "http://www.vdsworld.com/forum/viewtopic.php?t="%%topic"#"%%post
  %%download =
  gosub message
  if %%emailnotify
      %%subject = New post on VDSWORLD
      gosub SendEmail
  end
  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
  if %%emailnotify
     %%subject = New file on VDSWORLD
      gosub SendEmail
  end
  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
:SendEmail
internet SMTP,CREATE,1
internet SMTP,THREADS,1,OFF
internet SMTP,CONNECT,1,%%smtp,%%port
internet SMTP,USERAGENT,1,"VDSWORLD MAILER"
internet SMTP,FROM,1,"forum@vdsworld.com"
internet SMTP,TO,1,%%address
internet SMTP,SUBJECT,1,%%subject
internet smtp,body,1,%%message@cr()@cr()%%link@cr()%%download
internet SMTP,PRIORITY,1,3
internet SMTP,SEND,1
internet SMTP,DISCONNECT,1
internet SMTP,DESTROY,1
exit
 
:smtp1ondisconnect
  goto evloop

:message
  DIALOG CREATE,Check-Up Message Window,300,300,220,148,CLASS VDSMESSAGE,NOTITLE,ONTOP
  DIALOG ADD,STYLE,sMessage,,8,BL,,0000A0
  DIALOG ADD,SHAPE,sBackground,0,0,220,148,E1FFFF,0000A0,,RECTANGLE
  DIALOG ADD,TEXT,tMessage,8,8,212,132,%%message,,TRANSPARENT,sMessage,CLICK,HAND
  %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)
  if @equal(%e,tMessageclick)
    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
  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

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Oct 04, 2002 7:03 pm    Post subject: Reply with quote

For SMTP servers you can use ones such as smtp.mail.com, smtp.snet.net, etc. Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group