bileşeni indirip dosyalarını kontrol etmek için dowloand adresin
İndir
ayrıca kendim provider klasörünün içinde bulunan mobilenl.php dosyasını editleyerek kendi çalışacağım şirketin api bilgileri eklediğim kodlar aşağıda;
<?php
//check if joomla call us
defined( '_JEXEC' ) or die( 'Restricted access' );
if( defined( 'MYSMS_PROVIDER_MOBILENL_PHP' ) == true )
{
return;
}
/**
* Define our class constant to precent multipe definition
*/
define( 'MYSMS_PROVIDER_MOBILENL_PHP', 1 );
/**
* require our base class
*/
require_once('provider.php');
/**
* Mobile.nl is a sms gateway connection implementation (https://www.mobile.nl)
*
* @package MySMS
* @subpackage Provider
**/
class MOBILENL extends Provider
{
/**
* Constructor, setting up name, file and parameters
*/
function MOBILENL()
{
Provider::Provider(); //call base class constructor
$this->_name = 'MOBILENL';
$this->_file = basename( __FILE__ );
$this->_params['username'] = 'test'; //default params
$this->_params['password'] = 'test'; //default params
}
/**
* The sendSMS is for sending a sms, this function must be reimplemented in all dirved classes
* @param string $text
* @param string $from
* @param string $to
*/
function sendSms( $text, $from, $to, &$errMsg)
{
$urli = 'http://216.25.78.128/bulksms/bulksend.go?';
$url .= $this->buildQuery( array( 'username' => $username,
'password' => $password,
'originator' => $from,
'mobile' => $to,
'charset' => $charset,
'msgtext' => $text ) );
if (!is_numeric($to)) die("Invalid Mobile Number");
$text=urlencode($text);
$to=urlencode($to);
if(!$charset)$charset=0;
function httpget($url)
{
$data=''; $fp = fopen("$url", "r");
if (!$fp) return false;while (! feof($fp)) $data.=fread($fp, 1024);
fclose($fp); return $data;
}
$output =("$urli");
return true;
}//end send sms
} //end class aspsms
?>Çalışacağım şirketin örnek gönderim dosyası için php kodları aşağıda;<?php
$username="replace_with__your_email";
$password="replace_with__your_password";
$originator="mycompany";
$mobile="2011xxxxxxxxxx"; // do not use + infront of mobile phone
// For Latin text
$msgtext="Hello World";
if (!is_numeric($mobile)) die("Invalid Mobile Number");
$msgtext=urlencode($msgtext);
$originator=urlencode($originator);
if(!$charset)$charset=0;
function httpget($url)
{
$data=''; $fp = fopen("$url", "r");
if (!$fp) return false;while (! feof($fp)) $data.=fread($fp, 1024);
fclose($fp); return $data;
}
$output = httpget("http://216.25.78.128/bulksms/bulksend.go?username=$username&password=$password&originator=$originator&phone=$mobile&charset=$charset&msgtext=$msgtext");
if ($output=='OK') {
echo "SMS sent successfully to +$mobile";
} else {
echo "Error sending SMS: $output";
}
?>Arkadaşlar nerde hata yapıyorum yada ne yapmam lazım yardımcı olursanız sevinirim..Şimdiden herkese teşekkürler.