diff --git a/application/modules/default/views/scripts/home/index-opendesktop-start.phtml b/application/modules/default/views/scripts/home/index-opendesktop-start.phtml index 7805fa1c4..07fb407b1 100755 --- a/application/modules/default/views/scripts/home/index-opendesktop-start.phtml +++ b/application/modules/default/views/scripts/home/index-opendesktop-start.phtml @@ -1,169 +1,208 @@ . **/ +$config = Zend_Registry::get('config')->settings->domain->base; +$metaDomain = $config->host; +$this->headTitle($_SERVER['HTTP_HOST'], 'SET'); +$this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); +$this->headMeta()->appendProperty('og:url', $metaDomain); +$this->headMeta()->appendProperty('og:type', 'website'); +$this->headMeta()->appendProperty('og:title', $metaDomain); +$this->headMeta()->appendProperty('og:site_name',$metaDomain); +$this->headMeta()->appendProperty('og:description','Libre Cloud Services for users and developers. Keep your personal data save, start new projects, share apps, files and products, communicate freely with friends and colleagues.'); +$this->headMeta()->appendProperty('og:image','https://www.opendesktop.org/images/system/opendesktop-logo.png'); $modelInfo = new Default_Model_Info(); $helpPrintDate = new Default_View_Helper_PrintDate(); $helperImage = new Default_View_Helper_Image(); $config = Zend_Registry::get('config')->settings->client->default; $baseurl = $config->baseurl; $baseurlStore = $config->baseurl_store; $url_forum = $config->url_forum; $url_blog = $config->url_blog; $url_gitlab = $config->url_gitlab; $url_riot = $config->url_riot; $url_myopendesktop = $config->url_myopendesktop; $url_cloudopendesktop = $config->url_cloudopendesktop; $url_musicopendesktop = $config->url_musicopendesktop; $url_mastodon = $config->url_mastodon; $url_docsopendesktop = $config->url_docsopendesktop; -$config = Zend_Registry::get('config')->settings->domain->base; -$metaDomain = $config->host; - -$this->headTitle($_SERVER['HTTP_HOST'], 'SET'); -$this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); -$this->headMeta()->appendProperty('og:url', $metaDomain); -$this->headMeta()->appendProperty('og:type', 'website'); -$this->headMeta()->appendProperty('og:title', $metaDomain); -$this->headMeta()->appendProperty('og:site_name',$metaDomain); -$this->headMeta()->appendProperty('og:description','Libre Cloud Services for users and developers. Keep your personal data save, start new projects, share apps, files and products, communicate freely with friends and colleagues.'); -$this->headMeta()->appendProperty('og:image','https://www.opendesktop.org/images/system/opendesktop-logo.png'); - - $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } if (Zend_Auth::getInstance()->hasIdentity()){ $identity = Zend_Auth::getInstance()->getStorage()->read(); $avatar = $helperImage->image($identity->profile_image_url,array('width' => 100, 'height' => 100, 'crop' => 2)); $user = array( "username" => $identity->username, "member_id" => $identity->member_id, "mail" => $identity->mail, "avatar" => $avatar, "roleName" =>$identity->roleName, "isAdmin" => $isAdmin ); + $tableProduct = new Default_Model_Project(); + $productsRowset = $tableProduct->fetchAllProjectsForMember($identity->member_id,5); + $products = array(); + foreach ($productsRowset as $row) { + $products[] = $row; + } + + $parray=array(); + foreach ($products as $p) { + // $tmp= array('project_id'=> $p->project_id + // , 'image_small'=>$this->Image($p->image_small, array('width' => 200, 'height' => 200)) + // , 'title' => $p->title + // ,'laplace_score' =>$p->laplace_score + // ,'cat_title' =>$p->cat_title + // ,'updated_at' => $helpPrintDate->printDate(($p->changed_at==null?$p->created_at:$p->changed_at)) + // ) ; + + $tmp= array('project_id'=> $p->project_id + , 'image_small'=>$this->Image($p->image_small, array('width' => 200, 'height' => 200)) + , 'title' => $p->title + ,'laplace_score' =>$p->laplace_score*10 + ,'cat_title' =>$p->catTitle + ,'updated_at' => $helpPrintDate->printDate(($p->changed_at==null?$p->created_at:$p->changed_at)) + ) ; + $parray[] = $tmp; + } + + $comments = $modelInfo->getLastCommentsForUsersProjects($identity->member_id); + $commentsmoderation = $modelInfo->getLastCommentsForUsersProjects($identity->member_id,10,Default_Model_DbTable_Comments::COMMENT_TYPE_MODERATOR); $votes = $modelInfo->getLastVotesForUsersProjects($identity->member_id); - $donations = $modelInfo->getLastDonationsForUsersProjects($identity->member_id); + $spams = $modelInfo->getLastSpamProjects($identity->member_id); foreach ($comments as &$p) { $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); $p['comment_created_at'] = $helpPrintDate->printDate($p['comment_created_at']); } + foreach ($commentsmoderation as &$p) { + $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); + $p['comment_created_at'] = $helpPrintDate->printDate($p['comment_created_at']); + } foreach ($votes as &$p) { $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); $p['created_at'] = $helpPrintDate->printDate($p['created_at']); } + + foreach ($spams as &$p) { + $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); + $p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at'])); + } $tableMembers = new Default_Model_Member(); $supporterinfo = $tableMembers->fetchSupporterDonationInfo($identity->member_id); $response = array( 'user' => $user, + 'products' => $parray, 'supporterinfo' => $supporterinfo, 'comments' =>$comments, + 'commentsmoderation' =>$commentsmoderation, 'votes' => $votes, + 'spams' => $spams, "baseUrl" => $baseurl, "baseUrlStore" => $baseurlStore, "blogUrl" => $url_blog, "forumUrl" => $url_forum, "mastodonUrl" => $url_mastodon, "gitlabUrl" => $url_gitlab, "riotUrl" => $url_riot, "url_myopendesktop" => $url_myopendesktop, "url_cloudopendesktop" => $url_cloudopendesktop, "url_musicopendesktop" => $url_musicopendesktop, "url_docsopendesktop" => $url_docsopendesktop, "url_mastodon" => $url_mastodon, ); }else { $productsAppAddons = $modelInfo->getLastProductsForHostStores(5,'152,233'); $productsThemes = $modelInfo->getLastProductsForHostStores(5,'148'); $productsMultimedia = $modelInfo->getLastProductsForHostStores(5,'586'); $comments = $modelInfo->getLatestComments(5); foreach ($productsAppAddons as &$p) { $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); $p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at'])); } foreach ($productsThemes as &$p) { $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); $p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at'])); } foreach ($productsMultimedia as &$p) { $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); $p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at'])); } foreach ($comments as &$p) { $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); $p['comment_created_at'] = $helpPrintDate->printDate($p['comment_created_at']); } $response = array( 'comments' => $comments, 'products' => $productsAppAddons, 'productsThemes' => $productsThemes, 'productsMultimedia' => $productsMultimedia, "baseUrl" => $baseurl, "baseUrlStore" => $baseurlStore, "blogUrl" => $url_blog, "forumUrl" => $url_forum, "mastodonUrl" => $url_mastodon, "gitlabUrl" => $url_gitlab, "riotUrl" => $url_riot, "url_myopendesktop" => $url_myopendesktop, "url_cloudopendesktop" => $url_cloudopendesktop, "url_musicopendesktop" => $url_musicopendesktop, "url_mastodon" => $url_mastodon, + ); } ?> - -
+
- + +