News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Arcade

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

Previous topic - Next topic

mrkid

How recent was the fix? I believe the download was less than a week ago.

Edit: Disregard, I see the change dates/times on the files.

Chen Zhen

GitHub let's you view the history so you can see info regarding changes.
ie. date/time, actual file edits and my comments regarding those changes to the arcade files.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

-Sas-

Quote from: vbgamer45 on May 27, 2017, 08:36:24 PM
Also note if you did the SMF 2.0.14 patch you need to add this code
Into Sources\Subs-Db-mysql.php  around line 910 for MYSQLI support
in Function private function replacement__callback($matches)


if ($matches[1] === 'query_see_game')
return $user_info['query_see_game'];
elseif ($matches[1] === 'query_see_match')
return $user_info['query_see_match'];
elseif ($matches[1] === 'query_arena_game')
return $user_info['query_arena_game'];


Hello! :)

A few days ago i upgraded my forum to SMF 2.0.14.  Unfortunately, Arcade does not work anymore because off this upgrade. When I
(or other members) go to the Arcade section off my forum, we get this text:

Er is een fout opgetreden! (Something went wrong)

Invalid value inserted or no type specified.

I have tried to find a solution in this topic and found the messega added in the quote above this message. I wonder if this is the solution of my problem. I found (by FTP) this file: Sources\Subs-Db-mysql.php , but now I do not quite understand where I have to add the code. If this is indeed the solution, can someone clarify this?

Shambles

Hi Sas

If you look for this bit of code in Subs-Db-mysql.php and add the recommended code just after it, you should be fine:

Code (Find) Select

/**
* Callback for preg_replace_callback on the query.
* It allows to replace on the fly a few pre-defined strings, for convenience ('query_see_board', 'query_wanna_see_board'), with
* their current values from $user_info.
* In addition, it performs checks and sanitization on the values sent to the database.
*
* @param $matches
*/
private function replacement__callback($matches)
{
global $db_callback, $user_info, $db_prefix;

list ($values, $connection) = $db_callback;
if (!is_object($connection))
db_fatal_error();

if ($matches[1] === 'db_prefix')
return $db_prefix;

if ($matches[1] === 'query_see_board')
return $user_info['query_see_board'];

if ($matches[1] === 'query_wanna_see_board')
return $user_info['query_wanna_see_board'];


-Sas-

Thanks a lot! Arcade is working again :D The text is a bit different in my file.... but the last part was the same, so i added the code there...and it works!  8)

mrkid

Everything is working fine, and scores are saving since the new files were loaded. But I'm getting an error now.

Undefined index: arcadeAltTheme

/xxxxxx/xxxxxxxxx/public_html/forum/Sources/ArcadeHooks.php

Here's the line. Is this for users choice of skins?

'condensed' => array($txt['arcadeAltTheme']),

Chen Zhen

That's a language string for one of the links in the Arcade admin subsection.

Look at line 322 from this link:
https://github.com/Underdog-01/SMF-Arcade-RC5/blob/master/language/english/ArcadeAdmin.english.php

It is defined in ArcadeAdmin.english.php
Make sure you are using the updated language files.
Test it on the default theme.

If you are using a custom theme, do not start copying files in that custom theme's folders such as languages.
If you have done this recently with older versions then remove those Arcade files from your custom themes.
Those language files should only be put into the default theme which the package manager takes care of.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

mrkid

Quote from: Chen Zhen on July 07, 2017, 10:31:15 PM

It is defined in ArcadeAdmin.english.php


Got it! I missed some files, as I only uploaded files newer than what I had installed.

Games work, scores save, and not a single error...all on 2.0.14. Excellent work! Just wish I hadn't deleted the 1200 games I had previously... :-[

Chen Zhen


Nice to hear it works well for you now.
Perhaps you should have backed-up your game directory prior messing with anything.
I lost the collection I had a while back when I bought a new PC & reinstalled the OS on the old one.
Pictures & music were a priority but I forgot about the games.. oops.
Oh well.. visit those IBP Arcade & SMF Arcade sites and download them all over again.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

mrkid

I deleted them, because I assumed flash was dead. I started on a mission to find HTML5 games, and ended back here. ;D

Chen Zhen

#5170
Atm I only have about 20 HTML5 games that have my save sub-routine applied to them.
It is fairly easy to implement as many of those type of games are written in javascript and HTML5.
I plan to add IBP's HTML5 save sub-routine prior to releasing a stable version.

There are some HTML5 games that work on mobile and desktop and others work on mainly one or the other (Imo due to touchscreen control versus keys).
That's one way where categories can come into use.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Biology Forums

Thanks for updating us!

Will these games allow for savable scores?

Chen Zhen


The games that I have added a save sub-routine for SMF Arcade will save score.
Only 2 are available at the moment from Doc Skillz arcade test site as there may be changes prior to a stable release.
I have seen some IBP sites with HTML5 games available.
There will be testing to see if they save scores on those websites and if so then I will implement their newer save method.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

mrkid

Are you testing these on 2.0, or 2.1 Beta? I can run some games on either of my test sites if you want?

mrkid

The arcade is working great. But, I can't for the life of me find the css coding that adds yellow highlight to the names of the games in the arcade list. Where can I get rid of it? It doesn't really match my theme.

http://www.hauntersnation.com/forum/index.php?action=arcade

lurkalot

Quote from: mrkid on July 29, 2017, 07:39:45 PM
The arcade is working great. But, I can't for the life of me find the css coding that adds yellow highlight to the names of the games in the arcade list. Where can I get rid of it? It doesn't really match my theme.

http://www.hauntersnation.com/forum/index.php?action=arcade

In your index.css file for the theme you're using look for (around line 447)


/* Highlighted text - such as search results. */
.highlight
{
background-color: #ff0;
font-weight: bold;
color: #000;
}


Change the background color for something else

mrkid

Thank you! I think that is literally the only css file I didn't search through. :-\

lurkalot

Quote from: mrkid on July 30, 2017, 09:24:28 AM
Thank you! I think that is literally the only css file I didn't search through. :-\

No problem. Looks like it worked ok. ;)

Eyecu

I'm using Chen Zhen version RC5 just downloaded tonight from github. Got it installed correctly but when i go into any of games admin part (managegames.php) I'm getting and error 500 on my server. I know the problem just not the solution. My server is currently using debian wheezy so php 5.4 when looking in the logs im getting the following error
mod_fcgid: stderr: PHP Fatal error: Can't use function return value in write context in /home/buzzenbsr/public_html/openminded/Sources/ManageGames.php on line 818

line 818 is the following code


if (!file_exists($target . '/' . $newname))
{
if (empty(filesize($tmp_name)))   <----- LINE 818
{
if (file_exists($tmp_name))
unlink($tmp_name);
clearstatcache();
fatal_lang_error('arcade_upload_file_size');
}



Any help would be appreciated.

Chen Zhen

Eyecu,

PHP 5.5 is the minimal version to be used for the updated version of this modification.
This stipulation is noted within the changelog.
Below is a fix for what you posted that should work in PHP5.4 but Imo it is pointless as you may come across other errors due to newer and/or deprecated code.
If you are able to update your PHP version on your own or via your host customer service, I advise you to do it as soon as possible due to security vulnerabilities.


if (!file_exists($target . '/' . $newname))
{
                        $filesz = filesize($tmp_name);
if (empty($filesz))   
{
if (file_exists($tmp_name))
unlink($tmp_name);
clearstatcache();
fatal_lang_error('arcade_upload_file_size');
}

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Advertisement: