Customization

Here are some tips to change the look and feel of your PvDL pages and add some extra features.

Never Edit the /lib/pvdl_class.php

If you customize this file, you will encounter serious issues when we send you new versions of this file. So please, NEVER EDIT IT DIRECTLY !!!

Using the /my/pdvl_class_custom.php

For your convenience, we have created the pdvl_class_custom (child class) which extends the main pvdl_class (its parent class). This means that you can override or create any variables or methods from the parent class, by simply creating it in the child class.

You might use it to:

  • change the _htmlStart() and _htmlEnd() methods to fit your website's design.
  • change the main texts stored in the class variables.
  • add additional methods.

etc..

But be careful to NEVER modify the API pages or the methods they'are using. Doing so would surely break compatibility with our server's calls.

Using the Built-In API

We have also built several API methods that allow you to simply ask pvdl to return a convenient formated array with either :

  • all downloads
  • all downloads for a specific product
  • the whole files tree

This way, you can externally build anything you want in your product download pages, without having to use our automatically rendered HTML pages that list your downloads.

Querying the Built-in API

Simply call the script like this : http://www.server.com/pvdl/?pass=PASS&api=METHOD

where PASS is either :

  • the global Plugivery password as set in the api_pass variable from the pvdl_class
  • a custom password set in the 'api_pass' variable from the configuration file.

where METHOD is either :

  • files : returns the all parsed files
  • files_tree : returns the whole files tree
  • downloads : returns all downloads parsed and formatted
  • documents : returns all documents parsed and formatted
  • product : returns all downloads parsed and formatted only for the product set in the 'prod' parameter of the URL. Example: http://www.server.com/pvdl/?pass=PASS&api=product&prod=MyProduct1

You will receive a JSON formated Array containing all the data.

Studying its structure is very easy by adding “&debug=1” to the URL. Example : http://www.server.com/pvdl/?pass=PASS&api=files&debug=1

You should previously have set the 'debug' parameter (in the configuration file) to '1' or '2', to be able to print the array on screen for debugging purposes.