Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Give promocode when buy item? (http://www.mysidiaadoptables.com/forum/showthread.php?t=3820)

dulop 09-12-2012 02:02 AM

Give promocode when buy item?
 
Hello!
There is a way to give a promocode to the users, when they buy an item?

Thanks! :D

Hall of Famer 09-14-2012 02:13 AM

Well you can take a look at the class file class_promocode.php, it explains how to use the promocode class.

dulop 09-19-2012 08:29 PM

I dont know how to give a promocode when a user buy an item :s

Hall of Famer 09-19-2012 09:41 PM

Of course I know you dont know, thats why I told you to look at promocode class file and read the comments in it. I dont really have time to work on a custom script for anyone at this point, busy with school and Mys v1.3.2 at the moment(I will help with newbie problems such as installing/configuring the site though).

dulop 09-28-2012 12:33 AM

Ah ok, sorry! no problem, dont worry ^^
And thanks for reply!

dulop 02-02-2013 05:42 AM

i've seeing the files and i made this:

PHP Code:

function items_milagros($item$adopt){
$codigopromo $adopts->select("items_functions", array(), "code")->fetchObject();
$mtitle "Has ganado un logro!";
        
$mtext "Felicitaciones!  Has recibido una recompenza. El código es el siguiente:{$codigopromo} . Puedes usarlo en la página de promos. Para saber como usarlo hay una guía correspondiente.";

        
$date date('Y-m-d');
        
$GLOBALS['adopts']->insert("messages", array("id" => NULL"fromuser" => "SYSTEM""touser" => $owner"status" => "unread""datesent" => $date"messagetitle" => $mtitle"messagetext" => $mtext));
        
        
$row $GLOBALS['adopts']->select("users", array(), "username='{$owner}'")->fetchObject();    

        
$newmessagenotify=$row->newmessagenotify;
        
$email=$row->email;
        
        if(
$newmessagenotify == 1) {
            
// We are sending this user an email about the new message...
            
$systememail grabanysetting("systememail"); // QUERYPROBLEM - we should get the settings at the beginning so we never need to call for them after that.            
            
$headers "From: {$systememail}";
            
$site_name grabanysetting("sitename"); // QUERYPROBLEM - see, two queries for this message alone.
            
$message "Hello {$owner};\n\nYou have received a new Private Message from SYSTEM at {$site_name} with the title {$mtitle}.\n
            You can read this message at: http://www."
.constant("DOMAIN").constant("SCRIPTPATH")."/messages.php\n
            Thank You.  The 
{$site_name} team.";

            
mail($email$site_name." - You Have Received a Reward"$message$headers);
        }
        
$note "Has conseguido un código promo!";
return 
$note;


Its a new function. I want that when i use a item with this function, the system send me a pm, giving me a promocode.

But doesn't work. Any idea? when i use the item, the screen goes blank.
Thank you


All times are GMT -5. The time now is 02:30 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.