Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+11
View File
@@ -104,4 +104,15 @@ class _Application extends \IPS\Application
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=downloads&module=downloads&controller=submit", "front", "downloads_submit" ) );
}
}
/**
* Get any settings that are uploads
*
* @return array
*/
public function uploadSettings()
{
/* Apps can overload this */
return array( 'idm_watermarkpath' );
}
}
+1 -1
View File
@@ -611,7 +611,7 @@ class _files extends \IPS\Content\Api\ItemController
{
try
{
\IPS\File::get( $record['record_type'] == 'upload' ? 'downloads_Files' : 'downloads_Screenshots', $url )->delete();
\IPS\File::get( $record['record_type'] == 'upload' ? 'downloads_Files' : 'downloads_Screenshots', $record['record_location'] )->delete();
}
catch ( \Exception $e ) { }
}
+4 -4
View File
@@ -1,10 +1,10 @@
{
"Forums": {
"type": "C",
"class": "\\IPS\\forums\\Forum"
},
"Forum": {
"type": "C",
"class": "\\IPS\\forums\\modules\\admin\\forums\\forums"
},
"Forums": {
"type": "C",
"class": "\\IPS\\forums\\Forum"
}
}
+7 -7
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<javascript app="downloads">
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/downloads" javascript_name="ips.downloads.browse.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200">/**
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/downloads" javascript_name="ips.downloads.browse.js" javascript_type="controller" javascript_version="103038" javascript_position="1000200">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -59,7 +59,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="downloads" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.settings.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
<file javascript_app="downloads" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.settings.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -112,7 +112,7 @@
});
}(jQuery, _));</file>
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.linkedScreenshots.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.linkedScreenshots.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -184,7 +184,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.main.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -587,7 +587,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.changeLog.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150"><![CDATA[/**
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.changeLog.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -708,7 +708,7 @@
});
}(jQuery, _));]]></file>
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.download.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
<file javascript_app="downloads" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.download.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -833,7 +833,7 @@
});
}(jQuery, _));</file>
<file javascript_app="downloads" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.submit.js" javascript_type="template" javascript_version="103005" javascript_position="1000050"><![CDATA[/* VIEW TEMPLATES */
<file javascript_app="downloads" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.submit.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[/* VIEW TEMPLATES */
ips.templates.set('downloads.submit.screenshot', " \
<div class='ipsGrid_span3 ipsAttach ipsImageAttach ipsPad_half ipsAreaBackground_light' id='{{id}}' data-role='file' data-fileid='{{id}}' data-fullsizeurl='{{imagesrc}}' data-thumbnailurl='{{thumbnail}}' data-fileType='image'>\
<ul class='ipsList_inline ipsImageAttach_controls'>\
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="downloads" version="103005">
<app key="downloads" version="103038">
<word key="__app_downloads" js="0">Downloads</word>
<word key="frontnavigation_downloads" js="0">Downloads</word>
<word key="__indefart_downloads_file_comment" js="0">a comment on a file</word>
+2 -2
View File
@@ -2561,9 +2561,9 @@
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"length": 20,
"name": "dsess_mid",
"type": "INT",
"type": "BIGINT",
"unsigned": false,
"values": [],
"zerofill": false
+23 -33
View File
@@ -107,21 +107,17 @@
<div data-controller='downloads.front.downloads.browse'>
{template="categoryMenu" group="browse" params="$category->children()"}
{{if \IPS\downloads\Category::canOnAny('add') AND ( !$category OR $category->can('add') ) }}
<ul class="ipsToolList ipsToolList_horizontal ipsResponsive_hidePhone ipsClearfix ipsSpacer_both">
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add'), $category"}
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add') or $category->can('add'), $category"}
</ul>
{{endif}}
<div class='ipsBox cDownloadsCategoryTable'>
{$table|raw}
</div>
{{if \IPS\downloads\Category::canOnAny('add') AND ( !$category OR $category->can('add') ) }}
<ul class="ipsToolList ipsToolList_horizontal ipsResponsive_showPhone ipsResponsive_block ipsClearfix ipsSpacer_top">
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add'), $category"}
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add') or $category->can('add'), $category"}
</ul>
{{endif}}
</div>
<div class='ipsResponsive_showPhone ipsResponsive_block ipsSpacer_top'>
@@ -132,7 +128,7 @@
</div>
{{endif}}]]></template>
<template template_group="browse" template_name="categoryButtons" template_data="$canSubmitFiles, $currentCategory=NULL" template_location="front" template_app="downloads"><![CDATA[
{{if $canSubmitFiles AND ( !$currentCategory OR $currentCategory->can('add') ) }}
{{if $canSubmitFiles}}
<li class='ipsToolList_primaryAction'>
{{if $currentCategory OR $currentCategory = \IPS\downloads\Category::theOnlyNode()}}
{{if \IPS\Member::loggedIn()->group['idm_bulk_submit']}}
@@ -354,12 +350,10 @@
{{if \IPS\downloads\Category::canOnAny('add') OR \IPS\downloads\Category::theOnlyNode()}}
<ul class="ipsToolList ipsToolList_horizontal ipsResponsive_hidePhone ipsClearfix ipsSpacer_bottom">
{{if \IPS\downloads\Category::canOnAny('add')}}
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add')"}
{{endif}}
{{if \IPS\downloads\Category::theOnlyNode() and ( !\IPS\Settings::i()->club_nodes_in_apps or !\IPS\downloads\Category::clubNodes() )}}
<li><a class='ipsButton ipsButton_link ipsButton_medium ipsButton_fullWidth' href='{expression="\IPS\downloads\Category::theOnlyNode()->url()"}'>{lang="view_all_files"}</a></li>
{{endif}}
{{if \IPS\downloads\Category::theOnlyNode() and ( !\IPS\Settings::i()->club_nodes_in_apps or !\IPS\downloads\Category::clubNodes() )}}
<li><a class='ipsButton ipsButton_link ipsButton_medium ipsButton_fullWidth' href='{expression="\IPS\downloads\Category::theOnlyNode()->url()"}'>{lang="view_all_files"}</a></li>
{{endif}}
</ul>
{{endif}}
{{if settings.idm_show_newest }}
@@ -437,11 +431,9 @@
</div>
{{endif}}
{{if \IPS\downloads\Category::canOnAny('add')}}
<ul class="ipsToolList ipsToolList_horizontal ipsResponsive_showPhone ipsResponsive_block ipsClearfix ipsSpacer_top">
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add')"}
</ul>
{{endif}}]]></template>
<ul class="ipsToolList ipsToolList_horizontal ipsResponsive_showPhone ipsResponsive_block ipsClearfix ipsSpacer_top">
{template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add')"}
</ul>]]></template>
<template template_group="browse" template_name="indexBlock" template_data="$file" template_location="front" template_app="downloads"><![CDATA[<li class='ipsAreaBackground_reset ipsType_blendLinks ipsClearfix cDownloadsCarouselItem ipsPad_half ipsCarousel_item'>
<a href='{$file->url()}' title='{lang="view_this_file" sprintf="$file->name"}'>
{template="thumbImage" group="global" app="core" params="$file->primary_screenshot_thumb, $file->name"}
@@ -614,11 +606,11 @@
{{if in_array( $k, array( 'total_disk_spaced', 'total_bandwidth', 'current_month_bandwidth' ) )}}
{filesize="$v"}
{{elseif $k === 'largest_file'}}
<a href='{$v->url()}' target='_blank'>{$v->name}</a> <span class="ipsType_light">({filesize="$v->filesize()"})</span>
<a href='{$v->url()}' target='_blank' rel='noopener'>{$v->name}</a> <span class="ipsType_light">({filesize="$v->filesize()"})</span>
{{elseif $k === 'most_viewed_file'}}
<a href='{$v->url()}' target='_blank'>{$v->name}</a> <span class="ipsType_light">({lang="num_views_with_number" pluralize="$v->views"})</span>
<a href='{$v->url()}' target='_blank' rel='noopener'>{$v->name}</a> <span class="ipsType_light">({lang="num_views_with_number" pluralize="$v->views"})</span>
{{elseif $k === 'most_downloaded_file'}}
<a href='{$v->url()}' target='_blank'>{$v->name}</a> <span class="ipsType_light">({lang="num_downloads" pluralize="$v->downloads"})</span>
<a href='{$v->url()}' target='_blank' rel='noopener'>{$v->name}</a> <span class="ipsType_light">({lang="num_downloads" pluralize="$v->downloads"})</span>
{{elseif $k === 'total_files' OR $k === 'total_views' OR $k === 'total_downloads'}}
{number="$v"}
{{else}}
@@ -653,12 +645,10 @@
{template="embedHeader" group="embed" app="core" params="$item, \IPS\Member::loggedIn()->language()->addToStack( 'x_created_file_in', FALSE, array( 'sprintf' => array( $item->author()->name, $item->container()->_title ) ) ), $item->mapped('date'), $url"}
{{if $item->primary_screenshot_thumb}}
<div class='ipsRichEmbed_masthead ipsRichEmbed_mastheadBg cFileEmbed ipsType_center'>
<a href='{$url}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), \IPS\File::get( 'downloads_Screenshots', $item->primary_screenshot_thumb )->url )"}") '>
<img src='{file="$item->primary_screenshot_thumb" extension="downloads_Screenshots"}' alt="{$item->mapped('title')}" class='ipsHide'>
<a href='{$url}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $image->url )"}") '>
<img src='{$image->url}' alt="{$item->mapped('title')}" class='ipsHide'>
</a>
</div>
{{else}}
<div class='cFileEmbed ipsNoThumb ipsNoThumb_video'>&nbsp;</div>
{{endif}}
<div class='ipsPad_double ipsClearfix'>
<h3 class='ipsRichEmbed_itemTitle ipsTruncate ipsTruncate_line ipsType_blendLinks'>
@@ -1132,7 +1122,7 @@
<td>{template="userPhoto" app="core" group="global" params="$member"} {$member->link()|raw}</td>
<td>
{{if $member->member_id}}
<a href='{$member->url()->setQueryString( array( 'do' => 'content', 'type' => 'downloads_file' ) )}' target='_blank'>{$row['files']}</a>
<a href='{$member->url()->setQueryString( array( 'do' => 'content', 'type' => 'downloads_file' ) )}' target='_blank' rel='noopener'>{$row['files']}</a>
{{else}}
{$row['files']}
{{endif}}
@@ -1588,7 +1578,7 @@
</div>]]></template>
<template template_group="view" template_name="downloadButton" template_data="$file" template_location="front" template_app="downloads"><![CDATA[
<li>
{{if !$file->canDownload()}}
{{if !$file->canDownload() AND !( !$file->container()->can( 'download' ) AND $file->container()->message('npd') )}}
{{if !\IPS\Member::loggedIn()->member_id}}
<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> {lang="download_no_permission_guest"}</span>
<a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class='ipsButton ipsButton_light ipsButton_medium ipsButton_fullWidth ipsSpacer_top'>{lang="sign_in_short"}</a>
@@ -1932,14 +1922,14 @@
</section>
{{endif}}
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() or $file->canEnablePurchases() or $file->canDisablePurchases() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') ) || ( \IPS\IPS::classUsesTrait( $file, 'IPS\Content\Reactable' ) and settings.reputation_enabled )}}
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() or $file->canEnablePurchases() or $file->canDisablePurchases() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') ) or $file->canReportOrRevoke() or ( \IPS\IPS::classUsesTrait( $file, 'IPS\Content\Reactable' ) and settings.reputation_enabled )}}
<div class='ipsItemControls'>
{{if \IPS\IPS::classUsesTrait( $file, 'IPS\Content\Reactable' ) and settings.reputation_enabled}}
{template="reputation" app="core" group="global" params="$file"}
{{endif}}
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') ) || \IPS\Member::loggedIn()->group['g_can_report']}}
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() or $file->canEnablePurchases() or $file->canDisablePurchases() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') ) or $file->canReportOrRevoke()}}
<ul class='ipsToolList ipsToolList_horizontal ipsPos_left ipsClearfix ipsResponsive_noFloat ipsItemControls_left'>
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') )}}
{{if ( $file->canEdit() or $file->canPin() or $file->canUnpin() or $file->canFeature() or $file->canUnfeature() or $file->canHide() or $file->canUnhide() or $file->canMove() or $file->canLock() or $file->canUnlock() or $file->canDelete() or $file->canEnablePurchases() or $file->canDisablePurchases() ) or ( $file->hidden() == -2 AND \IPS\Member::loggedIn()->modPermission('can_manage_deleted_content') )}}
<li>
<a href='#elFileActions_menu' id='elFileActions' class='ipsButton ipsButton_light ipsButton_verySmall ipsButton_fullWidth' data-ipsMenu>{lang="file_actions"} <i class='fa fa-caret-down'></i></a>
<ul id='elFileActions_menu' class='ipsMenu ipsMenu_auto ipsHide'>
@@ -2255,7 +2245,7 @@
</div>
<div class='ipsDataItem_main'>
<div class='ipsType_break ipsContained'><a href="{$comment->url()}" class='ipsTruncate ipsTruncate_line'>{$comment->item()->name}</a></div>
<span class='ipsType_light ipsType_small'>{lang="byline_nodate" htmlsprintf="$comment->author()->link()"} &middot; <a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->id ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a></span>
<span class='ipsType_light ipsType_small'>{lang="byline_nodate" htmlsprintf="$comment->author()->link()"} &middot; <a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findReview', 'review' => $comment->id ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a></span>
{template="rating" group="global" location="front" app="core" params="'small', $comment->rating, \IPS\Settings::i()->reviews_rating_out_of"}
<div class='ipsType_medium ipsType_textBlock ipsType_richText ipsType_break ipsContained' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='{{if $orientation == 'vertical'}}6 lines{{else}}2 lines{{endif}}' data-ipsTruncate-watch='false'>
{$comment->truncated( true )|raw}
@@ -2277,14 +2267,14 @@
<a href='{$comment->url('report')}' data-ipsDialog data-ipsDialog-remoteSubmit data-ipsDialog-size='medium' data-ipsDialog-flashMessage='{lang="report_submit_success"}' data-ipsDialog-title="{lang="report"}" data-action='reportComment' title='{lang="report_content"}'>{lang="report"}</a> &middot;
{{endif}}
<a class='ipsType_blendLinks' href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->id ) )}' data-ipsTooltip title='{lang="share_this_comment"}' data-ipsMenu data-ipsMenu-closeOnClick='false' id='elShareComment_{$comment->id}'><i class='fa fa-share-alt'></i></a>
<a class='ipsType_blendLinks' href='{$comment->item()->url()->setQueryString( array( 'do' => 'findReview', 'review' => $comment->id ) )}' data-ipsTooltip title='{lang="share_this_comment"}' data-ipsMenu data-ipsMenu-closeOnClick='false' id='elShareComment_{$comment->id}'><i class='fa fa-share-alt'></i></a>
</p>
<h3 class='ipsComment_author ipsType_blendLinks'>
<strong class='ipsType_normal'>{template="userLink" app="core" group="global" params="$comment->author(), $comment->warningRef()"}</strong>
{template="reputationBadge" group="global" app="core" params="$comment->author()"}
</h3>
<p class='ipsComment_meta ipsType_light ipsType_medium'>
<a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->id ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a>
<a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findReview', 'review' => $comment->id ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a>
{{if $comment->editLine()}}
({lang="edited_lc"})
{{endif}}
@@ -2300,7 +2290,7 @@
</div>
<div class='ipsPad'>
{{if settings.reputation_enabled and \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and settings.reputation_highlight and $comment->reputation() >= settings.reputation_highlight}}
{{if settings.reputation_enabled and \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and settings.reputation_highlight and $comment->reactionCount() >= settings.reputation_highlight}}
<strong class='ipsComment_popularFlag' data-ipsTooltip title='{lang="this_is_a_popular_comment"}'><i class='fa fa-star'></i></strong>
{{endif}}
<div class='ipsType_break ipsContained'><a href="{$comment->url()}" class='ipsDataItem_title ipsTruncate ipsTruncate_line'>{$comment->item()->name}</a></div>
+35 -1
View File
@@ -239,9 +239,43 @@
"102046": "4.2.7",
"102047": "4.2.8",
"102048": "4.2.8",
"102049": "4.2.9",
"103000": "4.3.0 Beta 1",
"103002": "4.3.0 Beta 2",
"103003": "4.3.0 Beta 3",
"103004": "4.3.0 Beta 4",
"103005": "4.3.0"
"103005": "4.3.0",
"103006": "4.3.1",
"103007": "4.3.1",
"103008": "4.3.1",
"103009": "4.3.2",
"103010": "4.3.2",
"103011": "4.3.3",
"103012": "4.3.3",
"103013": "4.3.3",
"103014": "4.3.3",
"103015": "4.3.3",
"103016": "4.3.3",
"103017": "4.3.3",
"103018": "4.3.3",
"103019": "4.3.3",
"103020": "4.3.3",
"103021": "4.3.4",
"103022": "4.3.4",
"103023": "4.3.4",
"103024": "4.3.4",
"103025": "4.3.4",
"103026": "4.3.5 Beta 1",
"103027": "4.3.5 Beta 2",
"103028": "4.3.5",
"103029": "4.3.5",
"103030": "4.3.5",
"103031": "4.3.5",
"103032": "4.3.5",
"103033": "4.3.6 Beta 1",
"103034": "4.3.6 Beta 2",
"103035": "4.3.6",
"103036": "4.3.6",
"103037": "4.3.6",
"103038": "4.3.6"
}
@@ -31,7 +31,7 @@ class _Categories
/**
* @brief Controller classes
*/
public static $controllers = array( "browse" );
public static $controllers = array( "IPS\\downloads\\modules\\front\\downloads\\browse" );
/**
* Get Setting Field
@@ -24,18 +24,12 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
class _Downloads
{
/**
* @brief Content Item Classes
*/
public $classes = array();
/**
* Constructor
* @deprecated
*
* @param \IPS\Member|IPS\Member\Group|NULL $memberOrGroup If checking access, the member/group to check for, or NULL to not check access
* @return void
* @return bool
*/
public function __construct( $memberOrGroup = NULL )
final public function deprecated()
{
return TRUE;
}
}
@@ -31,7 +31,7 @@ class _Categories
*/
public function canUseHtml( $member )
{
return TRUE;
return NULL;
}
/**
@@ -49,14 +49,15 @@ class _Categories
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
{
try
{
@@ -49,14 +49,15 @@ class _Downloads
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
{
try
{
@@ -1,3 +1,32 @@
<?php
/**
* @brief Member Form Extension
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Downloads
* @since 07 Feb 2014
*/
// Removed
namespace IPS\downloads\extensions\core\MemberForm;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
class _Downloads
{
/**
* @deprecated
*
* @return bool
*/
final public function deprecated()
{
return TRUE;
}
}
@@ -67,8 +67,7 @@ class _Follow
}
$category = \IPS\downloads\Category::load( $data['category_id'] );
$title = $category->_title;
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('backgroundQueue_follow', FALSE, array( 'sprintf' => array( "<a href='{$category->url()}' target='_blank'>{$title}</a>" ) ) ), 'complete' => $complete );
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('backgroundQueue_follow', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->basicUrl( $category->url(), TRUE, $category->_title, FALSE ) ) ) ), 'complete' => $complete );
}
}
@@ -39,8 +39,8 @@ class _view extends \IPS\Content\Controller
{
$this->file = \IPS\downloads\File::load( \IPS\Request::i()->id );
/* Downloading does not check 'view' permission, as there is a separate download permission already */
if ( !$this->file->canView( \IPS\Member::loggedIn() ) and \IPS\Request::i()->do != 'download' )
/* Downloading and viewing the embed does not need to check the permission, as there is a separate download permission already and embed method need to return it's own error */
if ( !$this->file->canView( \IPS\Member::loggedIn() ) and \IPS\Request::i()->do != 'download' and \IPS\Request::i()->do != 'embed' )
{
\IPS\Output::i()->error( $this->file->container()->message('npv') ?: 'node_error', '2D161/2', 403, '' );
}
@@ -161,7 +161,7 @@ class _view extends \IPS\Content\Controller
\IPS\Output::i()->jsonLd['download']['dateModified'] = \IPS\DateTime::ts( $this->file->updated )->format( \IPS\DateTime::ISO8601 );
}
if( $this->file->container()->bitoptions['reviews'] AND $this->file->reviews )
if( $this->file->container()->bitoptions['reviews'] AND $this->file->reviews AND $this->file->averageReviewRating() )
{
\IPS\Output::i()->jsonLd['download']['aggregateRating'] = array(
'@type' => 'AggregateRating',
@@ -558,15 +558,19 @@ class _view extends \IPS\Content\Controller
{
\IPS\Output::i()->error( 'downloads_no_file', '3D161/G', 404, '' );
}
/* Log session */
$downloadSessionId = \IPS\Login::generateRandomString();
\IPS\Db::i()->insert( 'downloads_sessions', array(
'dsess_id' => $downloadSessionId,
'dsess_mid' => (int) \IPS\Member::loggedIn()->member_id,
'dsess_ip' => \IPS\Request::i()->ipAddress(),
'dsess_file' => $this->file->id,
'dsess_start' => time()
) );
/* Log session (but we don't need to create a new session on subsequent requests) */
if( !isset( $_SERVER['HTTP_RANGE'] ) )
{
$downloadSessionId = \IPS\Login::generateRandomString();
\IPS\Db::i()->insert( 'downloads_sessions', array(
'dsess_id' => $downloadSessionId,
'dsess_mid' => (int) \IPS\Member::loggedIn()->member_id,
'dsess_ip' => \IPS\Request::i()->ipAddress(),
'dsess_file' => $this->file->id,
'dsess_start' => time()
) );
}
/* If a user aborts the connection the shutdown function is not executed, and we need it to be */
ignore_user_abort( true );
@@ -785,7 +785,10 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->bitoptions[ $k ] = $values[ 'cbitoptions_' . $k ];
}
$this->types = implode( ',', $values['ctypes'] );
if( isset( $values['ctypes'] ) )
{
$this->types = implode( ',', $values['ctypes'] );
}
if ( $values['club_node_name'] )
{
+30 -23
View File
@@ -241,7 +241,7 @@ class _File extends \IPS\Content\Item implements
*/
public function lastReviewPageUrl()
{
return parent::lastCommentPageUrl()->setQueryString( 'tab', 'reviews' );
return parent::lastReviewPageUrl()->setQueryString( 'tab', 'reviews' );
}
/**
@@ -1084,7 +1084,7 @@ class _File extends \IPS\Content\Item implements
if ( !$this->container()->can( 'download', $member ) )
{
/* Hold on - if we're a guest and buying means we'll have to register which will put us in a group with permission, we can continue */
if ( \IPS\Member::loggedIn()->member_id or !$this->container()->can( 'download', \IPS\Member\Group::load( \IPS\Settings::i()->member_group ) ) )
if ( $member->member_id or !$this->container()->can( 'download', \IPS\Member\Group::load( \IPS\Settings::i()->member_group ) ) )
{
return FALSE;
}
@@ -1152,23 +1152,33 @@ class _File extends \IPS\Content\Item implements
}
/* Paid? */
if ( $this->isPaid() and !$member->group['idm_bypass_paid'] and $member->member_id != $this->author()->member_id )
if ( $this->isPaid() )
{
if ( $this->cost )
/* Guests can't download paid files */
if ( !$member->member_id )
{
if ( !count( \IPS\downloads\extensions\nexus\Item\File::getPurchases( \IPS\nexus\Customer::load( $member->member_id ), $this->id, FALSE ) ) )
throw new \DomainException( $this->container()->message('npd') ?: 'download_no_perm' );
}
if ( !$member->group['idm_bypass_paid'] and $member->member_id != $this->author()->member_id )
{
if ( $this->cost )
{
throw new \DomainException( 'file_not_purchased' );
if ( !count( \IPS\downloads\extensions\nexus\Item\File::getPurchases( \IPS\nexus\Customer::load( $member->member_id ), $this->id, FALSE ) ) )
{
throw new \DomainException( 'file_not_purchased' );
}
}
elseif ( $this->nexus )
{
if ( !count( \IPS\nexus\extensions\nexus\Item\Package::getPurchases( \IPS\nexus\Customer::load( $member->member_id ), explode( ',', $this->nexus ), FALSE ) ) )
{
throw new \DomainException( 'file_not_purchased' );
}
}
}
elseif ( $this->nexus )
{
if ( !count( \IPS\nexus\extensions\nexus\Item\Package::getPurchases( \IPS\nexus\Customer::load( $member->member_id ), explode( ',', $this->nexus ), FALSE ) ) )
{
throw new \DomainException( 'file_not_purchased' );
}
}
}
/* Minimum posts */
if ( $member->member_id and $restrictions['min_posts'] and $restrictions['min_posts'] > $member->member_posts )
@@ -1179,7 +1189,7 @@ class _File extends \IPS\Content\Item implements
/* Simultaneous downloads */
if ( $restrictions['limit_sim'] )
{
if ( \IPS\Db::i()->select( 'COUNT(*)', 'downloads_sessions', $member->member_id ? array( 'dsess_mid=?', $member->member_id ) : array( 'dsess_ip=?', \IPS\Request::i()->ipAddress() ) )->first() >= $restrictions['limit_sim'] )
if ( \IPS\Db::i()->select( 'COUNT(*)', 'downloads_sessions', array( array( 'dsess_start > ?', time() - ( 60 * 15 ) ), $member->member_id ? array( 'dsess_mid=?', $member->member_id ) : array( 'dsess_ip=?', \IPS\Request::i()->ipAddress() ) ) )->first() >= $restrictions['limit_sim'] )
{
throw new \DomainException( $member->language()->addToStack( 'max_simultaneous_downloads', FALSE, array( 'pluralize' => array( $restrictions['limit_sim'] ) ) ) );
}
@@ -1401,19 +1411,16 @@ class _File extends \IPS\Content\Item implements
*/
public function processForm( $values )
{
parent::processForm( $values );
$new = FALSE;
$new = $this->_new;
if ( $this->_new )
{
$new = TRUE;
}
else
parent::processForm( $values );
if ( !$new )
{
$oldContent = $this->desc;
}
$this->desc = $values['file_desc'];
if ( !$this->_new )
if ( !$new )
{
$this->sendAfterEditNotifications( $oldContent );
}
@@ -2329,7 +2336,7 @@ class _File extends \IPS\Content\Item implements
*/
public function embedImage()
{
return $this->primary_screenshot_thumb ? \IPS\File::get( 'downloads_Screenshots', $this->primary_screenshot_thumb ) : NULL;
return $this->primary_screenshot_thumb ?: NULL;
}
/**