DLE Visitators Diagram
26-12-2022, 13:51
I came across one module "CL Gifts 0.3.4" from the respected author "Mumi", its other name is "Gifts 0.3.4" and in this module I liked a coin that appeared on the site at a certain time (specified in the admin panel with different probability of display). And if you click on it, then 1 coin was credited to your account, which, after accumulation, could be spent on gifts.
Then the idea came to mind to integrate the "coin" into the "Points System 1.5" module, so that you would not be read coins, namely points and not one point, but with the number of points specified in the admin panel. I had to tinker a little with the code, and create a separate admin panel for the "coin", but I think it was worth it.
Attention! Everything was done on DLE 12.1 php 7.x (I assume that it should go to any version of the engine.)
So first of all we make a request to the database:
ALTER TABLE dle_users ADD COLUMN points_last_time int(20) not null default'0';
We follow the path:
engine\modules\main.php
Looking for:
$tpl->set ( '{AJAX}', $ajax );
$tpl->set ( '{info}', $tpl->result['info'] );
Insert above:
include ENGINE_DIR . '/modules/points/money.php';
Follow the path:
templates/{THEME}/main.tpl
Looking for:
{AJAX}
Insert below:
{AddMoney}
In the places where you want gifts to be displayed, place the following codes:
(each can be placed in different parts of the site so that the coin is not only in one place)
[allow_add1]{moneta}[/allow_add1]
[allow_add2]{moneta}[/allow_add2]
[allow_add3]{moneta}[/allow_add3]
[allow_add4]{moneta}[/allow_add4]
[allow_add5]{moneta}[/allow_add5]
Go ahead:
engine\modules\points.php
Looking for:
require_once ENGINE_DIR . '/modules/points/htaccess.php';
Insert below:
require_once ROOT_DIR.'/engine/data/money_config.php';
Looking for:
$tpl->set( '{point_userref}', $pointconf["point_userref"] );
Insert below:
$tpl->set( '{point_money}', $sets["money_row"] );
The {point_money} tag will now be available in the main.tpl points system template
Insert below:
templates\{THEME}\points\main.tpl
Looking for:
<li>• Invite a friend: <b>{point_userref}</b> points</li>
Insert below:
<li>• Collect Coin: <b>{point_money}</b> points</li>
We follow the path:
language\Russian\adminpoints.lng
Looking for:
'pointa_menus11' => "User Nickname change Settings or Management. Here are the applications",
Insert above:
'pointa_menu12' => "Coin",
'pointa_menus12' => "Coin display settings on the website",
We follow the path:
engine\inc\pointsadmin.php
Looking for:
elseif ( $_REQUEST['points'] == 'viewusers' ) include_once ENGINE_DIR . '/inc/points/viewusers.php';
Insert below:
elseif ( $_REQUEST['points'] == 'moneta' ) include_once ENGINE_DIR . '/inc/points/moneta.php';
We follow the path:
engine\inc\points\status.php
Looking for:
<div class="col-sm-6 media-list media-list-linked">
<a class="media-link" href="?mod=pointsadmin&points=changegroup">
<div class="media-left"><img class="img-lg section_icon" src="engine/skins/images/points/conts.png"></div>
<div class="media-body">
<h6 class="media-heading text-semibold">{$plang['pointa_menu2']}</h6>
<span class="text-muted text-size-small">{$plang['pointa_menus2']}</span>
</div>
</a>
</div>
Insert below:
<div class="col-sm-6 media-list media-list-linked">
<a class="media-link" href="?mod=pointsadmin&points=moneta">
<div class="media-left"><img class="img-lg section_icon" src="engine/skins/images/points/moneta.png"></div>
<div class="media-body">
<h6 class="media-heading text-semibold">{$plang['pointa_menu12']}</h6>
<span class="text-muted text-size-small">{$plang['pointa_menus12']}</span>
</div>
</a>
</div>
Or
Looking for:
<div class="col-md-6">
<div class="news with-icons">
<div class="avatar"><img src="engine/skins/images/points/conts.png" width="64"></div>
<div class="news-content">
<div class="news-title"><a href="$PHP_SELF?mod=pointsadmin&points=changegroup">{$plang['pointa_menu2']}</a></div>
<div class="news-text">
<a href="$PHP_SELF?mod=pointsadmin&points=changegroup">{$plang['pointa_menus2']}</a>
</div>
</div>
</div>
</div>
Insert below:
<div class="col-md-6">
<div class="news with-icons">
<div class="avatar"><img src="engine/skins/images/points/moneta.png" width="64"></div>
<div class="news-content">
<div class="news-title"><a href="$PHP_SELF?mod=pointsadmin&points=moneta">{$plang['pointa_menu12']}</a></div>
<div class="news-text">
<a href="$PHP_SELF?mod=pointsadmin&points=moneta">{$plang['pointa_menus12']}</a>
</div>
</div>
</div>
</div>
26-12-2022, 13:51
26-12-2022, 14:28
26-12-2022, 13:32
There are no comments
Information
Users of Visitor are not allowed to comment this publication.