Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2012, 05:46 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,829
Tequila is on a distinguished road
Default Code Help for Events

I'm coding a few events (one is a continuous puzzle collecting event that updates once a month with a new puzzle) and want to have it set up so that once a user "finds" a piece it shows up on a new page (tentatively titled 'puzzle', it would show up as 'puzzle.php?user=$username') that's linked from their profile.

Once a puzzle is completed they should get an message from the system that congratulates them, and hands out a promo code for a limited edition adoptable (only two available per user).

Before I can get it ready I'll need to create the puzzle page that's linked, and a way to see what pieces users have in MySQL to check against my puzzle file (which you can see below).

How would I go about doing this? I'm a little lost on what I need to code.

(PS: My puzzle file which lists all parts of the puzzles)
PHP Code:
// **********************************************************************************
// Welcome to the puzzle piece randomizer
// This file will generate 15 pieces of puzzles based on the event and season names
// Pieces can be traded in our forums to complete puzzles at any time
// So far our pieces are
// world, dusk, dawn, eclipse, seasons (spring, summer, fall, winter)
// Let's get this finished up then
// **********************************************************************************

<?php

    $digits 
= array {
        
"01.png",
        
"02.png",
        
"03.png",
        
"04.png",
        
"05.png",
        
"06.png",
        
"07.png",
        
"08.png",
        
"09.png",
        
"10.png",
        
"11.png",
        
"12.png",
        
"13.png",
        
"14.png",
        
"15.png",
    }

    
$event = array {
        
"world",
        
"dusk",
        
"dawn",
        
"eclipse",
    }

    
$season = array {
        
"spring",
        
"summer",
        
"fall",
        
"winter",
    }

?>
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #2  
Old 01-06-2012, 01:15 PM
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: 343,651
Hall of Famer is on a distinguished road
Default

Well to create a subpage in a script file, the easiest way is to define variables such as $page, $act or $more as super global array $_GET['page'], $_GET['act'], or $_GET['more']. This way you can continue to create a PHP form that direct the user to a certain page under certain conditions. The page and url info is stored in the super global $_GET, and thus can be readily extracted to use.

A very good example is account.php, in which the variable $act can have several values, each leading to a different subpage that users can edit their account info. A problem arises if you are creating a game script incase you do not want users to be able to cheat with the 'refresh' and 'back' button. The manipulation of PHP session variables will resolve this issue, but for now its your best interest not to worry about it till later.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


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
Looking for someone to code for me :) Infernette Staff Central 33 02-03-2014 04:44 PM
PHP Code. Aasixx Questions and Supports 2 09-17-2012 05:15 PM
Could some one code this..? Abronsyth Questions and Supports 5 04-13-2012 07:27 PM
Invite Code/Alpha Code Shex Questions and Supports 0 03-07-2011 04:08 AM
Need a code to vote Cosma Questions and Supports 0 01-25-2010 04:24 PM


All times are GMT -5. The time now is 05:24 AM.

Currently Active Users: 9863 (0 members and 9863 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