"Datatable PHP library" is this editor link?

"Datatable PHP library" is this editor link?

ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0
edited March 2018 in Free community support

When instructions here https://editor.datatables.net/examples/simple/server-side-processing.html say "Datatable PHP Library", is it simply referirng to this following link?

https://editor.datatables.net/extensions/Editor/js/dataTables.editor.min.js

Code:

// DataTables PHP library
include( "../../php/DataTables.php" );

// Alias Editor classes so they are easy to use
use
    DataTables\Editor,
    DataTables\Editor\Field,
    DataTables\Editor\Format,
    DataTables\Editor\Mjoin,
    DataTables\Editor\Options,
    DataTables\Editor\Upload,
    DataTables\Editor\Validate,
    DataTables\Editor\ValidateOptions;

It would be nice if links were included in the comment sections after the description section (but I am a beginner so maybe not).

Answers

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    edited March 2018

    You are referring to the minified version of the Editor javascript library. It is a bit confusing: The "Datatable PHP Library" is actually the Editor PHP Library. Its use requires the purchase of a license.

    You can download the Editor PHP Library here:
    https://editor.datatables.net/download/

    The path in the download is Editor-PHP-1.7.3/php/DataTables.php

    In that same directory you will need to edit the file config.php to fill in your database details.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    OK glad I asked. So if I am using 000webhost, I have to "dump" (upload?) that entire file into my account? Never had to do this before. Normally I just link a script or copy the file.

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415

    Yep, you would have to upload it. Like any other server script.
    You only need this directory on the server though (in case you don't care about the examples).
    Editor-PHP-1.7.3/php

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0
    edited March 2018

    Ok. I may have to search how to upload server-script on 000webhost.

    Normally I do this:

    By any other script I am assuming you don't mean this (because it didn't work):

    Thanks for help!

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415

    hmm ... maybe we have a misunderstanding here.

    fontawesome and bootstrap run on the client computer or your phone or whatever your users are using as a front end device. There it makes perfect sense to use a CDN because it may speed up loading on those client devices based on proximity. If your server is in the US and you have useres in Europe then those users will probably load the third party components from a server in Europe because most CDN providers have many servers around the world. This will be faster for your European users.

    Editor's php libraries do not run on the client computer and they do not get downloaded onto the client devices either. They run on the server which in your case is a server provided by 000webhost and it is probably in the US. It wouldn't really make sense to use a CDN for third party components you would like to use on your server (not on the clients!). You just put them on your server and you have no delay for loading.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0
    edited March 2018

    Interesting... On webhost, I found a "upload" button (I downloaded the file to my desktop). After uploading, it now has the name "/public_html/Editor-PHP-1.7.3.zip" by my index.php file. It looked like it worked! I guess I just have to include('Editor-PHP-1.7.3.zip") now.

    I am assuming the ending .zip is fine (and I do not have to change it to .php?).

    First time doing this, so thanks for patience!

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    Answer ✓

    well you uploaded the zip-archive which is fine. You should unzip it on the server. As far as I know 000webhost provides a control panel (cPanel). That usually has a file manager which you can use to unzip it.

    If you unzip the uploaded archive to "/public-html/Editor-PHP-1.7.3" you would need to include this into your index.php

    In case you can't figure out how to unzip the files on the server unzip them on your computer and upload the unzipped folders.

    // DataTables PHP library
    require_once 'Editor-PHP-1.7.3/php/DataTables.php';
    
  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    So basically upload the files within Editor-PHP-1.7.3 individually?

    Looks like they are these four files:
    css
    examples
    js
    php

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415

    just load up the entire folder with all of its subfolders and save it in public_html. In that case the "require_once" above is going to work. Editor then finds all of the other files it requires in the folder structure.

    I assume you mean "folders" not "files". "Editor-PHP-1.7.3" contains 4 folders and only one file which is "Readme.txt". Again, Editor only requires the subfolder "php" in "Editor-PHP-1.7.3" but it doesn't hurt to have the other stuff up there as well.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    Yes. I by file I meant folder.
    Ok I will upload the 4 folders individually:
    css
    examples
    js
    php

    It looks like that it is?

    One last question. If I am using "Editor-PHP-1.7.3", I do not have to use ssp.class.php https://github.com/DataTables/DataTables/blob/master/examples/server_side/scripts/ssp.class.php?

    Looks like this link was an example: https://editor.datatables.net/examples/simple/server-side-processing.html

    Thanks for the help!!

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    Answer ✓

    No, you don't need to use ssp.class. Everything you need is included in the software you downloaded.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0
    edited March 2018

    Ok. When I uploaded the editor.zip file, this is sample of what the lines look like for about 6000 lines:

    K»EÝ0BPf7M(x¿î¼à½nÁNÞMß¾!%½çe

    90% of it is unreadable. Is this normal?


    When I tried uploading each file individually, it would not let me. It would just take me to the next section within the folder (ie editor.boostrap, datatables.editor, etc). I did an extract of the zip and the same thing happened.

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    edited March 2018

    No this is not normal, Scott. How are you opening the zip file? You need to unzip it please with a tool not open the file. If your provider does not supply a tool to unzip a file please get a different web hoster.

    Web developers upload files to the server all the time. My IDE (Net Beans) does it automatically. if you don't have an IDE use FileZilla or some other tool. If you are using a Windows machine unzip the files first save them and then upload the unzipped folders with all the files to the server.

    Sorry, Scott, but I think I can't do anything else for you at this time. But I was really surprised that you obviously haven't come across uploading files to the server previously. I wouldn't know what an application looks like that doesn't have a server component. (When I learned coding the first time a generation ago it was opposite: Applications had no client component because there weren't any client computers ... just black screens with green monospace letters ....).

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    edited March 2018 Answer ✓

    Maybe another hint on your problem. If you open a zip file on a windows machine windows sees it is a zip archive and does NOT open it with an editor but retrieves and displays the folder structure to you. If you then click on a file within that folder structure windows unzips it for you, opens an editor (e.g. MS Word) and displays the file to you.

    That does not work the same with other operating system. The os of your hoster (some Linux version or whatever it is) obviously does NOT provide the same service. Here the zip file "really" gets "opened" and the content of the zip file is displayed. And yes, that is illegible stuff!

    Again you need to make sure you unzip the archive. Either do it on your windows machine and upload the unzipped folders. Or ask your hoster for a tool to unzip it on the server.

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    Answer ✓

    This thread has what you need I guess. It also mentions filezilla.
    https://www.000webhost.com/forum/t/how-do-i-unzip-files/24422

    I am away for the rest of the week. Good luck and Happy Easter Holidays.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    Yeah I did a lot of reading before bed last night and came to the same conclusion. On that topic, they recommended the same site that unzipped files. I also watched a youtube video that looks similar to that picture. But your topic is more specific with steps so should help. I will update how it goes! I think this will fix the problem.

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0
    edited March 2018
  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    Use FTP between Filezilla and 000WebHost video: https://www.youtube.com/watch?v=Ts_FBKDXBUA

  • ScottSchmidtScottSchmidt Posts: 38Questions: 5Answers: 0

    Hey RF,
    Great News! Got it to work.

    Now just got the typical error: include_path='.:/usr/share/pear:/usr/share/php.
    Using stackoverflow https://stackoverflow.com/questions/21645774/php-fatal-error-require-once-failed-opening-required-mail-php-include-pat

    It should a pretty quick fix.

    Thanks for the help!
    Happy Holidays too,

This discussion has been closed.