diff --git a/application/modules/default/controllers/ReportController.php b/application/modules/default/controllers/ReportController.php index f131f7cc6..687040c3a 100644 --- a/application/modules/default/controllers/ReportController.php +++ b/application/modules/default/controllers/ReportController.php @@ -1,240 +1,259 @@ . **/ class ReportController extends Zend_Controller_Action { public function commentAction() { $this->_helper->layout()->disableLayout(); if ((APPLICATION_ENV != 'searchbotenv') AND (false == SEARCHBOT_DETECTED)) { $comment_id = (int)$this->getParam('i'); $project_id = (int)$this->getParam('p'); $reported_by = Zend_Auth::getInstance()->hasIdentity() ? (int)Zend_Auth::getInstance()->getStorage()->read()->member_id : 0; $clientIp = null; $clientIp2 = null; if(isset($_SERVER['REMOTE_ADDR'])) { $clientIp = $_SERVER['REMOTE_ADDR']; } if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $clientIp2 = $_SERVER['HTTP_X_FORWARDED_FOR']; } $tableReportComments = new Default_Model_DbTable_ReportComments(); $commentReportArray = $tableReportComments->fetchAll('comment_id = ' . $comment_id . ' AND user_ip = "' . $clientIp . '"'); if(isset($commentReportArray) && count($commentReportArray) > 0) { $this->_helper->json(array( 'status' => 'ok', 'message' => '

You have already submitted a report for this comment.

', 'data' => array() )); } else { $tableReportComments->save(array('project_id' => $project_id, 'comment_id' => $comment_id, 'reported_by' => $reported_by, 'user_ip' => $clientIp, 'user_ip2' => $clientIp2 )); $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you for helping us to keep these sites SPAM-free.

', 'data' => array() )); } } } public function productAction() { $this->_helper->layout()->disableLayout(); if ((APPLICATION_ENV != 'searchbotenv') AND (false == SEARCHBOT_DETECTED)) { $session = new Zend_Session_Namespace(); $reportedProducts = isset($session->reportedProducts) ? $session->reportedProducts : array(); $project_id = (int)$this->getParam('p'); if (in_array($project_id, $reportedProducts)) { $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you, but you have already reported this product.

', 'data' => array() )); } $reported_by = 0; if (Zend_Auth::getInstance()->hasIdentity()) { $reported_by = (int)Zend_Auth::getInstance()->getStorage()->read()->member_id; } $modelProduct = new Default_Model_Project(); $productData = $modelProduct->fetchRow(array('project_id = ?' => $project_id, 'status' => Default_Model_DbTable_Project::PROJECT_ACTIVE)); if (empty($productData)) { $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you for helping us to keep these sites SPAM-free.

', 'data' => array() )); } if ($productData->spam_checked == 0) { $tableReportComments = new Default_Model_DbTable_ReportProducts(); $tableReportComments->save(array('project_id' => $project_id, 'reported_by' => $reported_by)); } $session->reportedProducts[] = $project_id; } $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you for helping us to keep these sites SPAM-free.

', 'data' => array() )); } public function productfraudAction() { $report_type = 1; $this->_helper->layout()->disableLayout(); if ((APPLICATION_ENV != 'searchbotenv') AND (false == SEARCHBOT_DETECTED)) { $session = new Zend_Session_Namespace(); $reportedFraudProducts = isset($session->reportedFraudProducts) ? $session->reportedFraudProducts : array(); $project_id = (int)$this->getParam('p'); $text = $this->getParam('t'); if (in_array($project_id, $reportedFraudProducts)) { $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you, but you have already reported this product.

', 'data' => array() )); } if (Zend_Auth::getInstance()->hasIdentity()) { $reported_by = (int)Zend_Auth::getInstance()->getStorage()->read()->member_id; $reportProducts = new Default_Model_DbTable_ReportProducts(); $reportProducts->save(array('project_id' => $project_id, 'reported_by' => $reported_by,'text' => $text, 'report_type' =>$report_type)); } $session->reportedFraudProducts[] = $project_id; } $this->_helper->json(array( 'status' => 'ok', 'message' => '

Thank you for reporting the misuse.

We will try to verify the reason for this case.

', 'data' => array() )); } public function flagmodAction() { $this->_helper->layout()->disableLayout(); $params = $this->getAllParams(); if ((APPLICATION_ENV != 'searchbotenv') AND (false == SEARCHBOT_DETECTED)) { $project_clone = $this->getParam('p'); $text = $this->getParam('t'); $url = $this->getParam('l'); $project_id = 0; if (Zend_Auth::getInstance()->hasIdentity()) { $reported_by = (int)Zend_Auth::getInstance()->getStorage()->read()->member_id; $reportProducts = new Default_Model_DbTable_ProjectClone(); $reportProducts->save(array('project_id' => $project_clone ,'member_id' => $reported_by ,'text' => $text ,'external_link' => $url ,'project_clone_type' =>1 ,'project_id_parent' =>$project_id)); } } $this->_helper->json(array( 'status' => 'ok', - 'message' => '

Thank you. The credits have been submitted.

It can take some time to appear while we verify it.

', + 'message' => '

Thank you. The credits have been submitted.

It can take some time to appear while we verify it.

+ + ', 'data' => $params )); } public function productcloneAction() { $this->_helper->layout()->disableLayout(); $params = $this->getAllParams(); + $productInfo=null; if ((APPLICATION_ENV != 'searchbotenv') AND (false == SEARCHBOT_DETECTED)) { $project_clone = $this->getParam('p'); $text = $this->getParam('t'); $project_id = $this->getParam('pc'); - + $type = $this->getParam('i'); + + $modelProduct = new Default_Model_Project(); + $productInfo = $modelProduct->fetchProductInfo($project_id); + if (empty($productInfo)) { + $this->_helper->json(array( + 'status' => 'err', + 'message' => 'Please input a valid project ID from pling. ', + 'data' => $params + )); + return; + } if($project_id) { $text = $text . ' '.$project_id; } if(!is_numeric($project_id)) { $project_id = 0; } if (Zend_Auth::getInstance()->hasIdentity()) { $reported_by = (int)Zend_Auth::getInstance()->getStorage()->read()->member_id; $reportProducts = new Default_Model_DbTable_ProjectClone(); - $reportProducts->save(array('project_id' => $project_clone, 'member_id' => $reported_by,'text' => $text, 'project_id_parent' =>$project_id)); + if($type=='is-original') + { + $reportProducts->save(array('project_id' => $project_clone + ,'member_id' => $reported_by + ,'text' => $text + ,'project_id_parent' =>$project_id)); + }else{ + $reportProducts->save(array('project_id' => $project_id + ,'member_id' => $reported_by + ,'text' => $text + ,'project_id_parent' =>$project_clone)); + } + } } $this->_helper->json(array( - 'status' => 'ok', - 'message' => '

Thank you. The credits have been submitted.

It can take some time to appear while we verify it.

', - 'data' => $params + 'status' => 'ok', + 'message' => '

Thank you. The credits have been submitted.

It can take some time to appear while we verify it.

+ ' + )); } - /* public function memberAction() - { - }*/ - } \ No newline at end of file diff --git a/application/modules/default/views/scripts/product/index.phtml b/application/modules/default/views/scripts/product/index.phtml index 53663f5aa..fcc5ffdb3 100644 --- a/application/modules/default/views/scripts/product/index.phtml +++ b/application/modules/default/views/scripts/product/index.phtml @@ -1,1194 +1,1195 @@ . **/ $helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme(); $helpMemberUrl = new Default_View_Helper_BuildMemberUrl(); $helpEncryptUrl = new Default_View_Helper_EncryptUrl(); $helpImage = new Default_View_Helper_Image(); $helpTruncate = new Default_View_Helper_Truncate(); $helpProductUrl = new Default_View_Helper_BuildProductUrl(); $helpBBCode = new Default_View_Helper_Bbcode2html(); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } $identity = Zend_Auth::getInstance()->getStorage()->read(); $loginUrl = '/login?redirect=' . $helpEncryptUrl->encryptUrl(Zend_Controller_Front::getInstance()->getRequest() ->getRequestUri(), true); $viewSidebar = 'product/partials/productAboutSidebar.phtml'; $viewClaimBox = false; if ($this->product->claimable == 1) { $viewClaimBox = 'product/partials/productClaimTopHeader.phtml'; } $helpProjectFiles = new Default_View_Helper_ProjectFiles(); $productFileInfos = $helpProjectFiles->projectFiles($this->product->ppload_collection_id); $this->product->title = Default_Model_HtmlPurify::purify($this->product->title); $this->product->description = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify($this->product->description)); $this->product->version = Default_Model_HtmlPurify::purify($this->product->version); //$this->product->embed_code =Default_Model_HtmlPurify::purify($this->product->embed_code,Default_Model_HtmlPurify::ALLOW_EMBED); $this->product->link_1 = Default_Model_HtmlPurify::purify($helpAddDefaultScheme->addDefaultScheme($this->product->link_1),Default_Model_HtmlPurify::ALLOW_URL); $this->product->source_url = Default_Model_HtmlPurify::purify($this->product->source_url,Default_Model_HtmlPurify::ALLOW_URL); $this->product->facebook_code = Default_Model_HtmlPurify::purify($this->product->facebook_code,Default_Model_HtmlPurify::ALLOW_URL); $this->product->twitter_code = Default_Model_HtmlPurify::purify($this->product->twitter_code,Default_Model_HtmlPurify::ALLOW_URL); $this->product->google_code = Default_Model_HtmlPurify::purify($this->product->google_code,Default_Model_HtmlPurify::ALLOW_URL); $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); $this->headMeta()->setName('description', $helpTruncate->truncate($this->product->description, 200, '...', false, true)); $this->headMeta()->setName('title', $helpTruncate->truncate($this->product->title, 200, '...', false, true)); $this->headMeta()->appendProperty('og:url', $helpProductUrl->buildProductUrl($this->product->project_id, '', null, true)); $this->headMeta()->appendProperty('og:type', 'website'); $this->headMeta()->appendProperty('og:title', $this->product->title); $this->headMeta()->appendProperty('og:description', $helpTruncate->truncate($this->product->description, 200, '...', false, true)); $this->headMeta()->appendProperty('og:image', $helpImage->Image($this->product->image_small, array('width' => 400, 'height' => 400))); $tableProject = new Default_Model_Project(); $tableCollection = new Default_Model_Collection(); $tableProjectUpdates = new Default_Model_ProjectUpdates(); $this->updates = $tableProjectUpdates->fetchProjectUpdates($this->product->project_id); $tableProjectRatings = new Default_Model_DbTable_ProjectRating(); $this->ratings = $tableProjectRatings->fetchRating($this->product->project_id); $commentModel = new Default_Model_ProjectComments(); $cntModeration = $commentModel->fetchCommentsWithTypeProjectCount(30,$this->product->project_id); if (Zend_Auth::getInstance()->hasIdentity()){ $this->ratingOfUser = $tableProjectRatings->getProjectRateForUser($this->product->project_id,$identity->member_id); } $tableProjectFollower = new Default_Model_DbTable_ProjectFollower(); $this->likes = $tableProjectFollower->fetchLikesForProject($this->product->project_id); $projectplings = new Default_Model_ProjectPlings(); $this->projectplings = $projectplings->fetchPlingsForProject($this->product->project_id); $projectsupport = new Default_Model_SectionSupport(); $this->projectaffiliates = $projectsupport->fetchAffiliatesForProject($this->product->project_id); $tagmodel = new Default_Model_Tags(); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $this->userRoleName = $userRoleName; $productTmp =$this->product->toArray(); $productTmp['image_small_absolute']=$helpImage->Image($this->product->image_small, array('width' => 400, 'height' => 400)); $productJson = Zend_Json::encode(Default_Model_Collection::cleanProductInfoForJson($productTmp)); $filesJson = $this->filesJson; $helperCatXdgType = new Default_View_Helper_CatXdgType(); $xdgTypeJson = Zend_Json::encode($helperCatXdgType->catXdgType($this->product->project_category_id)); $isowner = false; if(Zend_Auth::getInstance()->hasIdentity() && $identity->member_id==$this->product->member_id){ $isowner = true; } $this->isowner = $isowner; $filesTable = new Default_Model_DbTable_PploadFiles(); $countFiles = $filesTable->fetchFilesCntForProject($this->product->ppload_collection_id); $pics= $tableProject->getGalleryPictureSources($this->product->project_id); if(sizeof($pics)==0) { array_push($pics,$this->product->image_small); } $this->galleryPictures=array(); foreach ($pics as $p) { $this->galleryPictures[] = $this->Image($p, array('height' => '600')); } $galleryPicturesJson = Zend_Json::encode($this->galleryPictures); ?>
hasIdentity()) { ?> hasIdentity()) { ?> hasIdentity()) { ?>
product->link_1)): ?> product->title; ?> product->title; ?> translate('Edit Product') ?> product->featured=='1'){ ?> Featured isProjectOriginal($this->product->project_id)){?> Original isProjectMod($this->product->project_id)){?> Mod

product->project_category_id . '/order/latest">' . $this->product->cat_title . ' '; ?> '; $tagsuser = $tagmodel->getTagsUser($this->product->project_id, Default_Model_Tags::TAG_TYPE_PROJECT); echo ''; if(false === empty($tagsuser)) { foreach (explode(',',$tagsuser) as $tag) { ?> '; if($isowner){ $this->headLink()->appendStylesheet('/theme/flatui/css/select2.min.css'); $this->headLink()->appendStylesheet('/theme/flatui/css/select2.custmized.css'); $this->inlineScript()->appendFile('/theme/flatui/js/lib/select2.min.js'); ?> Saved inlineScript()->appendScript( ' $(document).ready(function(){ TagingProductDetail.setup(); }); '); } echo ''; ?>

Source (link to git-repo or to original if based on someone elses unmodified work): product->gitlab_project_id)) { $url = $this->gitlab_project['web_url']; $url = str_replace("http://", "https://", $url); echo ' ' . $url . ' '; } else if (false === empty($this->product->source_url)) { $target='_blank'; if (strpos($this->product->source_url, 'opencode.net') !== false) { $target='_self'; } echo '' . $this->product->source_url . ' '; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $cntSameSource = $tableProject->getCountSourceurl($this->product->source_url); if($cntSameSource>1){ $link = '/p/'.$this->product->project_id.'/listsamesourceurl'; echo ' ['.$cntSameSource.']'; } } } else { echo ' Add the source-code for this project on opencode.net'; } ?>

partial( '/product/partials/projectlike.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id ) ); ?>
render('partials/sidebarRating.phtml'); ?>
render('partials/sidebarScore.phtml'); ?>
product->is_gitlab_project && $this->product->use_gitlab_project_readme && null != $this->gitlab_project['readme_url']) { ?>
Description:

readme ?>

Description:

product->description ?>
updates) > 0) { $this->productUpdate = $this->updates[0]; ?>
Last changelog: render('product/partials/productUpdatesV1.phtml'); ?>
paramPageId; $testComments = $modelComments->getCommentTreeForProject($this->product->project_id); $testComments->setItemCountPerPage(25); $testComments->setCurrentPageNumber($offset); $this->comments = $testComments; echo $this->render('product/partials/productCommentsUX1.phtml'); ?>
partial( $viewClaimBox, array( "member" => $this->member, "product" => $this->product ) ); } ?>
updates) > 0) { ?>
updates as $this->productUpdate) { echo $this->render('product/partials/productUpdatesV1.phtml'); } ?>
product->show_gitlab_project_issues) { ?>
gitlab_project_issues; $i = 0; foreach ($issues as $issue){ $date = date('Y-m-d H:i:s', strtotime($issue['created_at'])); echo '
' . $issue['title'] . '
'.$this->printDate($date).'
'; $i ++; if($i>5) { break; } } ?> Show all gitlab_project['open_issues_count'] ?> Issues
render('product/partials/productRating2.phtml'); ?>
isProductDeprecatedModerator($this->product->project_id); ?>
/> product-deprecated
paramPageId; $testComments = $modelComments->getCommentTreeForProject($this->product->project_id,30); $testComments->setItemCountPerPage(25); $testComments->setCurrentPageNumber($offset); $this->comments = $testComments; echo $this->render('product/partials/productCommentsUX2.phtml'); ?>
likes) > 0) { ?>
render('product/partials/productLikes.phtml'); ?>
projectplings) > 0) { ?>
render('product/partials/productPlings.phtml'); ?>
render('product/partials/productAffiliates.phtml'); ?>
render('product/partials/ppload.phtml'); ?>
*Needs pling-store or ocs-url to install things
product->claimable)) { ?>
partial( '/product/partials/projectplings.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id, "ppload_collection_id" => $this->product->ppload_collection_id, "project_category_id" => $this->product->project_category_id ) ); ?>
projectaffiliates) ?> Affiliateprojectaffiliates) == 0?'s':'' ?>projectaffiliates) > 1?'s':'' ?>
product->paypal_mail) { * */ echo $this->partial( '/product/partials/support_box.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id, "project_title" => $this->product->title, "ppload_collection_id" => $this->product->ppload_collection_id, "project_category_id" => $this->product->project_category_id, "project_category_title" => $this->product->cat_title, "isAdmin" => $isAdmin ) ); /*}*/ ?> render('partials/sidebarRating.phtml'); */ ?>
*/ ?> countAllCollectionsForProject($this->product->project_id); if($cntCollections>0) { ?>
moreProducts = $tableCollection->fetchAllCollectionsForProject($this->product->project_id, 6); $this->moreProductsTitle = 'Is part of these Collections'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
-
+ fetchOrigins($this->product->project_id); $this->moreProducts = $origins; $this->moreProductsTitle = 'Based on'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productCloneFrom.phtml'); } ?> fetchRelatedProducts($this->product->project_id); $bflag = false; foreach ($related as $r){ $rid = $r->project_id; $bflag = false; foreach ($origins as $o){ $oid = $o->project_id; if($rid == $oid){ $bflag = true; break; } } if(!$bflag) { $relatednew[] = $r; } } $this->moreProducts = $relatednew; $this->moreProductsTitle = 'Variants'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productCloneFrom.phtml'); } ?>
moreProducts = $tableProject->fetchMoreProjects($this->product, 6); $this->moreProductsTitle = 'More ' . $this->product->cat_title . ' from ' . $this->product->username; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
moreProducts = $tableProject->fetchMoreProjectsOfOtherUsr($this->product, 6); $this->moreProductsTitle = 'Other ' . $this->product->cat_title; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
render('partials/sidebarCcLicense.phtml'); ?> isProjectEbook($this->product->project_id)) { echo $this->render('product/partials/ebook_details.phtml'); } ?> render('product/partials/details.phtml'); ?> render('product/partials/tags.phtml'); ?>
inlineScript()->appendScript( ' $(document).ready(function(){ InitActiveHashTab.setup(); PartialJson.setup(); PartialJsonFraud.setup(); PartialJsonClone.setup(); ProductDetailCarousel.setup(); PartialCommentReviewForm.setup(); PartialCommentReviewFormNew.setup(); PartialsButtonHeartDetail.setup(); PartialsButtonPlingProject.setup(); TooltipUser.setup("tooltipuserleft","left"); AppimagequestionOnClick.setup(); Opendownloadfile.setup(); CreateScoreRatingPopup.setup(); PagedetailModeratorDeprecated.setup('.$this->product->project_id.'); $(\'.tooltipheart\').tooltipster({theme: [\'tooltipster-light\', \'tooltipster-light-customized\'], contentCloning: true, contentAsHTML: true, interactive: true}); }); '); diff --git a/httpdocs/theme/react/bundle/app-product-relationship-bundle.js b/httpdocs/theme/react/bundle/app-product-relationship-bundle.js index 2f0dab2cd..f86dc5d6e 100644 --- a/httpdocs/theme/react/bundle/app-product-relationship-bundle.js +++ b/httpdocs/theme/react/bundle/app-product-relationship-bundle.js @@ -1,37 +1,805 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=50)}([function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";var r=n(7),i=n(19),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function l(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===o.call(e)}function s(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(o)})),e.exports=u}).call(this,n(21))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!0;var a={},l=void 0,u=void 0;for(l=0,u=n.length;l