Changeset 13572
- Timestamp:
- Jul 14, 2010, 9:36:46 PM (12 years ago)
- Location:
- OpenPNE3/plugins/opCommunityTopicPlugin/branches/tunn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/plugins/opCommunityTopicPlugin/branches/tunn/apps/pc_frontend/modules/communityTopic/templates/showSuccess.php
r13571 r13572 16 16 </div> 17 17 <div class="body"> 18 <?php if (count($images = $communityTopic->get Images()) != 0): ?>18 <?php if (count($images = $communityTopic->getCommunityTopicImagesJoinFile()) != 0): ?> 19 19 <ul class="photo"> 20 20 <?php foreach ($images as $image): ?> -
OpenPNE3/plugins/opCommunityTopicPlugin/branches/tunn/lib/form/doctrine/PluginCommunityTopicForm.class.php
r13560 r13572 36 36 if (!$this->isNew()) 37 37 { 38 $images = $this->getObject()->get ImagesWithNumber();38 $images = $this->getObject()->getCommunityTopicImagesJoinFile(); 39 39 } 40 40 41 41 $max = (int)sfConfig::get('app_community_topic_max_image_file_num', 3); 42 for ($i = 1; $i <=$max; $i++)42 for ($i = 0; $i < $max; $i++) 43 43 { 44 $key = 'photo_'. $i;44 $key = 'photo_'.($i+1); 45 45 46 46 if (isset($images[$i])) -
OpenPNE3/plugins/opCommunityTopicPlugin/branches/tunn/lib/model/doctrine/PluginCommunityTopic.class.php
r13560 r13572 65 65 return $result; 66 66 } 67 68 public function getCommunityTopicImagesJoinFile() 69 { 70 $q = Doctrine::getTable('CommunityTopicImage')->createQuery() 71 ->leftJoin('CommunityTopicImage.File') 72 ->where('post_id = ?', $this->id); 73 74 return $q->execute(); 75 } 67 76 }
Note: See TracChangeset
for help on using the changeset viewer.