News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF Arcade

Started by niko, October 01, 2004, 02:45:55 PM

Previous topic - Next topic

geo32101

Quote from: TrueSatan on December 23, 2007, 07:26:48 PM
Go back to Bigguy's advice that you quoted above and try to re-install the arcade.
I tries to install it again, but it keeps telling me to fill out the FTP Thing, I do, and click proceed, but nothing happens.

peterpan72

Ive installed the latest Mod from the Support site to my SMF 1.1.4 says everything is fine when I up loaded all the files, but there are no Tabs or options with Arcade on, can any1 help please

TrueSatan

Quote from: geo32101 on December 23, 2007, 08:05:03 PM
Quote from: TrueSatan on December 23, 2007, 07:26:48 PM
Go back to Bigguy's advice that you quoted above and try to re-install the arcade.
I tries to install it again, but it keeps telling me to fill out the FTP Thing, I do, and click proceed, but nothing happens.
You need to go to ACP>Packages>Options>Installation Options and set the fields according to your hosting details then on the same page go to Cleanup Permissions and select All files Writeable and run the cleanup...check via ftp that CHMOD of all your files is now 777 or 775 according to the peculiarities of your hosting and if not recheck the settings you made in Installation Options and run the cleanup again...continue as needed until you get the right settings.

The liklihood is that the details you gave the system for your ftp settings weren't correct...note it's the local path to SMF that you need to provide...this may take a form similar to:

/home/yourftpserver/yourftpaccount/yoursite.com/yourSMFdirectory

@ NoDrAmaUk

If you aren't using the SMF default theme you will need to manually install into your custom theme.

geo32101

What do you mean by all my files?

Also I did it, but it tells me to fill out the FTP thing, and I do, but nothing happens again.

TrueSatan

The only time I mentioned anythign similar was as "All files Writeable" which is the setting you should select...and that "nothing happens" tells you that the ftp details you have entered aren't correct.

ne.miguelito

in Forum Error Log no cp they appear these errors:

http://ne-miguelito.freealoja.com/index.php?action=arcade

8: Undefined variable: last
Ficheiro: /home/nemigue/public_html/Themes/default/ArcadeMenu.template.php (main_above sub template - eval?)
Linha: 677



http://ne-miguelito.freealoja.com/index.php?action=arcade

8: Undefined variable: first
Ficheiro: /home/nemigue/public_html/Themes/default/ArcadeMenu.template.php (main_above sub template - eval?)
Linha: 674


how to solve this?

ne.miguelito

I already got to solve...

geo32101

Quote from: TrueSatan on December 24, 2007, 04:08:51 AM
The only time I mentioned anythign similar was as "All files Writeable" which is the setting you should select...and that "nothing happens" tells you that the ftp details you have entered aren't correct.
Ok, I put all files writable, and did everything you told me, I also made sure everything was correct, but still nothing.

TrueSatan

So as per my post #3006 above:

Quotecheck via ftp that CHMOD of all your files is now 777 or 775 according to the peculiarities of your hosting

If, as you say, you've followed all the advice I gave you you will already have checked the above...are all your files CHMOD 777 or 775?

If your files are CHMOD 777 or 775  have you then, as per post #3003, tried to install the mod?

ne.miguelito

when I click in Statistics on arcade appears this error on  Forum Error Log:

http://ne-miguelito.freealoja.com/index.php?action=arcade;sa=stats
8: Undefined variable: where
Ficheiro: /home/nemigue/public_html/Sources/ArcadeStats.php
Linha: 233

my ArcadeStats.php

<?php
/*******************************************************************************
* SMF Arcade 2.0.8 (http://www.smfarcade.info)                                 *
* Copyright (C) 2004-2007  Niko Pahajoki (http://www.madjoki.com)              *
* This program is free software; you can redistribute it and/or modify         *
* it under the terms of the GNU General Public License as published by         *
* the Free Software Foundation; either version 2 of the License, or            *
* (at your option) any later version.                                          *
*                                                                              *
* This program is distributed in the hope that it will be useful,              *
* but WITHOUT ANY WARRANTY; without even the implied warranty of               *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                *
* GNU General Public License for more details.                                 *
*                                                                              *
* You should have received a copy of the GNU General Public License            *
* along with this program; if not, write to the Free Software                  *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
********************************************************************************
* ArcadeStats.php                                                              *
********************************************************************************/

if (!defined('SMF'))
die('Hacking attempt...');

/*
void ArcadeStats()
- ...

array ArcadeStats_BestPlayers([count = 10])
- ...

array ArcadeStats_LongestChampions([count = 10], [time])
- ...

array ArcadeStats_MostActive([count = 10], [time])
- ...

array ArcadeStats_MostPlayed([count = 10], [time])
- ...

array ArcadeStats_Rating([count = 10])
- ...

string format_time_ago(timestamp)
- Formats time to xxx ago

*/

function ArcadeStats()
{
global $txt, $context;

$context['sub_template'] = 'arcade_statistics';
$context['page_title'] = $txt['arcade_stats_title'];

// Load data using functions
$context['arcade']['statistics']['play'] = ArcadeStats_MostPlayed();
$context['arcade']['statistics']['active'] = ArcadeStats_MostActive();
$context['arcade']['statistics']['rating'] = ArcadeStats_Rating();
$context['arcade']['statistics']['champions'] = ArcadeStats_BestPlayers();
$context['arcade']['statistics']['longest'] = ArcadeStats_LongestChampions();

}

function
ArcadeStats_MostPlayed($count = 10)
{
// Returns most playd games
global $db_prefix, $scripturl;

$results = db_query("
SELECT game.ID_GAME, game.gameName, game.gameRating, game.numPlays
FROM
{$db_prefix}arcade_games AS game
ORDER BY game.numPlays DESC
LIMIT 0,
$count", __FILE__, __LINE__);

$top = array();
$max = -1;

while ($score = mysql_fetch_assoc($results))
{
if ($max == -1)
$max = $score['numPlays'];
if ($max == 0)
return false; // No one has played games yet0

$top[] = array(
'id' => $score['ID_GAME'],
'name' => $score['gameName'],
'link' => '<a href="' . $scripturl . '?action=arcade;sa=play;game=' . $score['ID_GAME'] . '">' .  $score['gameName'] . '</a>',
'rating' => $score['gameRating'],
'plays' => $score['numPlays'],
'precent' => ($score['numPlays'] / $max) * 100,
);
}

if (count($top) == 0)
return false;
elseif ($count > 1)
return $top;
else
return $top[0];
}

function
ArcadeStats_Rating($count = 10)
{
global $db_prefix, $scripturl;

$results = db_query("
SELECT game.ID_GAME, game.gameName, game.gameRating, game.numPlays
FROM
{$db_prefix}arcade_games AS game
WHERE gameRating > 0
ORDER BY game.gameRating DESC
LIMIT 0,
$count", __FILE__, __LINE__);

$top = array();
$max = -1;

while ($score = mysql_fetch_assoc($results))
{
if ($max == -1)
$max = $score['gameRating'];

$top[] = array(
'id' => $score['ID_GAME'],
'name' => $score['gameName'],
'link' => '<a href="' . $scripturl . '?action=arcade;sa=play;game=' . $score['ID_GAME'] . '">' .  $score['gameName'] . '</a>',
'rating' => $score['gameRating'],
'plays' => $score['numPlays'],
'precent' => ($score['gameRating'] / $max) * 100,
);
}

if (count($top) == 0)
return false;
elseif ($count > 1)
return $top;
else
return $top[0];
}

function
ArcadeStats_BestPlayers($count = 10)
{
// Returns best players by count of champions
global $db_prefix, $scripturl, $txt;

$results = db_query("
SELECT count(*) AS champions, IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem.realName, '') AS realName
FROM
{$db_prefix}arcade_games AS game
LEFT JOIN
{$db_prefix}members AS mem ON (mem.ID_MEMBER = game.ID_MEMBER_CHAMPION)
WHERE ID_CHAMPION_SCORE > 0
GROUP BY game.ID_MEMBER_CHAMPION
ORDER BY champions DESC
LIMIT 0,
$count", __FILE__, __LINE__);

$top = array();
$max = -1;

while ($score = mysql_fetch_assoc($results))
{
if ($max == -1)
$max = $score['champions'];

$top[] = array(
'name' => $score['realName'],
'link' => !empty($score['realName']) ? '<a href="' . $scripturl . '?action=profile;u=' . $score['ID_MEMBER'] . '">' .  $score['realName'] . '</a>' : $txt['arcade_guest'],
'champions' => $score['champions'],
'precent' => ($score['champions'] / $max) * 100,
);
}

if (count($top) == 0)
return false;
elseif ($count > 1)
return $top;
else
return $top[0];
}

function
ArcadeStats_MostActive($count = 10, $time = -1)
{
// Returns most active players
global $db_prefix, $scripturl, $txt;

$results = db_query("
SELECT count(*) AS scores, IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem.realName, '') AS realName
FROM
{$db_prefix}arcade_scores AS score
LEFT JOIN
{$db_prefix}members AS mem ON (mem.ID_MEMBER = score.ID_MEMBER)
GROUP BY score.ID_MEMBER
ORDER BY scores DESC
LIMIT 0,
$count", __FILE__, __LINE__);

$top = array();
$max = -1;

while ($score = mysql_fetch_assoc($results))
{
if ($max == -1)
$max = $score['scores'];

$top[] = array(
'name' => $score['realName'],
'link' => !empty($score['realName']) ? '<a href="' . $scripturl . '?action=profile;u=' . $score['ID_MEMBER'] . '">' .  $score['realName'] . '</a>' : $txt['arcade_guest'],
'scores' => $score['scores'],
'precent' => ($score['scores'] / $max) * 100,
);
}

if (count($top) == 0 || $count == 1)
return false;
elseif ($count > 1)
return $top;
else
return $top[0];
}

function
ArcadeStats_LongestChampions($count = 10, $time = - 1)
{
global $db_prefix, $scripturl, $txt;

if ($time == 'current')
$where = '
AND championTo = 0'
;
elseif ($time != -1)
$where = "
AND championFrom >
$time";

$results = db_query("
SELECT game.ID_GAME, game.gameName,
IF(championFrom > 0, (IF(championTo = 0, UNIX_TIMESTAMP(), championTo) - championFrom), 0) AS championDuration,
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem.realName, '') AS realName, IF(championTo = 0, 1, 0) AS current
FROM (
{$db_prefix}arcade_scores AS score, {$db_prefix}arcade_games AS game)
LEFT JOIN
{$db_prefix}members AS mem ON (mem.ID_MEMBER = score.ID_MEMBER)
WHERE game.ID_GAME = score.ID_GAME
{$where}
HAVING championDuration > 0
ORDER BY IF(championFrom > 0, (IF(championTo = 0, UNIX_TIMESTAMP(), championTo) - championFrom), 0) DESC
LIMIT
$count", __FILE__, __LINE__);

$top = array();
$max = -1;

while ($score = mysql_fetch_assoc($results))
{
if ($max == -1)
$max = $score['championDuration'];

$top[] = array(
'game_name' => $score['gameName'],
'game_link' => '<a href="' . $scripturl . '?action=arcade;sa=play;game=' . $score['ID_GAME'] . '">' .  $score['gameName'] . '</a>',
'member_name' => $score['realName'],
'member_link' => !empty($score['realName']) ? '<a href="' . $scripturl . '?action=profile;u=' . $score['ID_MEMBER'] . '">' .  $score['realName'] . '</a>' : $txt['arcade_guest'],
'duration' => format_time_ago($score['championDuration']),
'precent' => ($score['championDuration'] / $max) * 100,
'current' => $score['current'] == 1,
);
}

if (count($top) == 0)
return false;
elseif ($count > 1)
return $top;
else
return $top[0];
}

function
format_time_ago($timestamp)
{
global $txt;
// Returns formated string

$yksikot = array(
array(604800, $txt['arcade_weeks']), // Seconds in week
array(86400, $txt['arcade_days']), // Seconds in day
array(3600, $txt['arcade_hours']), // Seconds in hour
array(60, $txt['arcade_mins']), // Seconds in minute
);

if ($timestamp < 60)
return $txt['arcade_under_minute_ago'];

$text = '';

foreach( $yksikot as $t )
{
$tassa = floor($timestamp / $t[0]);

if ( $tassa > 1 )
{
$text .= $tassa . ' '. $t[1];
$text .= ' ';

$timestamp = $timestamp - ($t[0] * $tassa);
}
}

return trim($text);

}
?>



somebody can help

please...

TrueSatan

Please upgrade your arcade to the latest version, 2.0.11, and then see if the problem persists...it may well have already been fixed in an earlier release after that which you have installed.

ne.miguelito

My version is 2.0.11,

TrueSatan

Sorry...the 3rd line of the php file you quoted misled me. If you switch to English language (not English utf8) do the errors persist? If they don't then the translation of the mod would appear to be at fault.

geo32101

Quote from: TrueSatan on December 24, 2007, 08:05:09 PM
So as per my post #3006 above:

Quotecheck via ftp that CHMOD of all your files is now 777 or 775 according to the peculiarities of your hosting

If, as you say, you've followed all the advice I gave you you will already have checked the above...are all your files CHMOD 777 or 775?

If your files are CHMOD 777 or 775  have you then, as per post #3003, tried to install the mod?
I have also done that.

fwitt

#3014
ne.miguelito this issue has already been solved at http://www.smfarcade.info/index.php/topic,3383.0.html

ne.miguelito


Skhilled

Most of the errors and utf8 support has been added to version 2.0.12.

http://www.smfarcade.info/index.php/topic,3593.0.html

Ertado

I tried searching the forums for an answer to this problem with no success. When I am adding games to the arcade, I can only add them as disabled and then enable them individually. When I try to add them as enabled, I get this error:

No files selected!

I don't think it's practical to add large numbers of games without resolving this first so any help is appreciated.

rider

Quote from: Ertado on December 30, 2007, 04:59:22 AM
I tried searching the forums for an answer to this problem with no success. When I am adding games to the arcade, I can only add them as disabled and then enable them individually. When I try to add them as enabled, I get this error:

No files selected!

I don't think it's practical to add large numbers of games without resolving this first so any help is appreciated.
1st off How are you installing them?Try this,unzip the games you have and you'll see the games are in a double folder.Thats the problem the arcade reads the 1st folder and doesn't see the games in the original folder.Unzip the games then just highlight the games and re-zip just the games.Then try and install  the new zipfile.Should take care of the no files selected error.

Ertado

Well actually, I can't install from zip files on my server so I unzip them beforehand, upload them to the games directory then add them through the admin section. Is there a way to make the install as enabled thing work with them this way?

Advertisement: