Jump to content

Добавление своей кнопки в приложении "Файлы (Downloads)"

Featured Replies

Может кто знает, как добавить свою кнопку с внешней ссылкой в то место. где показано на скрине:

Screenshot.png

Спасибо заранее!

Link to comment
https://ipbmafia.ru/topic/15092-dobavlenie-svoej-knopki-v-prilozhenii-fajly-downloads/
Share on other sites

@MurderCore

шаблоны стиля - downloads - front - view - 

заменить весь шаблон на 

<div itemscope itemtype="http://schema.org/CreativeWork">
	<div class='{{if $file->primary_screenshot}}ipsColumns ipsColumns_collapsePhone{{endif}} ipsClearfix'>
		<div {{if $file->primary_screenshot_thumb}}class='ipsColumn ipsColumn_fluid'{{endif}}>
			<h1 class='ipsType_pageTitle ipsType_break'>
				{{if $file->prefix()}}
					{template="prefix" group="global" app="core" params="$file->prefix( TRUE ), $file->prefix()"}
				{{endif}}
				
				<div class='ipsType_break ipsContained'>{{if $file->locked()}}<i class='fa fa-lock'></i> {{endif}}{$file->name} {$file->version}</div>
				{{if $file->hidden() === 1}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
				{{elseif $file->hidden() === -1}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$file->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
				{{endif}}
				{{if $file->canUnfeature()}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
				{{endif}}
			</h1>
			
			{{if \IPS\Application::appIsEnabled( 'nexus' ) and settings.idm_nexus_on}}
				<p class="ipsType_pageTitle ipsType_reset ipsSpacer_top ipsSpacer_half">
					{{if $price = $file->price()}}
						<span class='cFilePrice'>{$price|raw}</span>
						{{if $renewalTerm = $file->renewalTerm()}}
							<span class='ipsType_light'>· {lang="file_renewal_term_val" sprintf="$renewalTerm"}</span>
						{{endif}}
					{{else}}
						<span class='cFilePrice'>{lang="file_free"}</span>
					{{endif}}
				</p>
			{{endif}}

			{{if $file->container()->bitoptions['reviews']}}
				<span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
					<meta itemprop='ratingValue' content='{$file->averageReviewRating()}'>
					<meta itemprop='reviewCount' content='{$file->reviews}'>
					{template="rating" group="global" location="front" app="core" params="'large', $file->averageReviewRating(), \IPS\Settings::i()->reviews_rating_out_of, $file->memberReviewRating()"}   <span class='ipsType_normal ipsType_light'>({lang="num_reviews" pluralize="$file->reviews"})</span>
				</span>
			{{endif}}

			<div class='ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone'>
				{template="follow" app="core" group="global" params="'downloads', 'file', $file->id, $file->followers()->count( TRUE )"}
			</div>

			<hr class='ipsHr'>

			<div class='ipsPhotoPanel ipsPhotoPanel_tiny ipsClearfix ipsSpacer_bottom'>
				{template="userPhoto" app="core" group="global" params="$file->author(), 'tiny', $file->warningRef()"}
				<div>
					<p class='ipsType_reset ipsType_large ipsType_blendLinks'>
						{lang="byline_nodate_itemprop" htmlsprintf="$file->author()->link( $file->warningRef() )"}{{if member.group['idm_view_approvers'] and $file->approver}} {lang="file_approved_by" sprintf="\IPS\Member::load( $file->approver )->name" htmlsprintf="\IPS\DateTime::ts( $file->approvedon )->html()"}{{endif}}
					</p>
					{{if $file->author()->member_id OR $file->canChangeAuthor()}}
					<ul class='ipsList_inline'>
						{{if $file->author()->member_id}}
							<li><a href='{url="app=core&module=members&controller=members&id={$file->author()->member_id}&do=content&type=downloads_file" base="front" seoTitles="$file->author()->members_seo_name" seoTemplate="profile_content"}'>{lang="find_users_files"}</a></li>
						{{endif}}
						{{if $file->canChangeAuthor()}}
							<li><a href='{$file->url()->setQueryString( array( 'do' => 'changeAuthor' ) )}' data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title="{lang="change_author_d"}" title='{lang="change_author_title"}'>{lang="change_author_d"}</a></li>
						{{endif}}
					</ul>
					{{endif}}
				</div>
			</div>	

			{{if count( $file->tags() )}}		
				{template="tags" group="global" app="core" params="$file->tags()"}
			{{endif}}	
		</div>

	</div>

	{{if $file->hidden() === 1 and $file->canUnhide()}}
		<div class="ipsMessage ipsMessage_warning ipsSpacer_both">
			<p class="ipsType_reset">{lang="file_pending_approval"}</p>
			<br>
			<ul class='ipsList_inline'>
				<li><a href="{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'unhide' ) )}" class="ipsButton ipsButton_positive ipsButton_verySmall" title='{lang="approve_title_file"}'><i class="fa fa-check"></i> {lang="approve"}</a></li>
				{{if $file->canDelete()}}
					<li><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'delete' ) )}' data-confirm  title='{lang="downloads_delete_title"}' class='ipsButton ipsButton_negative ipsButton_verySmall'><i class='fa fa-times'></i> {lang="delete"}</a></li>
				{{endif}}
			</ul>
		</div>
	{{endif}}
	
	{{if $file->screenshots()->getInnerIterator()->count( true )}}
		<section class='ipsBox ipsSpacer_both'>
			<h2 class='ipsType_sectionTitle ipsType_reset'>{lang="screenshots_ct" pluralize="$file->screenshots()->getInnerIterator()->count( true )"}</h2>
			<div class='ipsPad_half ipsAreaBackground'>
				<div class='ipsCarousel ipsClearfix' data-ipsCarousel data-ipsCarousel-showDots>
					<ul class='cDownloadsCarousel ipsClearfix' data-role="carouselItems">
						{{$fullScreenshots = iterator_to_array( $file->screenshots() );}}
						{{foreach $file->screenshots( 1 ) as $id => $screenshot}}
							<li class='ipsCarousel_item ipsAreaBackground_reset ipsPad_half'>
								<span style="background-image: url( '{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $screenshot->url )"}' )" class="ipsThumb ipsThumb_medium ipsThumb_bg ipsCursor_pointer" data-ipsLightbox data-ipsLightbox-group="download_{$file->id}" data-fullURL="{$fullScreenshots[ $id ]->url}">
									<img src="{$screenshot->url}" alt="" {{if $file->primary_screenshot_thumb == $screenshot}}itemprop='image'{{endif}}>
								</span>
							</li>
						{{endforeach}}
					</ul>
					<span class='ipsCarousel_shadow ipsCarousel_shadowLeft'></span>
					<span class='ipsCarousel_shadow ipsCarousel_shadowRight'></span>
					<a href='#' class='ipsCarousel_nav ipsHide' data-action='prev'><i class='fa fa-chevron-left'></i></a>
					<a href='#' class='ipsCarousel_nav ipsHide' data-action='next'><i class='fa fa-chevron-right'></i></a>
				</div>
			</div>
		</section>
	{{endif}} 

	<div class='ipsColumns ipsColumns_collapsePhone ipsBox'>
		<article class='ipsColumn ipsColumn_fluid'>
			<div class='ipsPad'>
				<h2 class='ipsType_sectionHead'>{lang="file_desc"}</h2>
				<section class='ipsType_normal ipsSpacer_top'>
					<div class='ipsType_richText ipsContained ipsType_break' itemprop='text' data-controller='core.front.core.lightboxedImages'>
						{$file->content()|raw}
					</div>

					{{if $versionData['b_changelog'] or !empty( $previousVersions )}}
						<hr class='ipsHr ipsSpacer_both ipsSpacer_double'>
						<section data-controller='downloads.front.view.changeLog'>
							<h2 class='ipsType_sectionHead'>{lang="whats_new_in_version" sprintf="$versionData['b_version']"}{{if !empty( $previousVersions )}}   <a href='#' id='elChangelog' data-ipsMenu data-ipsMenu-selectable="radio" class='ipsButton ipsButton_verySmall ipsButton_light' title='{lang="see_changelog_title"}'>{lang="see_changelog"} <i class='fa fa-caret-down'></i></a>{{endif}}</h2>

							<div data-role='changeLogData'>
								{template="changeLog" group="view" params="$file, $versionData"}
							</div>
							<ul class='ipsMenu ipsMenu_selectable ipsMenu_auto ipsHide' id='elChangelog_menu'>
								<li class='ipsMenu_item {{if !request.changelog}}ipsMenu_itemChecked{{endif}}' data-ipsMenuValue='{$file->version}'><a href='{$file->url()->setQuerystring( 'changelog', 0 )}' title='{lang="see_changelog_for" sprintf="$file->version"}'>{$file->version}</a></li>
								{{foreach $previousVersions as $version}}
									<li class='ipsMenu_item {{if request.changelog == $version['b_id']}}ipsMenu_itemChecked{{endif}} {{if $version['b_hidden']}}ipsModerated{{endif}}' data-ipsMenuValue='{expression="md5( $version['b_version'] . $version['b_backup'] . mt_rand() )"}' data-changelogTitle="{$version['b_version']}">
										<a href='{$file->url()->setQueryString( 'changelog', $version['b_id'] )}' title='{lang="see_changelog_for" sprintf="$version['b_version']"}'>
											{$version['b_version']}<br>
											<span class='ipsType_light'>{expression="\IPS\DateTime::ts( $version['b_backup'] )->html()" raw="true"}</span>
										</a>
									</li>
								{{endforeach}}
							</ul>
						</section>
					{{endif}}

					<hr class='ipsHr ipsSpacer_top ipsSpacer_double'>

					{{if $file instanceof \IPS\Content\Reputation and settings.reputation_enabled}}
						<div class='ipsPos_right'>
							{template="reputation" app="core" group="global" params="$file"}
						</div>
					{{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()}}
						<a href='#elFileActions_menu' id='elFileActions' class='ipsButton ipsButton_light ipsButton_verySmall' data-ipsMenu>{lang="file_actions"} <i class='fa fa-caret-down'></i></a>
						<ul id='elFileActions_menu' class='ipsMenu ipsMenu_auto ipsHide'>
							{{if $file->canEdit()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->setQueryString( array( 'do' => 'newVersion' ) )}' title='{lang="upload_new_version_title"}'>{lang="upload_new_version"}</a></li>
								<li class='ipsMenu_item'><a href='{$file->url()->setQueryString( array( 'do' => 'edit' ) )}' title='{lang="downloads_edit_details_title"}'>{lang="downloads_edit_details"}</a></li>
							{{endif}}
							{{if $file->canFeature()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'feature' ) )}' title='{lang="feature_title_file"}'>{lang="feature"}</a></li>
							{{endif}}
							{{if $file->canUnfeature()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'unfeature' ) )}' title='{lang="unfeature_title_file"}'>{lang="unfeature"}</a></li>
							{{endif}}
							{{if $file->canPin()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'pin' ) )}' title='{lang="pin_title_file"}'>{lang="pin"}</a></li>
							{{endif}}
							{{if $file->canUnpin()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'unpin' ) )}' title='{lang="unpin_title_file"}'>{lang="unpin"}</a></li>
							{{endif}}
							{{if $file->canHide()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'hide' ) )}' title='{lang="hide_title_file"}' data-ipsDialog data-ipsDialog-title="{lang="hide"}">{lang="hide"}</a></li>
							{{endif}}
							{{if $file->canUnhide()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'unhide' ) )}' title='{{if $file->hidden() === 1}}{lang="approve_title_file"}{{else}}{lang="unhide_title_file"}{{endif}}'>{{if $file->hidden() === 1}}{lang="approve"}{{else}}{lang="unhide"}{{endif}}</a></li>
							{{endif}}
							{{if $file->canLock()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'lock' ) )}' title='{lang="lock_title_file"}'>{lang="lock"}</a></li>
							{{endif}}
							{{if $file->canUnlock()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'unlock' ) )}' title='{lang="unlock_title_file"}'>{lang="unlock"}</a></li>
							{{endif}}
							{{if $file->canMove()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->setQueryString( array( 'do' => 'move' ) )}' data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title="{lang="move"}"  title='{lang="downloads_move_title"}'>{lang="move"}</a></li>
							{{endif}}
							{{if $file->canDelete()}}				
								<li class='ipsMenu_item'><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'moderate', 'action' => 'delete' ) )}' data-confirm  title='{lang="downloads_delete_title"}'>{lang="delete"}</a></li>
							{{endif}}
							{{if \IPS\Member::loggedIn()->modPermission('can_view_moderation_log')}}
								<li class='ipsMenu_sep'><hr></li>
								<li class="ipsMenu_item"><a href='{$file->url()->csrf()->setQueryString( array( 'do' => 'modLog' ) )}' data-ipsDialog data-ipsDialog-title='{lang="moderation_history"}'>{lang="moderation_history"}</a></li>
							{{endif}}
						</ul>
					{{endif}}

					{{if !\IPS\Member::loggedIn()->group['gbw_no_report'] }}
						 <a href='{$file->url('report')}' data-ipsDialog data-ipsDialog-size='medium' data-ipsDialog-title="{lang="report_file"}" data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="report_submit_success"}" title="{lang="report_file"}" class='ipsType_medium'>{lang="report_file"}</a>
					{{endif}}
				</section>
			</div>
		</article>
		<aside class='ipsColumn ipsColumn_wide'>
			<div class='ipsPad'>
				<ul class="ipsToolList ipsToolList_vertical ipsClearfix">
					{{if $file->canBuy()}}
						{{if $file->canDownload()}}
							{template="downloadButton" group="view" app="downloads" params="$file"}
						{{endif}}
						<li class='ipsToolList_primaryAction'>
							<a href='{$file->url('buy')->csrf()}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important'><i class='fa fa-shopping-cart'></i>  {lang="buy_now"} - {$file->price()|raw}</a>
						</li>
					{{else}}
						{{if $file->canDownload() or !$file->downloadTeaser()}}
							{template="downloadButton" group="view" app="downloads" params="$file"}
						{{else}}
							{$file->downloadTeaser()|raw}
						{{endif}}
					{{endif}}
					{{if ( isset( $purchasesToRenew ) or $purchasesToRenew = $file->purchasesToRenew() ) and count( $purchasesToRenew )}}
						<li class='ipsToolList_primaryAction'>
							{{if count( $purchasesToRenew ) === 1}}
								{{foreach $purchasesToRenew as $purchase}}
									<a href='{$purchase->url()->setQueryString('do', 'renew')->csrf()}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important'><i class='fa fa-refresh'></i>  {lang="purchase_renew_now"} - {$purchase->renewals->cost}</a>
								{{endforeach}}
							{{else}}
								<a href='#elFileRenew_menu' id='elFileRenew' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' data-ipsMenu><i class='fa fa-refresh'></i>  {lang="purchase_renew_now"} <i class="fa fa-caret-down"></i></a>
								<ul id='elFileRenew_menu' class='ipsMenu ipsMenu_auto ipsHide'>
									{{foreach $purchasesToRenew as $purchase}}
										<li class='ipsMenu_item'><a href="{$purchase->url()->setQueryString('do', 'renew')->csrf()}">{$purchase->name}<br><span class='ipsType_light'>{$purchase->renewals}</span></a></li>
									{{endforeach}}
								</ul>		
							{{endif}}						
						</li>
					{{endif}}
				</ul>
				<hr class='ipsHr'>

				{{if $file->topic()}}
					<a href='{$file->topic()->url()}' title='{lang="dl_get_support_title"}' class='ipsButton ipsButton_normal ipsButton_fullWidth'>{lang="dl_get_support"}</a>
				{{endif}}
				<hr class='ipsHr'>
					<a href='ссылка' title='текст' class='ipsButton ipsButton_normal ipsButton_fullWidth'>Название кнопки</a>              
					<br>              
              
              <h2 class='ipsType_sectionHead'>{lang="file_information"}</h2>
				<ul class="ipsDataList ipsDataList_reducedSpacing ipsSpacer_top">
					<li class="ipsDataItem">
						<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="views"}</strong></span>
						<span class="ipsDataItem_generic cFileInfoData">{number="$file->views"}</span>
						<meta itemprop='interactionCount' content='UserPageVisits:{$file->views}'>
					</li>
					{{if $file->price() and !$file->nexus and in_array( 'purchases', explode( ',', settings.idm_nexus_display ) )}}
						<li class="ipsDataItem" title='{lang="x_downloads" pluralize="$file->downloads"}' data-ipsTooltip>
							<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="idm_purchases"}</strong></span>
							<span class="ipsDataItem_generic cFileInfoData">{$file->purchaseCount()}</span>
							<meta itemprop='interactionCount' content='UserDownloads:{$file->downloads}'>
						</li>
					{{endif}}
					{{if !$file->price() or in_array( 'downloads', explode( ',', settings.idm_nexus_display ) ) }}
						<li class="ipsDataItem">
							<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="downloads_file_info"}</strong></span>
							<span class="ipsDataItem_generic cFileInfoData">{number="$file->downloads"}</span>
							<meta itemprop='interactionCount' content='UserDownloads:{$file->downloads}'>
						</li>
					{{endif}}
					<li class="ipsDataItem">
						<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="submitted"}</strong></span>
						<span class="ipsDataItem_generic cFileInfoData">{datetime="$file->submitted"}</span>
						<meta itemprop='dateCreated' content='{expression="\IPS\DateTime::ts( $file->submitted )->format( 'Y-m-d' )"}'>
					</li>
					{{if $file->updated != $file->submitted}}
						<li class="ipsDataItem">
							<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="updated"}</strong></span>
							<span class="ipsDataItem_generic cFileInfoData">{datetime="$file->updated"}</span>
							<meta itemprop='dateModified' content='{expression="\IPS\DateTime::ts( $file->updated )->format( 'Y-m-d' )"}'>
						</li>
					{{endif}}
					{{if $file->filesize()}}
						<li class="ipsDataItem">
							<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="filesize"}</strong></span>
							<span class="ipsDataItem_generic cFileInfoData">{filesize="$file->filesize()"}</span>
						</li>
					{{endif}}
					{{foreach $cfields as $k => $v}}
						<li class="ipsDataItem">
							<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="downloads_{$k}"}</strong></span>
							<div class="ipsDataItem_generic ipsType_break cFileInfoData">
								{$v|raw}
							</div>
						</li>
					{{endforeach}}
				</ul>

				{{if $file->canViewDownloaders() and $file->downloads}}
					<br>
					<a href='{$file->url('log')}' title='{lang="view_downloader_list"}' class='' data-ipsDialog data-ipsDialog-size="narrow" data-ipsDialog-title="{lang="downloaders"}">{lang="who_downloaded"}</a>
				{{endif}}

				<div class='ipsResponsive_showPhone ipsResponsive_block ipsSpacer_top'>
					{template="follow" app="core" group="global" params="'downloads', 'file', $file->id, $file->followers()->count( TRUE )"}
				</div>
			</div>
		</aside>
	</div>
	<br>
	
	{{if $prev || $next}}
		<div class='ipsGrid ipsGrid_collapsePhone ipsPager ipsSpacer_top'>
			{{if $prev !== NULL}}
				<div class="ipsGrid_span6 ipsType_left ipsPager_prev">
					<div class='ipsType_break ipsContained'>
						<a href="{$prev->url()}" title="{lang="prev_file"}" rel="prev">
							<span class="ipsPager_type">{lang="prev_file"}</span>
							<span class="ipsPager_title ipsType_light ipsTruncate ipsTruncate_line">{$prev->mapped('title')}</span>
						</a>
					</div>
				</div>
			{{else}}
				<div class='ipsGrid_span6'> </div>
			{{endif}}
			{{if $next !== NULL}}
				<div class="ipsGrid_span6 ipsType_right ipsPager_next">
					<div class='ipsType_break ipsContained'>
						<a href="{$next->url()}" title="{lang="next_file"}" rel="next">
							<span class="ipsPager_type">{lang="next_file"}</span>
							<span class="ipsPager_title ipsType_light ipsTruncate ipsTruncate_line">{$next->mapped('title')}</span>
						</a>
					</div>
				</div>
			{{else}}
				<div class='ipsGrid_span6'> </div>
			{{endif}}
		</div>
		<hr class='ipsHr'>
	{{endif}}

	{{if count( $file->shareLinks() )}}
		{template="sharelinks" app="core" group="global" params="$file"}
		<br>
	{{endif}}

	{{if $commentsAndReviews}}
		<a id="replies"></a>
		<h2 class='ipsType_sectionTitle ipsType_reset'>{lang="user_feedback"}</h2>
		{$commentsAndReviews|raw}
	{{endif}}
</div>

Далее, найти в этом шаблоне код

				<hr class='ipsHr'>
					<a href='ссылка' title='текст' class='ipsButton ipsButton_normal ipsButton_fullWidth'>Название кнопки</a>              
					<br>

и ввести ссылку, название кнопки и title

Edited by Redneck

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.


Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.