Skip to content

Minor Fixes#54

Merged
own3mall merged 5 commits intoOpenGamePanel:masterfrom
Adjokip:master
Mar 2, 2017
Merged

Minor Fixes#54
own3mall merged 5 commits intoOpenGamePanel:masterfrom
Adjokip:master

Conversation

@Adjokip
Copy link
Contributor

@Adjokip Adjokip commented Feb 27, 2017

This is mostly fixes for warnings or notices that appear with max error
reporting. There's still othr stuff, but this'll do for now.

Form_table_class: Uses the old, PHP-4 constructor method which is now
deprecated.
Refreshed: Same as above, used the PHP-4 constructor method. PHP 5.3 and
above is supported. So, no need to use much, much, older method.

lib_remote: Set the default timeout in the constructor method to match
that of what was commited in 6e1629f , and changed the remote_dirlistfm
method from having a function within the public method to utilize the
callback arguement.

view: Added a better check for the installation file removal. $admins
will either be false or an empty array. This prevents the script
attempting to delete the file every page load if the file doesn't exist.

show_users: Added single quotes around the user_id key to prevent a
notice.

TS3Admin: getRemoteServers returns false is there's no servers. Added a
check to make sure there is remote servers - if there's not, display a
message. Added a translation.

FTP Users: getRemoteServers returns false is there's no servers. And as
such you cannot add FTP users. So display a message to the user
notifying them about this.

is_numeric being passed to array_walk in this fashion was always
returning true, however generates muliple warnings. Now, array_filter is
used and the count value of that is used. Which also removes the need
for the first check.

Status: Added a check for the GD extension for the bar.php images. If GD
isn't loaded, the images won't be displayed but the other components
are. A message will be displayed telling the user that GD is required.
Added translations.

This is mostly fixes for warnings or notices that appear with max error
reporting. There's still othr stuff, but this'll do for now.

Form_table_class: Uses the old, PHP-4 constructor method which is now
deprecated.
Refreshed: Same as above, used the PHP-4 constructor method. PHP 5.3 and
above is supported. So, no need to use much, much, older method.

lib_remote: Set the default timeout in the constructor method to match
that of what was commited in 6e1629f , and changed the remote_dirlistfm
method from having a function within the public method to utilize the
callback arguement.

view: Added a better check for the installation file removal. $admins
will either be false or an empty array. This prevents the script
attempting to delete the file every page load if the file doesn't exist.

show_users: Added single quotes around the user_id key to prevent a
notice.

TS3Admin: getRemoteServers returns false is there's no servers. Added a
check to make sure there is remote servers - if there's not, display a
message. Added a translation.

FTP Users: getRemoteServers returns false is there's no servers. And as
such you cannot add FTP users. So display a message to the user
notifying them about this.

is_numeric being passed to array_walk in this fashion was always
returning true, however generates muliple warnings. Now, array_filter is
used and the count value of that is used. Which also removes the need
for the first check.

Status: Added a check for the GD extension for the bar.php images. If GD
isn't loaded, the images won't be displayed but the other components
are. A message will be displayed telling the user that GD is required.
Added translations.
define('feed_url_info', "GrayCube.com is sharing a LGSL feed on the URL:<br><b>http://www.greycube.co.uk/lgsl/feed/lgsl_files/lgsl_feed.php</b>");
define('charset', "Character Encoding");
define('charset_info', "UTF8, ISO, ASCII, etc... Left it blank to use ISO encoding.");
define('charset_info', "UTF8, ISO, ASCII, etc... Leave it blank to use ISO encoding.");
Copy link
Contributor

@Zorrototo Zorrototo Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this string now reflects what it does. I think if it is empty, it uses what is defined in the lang file (which is now UTF-8 for all because of transifex).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used on the panel settings page when hovering over the Character Encoding tooltip.

'Leave it blank' seems more natural than 'left it blank' - but if the word left needs to be used, then I'd probably phrase it, 'If left blank ISO encoding will be used.'

Copy link
Contributor

@Zorrototo Zorrototo Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was not talking about the better wording, but what I mean is that this string is surely not true now, because it uses what is defined in the main lang file global.php define('lang_charset', "UTF-8"); when empty, which is UTF-8. It will not use ISO encoding when empty but UTF-8 which is the standard we now use with Transifex<->OGP.

edit: or I'm misunderstanding how it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems English/globals.php file uses ISO as lang_charset, a quick look at some of the other language globals, and they use UTF-8.

It'd probably be good to change that to UTF-8 also, just for the sake of consistency. Afterwards, the translation above could be updated.

Copy link
Contributor

@Zorrototo Zorrototo Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know if we still need this parameter actually, as we define the encoding from lang files now (I think it was not like that long long time ago, will check sourceforge for that => yeah it was not like that on really old version). Maybe some inputs from own3mall on the topic will enlighten us more.

@own3mall
Copy link
Contributor

Must we declare our functions public? I never decorate my classes that way.

Encapsulation in the .NET world (the type of work I do professionally) is not very effective... in my opinion anyways.

As long as everything works, I'll merge this. I don't have the time to fully examine the changes since they appear very small,

@own3mall
Copy link
Contributor

But for the love of my sanity, please resolve the conflict? I really don't want to do it. I guess if I do, I will use TortoiseGit and Windows since I'm no expert on the git command line and had problems doing it last time from Linux...

@own3mall
Copy link
Contributor

I believe the encoding setting is still used. As to whether or not it affects the language files anymore, I have no idea, but it should be putting an encoding entry in the header for the panel.

@Zorrototo
Copy link
Contributor

Zorrototo commented Feb 28, 2017

What I see in my Panel with French lang, and nothing in this parameter: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
What I see in my Panel with French lang, and ISO in this parameter: <meta http-equiv="Content-Type" content="text/html; charset=ISO"> and of course french accentuated words are messed up.

What I see in my Panel with English lang, and nothing in this parameter: <meta http-equiv="Content-Type" content="text/html; charset=ISO">
What I see in my Panel with English lang, and ASCII in this parameter: <meta http-equiv="Content-Type" content="text/html; charset=ASCII">
What I see in my Panel with English lang, and LoL (yeah I know 🤣) in this parameter: <meta http-equiv="Content-Type" content="text/html; charset=LoL">

So yeah it definitely works and changes the page encoding in the header, but uses the encoding defined in the lang file when this parameter is empty, hence why I though it was a parameter that may not be needed anymore.

@Adjokip
Copy link
Contributor Author

Adjokip commented Feb 28, 2017

@own3mall Conflict should be resolved now.

Functions within a class default to public unless otherwise stated, however I think to be consistent with some of the other code, it's good to state that it is public - and it's generally just good practice to do so.

But everything does work - this commit was to fix some warnings/notices appearing at maximum error reporting.

@own3mall own3mall merged commit 511071a into OpenGamePanel:master Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments