diff --git a/application/modules/default/views/scripts/product/partials/details.phtml b/application/modules/default/views/scripts/product/partials/details.phtml index 51e956e9c..41c5b68d6 100644 --- a/application/modules/default/views/scripts/product/partials/details.phtml +++ b/application/modules/default/views/scripts/product/partials/details.phtml @@ -1,423 +1,427 @@ . **/ $tableProject = new Default_Model_Project(); $this->product_views = $tableProject->fetchProjectViews($this->product->project_id); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $tableTags = new Default_Model_Tags(); $tagsArray = $tableTags->getTagsArray($this->product->project_id, $tableTags::TAG_TYPE_PROJECT, $tableTags::TAG_GHNS_EXCLUDED_GROUPID); $isGhnsExcluded = false; if(isset($tagsArray) && (count($tagsArray) == 1)) { $isGhnsExcluded = true; } $filesTable = new Default_Model_DbTable_PploadFiles(); -$countDownloadsToday = $filesTable->fetchCountDownloadsTodayForProject($this->product->ppload_collection_id); -$countDownloadsTodayUk = $filesTable->fetchCountDownloadsTodayForProjectNew($this->product->ppload_collection_id); - $mediaViewsTable = new Default_Model_DbTable_MediaViews(); + +$countDownloadsToday = 0; +$countMediaViewsAlltime = 0; +if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { + $countDownloadsToday = $filesTable->fetchCountDownloadsTodayForProject($this->product->ppload_collection_id); + $countMediaViewsAlltime = $mediaViewsTable->fetchCountViewsForProjectAllTime($this->product->project_id); +} +$countDownloadsTodayUk = $filesTable->fetchCountDownloadsTodayForProjectNew($this->product->ppload_collection_id); $countMediaViewsToday = $mediaViewsTable->fetchCountViewsTodayForProject($this->product->project_id); -$countMediaViewsAlltime = $mediaViewsTable->fetchCountViewsForProjectAllTime($this->product->project_id); $countPageviews = $this->projectDetailCounts($this->product->project_id); $countPageviewsTotal = 0; $countPageviewsToday = $countPageviews[0]['count_views']; if(sizeof($countPageviews)==2) $countPageviewsTotal = $countPageviews[1]['count_views']; // $heute = date("Y-m-d H:i:s"); $today = (new DateTime())->modify('-1 day'); $filterDownloadToday = $today->format("Y-m-d H:i:s"); ?>
inlineScript()->appendScript( ' $(document).ready(function(){ GhnsExcludedClick.setup('.$this->product->project_id.'); }); '); }