[BETA] SMS Intregation

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Post by christhatsme » Wed Jun 07, 2006 5:44 pm

it alrwady works, the download, tested on a fresh install just now has 100% functionality.

Our of courtesy, I have requested you don't take my code, don't get even ruder than you already have been. (You can not publish your code here, as I already have the mod here)

Like you said yourself, your not a coder, you have probebly broken more than fixed.

if you have changed that sql statement, you have broken it " . $list_members . " is the amount of that lists members, therfore, the sql statement, would read sms_credits - *list members here*

Now stop spamming my topic, if you have something to say to me, do so via PM.
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
Slycom
Registered User
Posts: 12
Joined: Wed Mar 28, 2007 7:53 pm
Contact:

Re: [BETA] SMS Intregation

Post by Slycom » Thu Mar 29, 2007 5:08 am

Hello.
I must say its a nice Mod.
But i have future questions and a gateway question.

1. Can i change the code, that users will have automaticly xx SMS per Month? Not used SMS will delete or upgrade to specific amount of SMS.
2. How can i add the Funktion that users can send SMS outside my board?
3. " " " " " " so users must have validate his Mobile Number with a code send to his mobile. Only after his Number is confirmed, it will possible to send any SMS. And the From Number have to be only his Mobile Number.
4. How can i add a little Text like "powered by ..."?
At last: How can i put my Gateway "smskaufen.com" in.

I ope for help. Because i dont know xml in the script.

The sending format for this gateway is:
http://www.smskaufen.com/sms/gateway/sm ... der=%%from%%

(here in splitted commands:
http://www.smskaufen.com/sms/gateway/sms.php?
id=%%USER%%
pw=%%Password%%
text=%%thesms%%
type=4
empfaenger=%%to%%
absender=%%from%% )

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Fri Apr 06, 2007 8:55 am

5. This is possible to do but quite a lot of code will need editting, as my MOD uses its own class which sends the text via XML to my gateway. If you are unable to make the changes yourself with some guidance, I will happily do it for you.

4. This would be very easy, but I decided not to put it in As it would take too many characters, therefore, my gateway users senderID which means i could pt the name of the website in there. Does your gateway allow use of SenderID?

3. This is possible, quite an easy edit I should think

2. Outside your board? how do you mean? I guess you could use XML to send it to a script on your board and then onwards to the gateway.

1. Automatic texts will be very easy, there short edit.
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
Slycom
Registered User
Posts: 12
Joined: Wed Mar 28, 2007 7:53 pm
Contact:

Re: [BETA] SMS Intregation

Post by Slycom » Sat Apr 07, 2007 9:40 pm

Hi. nice to read from you again. ;)

So i want to have the following change.
I want do connect to my Gateway via "get" and not via "xml".
My Board users will have to Send sms to anybody, not only to registred users on my board (this is the meaning for Outside).
Yes i can use my own Sender ID. But the Sender ID must have only the MobileNumber from the Sender ("USER").

And a big thing for us in Germany is, that the Mobile Number witch is typed in from a user, must have be validate. So if i type in a Number, the script send me a code to my Mobile. Only if i typed the Code into the script back, my mobilenumber is valid. And only then i have the permission to send any sms. This code send must work ever if i change my mobilenumber, too.

And a next idea is, to give registred Users automatcly "xx" sms per Month for Free. (to config via ACP) But if a user dont use all of the Free sms per Month, so the rest sms will not added to the next month. every Month must have the same "xx" sms configured in the ACP.

Thats all. And i will send you back a german translate of your language file, if you want.

You can explain me how i can change any code or do the changes for me.

So, have big Thanks.

Here is a original Script from my Gateway if you want to see how its work. The "type=..." are used to know with kind of sms i will send. So if i use "type=4" i can add a own Sender ID like "absender".

Code: Select all

<html>

<head>
<title>Verschicken Sie schnell eine SMS mit SMSKAUFEN.de</title>
<meta name="generator" content="Namo WebEditor v5.0">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p><font face="Arial" size="1"><b><br></b><script language="JavaScript">
   function aenderung(wert)
   {
      var maxzeichen = 160;
      if (document.Formular.text.value.length > maxzeichen)
      {
         document.Formular.text.value = document.Formular.text.value.substring(0,maxzeichen);
         uebrigezeichen = 0;
      }
      else
      {
         uebrigezeichen = maxzeichen - document.Formular.text.value.length;
      }
      document.Formular.zeichen.value = uebrigezeichen;
   }
   // Formular-Check - light
   function check() {
      if (document.Formular.username.value == "") {
         alert('SMSkaufen.de Username fehlt ist ider falsch');
            document.Formular.username.focus();
         return false;
      }
      if (document.Formular.password.value == "") {
         alert("SMSkaufen.de Passwort fehlt ist ider falsch");
            document.Formular.password.focus();
         return false;
      }
      if (document.Formular.from.value == "") {
         alert('Von wem kommt die SMS - Absender nicht vergessen')
            document.Formular.from.focus();
         return false;
      }
      if (document.Formular.to.value == "") {
         alert('Wollen Sie die SMS ins Nirvana schicken?')
            document.Formular.to.focus();
         return false;
      }
      if (document.Formular.text.value == "") {
         alert('Zugegeben, manchmal ist weniger mehr, aber ein Buchstabe Text wäre toll!')
            document.Formular.text.focus();
         return false;
      }
   }
</script>
</font></p>
<div align="center">
    <p><font face="Arial" size="2"><b>&nbsp;Verschicken Sie schnell eine SMS</b></font></p>
   <table width="376" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <td bgcolor="#000000" width="376">
            <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="white">
               <tr>
                  <td bgcolor="#CCCCCC" width="361">
                     <form name="Formular" method="POST" action="<?php echo $GLOBALS["REQUEST_URI"]; ?>" onSubmit="return check()">
                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr valign="top">
                           <td width="336">
                              <table border="0" cellspacing="1" cellpadding="2" width="367">
                                 <tr>
                                    <td width="122" bgcolor="#CCCCCC"><font face="Arial" size="1">Username</font></td>
                                    <td width="234" bgcolor="#CCCCCC"><font face="Arial" size="1"><input name="username" type="text" value="<?php echo $HTTP_COOKIE_VARS[yomuser]; ?>" class="formfeld" size="33" style="background-color:rgb(255,150,45);"></font></td>
                                 </tr>
                                 <tr>
                                    <td width="122" bgcolor="#CCCCCC"><font face="Arial" size="1">Passwort</font></td>
                                    <td width="234" bgcolor="#CCCCCC"><font face="Arial" size="1"><input name="password" type="password" value="<?php echo $HTTP_COOKIE_VARS[yompass]; ?>" class="formfeld" size="33" style="background-color:rgb(255,150,45);"></font></td>
                                 </tr>
                                 <tr>
                                    <td width="122" bgcolor="#CCCCCC"><font face="Arial" size="1">Absender</font></td>
                                    <td width="234" bgcolor="#CCCCCC"><font face="Arial" size="1"><input name="from" type="text" value="" class="formfeld" size="33"></font></td>
                                 </tr>
                                 <tr>
                                    <td width="122" bgcolor="#CCCCCC"><font face="Arial" size="1">Senden an</font></td>
                                    <td width="234" bgcolor="#CCCCCC"><font face="Arial" size="1"><input name="to" type="text" value="01" class="formfeld" size="33"></font></td>
                                 </tr>
                                 <tr>
                                    <td valign="top" width="122" bgcolor="#CCCCCC"><font face="Arial" size="1">SMS-Text</font></td>
                                    <td width="234" bgcolor="#CCCCCC"><font face="Arial" size="1"><textarea rows="6" name="text" cols="25" onKeyUp="aenderung(this.length)" wrap="VIRTUAL" class="sms"></textarea></font></td>
                                 </tr>
                                 <tr>
                                    <td width="122" height="72" bgcolor="#CCCCCC">
                                       <font face="Arial" size="1">&nbsp;</font></td>
                                       <td width="234" height="72" bgcolor="#CCCCCC">
                                          <font face="Arial" size="1"><input name="zeichen" size="2" value="160" disabled class="zaehler">
                                  verbleibende Zeichen</font></td>
                                    </tr>
                                    <tr>
                                       <td width="122" bgcolor="#CCCCCC">
                                          &nbsp;
                                       </td>
                                       <td width="234" bgcolor="#CCCCCC">
                                          <font face="Arial" size="1"><input type="submit" value="SMS senden" name="Button" class="sendebtn"></font>
                                       </td>
                                    </tr>
                                 </table>
                              </td>
                              <td width="241" bgcolor="#CCCCCC"><font face="Arial" size="1">&nbsp;</font></td>
                           </tr>
                        </table>
                     </form>
                     <font face="Arial" size="1"><?php
   if ($HTTP_POST_VARS[Button])
   {
      if($HTTP_POST_VARS[username] == "" or $HTTP_POST_VARS[password] == "" or $HTTP_POST_VARS[from] == "" or $HTTP_POST_VARS[to] == "" or $HTTP_POST_VARS[text] == "")
      {
         echo "Bitte <b>alle</b> Felder ausf&uuml;llen!";
         exit;
      }
   // Text-Sezierung
   $text = urlencode($HTTP_POST_VARS[text]);
   $to = urlencode($HTTP_POST_VARS[to]);
   $url = "http://gateway.smskaufen.de/" . "?id=" . $HTTP_POST_VARS[username] . "&pw=" . $HTTP_POST_VARS[password] . "&absender=" . $HTTP_POST_VARS[from] . "&empfaenger=" . $to . "&text=" . $text . "&type=4";
   $fp = fopen($url, "r");
   $reply = fgets($fp, 1024);
   #echo "reply:'$reply'";

      if ($reply == 100)
      {
         echo "Die SMS wurde erfolgreich ausgeliefert";
      } else {
         echo "Leider konnte die SMS nicht versendet werden, es trat ein Fehler auf.<br />Fehlercode: " . $reply;
      }
   }
   ?></font>
                     </td>
               </tr>
            </table>
         </td>
      </tr>
   </table>
</div>
                                                <p align="center"><font face="Arial" size="1"><br></font></p>
</body>

</html>


User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Sun Apr 08, 2007 9:34 am

ok the powered by is fine then, it just takes up quite a few characters!

Ok, I see what you mean now by outside, and yes that is very easy to do. Do you want them to be able to send inside your board aswell?

Activation code is reasonably easy to do.

Free SMS credits per month is easy also.

No doubt I will need to add extra language entries, so you might need to translate them aswell (I will send them to you when I have finished. Do you want the password etc still configurable in the admin cp?
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
Slycom
Registered User
Posts: 12
Joined: Wed Mar 28, 2007 7:53 pm
Contact:

Re: [BETA] SMS Intregation

Post by Slycom » Sun Apr 08, 2007 3:00 pm

Yes if you can do so, so let the user can send to board users, too.
Yes all have to configure by ACP. In ACP i want configure:
- passwort and user of my gateway.
- the number of the sms "type"
- a powered by... Message at the end of the user text.
- Monthly sms contigent
- Manually give users sms credits
and so on.... So all possible things to find in ACP. ;)

Thanks a lot for your work...

But how is my English to you? Do i make many mistakes in grammar or other?
Greetings Sly. ;)

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Sun Apr 08, 2007 5:01 pm

the manually give is already there.. I would need to add the powered by message and monthly sms credits.

Your english is very good, couple of grammer mistakes, but definately understandable!

( I will get started now!)
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Sun Apr 08, 2007 5:13 pm

just realised. How do you want this done?

If I submit it using GET in a form, it will submit the data to that url, but it will also send the user there. Is that what you want? and once there if there is an error does it say so? With XML errors are returned from the server back to my board, this can't happen with this method.

Also do you want me to include the send to multiple users part? (will send same sms to multiple numbers) I see no way with your gateway. If there is a way (without overloading the server by my script sending requests multiple times) would you like the lists to be included (Allows users to send the same sms to multiple users who have subscribed to a SMS mailing list).
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
Slycom
Registered User
Posts: 12
Joined: Wed Mar 28, 2007 7:53 pm
Contact:

Re: [BETA] SMS Intregation

Post by Slycom » Sun Apr 08, 2007 5:46 pm

I dont know what you are sayed with "If I submit it using GET in a form, it will submit the data to that url, but it will also send the user there. Is that what you want?"

Other User doesnt need to see my gateway user and password. And all work of the script have done only in my board, not on other sites.
But if you think "xml" is better than "get" so do it this way. But i dont know the xml commands or format for this.

If a sms is send, the it will come back a http respond. And only by the Respond "100" the sms will delivered.
All other numbers are error codes.

And yes it is possible to send multiple sms. but i must take a look how is the command-format. it used the command "empfänger=", too. but even more than one number.

I hope this answer is good. ;) I have ICQ to, to talk there or over msn. so we can talk faster and dont make many reply here... ;)

____________
I take a look on my Gate way. The command to use is:

empfaenger=number;number;....

and on multi sms it must have a new command like this:
massen=1 (this will send a sms up to 500 recipient)
massen=2 (this will send a sms to over 500 recipient - but i dont need this.)

so it must have this form:
.....empfaenger=012345678;123456789&massen=1....... You know what i mean?

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Mon Apr 09, 2007 10:35 am

Done, attached is your custom build of my MOD.

Not fully tested, as I can't test your gateway, don't hesitate to ask if you run into
problems.
SMSIntregationCUSTOM-BUILD.zip
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

Tastengott
Registered User
Posts: 1
Joined: Sat Feb 09, 2008 4:46 am
Contact:

Re: [BETA] SMS Intregation

Post by Tastengott » Sat Feb 09, 2008 5:32 am

Hi!

Where can I download this MOD?
And where can I download the SMSIntregationCUSTOM-BUILD.zip?

The site from "christhatsme" is down!

beveiliging
Registered User
Posts: 6
Joined: Wed Feb 13, 2008 8:33 am
Location: Brandbeveiliging
Contact:

Re: [BETA] SMS Intregation

Post by beveiliging » Wed Feb 13, 2008 9:53 am

Tastengott wrote:Hi!

Where can I download this MOD?
And where can I download the SMSIntregationCUSTOM-BUILD.zip?

The site from "christhatsme" is down!
Try to send PM to creator christhatsme

If you go to main page http://christhatsme.x10hosting.com/ you will see that domain not exist (The domain "christhatsme.x10hosting.com" is available. To get .......)

Ravanolx
Registered User
Posts: 2
Joined: Thu Jun 12, 2008 2:04 am

Re: [BETA] SMS Intregation

Post by Ravanolx » Thu Jun 12, 2008 2:17 am

With a few tweaks you can point this script at a cheaper worldwide gateway at http://www.txtlocal.co.uk/sms-api.php

The php code to send a message (using cURl or sockets.. very simple) is:

Code: Select all

<?php 
$info = "1"; 
$test = "0";
$address = "www.txtlocal.com/sendsmspost.php";
$message = "Hello this is a test with an ampersand (&) and a £5 note";
$from = "Jims Autos";
$uname = "youremailaddress";
$pword = "yourpassword";
$selectednums = "4412345545324";

$newSMS = new sms;
$newSMS->smsCurl($address, $uname, $pword, $message, $from, $selectednums, $info, $test); // Sends an SMS using cURL
$newSMS->smsSockets($address, $uname, $pword, $message, $from, $selectednums, $info, $test); // Sends an SMS using sockets

class sms {
    // cURL SMS
    function smsCurl($address, $uname, $pword, $message, $from, $selectednums, $info, $test=0)
    { 
        // Build url
        $data = "uname=" . $uname . "&pword=" . $pword . "&message=" . urlencode($message) . "&from=" . $from . "&selectednums=" . $selectednums . "&info=" . $info . "&test=" . $test; 
        // Initiate cURL
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://$address"); 
        // curl_setopt($ch, CURLOPT_URL,"https://$address"); //secure connection
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
        // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //use this to suppress output
        $result = curl_exec ($ch); //This is the result from Txtlocal - store as required
        curl_close ($ch);
    } 
    // Socket SMS
    function smsSockets($address, $uname, $pword, $message, $from, $selectednums, $info, $test = 0)
    { 
        // Build data array
        $data = array ("uname" => $uname, "pword" => $pword, "message" => $message, "from" => $from, "selectednums" => $selectednums, "info" => $info, "test" => $test);
        $data = http_build_query($data);

        do_post_request("https://www.txtlocal.com/sendsmspost.php", $data);

        $params = array('http' => array('method' => 'POST',
                'content' => $data
                ));
        if ($optional_headers !== null) {
            $params['http']['header'] = $optional_headers;
        } 
        $ctx = stream_context_create($params);
        $fp = @fopen($address, 'rb', false, $ctx);
        if (!$fp) {
            throw new Exception("Problem with $url, $php_errormsg");
        } 
        $response = @stream_get_contents($fp);
        if ($response === false) {
            throw new Exception("Problem reading data from $url, $php_errormsg");
        } 
        return $response;
    } 
} 

?>
You can also get a free SMS text receiver number and receive SMS text from any phone worldwide into php... at no cost at all! Simply add these 2 variables to your page and you will grab the messages:

Code: Select all

$number = $_REQUEST["number"];
$status = $_REQUEST["status"];

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: [BETA] SMS Intregation

Post by christhatsme » Fri Jul 04, 2008 1:10 pm

Sorry about the serious lack of support for this MOD in recent months, I have been unbelievably busy with other things. I hope to try and get back on track and start fixing bugs etc again soon! :D

edit - Download link being updated now. (give me 30 mins!)

Chris
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

sf_adam
Registered User
Posts: 2
Joined: Fri Jul 18, 2008 1:02 am

Re: [BETA] SMS Intregation

Post by sf_adam » Fri Jul 18, 2008 1:04 am

christhatsme,

This mod is an excellent addition IMHO.

Have you given any thought to the technical feasibility of replying to an SMS to post a reply to the forum?

What would be required for that?

Thank you

Post Reply

Return to “[2.0.x] MODs in Development”