Changeset 3167:9b0e5988c0eb for inc
- Timestamp:
- 02/11/16 15:35:39 (9 years ago)
- Branch:
- default
- Location:
- inc
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.media.php
r3138 r3167 573 573 fileItems objects. 574 574 575 @param post_id <b>integer</b> Post ID575 @param post_id <b>integer</b> Post ID 576 576 @param media_id <b>integer</b> Optionnal media ID 577 @param link_type <b>string</b> Optionnal link type 577 578 @return <b>array</b> Array of fileItems 578 579 */ 579 public function getPostMedia($post_id,$media_id=null )580 public function getPostMedia($post_id,$media_id=null,$link_type=null) 580 581 { 581 582 $params = array( … … 586 587 $params['media_id'] = (integer) $media_id; 587 588 } 589 if ($link_type) { 590 $params['link_type'] = $link_type; 591 } 588 592 $rs = $this->postmedia->getPostMedia($params); 589 593 … … 604 608 @see dcPostMedia::addPostMedia 605 609 */ 606 public function addPostMedia($post_id,$media_id )607 { 608 $this->postmedia->addPostMedia($post_id,$media_id );610 public function addPostMedia($post_id,$media_id,$link_type='attachment') 611 { 612 $this->postmedia->addPostMedia($post_id,$media_id,$link_type); 609 613 } 610 614 … … 613 617 @see dcPostMedia::removePostMedia 614 618 */ 615 public function removePostMedia($post_id,$media_id )616 { 617 $this->postmedia->removePostMedia($post_id,$media_id, "attachment");619 public function removePostMedia($post_id,$media_id,$link_type='attachment') 620 { 621 $this->postmedia->removePostMedia($post_id,$media_id,$link_type); 618 622 } 619 623 -
inc/core/class.dc.postmedia.php
r2566 r3167 78 78 $strReq .= $params['sql']; 79 79 } 80 //echo $strReq; exit; 80 81 81 $rs = $this->con->select($strReq); 82 82 … … 87 87 Attaches a media to a post. 88 88 89 @param post_id <b>integer</b> Post ID89 @param post_id <b>integer</b> Post ID 90 90 @param media_id <b>integer</b> Optionnal media ID 91 @param link_type <b>string</b> Optionnal link type (default: attachment) 91 92 */ 92 93 public function addPostMedia($post_id,$media_id,$link_type='attachment') … … 113 114 Detaches a media from a post. 114 115 115 @param post_id <b>integer</b> Post ID116 @param post_id <b>integer</b> Post ID 116 117 @param media_id <b>integer</b> Optionnal media ID 118 @param link_type <b>string</b> Optionnal link type 117 119 */ 118 120 public function removePostMedia($post_id,$media_id,$link_type=null) -
inc/core/class.dc.rs.extensions.php
r3106 r3167 447 447 @return <b>integer</b> 448 448 */ 449 public static function countMedia($rs )449 public static function countMedia($rs,$link_type=null) 450 450 { 451 451 if (isset($rs->_nb_media[$rs->index()])) … … 459 459 'FROM '.$rs->core->prefix.'post_media '. 460 460 'WHERE post_id = '.(integer) $rs->post_id.' '; 461 if ($link_type != null) { 462 $strReq .= "AND link_type = '".$rs->core->con->escape($link_type)."'"; 463 } 461 464 462 465 $res = (integer) $rs->core->con->select($strReq)->f(0); -
inc/public/default-templates/currywurst/_entry-content.html
r2938 r3167 46 46 </tpl:AttachmentsHeader> 47 47 <li class="post-attachments-item {{tpl:AttachmentType}}"> 48 <tpl:AttachmentIf is_ mp3="1">49 {{tpl:include src="_ mp3_player.html"}} -48 <tpl:AttachmentIf is_audio="1"> 49 {{tpl:include src="_audio_player.html"}} 50 50 </tpl:AttachmentIf> 51 <tpl:AttachmentIf is_flv="1"> 52 {{tpl:include src="_flv_player.html"}} 51 <tpl:AttachmentIf is_video="1"> 52 <tpl:AttachmentIf is_flv="0"> 53 {{tpl:include src="_video_player.html"}} 54 {{tpl:else}} 55 {{tpl:include src="_flv_player.html"}} 56 </tpl:AttachmentIf> 53 57 </tpl:AttachmentIf> 54 <tpl:AttachmentIf is_ flv="0">58 <tpl:AttachmentIf is_video="0" is_audio="0"> 55 59 <a href="{{tpl:AttachmentURL}}" 56 60 title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a> -
inc/public/default-templates/mustek/post.html
r3017 r3167 100 100 </tpl:AttachmentsHeader> 101 101 <li class="{{tpl:AttachmentType}}"> 102 <tpl:AttachmentIf is_ mp3="1">103 {{tpl:include src="_ mp3_player.html"}} -102 <tpl:AttachmentIf is_audio="1"> 103 {{tpl:include src="_audio_player.html"}} 104 104 </tpl:AttachmentIf> 105 <tpl:AttachmentIf is_flv="1"> 106 {{tpl:include src="_flv_player.html"}} 107 </tpl:AttachmentIf> 108 <tpl:AttachmentIf is_flv="0"> 105 <tpl:AttachmentIf is_video="1"> 106 <tpl:AttachmentIf is_flv="0"> 107 {{tpl:include src="_video_player.html"}} 108 {{tpl:else}} 109 {{tpl:include src="_flv_player.html"}} 110 </tpl:AttachmentIf> 111 </tpl:AttachmentIf> 112 <tpl:AttachmentIf is_audio="0" is_video="0"> 109 113 <a href="{{tpl:AttachmentURL}}" 110 114 title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
Note: See TracChangeset
for help on using the changeset viewer.