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

Roaringwindz 06-13-2012 08:28 PM

Promocode Problem
 
I don't know why this is happening, but if someone could help me fix the problem, that would be so great.

The problem: I make a promo code for an adoptable, enter it in and it says the code matches the one in the database but I never get the pet. . . I go to the manage adoptables in my cpanel and see that the "adoptable's owner" is blank. Is there a reason why it didn't enter in my username?

Alaric 06-13-2012 09:07 PM

I Guess you are having the same problem as shown In The link (.See Screenshots.)

Problem

I'll help you out!

1. Go to the File-Manager.
2. Find classes/class_promo.php
3. Find this part as shown below.

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>";
  } 

4. Now Change it 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>";
  } 


Hall of Famer 06-14-2012 01:12 AM

Oh yeah this public promocode glitch... In fact I plan to redesign the promocode system after Mys v1.3.3 release(not v1.3.2). The Promocode class is trying to do too much, it handles both public and private promocode, and it handles both adoptables and items promocode. Bad object-oriented design Id say, will be improved in future.

Roaringwindz 06-14-2012 11:26 AM

Thanks Alaric and Hall of Fame! I can't wait until v1.3.2 and v1.3.3 are released.

draugluin 10-29-2012 06:53 AM

@ Alaric

great, it works. Thanks so much ... I just installed the version 1.3.1 and have exactly this problem.

Hall of Famer 11-21-2012 10:04 AM

Well this is fixed in Mys v1.3.2, the promocode system now supports both public and private codes. The usage of promocode is also extended to pages, although you do not go to promo.php and enters your password for pages. Instead, upon visiting the page url you will get a screen asking for promocode.


All times are GMT -5. The time now is 07:02 PM.

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