JoeGandy / ShareX-Custom-Upload

A little PHP script created for uploading custom sharex files to your own webserver
MIT License
166 stars 50 forks source link

Gallery doesn't show #22

Closed winnipeg21 closed 6 years ago

winnipeg21 commented 6 years ago

When i access my site via url.com/u is only shows the title. The table isn't there :/

DJkikisa commented 6 years ago

In config.php /* This is a list of IPs that can access the gallery page (Leave empty for universal access) */ 'allowed_ips' => array('192.168.0.0', '0.0.0.0'), For me it's empty 'allowed_ips' => '', And I have set password on index.php using .htpasswd. Only then you always need write url.com/u/index.php to login window show up.

winnipeg21 commented 6 years ago

Sorry for the delayed response, I have my config allowed_ips empty just like you. I'm receiving the header text and nothing else. All files have been changed to set to /img instead of /u. I'm also using cloudflare which can be an issue running scripts.

http://winnipeg21.xyz/img

DJkikisa commented 6 years ago

I'm using cloudflare too, it would be problem only if you use allowed ips. I just downloaded full script and edited in it only allowed_ips line to '' and all was working. And have you edited upload.php so it uploads to /img/ not /u/ ?

winnipeg21 commented 6 years ago

Everything works expect the gallery aspect doesn't appear

DJkikisa commented 6 years ago

Doesn't load main.js in js folder :)

winnipeg21 commented 6 years ago

That could be something bad

winnipeg21 commented 6 years ago

So in the index.php I switched it from js/main.js ==> img/js/main.js. That didn't work. So then I switched it to /js/main.js.

DJkikisa commented 6 years ago

You can always put main.js content in index.php, not best but if you can't load main.js that would fix it: <script> $(document).ready(function() { $('#example').DataTable(); } ); </script>

winnipeg21 commented 6 years ago

I added that code line in. Still doesn't work. Just gives me a blank white screen with the heading.

DJkikisa commented 6 years ago

You needed replace with that code not in head tags since jquery is loaded later and it shows error becouse of that.

winnipeg21 commented 6 years ago

I've done that. Still nothing

DJkikisa commented 6 years ago

You can fully remove ip check from code: Line 27 delete: if(empty($config['allowed_ips']) || in_array($_SERVER['REMOTE_ADDR'], $config['allowed_ips'])){ And Line 54: <?php }?> And test then.

winnipeg21 commented 6 years ago

Works! Thanks

Natfan commented 6 years ago

Looks like this is done, closing issue (feel free to reopen if needed!)