Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid JSON Response #63

Open
3GaNwO opened this issue Oct 23, 2021 · 1 comment
Open

Invalid JSON Response #63

3GaNwO opened this issue Oct 23, 2021 · 1 comment

Comments

@3GaNwO
Copy link

3GaNwO commented Oct 23, 2021

DataTables warning: table id=LeaderBoardTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

I had this working for a split second but for whatever reason I am getting this error now when I try and goto the leaderboards.

I have all the database tables which I will provide a pic of it.

database tables

I can't seem to figure out the issue.

I look into the developer tools and I also see an error about allowing right clicking and I have no idea how to fix this one either

"allow right click processing https://xyz.org/rankme/leaderboards.php"

I had to fix a couple things because my site is secure so I had to make sure the fonts being used was also on a secure page (simple fix)

I hope y'all can help I can't seem to figure out where to go next to fix the issues

@musoviich
Copy link

Hi sir, this is quick fix for your problem. (DataTables cant see special characters ( I Had problem with this character: • )

Go into control/leaderboard/leaderboardGrab.php

Create new function after $primaryKey;
`function clean($string) {
$string = preg_replace('/[^A-Za-z0-9\-]/', ' ', $string); // Removes special chars.

return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
}`

Then in columns, replace array( 'db' => 'name', 'dt' => 0 ), with
array( 'db' => 'name', 'dt' => 0, 'formatter' => function($d, $row){ $name = clean($row['name']); return $name; } ),
I'll leave you attach of this fix.
leaderboardGrab.txt
Just replace .txt with .php

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

No branches or pull requests

2 participants