SmsCoin - sms:key module

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

All information within this software product is the
intellectual property of SmsCoin, Israel.

Given software can be used by http://smscoin.com/ clients
for sms:key service only. Any other use of the software
is violation of the company's right and will be pursued
according to operating law.

SmsCoin. Israel will not be held liable for any loss
or damage of any kind as a result of using this software,
including any lost revenues and/or data.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

 Current plugin allows you to restrict an access to your site news.

1. Setup: open modules/news/index.php file and find the following line:

	$text = (!$bodytext) ? "".$hometext."".$fields."" : "".$hometext."<br /><br />".$bodytext."".$fields."";

	then replace it with the following code:

	$smscoin_hide = "sms";
	if(preg_match('/\\['.$smscoin_hide.'\\](.*?)\\[\\/'.$smscoin_hide.'\\]/is', $bodytext, $matches)) {
			### SMS:Key v1.0.6 ###
			$old_ua = @ini_set('user_agent', 'smscoin_key_1.0.6');
			$key_id = 210070; // ID вашего смс ключа
			$response = @file("http://key.smscoin.com/key/?s_key=".$key_id."&s_pure=1&s_enc=utf-8"
			."&s_pair=".urlencode(substr($_GET["s_pair"],0,10))
			."&s_language=".urlencode(substr($_GET["s_language"],0,10))
			."&s_ip=".$_SERVER["REMOTE_ADDR"]
			."&s_url=".$_SERVER["SERVER_NAME"].htmlentities(urlencode($_SERVER["REQUEST_URI"])));
			if ($response !== false) {
				if (count($response)>1 || $response[0] != 'true') {
					$text = "".$hometext."<br>".(implode("", $response))."".$fields."";
					$text = "".$hometext."<br>".preg_replace('/\\['.$smscoin_hide.'\\].*?\\[\\/'.$smscoin_hide.'\\]/is', implode("", $response), $bodytext)."".$fields."";
				} else {
					$text =
					$text = (!$bodytext) ? "".$hometext."".$fields."" : "".$hometext."<br><br>".preg_replace('/\\['.$smscoin_hide.'\\].*?\\[\\/'.$smscoin_hide.'\\]/is', $matches[1], $bodytext)."".$fields."";
				}
			} else $text = "".$hometext."<br>Cannot connact to server".$fields."";
			@ini_set('user_agent', $old_ua);
			### SMS:Key end ###
	} else {
		$text = (!$bodytext) ? "".$hometext."".$fields."" : "".$hometext."<br /><br />".$bodytext."".$fields."";
	}

2. Assign your service (sms:key) ID to $key_id variable

