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)
-   -   Promocode (http://www.mysidiaadoptables.com/forum/showthread.php?t=3580)

Hall of Famer 04-12-2012 12:51 AM

the adopt.php file in AdminCP subfolder.

SilverDragonTears 04-12-2012 12:51 AM

No it says
Code:

<p>
                                                                        User:(leave blank if you want it to be available to everyone)<br> 
                                                                <input name='user' type='text' id='name'>
                                                                </p>


Hall of Famer 04-12-2012 01:43 AM

Then change it, I apologize for this. No idea why it happened as my site was working out just nicely...

SilverDragonTears 04-12-2012 01:48 AM

Changed it and readded the promocode but there is still nothing in the user field

Hall of Famer 04-12-2012 01:52 AM

Then it was not the cause of your problem after all, its strange how it is working on my site though. What did you enter for the user field? It should be the username, not uid.

SilverDragonTears 04-12-2012 02:01 AM

Nothing. It says if you want it to apply to all then to leave it blank.

Hall of Famer 04-12-2012 02:17 AM

Oh... So the promocode is working if you give it to a specific user, but not to the general public?

SilverDragonTears 04-12-2012 02:18 AM

Yep! That's the problem

Hall of Famer 04-12-2012 02:26 AM

I see, at this moment the promocode is not set up in a way to handle multiple users yet. However, you can make it happen by editing these:

PHP Code:

  public function __construct($code ""){
      
// Fetch the database info into object property

      
$stmt $GLOBALS['adopts']->select("promocodes", array(), "code ='{$code}'");
      if(
$row $stmt->fetchObject()){
         
// loop through the anonymous object created to assign properties
         
foreach($row as $key => $val){
            
// Assign properties to our promocode instance
            
$this->$key $val;         
         }
      }
      else 
$this->message "Promocode does not exist...<br>";
  } 

change to:

PHP Code:

  public function __construct($code ""){
      
// Fetch the database info into object property

      
$stmt $GLOBALS['adopts']->select("promocodes", array(), "code ='{$code}'");
      if(
$row $stmt->fetchObject()){
         
// loop through the anonymous object created to assign properties
         
foreach($row as $key => $val){
            
// Assign properties to our promocode instance
            
$this->$key $val;         
         }
         if(empty(
$this->user)) $this->user $GLOBALS['loggedinname'];
      }
      else 
$this->message "Promocode does not exist...<br>";
  } 


SilverDragonTears 04-12-2012 02:29 AM

Sorry :/ Which script?


All times are GMT -5. The time now is 01:49 PM.

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