定制 mediadreams/md_unreadnews 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mediadreams/md_unreadnews

最新稳定版本:5.0.3

Composer 安装命令:

composer require mediadreams/md_unreadnews

包简介

This TYPO3 extension adds unread information to the records of ext:news for frontend users.

README 文档

README

**!!! Obsolete !!!**

This extension was replaced by ext:md_notifications. For TYPO3 v12 and newer, please use the versatile extension ext:md_notifications instead!

This extension won't get any updates anymore!

TYPO3 Extension md_unreadnews

This extension adds unread information to the records of ext:news for frontend users. In a list of news records, a frontend user can see, whether or not an article was read by himself. Additional it is possible to show how many unread articles are in a category.

The extension is shipped with typoscript libraries, which can be included at desired places.

Requirements

  • TYPO3 >= 11.5
  • ext:news >= 9.0

Screenshots

Screenshot list

Installation

  • Install the extension by using the extension manager or use composer
  • Include the static TypoScript of the extension
  • Configure the extension by setting your own constants

Available constants:

  • storagePid: This is the uid of the page, where you want to store the unread records
  • categories: Comma separated string of category uids. All news records which are connected to a configured category will be marked as unread. If you don't provide a category, all news records will be considered.
  • feGroup: The uid of a feUserGroup. If provided, the unread info will only be set for users, who belong to this group. If not set, all users are considered.

Usage

As soon as you have installed and activated the extension, it will hook into the saving process of new news records. Everytime a backend user adds a new record, the unread info for this record and the configured feUsers will be added.

List plugin

The extension ships a plugin, which shows a list of all unread news for a user. In the Plugin Options you can set the link to the detail page. If you do not provide the detail page, the news record will be linked to the page of the first attached category.

Show general unread counter

This counter will show the number of unread items for a user. To show this information use the following code in your fluid template:

<f:cObject typoscriptObjectPath="lib.mdAllUnreadCount" />

Show unread info in list view

Use the following code in the fluid template of the news extension to show, whether the current logged in feUser has read a news or not.

<f:cObject typoscriptObjectPath="lib.mdIsUnread" data="{newsUid:'{newsItem.uid}'}" />

Example: Copy ext:news/Ressources/Private/Partials/List/Item.html into your extension and modify the following:

<!-- header -->
<div class="header">
    <h3>
        <n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
            <span itemprop="headline">{newsItem.title}</span>
            <f:cObject typoscriptObjectPath="lib.mdIsUnread" data="{newsUid:'{newsItem.uid}'}" />
        </n:link>
    </h3>
</div>

Show unread info for categories

With the following code snippet you can show the number of unread news according to categories:

<f:cObject typoscriptObjectPath="lib.mdCategoryCount" data="{categoryUid:'{category.item.uid}'}" />

Example: Copy ext:news/Ressources/Private/Templates/Category/List.html into your extension and modify the following:

<f:link.page title="{category.item.title}" pageUid="{settings.listPid}" additionalParams="{tx_news_pi1:{overwriteDemand:{categories: category.item.uid}}}">
    {category.item.title}
    <f:cObject typoscriptObjectPath="lib.mdCategoryCount" data="{categoryUid:'{category.item.uid}'}" />
</f:link.page>

Remove unread info

Remove the unread info as soon, as the user has read the news article. Therefore add the following code on the news detail page:

<f:cObject typoscriptObjectPath="lib.mdRemoveUnread" data="{newsUid:'{newsItem.uid}'}" />

Example: Copy ext:news/Ressources/Private/Templates/News/Detail.html into your extension and add the following code at the end of the template:

<f:if condition="{newsItem}">
    <f:then>
        <f:cObject typoscriptObjectPath="lib.mdRemoveUnread" data="{newsUid:'{newsItem.uid}'}" />
    </f:then>
</f:if>

Cleanup task

This extension ships a scheduler task, which allows you to remove unread information, which is older than a certain period of days. Activate this job, by following these steps:

  • Switch to module Scheduler
  • Add a new task and choose in the select field Class the option Execute console commands
  • Fill all fields like you need them and use mdUnreadnews:cleanup: Remove old unread information in the field Schedulable Command.
  • After saving the task, you will be able to fill the field Argument: days. Amount of days in the past till then all unread information shall be deleted. (integer). Enter the days how long you want to keep the unread information. Default is 30 days.

Bugs and Known Issues

If you find a bug, it would be nice if you add an issue on Github.

THANKS

Thanks a lot to all who make this outstanding TYPO3 project possible!

Credits

Extension icon was copied from ext:news and then modified.

mediadreams/md_unreadnews 适用场景与选型建议

mediadreams/md_unreadnews 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.29k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「extension」 「news」 「typo3」 「unread」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 mediadreams/md_unreadnews 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mediadreams/md_unreadnews 我们能提供哪些服务?
定制开发 / 二次开发

基于 mediadreams/md_unreadnews 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.29k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-03-28