Download the PHP package dukt/follow without Composer

On this page you can find all versions of the php package dukt/follow. 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 follow

Follow for Craft CMS

A simple plugin to connect to Follow's API.


Installation

  1. Download the latest release of the plugin
  2. Drop the follow plugin folder to craft/plugins
  3. Install Follow from the control panel in Settings > Plugins

Templating

Following

Users that you are following.

{% if not currentUser %}
    <p>You need to <a href="{{url('follow/login')}}">login</a> in order to see the users you follow.</p>
{% else %}
    {% set users = craft.follow.getFollowing() %}

    {% if users|length > 0 %}

        <p>You are following {{users|length}} users.</p>

        <div class="row">
            {% for user in users %}
                <div class="col-md-4">
                    {% include 'follow/_user' with { user: user } %}
                </div>
            {% endfor %}
        </div>

    {% else %}
        <p>{{ "You are not following anyone."|t }}</p>
    {% endif %}

{% endif %}

Followers

Users that are following you.

{% if not currentUser %}
    <p>{{ 'You need to <a href="{url}">login</a> in order to see you followers.'|t({ url: url('follow/login') })|raw }}</p>
{% else %}
    {% set users = craft.follow.getFollowers(currentUser.id) %}

    {% if users %}

        <p>{{ "You have {count} followers."|t({ count: users|length }) }}</p>

        <div class="row">
            {% for user in users %}
                <div class="col-md-4">
                    {% include 'follow/_user' with { user: user } %}
                </div>
            {% endfor %}
        </div>

    {% else %}
        <p>{{ "No one is following you." }}</p>
    {% endif %}
{% endif %}

Activity

Recent entries from users you are following.

{% if not currentUser %}
    <p>{{ 'You need to <a href="{url}">login</a> in order to see the activity of users you follow.'|t({ url: url('follow/login') })|raw }}</p>
{% else %}
    {% set followingUsers = craft.follow.getFollowing( user.id ) %}

    {% set followingUserIds = [] %}
    {% for followingUser in followingUsers %}
        {% set followingUserIds = followingUserIds|merge([ followingUser.id ]) %}
    {% endfor %}

    {% if followingUserIds|length > 0 %}

        {% set entries = craft.entries.authorId(followingUserIds).find() %}

        {% if entries|length %}
            {% for entry in entries %}
                <div class="media">
                    <div class="media-left text-center">

                        {% if entry.author.photoUrl %}
                            {% set photoUrl = entry.author.photoUrl(80) %}
                        {% else %}
                            {% set photoUrl = resourceUrl('images/user.gif') %}
                        {% endif %}

                        <img src="{{ photoUrl }}" width="80" class="img-circle" />

                        <p>{{ entry.author.fullName }}</p>

                    </div>

                    <div class="media-body">

                        <h4 class="media-heading">{{ entry.title }}</h4>

                        <p>
                            <small>{{ entry.postDate.nice }}</small>
                        </p>

                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, unde molestias odit mollitia sint. Similique, nesciunt, sunt, magnam enim asperiores totam consequuntur ratione nemo quam ut vitae accusantium blanditiis esse.</p>

                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, unde molestias odit mollitia sint. Similique, nesciunt, sunt, magnam enim asperiores totam consequuntur ratione nemo quam ut vitae accusantium blanditiis esse.</p>

                    </div>
                </div>

                <hr>
            {% endfor %}
        {% else %}
            <p>{{ "Start following some users to see their recent entries."|t }}</p>
        {% endif %}
    {% else %}
        <p>{{ "Start following some users to see their recent entries."|t }}</p>
    {% endif %}

{% endif %}

user.html

{% set followers = craft.follow.getFollowers(user.id) %}

<div class="row">
    <div class="col-md-12">

        <div class="panel panel-default">
            <div class="panel-body">

                <div class="row">
                    <div class="col-sm-4">
                        {% if user.photoUrl %}
                            {% set photoUrl = user.photoUrl %}
                        {% else %}
                            {% set photoUrl = resourceUrl('images/user.gif') %}
                        {% endif %}

                        <img src="{{ photoUrl }}" width="90" class="img-circle" />
                    </div>
                    <div class="col-sm-8">

                        <h5>{{ user.fullName }}</h5>

                        {% set followersCount = followers|length %}

                        {% if followersCount > 1 %}
                            <p>{{ "{count} followers"|t({ count: followersCount }) }}</p>
                        {% else %}
                            <p>{{ "{count} follower"|t({ count: followersCount }) }}</p>
                        {% endif %}

                        {% if currentUser and currentUser.id != user.id %}
                            {% if craft.follow.isFollow(user.id) %}
                                <a class="btn btn-default btn-sm" href="{{actionUrl('follow/stopFollowing', {id:user.id})}}">{{ "Unfollow"|t }}</a>
                            {% else %}
                                <a class="btn btn-default btn-sm btn-primary" href="{{actionUrl('follow/startFollowing', {id:user.id})}}">{{ "Follow"|t }}</a>
                            {% endif %}
                        {% else %}
                            <div class="btn btn-default btn-sm btn-primary disabled">{{ "Follow"|t }}</div>
                        {% endif %}

                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

API

FollowVariable


All versions of follow with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
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 dukt/follow contains the following files

Loading the files please wait ....