Parašė bruzgis· 2008 Sau. 27 21:01:14
#1
Sudetingesnis klausimelis.
Yra pagrindinis failas siusti sms`ams:
<?php
$sms_user = "pramogauk";
$sms_password = "slaptazodis";
$reklama = "\nPramogauk.NET\nPasveikink ir tu savo drauga";
$numb = $_GET['numb'];
$text = $_GET['text'];
if ($numb != "" && $text != "") {
if (strlen($numb) != 7) { exit("snd.innerHTML='Įvedėte klaidingą numerį!'"); }
if (strlen($text) > 130) { exit("snd.innerHTML='Viršinote leistiną ženklų kiekį!'"); }
if (!is_numeric($numb)) { exit("snd.innerHTML='Įvedėte klaidingą numerį!'"); }
$numb = substr($numb, 0, 7);
$numb = rawurlencode($numb);
$text = substr($text, 0, 130);
$reklama = substr($reklama, 0, 30);
$text = $text . $reklama;
$text = urlencode($text);
$fp = fopen("http://sms.reboot.lt/sms.php?user=$sms_user&password=$sms_password&numb=$numb&text=$text", "rb");
if($fp){ while(!feof($fp)) { $img = $img . fread($fp, 1024); } }
$img = substr($img, 2); exit("snd.innerHTML='$img'");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="author" content="ELFA">
<meta name="keywords" >
<title>SMS siuntimas</title>
<script language="JavaScript" type="text/JavaScript">
<!--
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);
function ajax_do (url) {
snd = document.getElementById('idTEXT');
if (url.substring(0, 4) != 'http') {
url = base_url + url + '?text=' + escape(document.smsform.text.value) + '&numb=' + escape (document.smsform.numb.value);
}
var jsel = document.createElement('SCRIPT');
jsel.type = 'text/javascript';
jsel.src = url;
document.body.appendChild (jsel);
}
function t_r() {
document.smsform.liko.value = 130 - document.smsform.text.value.length;
if (document.smsform.liko.value < 0) {
document.smsform.text.value = document.smsform.text.value.substring(0, document.smsform.text.value.length+(130 - document.smsform.text.value.length));
document.smsform.liko.value = 130 - document.smsform.text.value.length;
}
}
//-->
</script>
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH="0" MARGINHEIGHT="0" bgcolor="#2792BC">
<table width="170" border="0" cellspacing="0" cellpadding="0" height="300">
<tr>
<td>
<div align="center">
<FORM name='smsform' target="_top">
<b>+3706</b><INPUT name='numb' size=15 maxlength='7' style='border: 0px solid #cecfce;background-color:#2792BC; width:104px;
font-family: Tahoma; padding-left:2px;
font-size: 11px;' onblur="if (value == '') {value='xxxxxxx';}" value="xxxxxxx" onfocus="if (value == 'xxxxxxx') {value='';}">
<br>
<textarea name='text' onkeyup="t_r()" onkeydown="t_r()" onchange="t_r()" onblur="if (value == ''){ value = 'Jūsų tekstas';}" onfocus="if (value == 'Jūsų tekstas') {value='';}" rows='12' cols='18' style='border: 1px solid #cecfce;background-color:#2792BC; width:145px;
font-family: Tahoma; padding-left:2px;
font-size: 11px;' >Jūsų tekstas</textarea><br>
<INPUT name="liko" size='15' value='130' style='border: 0px solid #cecfce;background-color:#2792BC; width:145px;
font-family: Tahoma; padding-left:65px;padding-bottom: 2px;padding-top: 2px;
font-size: 11px;'><br>
<INPUT TYPE='reset' VALUE='Valyti' style='border: 1px solid #cecfce;background-color:#2792BC;width:71px; font-family: Tahoma; font-size: 11px;'> <INPUT TYPE='reset' onClick="ajax_do('sms.php')" VALUE='Siųsti SMS' style='border: 1px solid #cecfce;background-color:#2792BC;width:71px; font-family: Tahoma; font-size: 11px;'><br><br>
<div id="idTEXT" style='color: #F9F9F9; font-family: Tahoma; font-size: 11px;'>paslaugos tiekėjas: <a href="http://sms.reboot.lt/" target="_blank">sms.reboot.lt</a></div>
</form>
</div>
</tr></td>
</table>
</body>
</html>
perdarytas failas straipsniu:
<? require_once "maincore.php";
if (!isset($article_id) || !isNum($article_id)) fallback("sms_siusti.php");
$result = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name FROM ".$db_prefix."sms ta
INNER JOIN ".$db_prefix."sms_cats tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
WHERE article_id='$article_id'"
);
$res = 0;
if (dbrows($result) != 0) {
$data = dbarray($result);
if (checkgroup($data['article_cat_access'])) {
$res = 1;
if ($rowstart == 0) $result = dbquery("UPDATE ".$db_prefix."sms SET article_reads=article_reads+1 WHERE article_id='$article_id'");
$article = stripslashes($data['article_article']);
$article = explode("<--PAGEBREAK-->", $article);
$pagecount = count($article);
$article_subject = stripslashes($data['article_subject']);
$article_info = array(
"article_id" => $data['article_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"article_date" => $data['article_datestamp'],
"article_breaks" => $data['article_breaks'],
"article_comments" => dbcount("(comment_id)", "comments", "comment_type='A' AND comment_item_id='".$data['article_id']."'"),
"article_reads" => $data['article_reads'],
"article_allow_comments" => $data['article_allow_comments']
);
?>
Nuoroda einanti i si faila:
<a href=\"javascript:void(0)\" onclick=\"window.open('".BASEDIR."sms_siusti.php?article_id=$article_id','welcome','width=500,height=600')\"><img src='".IMAGES."sent/send_01.png'></a>
o beda tokia, niekaip nesugebu sujungt i viena faila, kad siustu straipsni per sms.
gal kas galetu padet? dekui is anksto :)