Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-19-2011, 03:50 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: 110,014
Tequila is on a distinguished road
Default [WIP]Reward System and Games

First off a Disclaimer these are modifications of existing php stuff. I'm all right with tricking them to work in certain environments, but cannot get them to function at all with the Mys script yet.

Mod 01: Reward System
Inspired by Online Trading Card Games like MissingNO (tell them Sidiko sent you), original script from In The Cards.
So far all I'm getting are errors. I have a feeling that we'll have to add stuff into the functions of the script to get this to work.

Current Code
PHP Code:
<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads getads("any");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************



// **********************************************************************
// Let's Set up the Rewards for the games
//
// This works great when you're giving out items and such along with money
// What will you use?  Please feel free to ask < enddayne > on how to
// Modify this script on the forum :)
// **********************************************************************
// First We'll Get The Money and Run...
// **********************************************************************

$query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);
                  
$i 0;
while (
$i 1) {
$dollar = @mysql_result($result$i"dollar");
                      
// Change this number 10 to the number of currency you want users to earn on level up  
$amount rand(515);
$newbalance $dollar $amount;
                      
$i++;
}
                  
mysql_query("UPDATE `adopts_users` SET `dollar`='" $newbalance "' WHERE `username`='$loggedinname'");

// **********************************************************************
// Let's add the items in next, may also work for decorations... eventaually
// **********************************************************************
function randomImage $array ) {
$total count($array);
$call rand(0,$total-1);
return 
$array[$call];
}
$items = array (
'items/bomb.png',
'items/cake.png',
'items/controller.png',
'items/guitar.png',
'items/heaphones.png'
);

// **********************************************************************
// Use the above syntax when adding more items to the script
// **********************************************************************


$article_title $article_title."Reward"
$article_content $article_content "<div align='center'><br />You have earned "$amount ." Dollars for leveling up this Adoptable. <br />You now have  " $newbalance " Dollars.
You have also gained the following item from playing the game.<br />
<img src='"
.randomImage($items)." alt='Prize'></div>;"

// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file $themeurl;

// Do the template changes and echo the ready template
$template file_get_contents($file);

$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);

$template replace(':BROWSERTITLE:',$browsertitle,$template);
$template replace(':SITENAME:',$sitename,$template);

//Define our links
$template replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar getsidebar();
$template replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template replace(':ADS:',$ads,$template);

//Get the slogan info
$template replace(':SLOGAN:',$slogan,$template);


echo 
$template;

// **********************************************************************
// End Template Definition
// **********************************************************************



?>
We're logging the following error at the moment:
Quote:
Parse error: syntax error, unexpected T_VARIABLE in /home/enddayne/public_html/devdemo/reward.php on line 123
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]

Last edited by Tequila; 01-19-2011 at 03:51 PM. Reason: PHP is not a Quote...
Reply With Quote
 


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
So Many Games Kyttias Other Chat 2 03-10-2015 11:21 PM
Games? RoconzaArt Questions and Supports 3 02-20-2011 06:35 PM
Reward Message Character Count - answered, thank you! we are halloween Questions and Supports 3 09-26-2010 08:43 AM
Games With the Cash System redheadturkey Suggestions and Feature Requests 8 08-27-2010 04:37 AM


All times are GMT -5. The time now is 01:09 AM.

Currently Active Users: 1211 (0 members and 1211 guests)
Threads: 4,081, Posts: 32,032, 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