Download the PHP package samharrison/disqus-plugin without Composer

On this page you can find all versions of the php package samharrison/disqus-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package disqus-plugin

Disqus Plugin for PyroCMS

This plugin provides a simple way to display Disqus comments on pages, posts or pretty much wherever you want.

Installation

Simply copy the plugin's files to addons/{site-ref}/samharrison/disqus-plugin (or ask your administrator if you don't have access to your site's files).

Alternative, you can use Composer:

Setup

Firstly, make sure you've registered your website with Disqus. Check out their Quickstart Guide for more information.

Whilst registering, you'll be able to specify a "forum shortname" for your website. Before using the plugin, you must set this shortname in the Plugin section of the Settings module. If you don't set a shortname, the Disqus comments won't load.

Usage

The simplest way to display comments is to add

to a template (e.g., you theme's layout files, or a post/page type's layout field). Disqus takes the page's unique identifier as being the page URL and the title as being whatever is in the title attribute. However, it is recommended to define your own unique identifier as using a URL can be unreliable (e.g., if you change domains or the page's slug). You can do so by providing it as a parameter for the plugin. For example, if you are using the plugin on a post's template:

Or, on a page's template:

Warning: Posts and pages (and other entries you wish to display comments on) might share the same ID, so if you wish to display comments on them all, it might be wise to prefix the identifier; for example, {{ disqus('posts-'~post.id) }}. You can also prevent Disqus using the <title> attribute by specifying a title as the second parameter:

More on Disqus' configuration variable can be found in the Disqus documentation.

Output the Javascript only

To display comments, a <div> with id="disqus_thread" is required where the comments should be displayed on the page. The {{ disqus() }} plugin above includes this wherever in the template it is used. If you wish to output only the Javascript so that you have more control over where and how the <div id="disqus_thread"> is display, you can use the {{ disqus_script() }} plugin.

For example, this might be useful is you want to add custom classes to the <div>, or to place it in a template where it isn't so easy to get the page or post's ID:

disqus_script() supports the same options as disqus().

Use case: Post comments that can be disabled

This plugin makes adding Disqus comments to a post super easy, even if you don't have access to your site's theme files. Here's an example of how to add Disqus comments to a post, with an option on each post as to whether you want the comments displayed or not.

Firstly, install the plugin as above and ensure you've set your forum shortname in the Settings module. Now, let's create a boolean (true/false) field type by going to the Field section in the Posts module, adding a new field and selecting "Boolean" as the field type:

add_field

Name the field whatever you like (e.g., "Display Disqus comments?") and set the slug to "enable_disqus". Now assign this field to a particular page type in the Types section of the Posts module, by selecting "Assignments" on the page type you want (e.g., Default) and then "Assign Fields". Select the field you just created by the name you gave it, and fill in any details you wish on the field assignment form.

Now we can edit the page type's layout to show the Disqus comments: Select the "Edit" button of the page type you've just assigned the new field to, and add the following code to the bottom of the Post Layout field:

Depending on how your site is set up, the Post Layout might now look something like this:

post_layout

When you create a new post of this type, you can now select if you want Disqus comments to be displayed or not, and if you opt to display them, the comments will be embedded at the bottom of your blog post:

post


All versions of disqus-plugin with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package samharrison/disqus-plugin contains the following files

Loading the files please wait ....