Title: Dexs.Counter
Author: pytesNET
Published: <strong>11. desember, 2016</strong>
Last modified: 15. desember, 2016

---

Søk i utvidelser

![](https://ps.w.org/dexs-counter/assets/banner-772x250.png?rev=1555071)

Denne utvidelsen **har ikke blitt testet mot noen av de siste 3 hovedutgivelsene
av WordPress**. Den er kanskje ikke lenger holdt vedlike eller støttet, og den kan
ha kompatibilitetsproblemer med nyeste versjoner av WordPress.

![](https://ps.w.org/dexs-counter/assets/icon-256x256.png?rev=1555071)

# Dexs.Counter

 Av [pytesNET](https://profiles.wordpress.org/sambrishes/)

[Last ned](https://downloads.wordpress.org/plugin/dexs-counter.0.1.3.zip)

 * [Detaljer](https://nb.wordpress.org/plugins/dexs-counter/#description)
 * [Omtaler](https://nb.wordpress.org/plugins/dexs-counter/#reviews)
 *  [Installering](https://nb.wordpress.org/plugins/dexs-counter/#installation)
 * [Utvikling](https://nb.wordpress.org/plugins/dexs-counter/#developers)

 [Brukerstøtte](https://wordpress.org/support/plugin/dexs-counter/)

## Beskrivelse

The Dexs.Counter plugin detects each (unique) view and stores the collected data
into the own
 database table as well as own post_meta, which can be used to configure
WP_Query loops depending on the counter. This informations are already used in the
2 frontend and in the small dashboard widget. The plugin contains also an extended
statistic, which shows the daily views (of all posts) as diagram within the dashboard
widget. Last but not Least: The plugin offers also a small rating system.

#### Alpha

This plugin is still Alpha and will be expanded in the future. However, it should
not contain
 critical bugs, but if you found one or if you even have general suggestions
for improvement then write us on our [WordPress Plugin Support Page](https://wordpress.org/support/plugin/dexs-counter).

Thank You!

#### Features

 * Post Types: En/Disable the view and rating counter on each single (costum) post
   type.
 * Exclude Roles: In/Exclude user roles from the view- and rating system.
 * Rating Layout: Choose between a single (Like), double (Like, Dislike), 3-level
   and 5-level rating layout.
 * Frontend Widgets: 2 Frontend widgets which allows you to display post lists depending
   on the view and rate counter.
 * Extended Statistics: Logs each day-counter and displays this informations within
   the dashboard widget.

## Skjermbilder

 * [[
 * The settings page.
 * [[
 * The dashboard widget.

## Installasjon

 1. Upload the `dexs-counter` folder to your `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Configure the plugin through the own ‘Dexs Counter’ Admin Page.
 4. Use It and rate our plugin on the official [WordPress Plugin Directory](https://plugins.wordpress.org/dexs-counter);
    3!

## Ofte stilte spørsmål

You can use the dexs counter environment easily within your own WordPress theme.
This is useful, if
 you want to adapt the dexs counter design seamless to your theme.
Please Note: You should always check, if the respective function exists with the
php `function_exists(function_name)` method!

  dexs_cr_get_views ($post_id, $type)

Get one of the four view counter numbers for the respective post.

**Parameters**

 * **$post_id** _(Required)_
    The respective post id. Use the `get_the_ID()` WordPress
   function within a loop.
 * **$type** _(Optional)_
    Set the view counter type by using one of the following
   strings
    - `"total"` returns all registered clicks. (Default)
 *  - `"daily"` returns all registered clicks for the current day.
 *  - `"unique"` returns all unique clicks (one click / user).
 *  - `"daily_unique"` returns all unique clicks (one click / user) for the current
      day.

**Return Values**

Returns the view counter number as **integer** or **false** if the $post_id parameter
in invalid.

  dexs_cr_has_viewed ($post_id)

Checks if the current user has already clicked on the respective post.

**Parameters**

 * **$post_id** _(Required)_
    The respective post id. Use the `get_the_ID()` WordPress
   function within a loop.

**Return Values**

Returns **true** if the user has already clicked on the post, and **false** if not
or if the
 $post_id parameter is invalid!

  dexs_cr_get_rating ($post_id)

Get the rating data for the respective post.

**Parameters**

 * **$post_id** _(Required)_
    The respective post id. Use the `get_the_ID()` WordPress
   function within a loop.

**Return Values**

Returns an **array** with the rating data or **false** on failure. Note: The rating
data (or rather
 the array keys) depends on your rating layout setting (see below),
but the values are always **integers** an represents the number of ratings / clicks
on the respective rating value.

 * On **«Single»**: `array("like" => [int])`
 * On **«Double»**: `array("like" => [int], "dislike" => [int])`
 * On **«3-Level»**: `array("1" => [int], "2" => [int], "3" => [int])`
 * On **«5-Level»**: `array("1" => [int], "2" => [int], "3" => [int], "4" => [int],"
   5" => [int])`

  dexs_cr_has_rated ($post_id, $value)

Checks if the current user has already rated yet and returns perhaps his rating 
value.

**Parameters**

 * **$post_id** _(Required)_
    The respective post id. Use the `get_the_ID()` WordPress
   function within a loop.
 * **$value** _(Optional)_
    Change the returning value:
    - `false` checks only if the user has already rated. (Default)
 *  - `true` checks if the user has already rated and returns the rate value.

**Return Values**

    ```
    ($value == false):<br />
    ```

Returns **true** if the user has already rated yet or **false** if not or if the
$post_id is invalid.
 Note: Returns **NULL** if the current user is within an excluded
role!

    ```
    ($value == true):<br />
    ```

Returns the respective rating value as **string** or an empty **string** if the 
current user hasn’t
 rated yet. Note: Returns **false** if the $post_id is invalid
and **NULL** if the current user is within an excluded role

  dexs_cr_rating_link ($post_id, $value)

**Parameters**
 Creates one or more rating links with an WordPress nonce. Example:
http://www.example.com/post_permalink/?dexs-nonce=_nonce_&dexs=rating_value

 * **$post_id** _(Required)_
    The respective post id. Use the `get_the_ID()` WordPress
   function within a loop.
 * **$value** _(Optional)_
    Configure the returning value:
    - `NULL` all rating values, depending on the rating layout. (Default)
 *  - `*value*` checks if the user has already rated and returns the rate value.

**Return Values**

    ```
    ($value == NULL):<br />
    ```

Returns all rating links as **array** or **false* on failure. Note: The array keys
are the
 respective rating values, depending on the rating layout setting!

    ```
    ($value == value):<br />
    ```

Returns the respective rating link as **string** or **false** on failure. Note: 
Returns also false
 if the given value doesn’t match to the rating layout setting!

  WP_Query

You can use the following settings to change the post order, of your costum WP_Query
requests,
 depending to view counter OR rating counter. Note: You may return an 
empty post list, if you use the daily or daily_unique counter and if nobody has 
viewed a single post item on the day yet. Note also: The Dexs.Counter plugin doesn’t
automatically add the counter meta data to all of your posts. So each post that 
havn’t been clicked / rated yet are therefore not considered!

    ```
    &lt;?php
        // The Most-Viewed Posts (Total)
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_views_total"
        );
        $posts = new WP_Query($query);

        // The Most-Viewed Posts (Unique)
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_views_unique"
        );
        $posts = new WP_Query($query);

        // The Most-Viewed Posts (Total / Today)
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_views_today"
        );
        $posts = new WP_Query($query);

        // The Most-Viewed Posts (Unique / Today)
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_views_today_unique"
        );
        $posts = new WP_Query($query);

        // The Best-Rated Posts
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_ratings"
        );
        $posts = new WP_Query($query);

        // The Worst-Rated Posts
        $query = array(
            "order"     => "ASC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_ratings"
        );
        $posts = new WP_Query($query);

        // The Most-Rated Posts
        $query = array(
            "order"     => "DESC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_ratings_num"
        );
        $posts = new WP_Query($query);

        // The Fewest-Rated Posts
        $query = array(
            "order"     => "ASC",
            "orderby"   => "meta_value_num",
            "meta_key"  => "dexs_ratings_num"
        );
        $posts = new WP_Query($query);
    ?&gt;
    ```

## Vurderinger

Det er ingen omtaler av denne utvidelsen.

## Bidragsytere og utviklere

«Dexs.Counter» er programvare med åpen kildekode. Følgende personer har bidratt 
til denne utvidelsen:

Bidragsytere

 *   [ pytesNET ](https://profiles.wordpress.org/sambrishes/)

“Dexs.Counter” har blitt oversatt til 1 språk. Takk til [oversetterne](https://translate.wordpress.org/projects/wp-plugins/dexs-counter/contributors)
for deres bidrag.

[Oversett “Dexs.Counter” til ditt språk.](https://translate.wordpress.org/projects/wp-plugins/dexs-counter)

### Interessert i utvikling?

[Bla gjennom koden](https://plugins.trac.wordpress.org/browser/dexs-counter/), sjekk
ut [SVN-repositoriet](https://plugins.svn.wordpress.org/dexs-counter/), eller abonner
på [utviklingsloggen](https://plugins.trac.wordpress.org/log/dexs-counter/) med 
[RSS](https://plugins.trac.wordpress.org/log/dexs-counter/?limit=100&mode=stop_on_copy&format=rss).

## Endringslogg

#### Version 0.1.3 (Alpha)

 * [FIX] Error on an empty counter diagram within the dashboard widget.

#### Version 0.1.2 (Alpha)

 * [UPD] The design and data within the counter diagram.
 * [FIX] The counter diagram datasets had the wrong direction.

#### Version 0.1.1 (Alpha)

 * [ADD] Trivial «Humanity Test» for the view counter.
 * [ADD] The `dexs-counter-verify` option as part of the new «Humanity Test».
 * [FIX] The `_ip()` function has hashed the wrong value.

#### Version 0.1.0 (Alpha)

 * First Release

## Meta

 *  Versjon **0.1.3**
 *  Sist oppdatert **9 år siden**
 *  Aktive installasjoner **10+**
 *  WordPress-versjon ** 4.0 eller nyere **
 *  Testet opp til **4.7.33**
 *  Språk
 * [English (US)](https://wordpress.org/plugins/dexs-counter/) og [German](https://de.wordpress.org/plugins/dexs-counter/).
 *  [Oversett til ditt språk](https://translate.wordpress.org/projects/wp-plugins/dexs-counter)
 * Stikkord
 * [count](https://nb.wordpress.org/plugins/tags/count/)[Counter](https://nb.wordpress.org/plugins/tags/counter/)
   [rating](https://nb.wordpress.org/plugins/tags/rating/)[view](https://nb.wordpress.org/plugins/tags/view/)
   [views](https://nb.wordpress.org/plugins/tags/views/)
 *  [Avansert visning](https://nb.wordpress.org/plugins/dexs-counter/advanced/)

## Vurderinger

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/dexs-counter/reviews/#new-post)

[Se alle omtalene](https://wordpress.org/support/plugin/dexs-counter/reviews/)

## Bidragsytere

 *   [ pytesNET ](https://profiles.wordpress.org/sambrishes/)

## Brukerstøtte

Har du noe å si? Trenger du hjelp?

 [Vis brukerstøtteforumet](https://wordpress.org/support/plugin/dexs-counter/)