Changeset 29136
- Timestamp:
- 04/14/10 14:33:42 (3 years ago)
- Files:
-
- plugins/vjCommentPlugin/TRUNK/README (modified) (2 diffs)
- plugins/vjCommentPlugin/TRUNK/lib/model/doctrine/PluginComment.class.php (modified) (1 diff)
- plugins/vjCommentPlugin/TRUNK/lib/tools/GravatarApi.class.php (modified) (2 diffs)
- plugins/vjCommentPlugin/TRUNK/package.xml.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/vjCommentPlugin/TRUNK/README
r29082 r29136 114 114 enabled: false 115 115 116 You can change default size or default imageof gravatar116 You can change default size, image or directories of gravatar 117 117 118 118 * edit apps/your_frontend_app/config/app.yml … … 122 122 default_size: 40 123 123 default_image: ../web/images/gravatar_default.png 124 upload_dir: .. # by default, this uses sf_upload_dir configuration 125 cache_dir_name: g_cache 124 126 125 127 How to moderate comments and/or reports ? plugins/vjCommentPlugin/TRUNK/lib/model/doctrine/PluginComment.class.php
r28935 r29136 13 13 public function getAuthor() 14 14 { 15 //var_dump( is_null( $this->getUserId() ) );16 15 if( null !== $this->getUserId() ) 17 16 { plugins/vjCommentPlugin/TRUNK/lib/tools/GravatarApi.class.php
r28879 r29136 33 33 public function __construct($image_size = null, $rating = null) 34 34 { 35 $this->cache_dir = sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR 36 .sfConfig::get('app_gravatar_cache_dir_name', 'g_cache').DIRECTORY_SEPARATOR; 37 $this->cache_dir_name = str_replace(sfConfig::get('sf_web_dir'), '', $this->cache_dir); 35 $this->setDirectories(); 38 36 if (!is_dir($this->cache_dir)) 39 37 { … … 169 167 return str_replace(DIRECTORY_SEPARATOR, '/', $this->cache_dir_name).$to_return; 170 168 } 169 170 protected function setDirectories() 171 { 172 $gravatar_cache_dir_name = sfConfig::get('app_gravatar_cache_dir_name', 'g_cache'); 173 174 $this->cache_dir = $this->clearPath(sfConfig::get('sf_web_dir') 175 .DIRECTORY_SEPARATOR 176 .$this->getGravatarUploadDir() 177 .DIRECTORY_SEPARATOR 178 .$gravatar_cache_dir_name 179 .DIRECTORY_SEPARATOR); 180 $this->cache_dir_name = str_replace(sfConfig::get('sf_web_dir'), '', $this->cache_dir); 181 } 182 183 protected function hasGravatarUploadDir() 184 { 185 return !is_null(sfConfig::get('app_gravatar_upload_dir')); 186 } 187 188 protected function getGravatarUploadDir() 189 { 190 return $this->clearPath(sfConfig::get('app_gravatar_upload_dir', str_replace(sfConfig::get('sf_web_dir'), '', sfConfig::get('sf_upload_dir')))); 191 } 192 193 protected function clearPath($path) 194 { 195 return str_replace("//", "/", $path); 196 } 171 197 } plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
r29128 r29136 71 71 * fizyk: integrated functionality to make use of sfGuardUser 72 72 * fizyk: added relation to sfGuardUser 73 * jp_morvan: add option to define gravatar's directories (by default : sf_web_dir/sf_upload_dir/g_cache) 73 74 </notes> 74 75 </release>