Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2011, 01:06 PM
HIddenPanda's Avatar
HIddenPanda HIddenPanda is offline
I Am... Da Sheep
 
Join Date: Jul 2010
Posts: 52
Gender: Male
Credits: 5,275
HIddenPanda
Cool View Active Promocodes Plugin 1.1 [MAJOR BUG FIX]

Compatible With: Mysidia Adoptables 1.0 - 1.1.2

This plugin is just a simplified version of my old mod. It can be accessed through the System Settings> Plugins Menu

Just upload both admcodes.php and admcodes_install.php to the main directory. Open up admcodes_install.php (YOU MUST BE LOGGED IN TO AN ADMINISTRATOR ACCOUNT FOR THE INSTALLATION TO WORK!) in your web browser. Then delete it off your server and voila

Edit 1: Bugfix - The code would only show one promo code over and over again, but this fixes that :D


If you already installed this addon All you need to do is replace admcodes.php (Delete if off the server and upload this copy (in the attatchments))
Attached Files
File Type: php admcodes_install.php (4.0 KB, 13 views)
File Type: php admcodes.php (4.5 KB, 6 views)
__________________
dasheep.tk

Last edited by HIddenPanda; 01-25-2011 at 08:22 PM. Reason: Major bugfix in admcodes
Reply With Quote
  #2  
Old 01-23-2011, 09:07 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 28,030
Bloodrun
Send a message via Yahoo to Bloodrun
Default

Nicely done Panda. =D This is how Plugins should work.
__________________
Have any questions?
Feel Free to PM Me! =D
What you could get with a Premium Member account.
The Forum has been released!
Reply With Quote
  #3  
Old 01-23-2011, 10:20 PM
HIddenPanda's Avatar
HIddenPanda HIddenPanda is offline
I Am... Da Sheep
 
Join Date: Jul 2010
Posts: 52
Gender: Male
Credits: 5,275
HIddenPanda
Default

Thank you :D, I was always wondering why no one ever took advantage of the Admin Control Panel Plugin page? Wasted page much?
__________________
dasheep.tk
Reply With Quote
  #4  
Old 01-23-2011, 10:45 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 28,030
Bloodrun
Send a message via Yahoo to Bloodrun
Default

Quote:
Originally Posted by HIddenPanda View Post
Thank you :D, I was always wondering why no one ever took advantage of the Admin Control Panel Plugin page? Wasted page much?
No one ever knew how lol. =P
__________________
Have any questions?
Feel Free to PM Me! =D
What you could get with a Premium Member account.
The Forum has been released!
Reply With Quote
  #5  
Old 01-23-2011, 10:54 PM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,506
fadillzzz is an unknown quantity at this point
Default

For some reason, it only loop the first promo code over and over.
Are you aware of this?
Reply With Quote
  #6  
Old 01-24-2011, 08:18 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 31,868
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

Quote:
For some reason, it only loop the first promo code over and over.
Are you aware of this?
Is it repeating the adoptable type as well as the promocode?

You may want to replace the loop, give this a try:
PHP Code:
$i=0;
        while(
$i $num){
            
$article_content $article_content."<tr><td>Adoptable</td><td>".$promocodes['type']."</td><td>".$promocodes['promocode']."</td></tr>";
            
$i++;
        } 
I don't know if that's the issue or not but that's how almost all the other loops in the script are set up so...
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
  #7  
Old 01-24-2011, 09:21 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,485
Hall of Famer is on a distinguished road
Default

Honestly I wonder too, it may seem that most coders never really pay much attention to acp. We'd rather directly add/modify script files or mysql tables at this moment, which is another reason why acp needs a serious overhaul. It's quite meaningless if using acp does not give an edge over manipulating phpmyadmin.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #8  
Old 01-24-2011, 09:44 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 31,868
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

I almost never use the ACP so that's why I never discovered the plugin thing. I have started an ACP overhaul project though... >.> more or less for a commission but I can release it here too.
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
  #9  
Old 01-24-2011, 09:58 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,506
fadillzzz is an unknown quantity at this point
Default

Quote:
Originally Posted by Kaeliah View Post
Is it repeating the adoptable type as well as the promocode?

You may want to replace the loop, give this a try:
PHP Code:
$i=0;
        while(
$i $num){
            
$article_content $article_content."<tr><td>Adoptable</td><td>".$promocodes['type']."</td><td>".$promocodes['promocode']."</td></tr>";
            
$i++;
        } 
I don't know if that's the issue or not but that's how almost all the other loops in the script are set up so...
Yes, it's repeating the type and the promo code and I already tried that loop before. Didn't work
Reply With Quote
  #10  
Old 01-24-2011, 10:06 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 31,868
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

I think I see the error...

Just replace everything on that page between the End Prepwork and Begin Template with this:

PHP Code:
if($isloggedin == "yes"){

    
$group getgroup();
    
$cancp cancp($group);

    if(
$cancp == "yes"){
    
        
$article_title "Promo Codes";
        
$article_content "<table width='400' border='1'><tbody><tr><td><b>Type</b></td><td><b>Reward</b></td><td><b>Promo Code</b></td></tr>";
        
        
$query "SELECT * FROM " .$prefix "adoptables WHERE whenisavail='promo'";
        
$result mysql_query($query);
        
$num mysql_num_rows($result);
        
        
$i=0;
        while(
$i $num){
            
$promocodes = @mysql_result($result,$i,"promocode");
            
$type = @mysql_result($result,$i,"type");
            
            
$article_content $article_content."<tr><td>Adoptable</td><td>".$type."</td><td>".$promocodes."</td></tr>";
            
$i++;
        }
        
        
$article_content $article_content."</tbody></table>";
    }else{
     
        
$article_title "Access Denied";
        
$article_content "Access Denied";
        
    }
    

The issue is $i is not involved in the array, so it's only reading the first row. I'm not great with arrays so I just reverted it to results...
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Promocodes can be claimed more than 1 time. LucasA33 Questions and Supports 2 12-09-2012 01:52 PM
I can't make my adoptables show up/active! MintChip Questions and Supports 25 10-04-2012 09:45 PM
Multiple Alternate Image Plugin Kaeliah Mys v1.2.x Mods 40 03-25-2012 03:47 AM
EpicStats Plugin [by Kae] Kaeliah Mys v1.2.x Mods 9 04-10-2011 07:46 PM
Admins Can View All Active Promo Codes HIddenPanda Mys v1.1.x Mods 0 07-15-2010 06:55 PM


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

Currently Active Users: 440 (0 members and 440 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636