From b68f28a86e6bd17c97bb43f6667ed9bbf5ceb2eb Mon Sep 17 00:00:00 2001 From: "tofulm@gmail.com" <> Date: Wed, 24 Oct 2018 10:06:34 +0000 Subject: [PATCH] =?UTF-8?q?On=20cree=20un=20table=20spip=5Fsms=5Flogs=20po?= =?UTF-8?q?ur=20loguer=20les=20envois,=20les=20telephones=20sont=20en=20md?= =?UTF-8?q?5=20=3D>=20cette=20table=20est=20peupl=C3=A9e=20pour=20l'instan?= =?UTF-8?q?t=20seulement=20si=20on=20utilise=20smsfactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 ++ base/sms.php | 56 +++++++++++++++++++++++++++++++++++++++++ paquet.xml | 6 ++++- sms_administrations.php | 42 +++++++++++++++++++++++++++++++ sms_fonctions.php | 24 ++++++++++++++++++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 base/sms.php create mode 100644 sms_administrations.php diff --git a/.gitattributes b/.gitattributes index b954c18..d5b24a6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * text=auto !eol +base/sms.php -text classes/octopush/config.inc.php -text classes/octopush/sms.inc.php -text classes/smsfactor/AccuseReceptionSMSClass.php -text @@ -14,4 +15,5 @@ prive/squelettes/contenu/configurer_sms.html -text prive/themes/spip/images/sms-16.png -text svneol=unset#image/png prive/themes/spip/images/sms-24.png -text svneol=unset#image/png prive/themes/spip/images/sms-64.png -text svneol=unset#image/png +/sms_administrations.php -text /sms_fonctions.php -text diff --git a/base/sms.php b/base/sms.php new file mode 100644 index 0000000..3cbfbe6 --- /dev/null +++ b/base/sms.php @@ -0,0 +1,56 @@ + 'sms_log', + 'principale' => 'oui', + 'field'=> array( + 'id_sms_log' => 'bigint(21) NOT NULL', + 'nbr_sms' => 'tinyint(4) NOT NULL', + 'message' => 'text NOT NULL DEFAULT ""', + 'telephone' => 'text NOT NULL DEFAULT ""', + 'type_sms' => 'varchar(255) NOT NULL DEFAULT ""', + 'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"', + ), + 'key' => array( + 'PRIMARY KEY' => 'id_sms_log', + ), + ); + + return $tables; +} diff --git a/paquet.xml b/paquet.xml index 4e757ae..12d5748 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,11 +1,12 @@ SMS @@ -13,4 +14,7 @@ GNU/GPL + + + diff --git a/sms_administrations.php b/sms_administrations.php new file mode 100644 index 0000000..3009afc --- /dev/null +++ b/sms_administrations.php @@ -0,0 +1,42 @@ +message == "OK" ) { + if (count($destinataire)) { + $cost = $reponse->cost; + $sent = $reponse->sent; + $nbr_sms = 0; + if ($sent != 0) { + $nbr_sms = $cost / $sent; + } + + $type_sms = ''; + if (array_key_exists('type_sms', $arg)) { + $type_sms = $arg['type_sms']; + } + + foreach ($destinataire as $tel) { + $set = array( + 'telephone' => md5($tel), + 'date' => date("Y-m-d H:i:s"), + 'message' => $message, + 'nbr_sms' => $nbr_sms, + 'type_sms' => $type_sms + ); + sql_insertq('spip_sms_logs',$set); + } + } return true; } else { return false;