Talk Arcades: Forum for Arcade Webmasters    

  Talk Arcades > Arcades > Scripts & Software > onArcade

Welcome to Talk Arcades, the premier forum for arcade webmasters.

You are currently viewing our boards as a guest. By joining our community you will be able to make posts, communicate privately with other arcade webmasters and participate in our Live Marketplace. Registration is easy, so please join us today!

Reply
 
LinkBack Thread Tools Display Modes
Old 06-15-2006, 11:42 PM   #1 (permalink)
admin
Preferred Member
 
Join Date: May 2006
Location: Planet Earth
Posts: 190
admin is on a distinguished road
Send a message via MSN to admin


Default OA Hack: Featured Game Hack

Depending on the the location you want to place this hack; just change the spot you put the codes for the menu.html page...

To add this hack to your site do the following:

Create a file and name it something you'll rememeber -- in that file put(MUST PUT THIS FILE IN YOUR ROOT DIRECTORY OF OnArcade):

PHP Code:
<?
include("includes/config.php");

$new_table "CREATE TABLE `featured_game` (
  id int(5) NOT NULL,
  fileid varchar(200) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;"
;
$result mysql_query($new_table) or die(mysql_error());
if (
$result) {
    
$insertGame mysql_query("INSERT INTO `featured_game` SET id = '1', fileid = '1'");
    echo 
"Featured Game DB Structure Is Installed!";
} else {
    echo 
"Failed to Connect to DB to install Featured Game DB Structure";
}
?>
You can skip this if you wish to just run the commands manually.. Run the following commands VIA MYSQL If you DO NOT WANT TO CREATE THAT FILE AND RUN IT -- DO NOT DO BOTH!!!:

PHP Code:
INSERT INTO `featured_gameSET id '1'fileid '1';

CREATE TABLE `featured_game` (
   
id int(5NOT NULL,
   
fileid varchar(200NOT NULL default '',
   
PRIMARY KEY  (id)
 ) 
TYPE=MyISAM
Add the following to (I placed just under the games list, you can place this anywhere): \templates\default\menu.html

PHP Code:
<div class="contentbox">
  <div class="contentheader">
   Featured Game
  </div>
   <div class="boxestext">
   <?php displayFeaturedGame(); ?>
   </div>
 </div>
Next, Add the following to \includes\functions.php

PHP Code:
// Featured Game Plugin
// Created by Robert Maltby
// TalkArcades.com
function displayFeaturedGame() {
    $query = "SELECT * FROM `featured_game` WHERE id = '1' LIMIT 1";
    $game = mysql_query($query);
    
    if($game) {
        $row = mysql_fetch_assoc($game);
        $fileid = $row['fileid'];
        $infoQuery = "SELECT * FROM `files` WHERE `fileid` = '".$fileid."' LIMIT 1";
        $infoResult = mysql_query($infoQuery);
        if($infoResult) {
            $row2 = mysql_fetch_assoc($infoResult);
            $imageurl = $siteurl."/files/image/".$row2['icon'];
            $filetitle = $row2['title'];
            $filedescription = $row2['description'];  
?>
            <table class="boxestext" border="0" width="100%">
                          <tr>
                <td width="71" valign="top" align="center">
                <a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self"><img src="<?php echo $imageurl?>" width="70" height="59" title="<?php echo $filetitle?>" alt="<?php echo $filetitle?>" border="0"></a><br /><br />
<a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self" class="gamelink"><?php echo $filetitle?></a>
</td>
                <td valign="top">
                <?php echo $filedescription?><br />
                </td>
              </tr>
            </table>

<?      
        
} else {
            
$noGame "There is no Features Game at this time";
            return 
$noGame;
        } 
    } else {
        
$noGame "There is no Features Game at this time";
        return 
$noGame;
    }
}
//End FGP
For the Admin Integration; Find the following in \admin\games.php:

PHP Code:
?>
  <tr bgcolor="<?php echo $rowbgcolor?>">
  <td><?php echo $filetitle?></td><td align="center"><?php echo $categoryname?></td><td align="center"><?php echo $filetype?></td><td align="center"><?php echo $dateadded?></td><td align="center"><?php echo $filestatus?></td><td align="center"><a href="index.php?action=editgame&gameid=<?php echo $fileid?>" style="color: #003366;">Edit</a> - <a href="index.php?action=comments&fid=<?php echo $fileid?>" style="color: #003366;">Comments</a> - <a onclick='return confirmDelete()' href="index.php?action=deletegame&gameid=<?php echo $fileid?>" style="color: #003366;">Delete</a></td>
  </tr>
<?php
}
}
?>
</table>
Replace That with:

PHP Code:
// Featured Game Plugin
        $FGAQuery = "SELECT * FROM `featured_game` WHERE id = '1' LIMIT 1";
        $FGAResult = mysql_query($FGAQuery);
        $FGARow = mysql_fetch_assoc($FGAResult);
        if($FGAResult) {
            $FGAGameID = $FGARow['fileid'];
        } else {
            $FGAGameID = "";
        }
        if($FGAGameID == $fileid) {
?>
  <tr bgcolor="<?php echo $rowbgcolor?>">
  <td><font style="color:#FF0000; font-weight:bold;"><?php echo $filetitle?></font></td><td align="center"><?php echo $categoryname?></td><td align="center"><?php echo $filetype?></td><td align="center"><?php echo $dateadded?></td><td align="center"><?php echo $filestatus?></td><td align="center"><a href="index.php?action=editgame&gameid=<?php echo $fileid?>" style="color: #003366;">Edit</a> - <a href="index.php?action=comments&fid=<?php echo $fileid?>" style="color: #003366;">Comments</a> - <a onclick='return confirmDelete()' href="index.php?action=deletegame&gameid=<?php echo $fileid?>" style="color: #003366;">Delete</a></td>
  </tr>
<?php
 
} else {
?>
  <tr bgcolor="<?php echo $rowbgcolor?>">
  <td><?php echo $filetitle?></td><td align="center"><?php echo $categoryname?></td><td align="center"><?php echo $filetype?></td><td align="center"><?php echo $dateadded?></td><td align="center"><?php echo $filestatus?></td><td align="center"><a href="index.php?action=editgame&gameid=<?php echo $fileid?>" style="color: #003366;">Edit</a> - <a href="index.php?action=comments&fid=<?php echo $fileid?>" style="color: #003366;">Comments</a> - <a onclick='return confirmDelete()' href="index.php?action=deletegame&gameid=<?php echo $fileid?>" style="color: #003366;">Delete</a></td>
  </tr>
<?php
 
}        
// End FGP

}
}
?>
</table>
We're Almost done, just 2 files left

In \admin\editgame.php, on line 27 you'll see a BLANK LINE.. Just add the following to it:

PHP Code:
// Featured Game Stuff
        // Featured Game Plugin
        
$FGAQuery "SELECT * FROM `featured_game` WHERE id = '1' LIMIT 1";
        
$FGAResult mysql_query($FGAQuery);
        
$FGARow mysql_fetch_assoc($FGAResult);
        if(
$FGAResult) {
            
$featured $FGARow['fileid'];
        } else {
            
$featured "";
        }
    
// End FGS 
Later on down that file, you'll see a large chunk of a Form.. Add the following where ever you please (I put it just after the Status part and just before the submit button)

PHP Code:
<?
  
// Featured Game Plugin -> EDIT GAME FORM
   
?>
  <tr>
  <td width="20%" valign="top">Featured Game?:</td><td width="80%"><select name="featured"><option value="1" <?php if ($featured == $fileid) { echo "selected"; } ?>>Yes</option><option value="0" <?php if ($featured != $fileid) { echo "selected"; } ?>>No</option></select></td>
  </tr>
  <?
  
// End FGP
  
?>
Last but not least, on \admin\index.php Find:

PHP Code:
} elseif ($action == 'updategame') {
    
$gameid $_POST[gameid];
    
$gametitle $_POST[name];
    
$gamedescription $_POST[description];
    
$gamekeywords $_POST[keywords];
    
$gamecategory $_POST[category];
    
$gamewidth $_POST[width];
    
$gameheight $_POST[height];
    
$gamefiletype $_POST[gamefiletype];
    
$gamefile $_POST[gamefile];
    
$gamefilelocation $_POST[filelocation];
    
$gameimage $_POST[gameimage];
    
$gameimagelocation $_POST[imagelocation];
    
$gamefilestatus $_POST[filestatus]; 
and Add this just after that:

PHP Code:
// Featured Game Plugin
    
if($_POST['featured'] == 1) {
    
$query "UPDATE `featured_game` SET fileid = '$gameid' WHERE id = '1'";
    
//echo $query;
        
$updateFG mysql_query($query);
    }
    
// END FGP 
Hope you like my Hack

Btw; V12Kid, this one is for you
admin is offline  
Digg this Post!
Reply With Quote
Old 06-16-2006, 11:14 AM   #2 (permalink)
v12kid
Preferred Member
 
v12kid's Avatar
 
Join Date: Jun 2006
Posts: 178
v12kid is on a distinguished road
Send a message via AIM to v12kid Send a message via MSN to v12kid Send a message via Skype™ to v12kid


Default

awesome hack!
__________________
The Boss Is Away!
v12kid is offline  
Digg this Post!
Reply With Quote
Old 06-19-2006, 01:14 PM   #3 (permalink)
Creature
Preferred Member
 
Join Date: Jun 2006
Posts: 136
Creature is on a distinguished road


Default

Great hack.

Thanks a lot man
__________________
www.cheatstomb.com The place for your cheats
Join the Best Webmasters Forum and chat with other webmasters.
www.bestforumer.com
Creature is offline  
Digg this Post!
Reply With Quote
Old 06-19-2006, 11:42 PM   #4 (permalink)
Matsta
Senior Member
 
Matsta's Avatar
 
Join Date: Jun 2006
Location: In a box!
Posts: 208
Matsta is on a distinguished road
Send a message via ICQ to Matsta Send a message via AIM to Matsta Send a message via MSN to Matsta Send a message via Yahoo to Matsta Send a message via Skype™ to Matsta


Default

Wat does it do exactly. OA starting to look like moddin ipb if you kno what i mean!
__________________
Matsta
i9Host can offer up to 5GIG of space and 75GIG bandwith with NO ADS
Matsta Galaxy Arcade Rocketproxy Nosforums
Dues X


Matsta is offline  
Digg this Post!
Reply With Quote
Old 06-22-2006, 07:16 PM   #5 (permalink)
Duality
Preferred Member
 
Join Date: Jun 2006
Posts: 185
Duality is on a distinguished road


Default

Are you allowed to put this hack out in accordance to OA? I thought that by showing a hack like this publicly, would give people an idea of how the script actually is.
Duality is offline  
Digg this Post!
Reply With Quote
Old 06-25-2006, 09:51 AM   #6 (permalink)
admin
Preferred Member
 
Join Date: May 2006
Location: Planet Earth
Posts: 190
admin is on a distinguished road
Send a message via MSN to admin


Default

Licenses have been ordered in compliance to those sites..
admin is offline  
Digg this Post!
Reply With Quote
Old 06-25-2006, 11:49 AM   #7 (permalink)
Duality
Preferred Member
 
Join Date: Jun 2006
Posts: 185
Duality is on a distinguished road


Default

How come you didn't have the licenses before? Just curious.
Duality is offline  
Digg this Post!
Reply With Quote
Old 06-25-2006, 12:06 PM   #8 (permalink)
admin
Preferred Member
 
Join Date: May 2006
Location: Planet Earth
Posts: 190
admin is on a distinguished road
Send a message via MSN to admin


Default

I was Actually trying to get a SERVER-WIDE License from Hans.. During the process of negiotating terms.. I decided to pre-launch the sites running on 1 DB --I should have waited, thats true, but I was anxious to get the ball rolling as my other arcades are starting to get into 20-30.00 daily now
admin is offline  
Digg this Post!
Reply With Quote
Old 06-25-2006, 12:29 PM   #9 (permalink)
Duality
Preferred Member
 
Join Date: Jun 2006
Posts: 185
Duality is on a distinguished road


Default

Can you teach me your ways? Lol.
Duality is offline  
Digg this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arcade Script Reviews arcadillo Scripts & Software 6 08-08-2008 02:35 AM
1500 games for GameSiteScript with SQL database for $10 ArcadeMan GameSiteScript 1 05-10-2007 10:56 AM
Have an Arcade? Need Games? 2229 Games Inside!!! admin Game Packs 3 09-15-2006 10:30 AM
Nintendo Cleans Up @ Game Critics Awards Creature The Lounge 0 06-20-2006 06:55 AM
GameSiteScript Arcade Game Packs As Low As $0.045/GAME!! admin Game Packs 3 06-19-2006 04:34 AM


All times are GMT -6. The time now is 12:50 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6
© TalkArcades.com
Forum - Register - Calendar - Memberlist - FAQ - Search