Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Content Managament Systems
Reload this Page How do I get a mochi feed to work on my site?
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
Imozeb is on a distinguished road
 
Posts: 13
Join Date: Mar 2012
Default How do I get a mochi feed to work on my site? - 04-16-2012, 01:47 AM

I am trying to use ProArcadeScript to import my games from Mochimedia. How do I do this?

My site is: http://thethoughttreasury.host56.com/
My host is: http://members.000webhost.com/login.php
The instructions for the script is: http://proarcadescript.com/manual/mochi-games/

The script they want me to use and edit is:

<?php
/************************************************** *****************
/ ProArcadeScript
/ File description:
/ MochiAds game feeds reader for cron jobs
/ parameters
/ user: your username used to access admin cp
/ password: your admin password
/ rating: (all, everyone, teen, mature) restrict the game feed
to only containing a particular content rating
/ category: slug of any category to limit the type of games in the feed
/ tags: (comma-separated list of tags) used to filter results
returned by mochi server
/ games: limit the number of games in the feed
/ skip: offset parameter to fetch older games in smaller chunks
/
/ sample: GET "mochicron.php?user=admin&password=secret&rating=a ll&games=5"
/ sample: GET "mochicron.php?user=admin&password=secret&games=10 0&skip=100"
/ sample: GET "mochicron.php?user=admin&password=secret&games=10 0&tags=card,casino"
/ sample: GET "mochicron.php?user=admin&password=secret&games=10 0&category=Board%20Game"
/ **Mine: GET "http://thethoughttreasury.host56.com/admin/mochicron.php?user=USER&password=PASS!&rating=teen &category=Strategy&tags=Strategy&games=50"**
/
/************************************************** *****************/
require( '../include/config.php' );
require( '../include/helpers.php' );
require( '../include/class.Database.php' );
require( '../include/class.Cache.php' );
require( 'mochiimporter.php' );

// make sure the script is called by the same server
if( $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] )
{
echo( 'This script is not for direct access. You should setup a cron job for running it!' );
exit();
}

// check username/password
if( ($_GET['user'] != $cSite['sAdminName']) || (md5($_GET['password']) != $cSite['sAdminPassword']) )
{
echo( 'Error: wrong username or password.' );
exit();
}

// Init key objects
$db = new CDatabase( $cMain["dbUser"], $cMain["dbPassword"], $cMain["dbName"], $cMain["dbHost"], 0 );
if( !$db )
{
echo( 'Error: Can\'t init database.');
exit();
}

$cache = new CCache();
if( !$cache )
{
echo( 'Error: Can\'t init cache.');
exit();
}

// check database for compatibility
$res = $db->query( 'SELECT * FROM '.$cMain['dbPrefix'].'games LIMIT 1' );
$fields = $db->get_result_fields( $res );
$fieldNames = array();
foreach($fields as $field )
$fieldNames[] = $field->name;
if( !in_array('coins_revshare_enabled', $fieldNames) )
{
echo( 'Error: database structure is obsolete, please open the "Content->Mochi Games" admin cp\'s page in your browser.' );
exit();
}

// init settings array
**$settings = array(
'publisher_id' => 'MYID',
'rating' => 'teen',
'category' => 'strategy',
'tags' => '',
'import_games' => 30,
'import_skip' => 0,
);**

$savedSettings = $db->super_query('SELECT * FROM '.$cMain['dbPrefix'].'mochisettings LIMIT 1', false);
if( empty($savedSettings['publisher_id']) )
{
echo( 'Publisher ID is not set. Please check the settings on the "Content->Mochi Games" page inside your admin cp.' );
exit();
}

$settings['publisher_id'] = $savedSettings['publisher_id'];
$settings['rating'] = $_GET['rating'];
$settings['category'] = mysql_escape_string($_GET['category']);
$settings['tags'] = mysql_escape_string($_GET['tags']);
$settings['import_games'] = $_GET['games'];
$settings['import_skip'] = $_GET['skip'];

// import games!
$timeStart = time();
list( $addedGames, $skippedGames, $message ) = importMochiGames( $db, $settings, true );
$timeResult = time() - $timeStart;


// Assemble report message
if( is_array($addedGames) )
$message .= ' ' . count($addedGames) . ' games added; ';
if( is_array($skippedGames) )
$message .= count($skippedGames) . ' games skipped; ';
$message .= "Spent $timeResult seconds.";

$output = "Import Results:
------------------------------------------------
$message


";

$gotGames = false;
if( count($addedGames) > 0 )
{
$output .= 'Added games:
------------------------------------------------
';
$gotGames = true;
foreach( $addedGames as $game )
$output .= "$game
";
$output .= '

';
}

if( count($skippedGames) > 0 )
{
$output .= 'Skipped games:
------------------------------------------------
';
$gotGames = true;
foreach( $skippedGames as $game )
$output .= "$game
";
$output .= '

';
}

if( !$gotGames )
$output .= 'No games processed... check PAS-ERRORS.log for possible reason.';
echo( $output );
?>
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 4,231
Join Date: Jul 2011
Location: UK
Default 04-16-2012, 07:23 AM

Would that fall under this?
Quote:
7. We do not allow online gaming scripts such as ogame, mafia, etc.. (allowed if you upgrade account)
From here http://www.000webhost.com/includes/tos.php
Reply With Quote
(#3 (permalink))
Old
Junior Member
Imozeb is on a distinguished road
 
Posts: 13
Join Date: Mar 2012
Default 04-16-2012, 10:54 AM

Okay. I will upgrade.
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com