Author Topic: Another Bug in E-mail Code  (Read 14717 times)

Offline saladbar821

Another Bug in E-mail Code
« on: January 13, 2010, 03:23:40 am »
I ran into another issue with the e-mail admin code. If you try to use a br tag in the additional fields box, saving resets all of the values below "Make sure to change..." to 0.

EDIT: Actually, it seems that this happens when you edit the form.
« Last Edit: January 14, 2010, 08:16:11 am by saladbar821 »

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #1 on: March 22, 2011, 11:42:28 pm »
That's because it's all message up. I'll see if I can come up with a new one later on today.



Serving Gamers from around the world
http://www.df-barracks.com/


Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #2 on: March 23, 2011, 02:10:52 am »
Ok, here you go. It works and I tested it. I just took out all the extra **** that didn't need to be in there. If you see some thing extra that you would like to add to it. Let me know.

You will have to edit lines 32 and 33 to your own Name and Email address to use. Until I can get more information.



« Last Edit: March 23, 2011, 02:19:23 am by bigjoe11a »
Serving Gamers from around the world
http://www.df-barracks.com/


Offline saladbar821

Re: Another Bug in E-mail Code
« Reply #3 on: March 23, 2011, 05:26:36 am »
Well I certainly appreciate the effort, however I've since moved on to MyBB.

Glad to see somebody worked on this!

Offline goodman84

Re: Another Bug in E-mail Code
« Reply #4 on: January 26, 2012, 11:35:43 pm »
I'm aware that nothing has been posted in 75 days. But this forum is almost always dead anyways. So...

I still have an issue. I need the message that will be sent to be predefined by me. For each item. And when they use it it will tell me there user name and the item they used.

How would I do this?

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #5 on: January 27, 2012, 02:41:11 am »
I'm aware that nothing has been posted in 75 days. But this forum is almost always dead anyways. So...

I still have an issue. I need the message that will be sent to be predefined by me. For each item. And when they use it it will tell me there user name and the item they used.

How would I do this?

Well 1st you need to tell me or us what you mean. Your post I'm sorry I don't under stand.

Your talking about some message that you want to predefine it your self. So can you tell me what message are you talking about.

Serving Gamers from around the world
http://www.df-barracks.com/


Offline goodman84

Re: Another Bug in E-mail Code
« Reply #6 on: January 27, 2012, 03:31:58 am »
I want to make it so I set the message that's sent. So what happens is the user buys an item from the shop and uses it, and it sends me an email with there username and the item that they used they used as well as like a varification code i'd put on or something.

The way I had it set on the normal AdminEmail thing was that they would enter there user name into the example field and what not.

It worked great untill I edited the item again and everything went to zeros.

So I tried your shopadmin fix. but then it gave me a SQL error.

Code: [Select]
Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text" name="example" />

", `info4` = "The user: {$_POST["example"]}' at line 10
File: /home/conjoint/public_html/forum/Sources/shop/ShopAdmin.php
Line: 559

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.2, while your database is at version 2.0. The above error might possibly go away if you execute the latest version of upgrade.php.

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #7 on: January 27, 2012, 04:26:31 am »
Ok, so can you show me your code. The shop item. So that I can see what your doing. and Then maybe I mite be able to fix it.
Serving Gamers from around the world
http://www.df-barracks.com/


Offline goodman84

Re: Another Bug in E-mail Code
« Reply #8 on: January 27, 2012, 05:53:18 am »
I haven't changed any of the code for EmailAdmin.php ?

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #9 on: January 27, 2012, 06:28:45 am »
Ok, now giving some better detail. Tell me just what your trying to do and what version of shop are you using.
Serving Gamers from around the world
http://www.df-barracks.com/


Offline goodman84

Re: Another Bug in E-mail Code
« Reply #10 on: January 27, 2012, 12:58:46 pm »
I'm Running the latest version of the shop.

What I want to happen is the person buys an item from the shop (prize item). When they use it it sends an email telling me to give the person their prize.

Thats essentially what I need it for.

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #11 on: January 27, 2012, 01:18:06 pm »
That's not all that hard. If you look at some of the ones that are all ready created you will find that they will have an option for sending an email. and you can set it up so that it can email you with who won the prize and so on. If you can't find it. Let me know and I'll take a quick look for you. I'm sure that the items that come stock with the shop have 2 or 3 items that send both PM and email.

UPDATE:
   I check that file for you and it all ready has that option added for you. When a user buys the item and uses it. It sends you an email. Here look at the code.

EmailAdmin.php
Code: [Select]
function onUse()
{
global $sourcedir, $item_info;
$to = $item_info[1];
$subject = $item_info[2];
$message = $item_info[4];
// We need sendmail!
require_once($sourcedir . '/Subs-Post.php');

// Hack put in place to allow $_POST and $_GET vars in the $message var
// --Daniel15, 4 Septemeber 2005 2:15PM
foreach ($_POST as $postKey => $postVar)
$message = str_replace('{$_POST["' . $postKey . '"]}', $postVar, $message);
 
foreach ($_GET as $getKey => $getVar)
$message = str_replace('{$_GET["' . $getKey . '"]}', $getVar, $message);

// Send the email!
sendmail($to, $subject, $message) or die('Error sending message to admin! Please inform the Admin of this error. This item will still be available in your inventory.');

return 'Message sent to admin!';
}

« Last Edit: January 27, 2012, 01:24:14 pm by bigjoe11a »
Serving Gamers from around the world
http://www.df-barracks.com/


Offline goodman84

Re: Another Bug in E-mail Code
« Reply #12 on: January 27, 2012, 04:05:55 pm »
Yeah but If I go to edit that file all the fields I filled in are changed to Zeros.

Offline bigjoe11a

Re: Another Bug in E-mail Code
« Reply #13 on: January 27, 2012, 05:18:12 pm »
Ok, let me play with it and I'll get back to you on this.

UPDATE:
  Ok, well the problem your having is some thing that is not happening on my end. So what I would do is, Is uninstall the mod and try and reinstall it again and see if you don't have the same problem.

The other thing is that if your using SMFShop 3.1.8. This is newer then what I'm using. I use version 3.1.6. and I don't seem to have this problem. You mite want to do is down grade your SMF Shop and see if that doesn't fix it. It could be a bug in the PHP scripts.
« Last Edit: January 27, 2012, 09:09:48 pm by bigjoe11a »
Serving Gamers from around the world
http://www.df-barracks.com/


Offline goodman84

Re: Another Bug in E-mail Code
« Reply #14 on: January 28, 2012, 12:28:48 pm »
Ok, let me play with it and I'll get back to you on this.

UPDATE:
  Ok, well the problem your having is some thing that is not happening on my end. So what I would do is, Is uninstall the mod and try and reinstall it again and see if you don't have the same problem.

The other thing is that if your using SMFShop 3.1.8. This is newer then what I'm using. I use version 3.1.6. and I don't seem to have this problem. You mite want to do is down grade your SMF Shop and see if that doesn't fix it. It could be a bug in the PHP scripts.

Is 3.1.6 Compatible with the latest version of SMF?