icq蓝牙_使用WhizBase发送ICQ消息
icq藍牙
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version.
在本教程中,我將重點介紹如何使用WhizBase作為向ICQ發送ICQ消息的工具。 在這里,我將在WhizBase 5.1版本中發布的WhizBase中使用一項新技術。
In this tutorial I will use 3 files, pager.wbsp for the processing, email.wbsp for sending the messages and eng.ic as a language file.
在本教程中,我將使用3個文件,pager.wbsp用于處理,email.wbsp用于發送消息,以及eng.ic作為語言文件。
Multilingual abilities
多語種能力
WhizBase has built-in multilingual support, but I will not use it in this tutorial because it is not supported in 5.1 version. So I will use the older method of including a language file.
WhizBase具有內置的多語言支持,但在本教程中我將不使用它,因為5.1版本不支持它。 因此,我將使用包含語言文件的較舊方法。
In this language file we will define variables with the language content:
在此語言文件中,我們將使用語言內容定義變量:
$wbsetv[l_send|Send the message to this ICQ number:] $wbsetv[l_emne|Subject:] $wbsetv[l_besked|Message:] $wbsetv[l_ditnavn|Your name:] $wbsetv[l_dinepost|Your email address:] $wbsetv[l_sendbeskeden|Send the message] $wbsetv[l_icqikkeudfyldt|You forgot to fill in the ICQ number that the message should be sent to.] $wbsetv[l_ingenbesked|You forgot to write a message.] $wbsetv[l_tilbage|Back] $wbsetv[l_over450tegn|The message is too long. Maximum is 450 characters.] $wbsetv[l_epostikkeudfyldt|You forgot to fill in your email address.] $wbsetv[l_beskedenafsendt|The message has been sent.]I've used $wbsetv to set language variables, now I will save this code as "lang.ic" and put it in lang folder I have created on webs root. I have that practice to separate language files from others.
我使用$ wbsetv設置語言變量,現在我將這段代碼另存為“ lang.ic”并將其放在在web根目錄下創建的lang文件夾中。 我有將語言文件與其他文件分開的做法。
Subroutine code
子程序代碼
WhizBase supports subroutines (from version 5.1 on); it is something like a custom function available in some languages like VB. This is a powerful new technology in WhizBase which eases rapid application developments.
WhizBase支持子例程(從5.1版本開始); 它類似于自定義功能,在某些語言(如VB)中可用。 這是WhizBase中一項功能強大的新技術,可簡化快速的應用程序開發。
The code of a subroutine can be added in any place in WhizBase code, but it is preferably to put it after <!--WB_BeginTemplate--> so we can find it easily.
可以在WhizBase代碼的任何位置添加子例程的代碼,但最好將其放在<!-WB_BeginTemplate->之后,以便我們輕松找到它。
The syntax used for adding subroutines is:
用于添加子例程的語法為:
<!--WB_BeginSub_subroutinename--> subroutine code <!--WB_EndSub-->We will need to provide the subroutine name and the subroutine code, which is any set of WhizBase commands and code.
我們將需要提供子例程名稱和子例程代碼,它是任何WhizBase命令和代碼集。
I will make a subroutine to show a back input with error message if the user makes any mistake in the form.
如果用戶在表單中有任何錯誤,我將創建一個子例程以顯示帶有錯誤消息的反向輸入。
#* we define the pager Subroutine *# <!--WB_BeginSub_pager--> <html><head><title>Pager</title> <style type=text/css> body {background:white; font-family:helvetica; font-size:10pt; color:#000000} </style> </head><body> <center>$wbgetv[msg]<br /> <input type="button" onClick="history.go(-1)" value="<<< $wbgetv[l_tilbage]"> </center> </body></html> <!--WB_EndSub-->Call the language file
調用語言文件
I will call the language file by wbrinc after defining which language I am using.
在定義我使用的語言之后,我將通過wbrinc調用語言文件。
#* Please set here your language file *# $wbsetv[lang|eng] #**************************************##* We include the language file *# $wbrinc[lang/$wbgetv[lang].ic]As you see I am using relative paths but I can also use absolute paths, WhizBase supports both.
如您所見,我正在使用相對路徑,但我也可以使用絕對路徑,WhizBase支持兩者。
The Form
表格
I will make a simple HTML form which submits the page to itself, I will put it in a variable so I can use it later where I need it.
我將制作一個簡單HTML表單,將頁面提交給它自己,將其放入變量中,以便以后可以在需要時使用它。
$wbsetv[formular|<form action="" method="post"><table bgcolor="#cccccc" border="#000000" cellspacing="0" cellpadding="5"> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_send]</td> <td><input type="text" name="icqnummer" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_emne]</td> <td><input type="text" name="emne" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_besked]</td> <td><textarea name="besked" cols="25" rows="8" wrap"=virtual"></textarea></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_ditnavn]</td> <td><input type="text" name="navn" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_dinepost]</td> <td><input type="text" name="epost" size="25" /></td> <tr><td> </td> <td><font size="2" face="arial" color="#000000"><input type="submit" name="submit" value="$wbgetv[l_sendbeskeden]" /> </table></form>]As I previously indicated, I am using language file's variables instead of text. This is to support multilingualism.
如前所述,我正在使用語言文件的變量而不是文本。 這是為了支持多種語言。
If this do that, if not do not, then do that or this
如果這樣做,如果不是,則這樣做
I made a simple validation IF conditions block, I am using this like that just to show how we can use complex IF conditions in WhizBase, but in real life I use JS for this type of validation - then there's no need to refresh the page to validate if an input is empty.
我做了一個簡單的驗證IF條件塊,我正像這樣使用它,只是為了展示我們如何在WhizBase中使用復雜的IF條件,但是在現實生活中,我使用JS來進行這種類型的驗證-則無需刷新頁面即可驗證輸入是否為空。
$wbif["$wbv[submit]"<>""|$wbsetv[OK|1]$wbif["$wbv[emne]"=""|$wbsetv[OK|0]$wbsetv[emne|No subject]|$wbsetv[emne|$wbv[emne]]]$wbif["$wbv[navn]"=""|$wbsetv[OK|0]$wbsetv[navn|No name]|$wbsetv[navn|$wbv[navn]]]#* If no ICQ number was specified... *#$wbif["$wbv[icqnummer]"=""|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_icqikkeudfyldt]] $wbsub[pager]|#* If the user did not write a message... *#$wbif[$wblen[$wbv[besked]]=0|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_ingenbesked]] $wbsub[pager]|#* The message body cannot contain more than 450 characters *#$wbif[$wblen[$wbv[besked]]>450|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_over450tegn]] $wbsub[pager]|#* If the user did not specify his/her email address... *#$wbif[$wblen[$wbv[epost]]=0|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_epostikkeudfyldt]] $wbsub[pager]|]]]]#* Sending the message *#$wbif[$wbgetv[OK]=1|$wbsetv[msg|$wbgetv[l_beskedenafsendt]] $wbsetv[to|$wbv[icqnummer]@pager.icq.com] $wbsetv[body|$wbv[besked]] $wbsetv[from|$wbgetv[navn] <$wbv[epost]>] $wbgeturl[email.wbsp?to=$wbesc[$wbgetv[to]]&from=$wbesc[$wbgetv[from]]&body=$wbesc[$wbgetv[body]]]|] | $wbgetv[formular] ]The first IF is to check if I have submitted the form or I am coming to the site first time. If the submit is submitted I will go ahead with validation, if not I will show the form variable.
第一個IF是要檢查我是否已提交表格,還是我第一次來該網站。 如果提交了提交,我將繼續進行驗證,否則,我將顯示form變量。
Then I have a number of conditions, if everything is OK I will go on and send the message to ICQ, if not I will define the error message from the language file and call the subroutine.
然后,我遇到了許多情況,如果一切正常,我將繼續并將消息發送給ICQ,否則,我將從語言文件中定義錯誤消息并調用子例程。
If everything is OK, I call a file I will create later by $wbgeturl, I named it email.wbsp, and will pass to it variables to, from, and body. All escaped by $wbesc function.
如果一切正常,我將調用$ wbgeturl稍后創建的文件,將其命名為email.wbsp,并將變量傳遞給,來自和正文。 $ wbesc函數全部轉義了。
In case one of the conditions do not pass I call the subroutine pager by $wbsub[] to show the error message.
如果其中一個條件沒有通過,我通過$ wbsub []調用子例程尋呼機以顯示錯誤消息。
In case I did not submit a form yet it will skip all the conditions and show me the form we specified above before.
如果我沒有提交表格,它將跳過所有條件,并向我們顯示我們之前指定的表格。
Now we will put all this together in one file:
現在,我們將所有這些放到一個文件中:
[FormFields] WB_Command=R wb_showlogo=F <!--WB_BeginTemplate--> #* Please set here your language file *# $wbsetv[lang|eng] #**************************************##* We include the language file *# $wbrinc[lang/$wbgetv[lang].ic]#* we define the pager Subroutine *# <!--WB_BeginSub_pager--> <html><head><title>Pager</title> <style type=text/css> body {background:white; font-family:helvetica; font-size:10pt; color:#000000} </style> </head><body> <center>$wbgetv[msg]<br /> <input type="button" onClick="history.go(-1)" value="<<< $wbgetv[l_tilbage]"> </center> </body></html> <!--WB_EndSub-->$wbsetv[formular|<form action="" method="post"><TABLE bgcolor="#cccccc" border="#000000" cellspacing="0" cellpadding="5"> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_send]</td> <td><input type="text" name="icqnummer" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_emne]</td> <td><input type="text" name="emne" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_besked]</td> <td><textarea name="besked" cols="25" rows="8" wrap"=virtual"></textarea></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_ditnavn]</td> <td><input type="text" name="navn" size="25" /></td> <tr><td><font size="2" face="arial" color="#000000">$wbgetv[l_dinepost]</td> <td><input type="text" name="epost" size="25" /></td> <tr><td> </td> <td><font size="2" face="arial" color="#000000"><input type="submit" name="submit" value="$wbgetv[l_sendbeskeden]" /> </table></form>]$wbif["$wbv[submit]"<>""|$wbsetv[OK|1]$wbif["$wbv[emne]"=""|$wbsetv[OK|0]$wbsetv[emne|No subject]|$wbsetv[emne|$wbv[emne]]]$wbif["$wbv[navn]"=""|$wbsetv[OK|0]$wbsetv[navn|No name]|$wbsetv[navn|$wbv[navn]]]#* If no ICQ number was specified... *#$wbif["$wbv[icqnummer]"=""|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_icqikkeudfyldt]] $wbsub[pager]|#* If the user did not write a message... *#$wbif[$wblen[$wbv[besked]]=0|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_ingenbesked]] $wbsub[pager]|#* The message body cannot contain more than 450 characters *#$wbif[$wblen[$wbv[besked]]>450|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_over450tegn]] $wbsub[pager]|#* If the user did not specify his/her email address... *#$wbif[$wblen[$wbv[epost]]=0|$wbsetv[OK|0]$wbsetv[msg|$wbgetv[l_epostikkeudfyldt]] $wbsub[pager]|]]]]#* Sending the message *#$wbif[$wbgetv[OK]=1|$wbsetv[msg|$wbgetv[l_beskedenafsendt]] $wbsetv[to|$wbv[icqnummer]@pager.icq.com] $wbsetv[body|$wbv[besked]] $wbsetv[from|$wbgetv[navn] <$wbv[epost]>] $wbgeturl[email.wbsp?to=$wbesc[$wbgetv[to]]&from=$wbesc[$wbgetv[from]]&body=$wbesc[$wbgetv[body]]]|] | $wbgetv[formular] ]Save this file as default.wbsp.
將此文件另存為default.wbsp。
Sending the email
發送郵件
Finally the message we want to send to some ICQ account we send it by email. In WhizBase sending emails are very simple. You just need four variables, three we have already passed in the $wbgeturl function and the fourth is set in this file.
最后,我們要發送到某個ICQ帳戶的郵件,我們通過電子郵件發送。 在WhizBase中,發送電子郵件非常簡單。 您只需要四個變量,三個變量已經傳遞給$ wbgeturl函數,而第四個變量已在此文件中設置。
[FormFields] wb_mailserver=mail.localhost #* Here we define the outgoing mail server *# wb_command=p WB_To=$wbv{to} WB_From=$wbv{from} <!--WB_BeginTemplate--> $wbv[body]I hope this tutorial helped you learn more about WhizBase capabilities. Until the next article, have a good time.
我希望本教程可以幫助您了解有關WhizBase功能的更多信息。 在下一篇文章之前,玩得開心。
For more information email me at: NurAzije [at] Gmail [dot] com
有關更多信息,請給我發送電子郵件:NurAzije [at] Gmail [dot] com
Or visit WhizBase official site at www.whizbase.com
或訪問WhizBase官方網站www.whizbase.com
NurAzije is a PHP and WhizBase programmer, who at the time of article publication is working in partnership with WhizBase on several projects.- - -
---
翻譯自: https://www.experts-exchange.com/articles/2634/Using-WhizBase-to-send-ICQ-messages.html
icq藍牙
總結
以上是生活随笔為你收集整理的icq蓝牙_使用WhizBase发送ICQ消息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 胎儿式保姆级教程:Jetson Xavi
- 下一篇: 愿你在迷茫时,坚信你的珍贵,爱你所爱,行