Addon 2x XFRM download history - Lịch sử tải xuống XFRM cho XenForo 2 1.4

PVS

Generalissimo
Thành viên BQT
XFRM download history - Lịch sử tải xuống XFRM cho XenForo 2 1.4

Cho thấy các thành viên đã tải xuống tài nguyên.

pic001.jpgpic002.jpgpic003.jpgpic004.jpg
Tính năng:
  • Tất cả phrase bắt đầu với xfrmdownloadhistory_ để thuận tiện cho bạn.
Chúc các bạn thành công.


Nguồn: Internet​
 

Đính kèm

  • Andy-XFRMDownloadHistory-1.4.zip
    15.7 KB · Lượt xem: 19

thahtrung06

MasterSergeant
Addons này được cập nhật vào ngày 5/9/2019, cài trên XF 2.2.7 Patch 1 thì bị lỗi ko hiển thị được, trong trang ACP báo lỗi về addons này rất nhiều. Cụ thể, lỗi ở hàm: $finder = \XF::finder('XFRM:ResourceItem');
HTML:
<?php

namespace Andy\XFRMDownloadHistory\XFRM\Pub\Controller;

use XF\Mvc\ParameterBag;

class ResourceItem extends XFCP_ResourceItem
{
    public function actionDownloadHistory(ParameterBag $params)
    {
        // get visitor
        $visitor = \XF::visitor();
        
        // get permission
        if (!$visitor->hasPermission('XFRMDownloadHistory', 'view'))
        {
            return $this->noPermission();
        }
        
        // get options
        $options = \XF::options();

        // get options from Admin CP -> Options -> XFRM download history -> Limit
        $limit = $options->XFRMDownloadHistoryLimit;
        
        // get resourceId
        $resourceId = $params->resource_id;
        
        // get resource
        $finder = \XF::finder('XFRM:ResourceItem');
        $resource = $finder
            ->where('resource_id', $resourceId)
            ->fetchOne();
        
        // get resourceTitle
        $resourceTitle = $resource['title'];
        
        // get results
        $finder = \XF::finder('XFRM:ResourceItem');
        $results = $finder
            ->where('resource_id', $resourceId)
            ->order('CurrentVersion.resource_version_id', 'DESC')
            ->order('CurrentVersion.release_date', 'DESC')
            ->limit($limit)
            ->fetch();
        
        // prepare viewParams
        $viewParams = [
            'resourceTitle' => $resourceTitle,
            'results' => $results
        ];

        // send to template
        return $this->view('Andy\XFRMDownloadHistory:DownloadHistory', 'andy_xfrmdownloadhistory', $viewParams);
    }
}
 
Sửa lần cuối:

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Hỗ trợ trực tuyến

Support Quảng cáo
Mr. San (PVS)

Skype chat, instant message

Mr. Tuấn (Blue)

Skype chat, instant message

Mr. Tuấn
0988 488 096
Mr. Trọng
0906 081 284
kinhdoanh@vnxf.vn

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Điện Lạnh Thịnh Phát
Top