Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Straipsniu siuntimas smsu

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='&#302;ved&#279;te klaiding&#261; numer&#303;!'"); }
if (strlen($text) > 130) { exit("snd.innerHTML='Vir&#353;inote leistin&#261; &#382;enkl&#371; kiek&#303;!'"); }
if (!is_numeric($numb)) {  exit("snd.innerHTML='&#302;ved&#279;te klaiding&#261; numer&#303;!'"); }

$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&#363;s&#371; tekstas';}"  onfocus="if (value == 'J&#363;s&#371; 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&#363;s&#371; 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&#371;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&#279;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 :)

Parašė kiskiss· 2008 Sau. 27 22:01:27
#2

Nevisai supratau kas tau neveikia, šitas scriptas, ar kas, ir ar straipsnius iškarto siūstu tiesiogiai į saita be patvirtinimu ar su patvirtinimais?

Parašė bruzgis· 2008 Sau. 27 22:01:08
#3

pirma ***, antra niekur nesakiau kad kas nors neveikia, trecia parasyta aiskiai kad nesugebu sujugt visko i viena faila :)

uzeini i sms.php faila, ten issirenki kategorija, tada tave pasiuncia i sms.php?cat_id=2 ten issirenki straipsni, numeta tave i sms_skaityti.php?article_id=123 ten paspaudi linka:
<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>




ir tau ismeta toki langa:



ten ivedi draugo numeri ir savo varda ir spaudi siusti, issiuncia ta straipsni sms`u, tada atsiranda uzrasas 'sms sekmingai issiustas'
ir po keliu sekundziu uzsidaro tas popupas.


Parašė Hardrock· 2008 Sau. 28 15:01:55
#4

Na kaip ir visada tik užvesiu ant kelio, nes neturiu laiko...

Persimodifikuok article.php

Taip pat failo apačioje įterpk sms kodą...

Tame sms kode, kur yra jūsų tekstas pakeis į $article

Ir žiūrėk kas gaunasi.