You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 493 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - SMS Module problems [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Shep
Nuke Soldier
Nuke Soldier


Joined: May 28, 2003
Posts: 22


PostPosted: Sat Jul 24, 2004 2:46 pm Reply with quoteBack to top

OK, I have installed SMS Center v.0.0.1b and modified it considerably to fit my needs.

The module is working and I can send SMS messages. (I am not a coder, so I am sure there is a better way to do this) but I have adapted the script so that ANY sms privider can be used, t-mobile, Verizon etc.

OK - here is what I am having trouble with:

Sender seems to default to whatever email address is set in PHP ie: admin@ site.com - and I would like to change that to whatever domain name I happen to be using on the site.

Also, it doesn't seem to pick up the "From:" and I would like to be able to use user_email from the PHPNuke database.

Here is the form script I modified for use with t-mobile:

Quote:
<?php

/************************************************************************/
/* radically based on:
/* Send_Mail: PHP-NUKE module created by Jan Skurovec (svab@cooltura.cz)*/
/* Nuke_Mailer: module by yahooooh@yahooooh.com */
/* =========================== */
/* */
/* Module further modified by shep@thedaggers.net for use with various */
/* phone SMS gateways. Please notify Shep is you make it better! */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

$index = 1;
$registered_only = "1";

function adresar() {
global $dbi, $module_name, $cookie;
$result = sql_query("SELECT * FROM nuke_send_sms_phonebook WHERE smuid='$cookie[1]' ", $dbi)or die (mysql_error());
while(list($adress_id, $suid, $smemail, $smname) = sql_fetch_row($result, $dbi)) {
$usersnames .= "<option value=\"$smemail\">$smname</option>"; }
return $usersnames;
}

function main() {
global $module_name;
global $registered_only;
include("header.php");
if($registered_only == "1"):
global $uname, $user_prefix, $dbi, $cookie;
if($cookie[1]==""):
header("location: modules.php?name=$module_name&file=t-mobile&func=smula");
endif;
$result = sql_query("SELECT user_email from ".$user_prefix."_users where username='$cookie[1]'", $dbi)or die (mysql_error());
$userinfo = sql_fetch_array($result, $dbi);
$odkoho = $userinfo[user_email];
endif;
OpenTable();
echo(" <center><br><h2>T-Mobile</h2><p><a href=\"modules.php?name=$module_name&file=t-mobile&func=terms\">"._smsterms."</a><br><br>");
echo(" <form action=\"modules.php?name=$module_name&amp;file=t-mobilesend\" method=\"POST\" enctype=\"MULTIPART/FORM-DATA\">");
echo(" <table border=0 width=\"75%\" cellpadding=\"1\" cellspacing=\"0\">");
echo(" <tr><td align=\"right\"></td><td><input name=\"jak\" type=\"radio\" value=\"normal\" checked>"._adresatovi.""); if($registered_only == "1"): echo ("<input name=\"jak\" type=\"radio\" value=\"adresar\">"._zadresare."</td></tr>"); endif;
if($registered_only == "1"): echo(" <tr><td align=\"right\">"._adressbook.":</td><td><select name=\"seznam\"><option value=\"none\" selected>"._selectadress."</option>".adresar()."</select></td></tr>"); endif;
echo(" <tr><td align=\"right\">"._komu.":</td><td><input name=\"komu\" size=\"15\"> "._komuexam1."</td></tr>");
echo(" <tr><td align=\"right\">"._subjekt.":</td><td><input name=\"subjekt\" size=\"15\"></td></tr>");
echo(" <tr><td align=\"right\" valign=\"top\">"._zprava.":</td>");
echo(" <td><textarea cols=\"42\" name=\"zprava\" rows=\"6\" ></textarea></td></tr>");
if($registered_only == "1"):
echo("<tr><td align=\"right\">"._vasmail.":</td><td>$odkoho<input type=\"hidden\" name=\"odkoho\" value=\"$odkoho\" size=\"45\">");
echo("</td></tr>");
else:
echo(" <tr><td align=\"right\">"._vasmail.":</td><td><input name=\"odkoho\" value=\"$odkoho\" size=\"45\"></td></tr>");
endif;
echo(" </table>");
echo(" <br><input type=\"submit\" value=\""._odeslat."\"><input type=\"reset\" value=\""._CLEAR."\">");
echo(" </form>");
CloseTable();
if($registered_only == "1"):
echo("<br>");
OpenTable();
echo("<h6>"._pridatdoadresare."</h6>");
echo("<form action=\"modules.php?name=$module_name&amp;file=t-mobile&amp;func=pridat\" method=\"POST\" enctype=\"MULTIPART/FORM-DATA\">");
echo("<table border=0 width=\"75%\" cellpadding=\"1\" cellspacing=\"0\">");
echo("<tr><td align=\"right\">"._emailovaadresa.":</td><td><input name=\"smemail\" size=\"15\"> "._komuexam1."</td></tr>");
echo("<tr><td align=\"right\">"._jmeno.":</td> <td><input name=\"smname\" size=\"15\"> "._komuexam2."</td></tr>");
echo("</table>");
echo("<br><input type=\"submit\" value=\""._odeslat."\"><input type=\"reset\" value=\""._CLEAR."\">");
echo("<input type=\"hidden\" name=\"smuid\" value=\"$cookie[1]\" ></td></tr>");
echo("</form>");
CloseTable();
endif;

if($registered_only == "1"):
echo("<br>");
OpenTable();
echo("<h6>"._editovat."</h6>");
echo("<form action=\"modules.php?name=$module_name&amp;file=edit\" method=\"POST\" enctype=\"MULTIPART/FORM-DATA\">");
echo("<table border=0 cellpadding=\"1\" cellspacing=\"0\">");
echo("<tr><td>"._selectfriend."</td><td><select name=\"editovat\"><option value=\"none\" selected>"._selectadress."</option>".adresar()."</select></td></tr>");
echo("</table>");
echo("<br><input type=\"submit\" name=\"buttonek\" value=\""._DELETED."\"><input type=\"submit\" name=\"buttonek\" value=\"Edit\">");
echo("<input type=\"hidden\" name=\"smuid\" value=\"$cookie[1]\" ></td></tr>");
echo("</form>");
CloseTable();
endif;

include("footer.php");

}

function error() {
global $module_name;
include("header.php");
OpenTable();
echo ""._error."";
echo "<br><br><a href=\"modules.php?name=$module_name\">"._znovu."</a>";
CloseTable();
include("footer.php");

}

function sent() {
global $module_name;
include("header.php");
OpenTable();
echo ""._smssent."";
echo "<br><br><a href=\"modules.php?name=$module_name\">"._dalsi."</a>";
CloseTable();
echo("<br>");
include("sms_count.php");
OpenTable();
echo "<p align=\"center\">"._smsthnks."</p>";
echo "<br>";
echo "<center><h3>"._success."</H3>";
echo "<br>";
echo "<p align=\"center\"><a href=\"http://www.thedaggers.net/modules.php?name=SMS\" target=\"_self\"><IMG SRC=\"http://www.thedaggers.net/modules/SMS/images/antiquephone.gif\" alt=\"Send Another Message\" border=\"1\" hspace=\"0\"><BR>Send another message</a>";
echo "<br>";
echo "<p align=\"center\"><a href=\"modules.php?name=$module_name&file=t-mobile&func=terms\">"._smsterms."</a>";
echo "<br>";
echo "<br><em>- $count -</em></p>";
CloseTable();
include("footer.php");

}

function adresa() {
global $module_name;
include("header.php");
OpenTable();
echo ""._adresa."";
echo "<br><br><a href=\"modules.php?name=$module_name\">"._znovu."</a>";
CloseTable();
include("footer.php");
}

function smula() {
include("header.php");
OpenTable();
echo ""._smula."";
echo "<br><br><a href=\"modules.php?name=Your_Account&op=new_user\">"._zaregistrovat."</a>";
echo " <a href=\"modules.php?name=Your_Account\">"._zalogovat."</a>";
CloseTable();
include("footer.php");
}

function pridat($smuid, $smemail, $smname) {
global $dbi, $module_name, $cookie;

$result = sql_query("INSERT INTO nuke_send_sms_phonebook VALUES ('', '$smuid', '$smemail', '$smname')", $dbi);
if(!$result):
include("header.php");
OpenTable();
echo ""._erroradd."";
echo "<br><a href=\"modules.php?name=$module_name\">"._ted."</a>";
CloseTable();
include("footer.php");
else:
header("location: modules.php?name=$module_name&file=t-mobile&func=pridano");
endif;
}


function pridano() {
global $module_name;
include("header.php");
OpenTable();
echo ""._addeddb."";
echo "<br><br><a href=\"modules.php?name=$module_name\">"._nextsms."</a>";
CloseTable();
include("footer.php");
}

function terms() {
global $module_name;
include("header.php");
OpenTable();
echo "<center><h2>"._welcome."</h2>";
echo "<br>"._smsterms."</center";
CloseTable();
echo("<br>");
include("sms_count.php");
OpenTable();
echo "<p align=\"left\">"._smsterms1."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms2."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms3."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms4."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms5."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms6."</p>";
echo "<br>";
echo "<p align=\"left\">"._smsterms7."</p>";
echo "<br>";
echo "<br><br><a href=\"modules.php?name=$module_name\">"._nextsms."</a>";
CloseTable();
include("footer.php");
}

function error_delete() {
global $module_name;
include("header.php");
OpenTable();
echo ""._error_delete."";
echo "<br><a href=\"modules.php?name=$module_name\">"._ted."</a>";
CloseTable();
include("footer.php");
}

function error_update() {
global $module_name;
include("header.php");
OpenTable();
echo ""._error_update."";
echo "<br><a href=\"modules.php?name=$module_name\">"._ted."</a>";
CloseTable();
include("footer.php");
}


switch($func)
{
default:
main();
break;

case "error":
error();
break;

case "pridat":
pridat($smuid, $smemail, $smname);
break;

case "sent":
sent();
break;

case "pridano":
pridano();
break;

case "install":
createdb();
break;

case "adresa":
adresa();
break;

case "smula":
smula();
break;

case "error_update":
update();
break;

case "error_delete":
error_delete();
break;

case "terms":
terms();
break;


}


?>


And here is the processing script (also modified):

Quote:
<?php
/************************************************************************/
/* SMS: PHP-Nuke module modified to work with an ICQ email2sms gateway. */
/* radically based on:
/* Send_Mail: PHP-NUKE module created by Jan Skurovec (svab@cooltura.cz)*/
/* Nuke_Mailer: module by yahooooh@yahooooh.com */
/* =========================== */
/* */
/* Module further modified by shep@thedaggers.net for use with various */
/* phone SMS gateways. Please notify Shep is you make it better! */
/* */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

$multisend = 0;

switch($jak)
{
case "normal":
if($multisend == 0):
if(!ereg("^[0-9]",$komu)) // number validation
{
header("location: modules.php?name=$module_name&file=t-mobile&func=adresa");
exit;
}
endif;
break;

case "admin":
$komu = $user_email;
break;

case "adresar":
$komu = $seznam;
break;
}

$komu = strip_tags(trim($komu));
$subjekt = strip_tags(trim($subjekt));
$zprava = strip_tags(trim($zprava));
$odkoho = strip_tags(trim($odkoho));
//$headers = "From:$odkoho";

// --- Start editing here --- //

$prefix = ""; // You country code. (Leave empty if you want users to use full 11 digit numbers)
// Note that some mobile providers required "+" from the begining of number
$gateway = "@tmomail.net"; // Your mobile provider e-mail gateway E.g.: @t-momail.net.

// --- Stop editing here --- //

$phone = "$prefix$komu$gateway";
@$send=mail($phone,$subjekt,$zprava,$komu);

if(!$send){
header("location: modules.php?name=$module_name&file=t-mobile&func=error");
}else{
header("location: modules.php?name=$module_name&file=t-mobile&func=sent");
}

exit();


?>


I am ONLY looking for why the "From:" isn't included in the send....

THanks,
Shep
Find all posts by ShepView user's profileSend private message
youdownloadit
Nuke Cadet
Nuke Cadet


Joined: Jun 17, 2006
Posts: 2


PostPosted: Sat Jun 17, 2006 6:08 am Reply with quoteBack to top

If you can send me the module i will be able to convert it for you
Find all posts by youdownloaditView user's profileSend private message
webjunky
Lieutenant
Lieutenant


Joined: May 11, 2003
Posts: 167


PostPosted: Sat Jun 17, 2006 10:56 am Reply with quoteBack to top

I would be interested in this module too..
I also could help converting it...

I've send you a pm,

_________________
- Do not pm me for help -
Find all posts by webjunkyView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.101 Seconds - 197 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::