Changeset 1266:f18660c2ca33
- Timestamp:
- 08/05/13 12:44:48 (10 years ago)
- Branch:
- ticket1084
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.media.php
r1220 r1266 497 497 @param post_id <b>integer</b> Post ID 498 498 @param media_id <b>integer</b> Optionnal media ID 499 @param rs <b>boolean</b> Whether to return a resultset (true) or an array (false, default value). 499 500 @return <b>array</b> Array of fileItems 500 501 */ 501 public function getPostMedia($post_id,$media_id=null )502 public function getPostMedia($post_id,$media_id=null,$rs=false) 502 503 { 503 504 $params = array( … … 515 516 $f = $this->fileRecord($rs); 516 517 if ($f !== null) { 517 $res[] = new ArrayObject($f);518 } 519 } 520 521 return $r es;518 $res[] = $rs ? new ArrayObject($f) : $f; 519 } 520 } 521 522 return $rs ? staticRecord::newFromArray($res) : $res; 522 523 } 523 524 -
plugins/attachments/_public.php
r1221 r1266 40 40 "<?php\n". 41 41 'if ($_ctx->posts !== null && $core->media) {'."\n". 42 '$_ctx->attachments = staticRecord::newFromArray($core->media->getPostMedia($_ctx->posts->post_id));'."\n".42 '$_ctx->attachments = $core->media->getPostMedia($_ctx->posts->post_id, null, true);'."\n". 43 43 "?>\n". 44 44 … … 46 46 '<?php while ($_ctx->attachments->fetch()) : ?>'. 47 47 48 '<?php $GLOBALS[\'attach_i\'] = $attach_i; $attach_f = $_ctx->attachments ->row(); $GLOBALS[\'attach_f\'] = $attach_f;'. // LEGACY48 '<?php $GLOBALS[\'attach_i\'] = $attach_i; $attach_f = $_ctx->attachments; $GLOBALS[\'attach_f\'] = $attach_f;'. // LEGACY 49 49 '$_ctx->file_url = $attach_f->file_url; ?>'. // LEGACY 50 50 $content.
Note: See TracChangeset
for help on using the changeset viewer.