To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
09/01/10 11:59:43 (21 months ago)
Author:
wjohnald
Message:

this commit resolves tickets: #144 and #347

Location:
plugins/apostrophePlugin/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk

  • plugins/apostrophePlugin/trunk/lib/model/doctrine/PluginaPage.class.php

    r2085 r2107  
    246246    return $title; 
    247247  } 
     248   
     249  public function getMetaDescription() 
     250  { 
     251        $metaDescriptionSlot = $this->getSlot('metaDescription'); 
     252         
     253        $result = ''; 
     254        if ($metaDescriptionSlot) 
     255        { 
     256                $result = $metaDescriptionSlot->value; 
     257        } 
     258        return trim($result); 
     259  } 
     260   
     261   
    248262   
    249263  // Changed in 1.5: returns a flat array, not an associative array indexed by version. 
     
    866880  } 
    867881 
     882  public function setMetaDescription($description) 
     883  { 
     884        $slot = $this->createSlot('aText'); 
     885        $slot->value = $description; 
     886        $slot->save(); 
     887         
     888        $this->newAreaVersion('metaDescription', 'update', 
     889                array( 
     890                        'permid' => 1, 
     891                        'slot' => $slot)); 
     892         
     893  } 
     894 
     895 
    868896  // SAVE ANY CHANGES to the actual page object FIRST before you call this method. 
    869897   
     
    12711299    $summary = $this->getSearchSummary(); 
    12721300    $text = $this->getSearchText(); 
     1301    $tags = implode(',', $this->getTags()); 
     1302    $metaDescription = $this->getMetaDescription(); 
    12731303    $slug = $this->getSlug(); 
    12741304    $info = $this->getInfo(); 
     
    12771307    // it lets us check explicit privileges 
    12781308    unset($info['title']); 
    1279     // These are indexed but not stored. Use for fat fields that 
    1280     // would otherwise turn Lucene into a database (it's a terrible database) 
    12811309    aZendSearch::updateLuceneIndex($this,  
    1282       array('text' => $text), 
     1310      array('text' => $text, 'tags' => $tags, 'metadescription' => $metaDescription), 
    12831311      $this->getCulture(), 
    1284       // These are stored, not indexed. They are used to present and filter summaries 
    1285       array( 
    1286         'summary' => $summary, 
    1287         'info' => serialize($info)), 
    1288       // These are stored AND indexed 
    12891312      array( 
    12901313        'title' => $title, 
    1291         'slug' => $slug 
    1292       )); 
     1314        'summary' => $summary, 
     1315        'slug' => $slug, 
     1316        'info' => serialize($info)), 
     1317      array('tags' => 2.0, 'metadescription' => 1.2)); 
    12931318  } 
    12941319