</div></div> <?php } ?> <div class="module-products-template-slider-item-content"> <?php if ($show_fields == false or in_array('thumbnail', $show_fields)) { ?> <?php $pictures = get_pictures($item['id']); ?> <a href="<?php print $item['link']; ?> " class="bgimage-fader"> <span class="<?php print isset($pictures[1]) ? 'multiple-thumbnails' : 'single-thumbnail'; ?> " style="background-image: url(<?php print thumbnail($item['image'], $tn[0], $tn[1]); ?> );"></span>
public function copy($data) { $new_cont_id = false; if (defined('MW_API_CALL')) { $to_trash = true; $adm = $this->app->user_manager->is_admin(); if ($adm == false) { return array('error' => 'You must be admin to copy content!'); } } if (isset($data['id'])) { $this->app->event_manager->trigger('content.before.copy', $data); $cont = get_content_by_id($data['id']); if ($cont != false and isset($cont['id'])) { $new_cont = $cont; if (isset($new_cont['title'])) { $new_cont['title'] = $new_cont['title'] . ' copy'; } $new_cont['id'] = 0; $content_cats = array(); $cats = content_categories($cont['id']); if (!empty($cats)) { foreach ($cats as $cat) { if (isset($cat['id'])) { $content_cats[] = $cat['id']; } } } if (!empty($content_cats)) { $new_cont['categories'] = $content_cats; } $new_cont_id = $this->save($new_cont); $cust_fields = get_custom_fields('content', $data['id'], true); if (!empty($cust_fields)) { foreach ($cust_fields as $cust_field) { $new = $cust_field; $new['id'] = 0; $new['rel_id'] = $new_cont_id; $new_item = save_custom_field($new); } } $images = get_pictures($data['id']); if (!empty($images)) { foreach ($images as $image) { $new = $image; $new['id'] = 0; $new['rel_id'] = $new_cont_id; $new['rel_type'] = 'content'; $new_item = save_media($new); } } } } return $new_cont_id; }
if (isset($_GET["albums"]) && $_GET["albums"] == 1 || isset($_GET["album_id"]) && $_GET["album_id"] == $album["album_id"]) { if ($limitType == 'albums') { if ($total == $limit) { break; } $total++; } $album["thumb_path"] = "plog-thumb.php?id=" . $album["thumbnail_id"]; $xml .= '<album'; foreach ($album as $var => $val) { $xml .= ' ' . $var . '="' . htmlspecialchars($val) . '"'; } $xml .= '>'; } if (isset($_GET["pictures"])) { $pictures = get_pictures($album["album_id"], "mod", "DESC"); } else { if (isset($_GET["picture_id"])) { $pic = get_picture_by_id($_GET["picture_id"], $album["album_id"]); if ($pic) { $pictures = array($pic); } else { $pictures = array(); } } else { if (isset($_GET["comments"]) || isset($_GET["comment_id"])) { $pictures = get_picture_ids($album["album_id"], "mod", "DESC"); } else { $pictures = array(); } }
$for = mw()->database_manager->assoc_table_name($for); if (!isset($params['for-id'])) { $params['for-id'] = $params['id']; } if (isset($params['for-id'])) { $for_id = $params['for-id']; } $rand = uniqid(); if (trim($for_id) != '' and trim($for_id) != '0') { $media = get_pictures("rel_id={$for_id}&rel_type={$for}"); } else { $sid = mw()->user_manager->session_id(); if ($sid == '') { $sid = mw()->user_manager->session_id(); } $media = get_pictures("rel_id=0&rel_type={$for}&session_id={$sid}"); } ?> <script type="text/javascript"> after_upld = window.after_upld || function (a, e, f, id, module_id){ if(e != 'done' ){ var data = {}; data['for'] = f; data.src = a; data.media_type = 'picture'; if(id == undefined || id == ''){ data.for_id = 0; } else { data.for_id = (id);
$type = $_POST['type']; $video = $_POST['video']; $main_img = $_POST['main_img']; if ($_POST['heading'] === 'true') { $heading = 1; } //$image=$_POST['image']; //$id=$_POST['id']; // $video=preg_replace('~width="[\d]+"~', 'width="200"', $video); // $video=preg_replace('~height="[\d]+"~', 'height="200"', $video); $conn = connect(); if ($type == 'add') { $query = "insert into news values(null,'{$title}','{$content}','{$video}','{$language}',{$heading},null)"; $res = mysqli_query($conn, $query); $insert_id = mysqli_insert_id($conn); $images = get_pictures(); if (count($images)) { $index = 1; for ($k = 0; $k < count($images); $k++) { $pattern = '~(jpg|jpeg|gif|png)~'; preg_match($pattern, $images[$k], $matches); $ext = $matches[0]; if ($images[$k] == $main_img) { $path = "../my_images/news" . $insert_id . '-main.' . $ext; } else { $path = "../my_images/news" . $insert_id . '_' . $index . '.' . $ext; $index++; } if (!is_file($path)) { copy('../temp/' . $images[$k], $path); }
if ($limitType == 'albums') { if ($total == $limit) { break; } $total++; } $album['album_path'] = sanitize_filename($album['collection_name']) . '/' . sanitize_filename($album['album_name']) . '/'; $album['thumb_path'] = 'plog-thumb.php?id=' . $album['thumbnail_id']; $xml .= '<album'; foreach ($album as $var => $val) { $xml .= ' ' . $var . '="' . htmlspecialchars($val) . '"'; } $xml .= '>'; } if (isset($_GET['pictures'])) { $pictures = get_pictures($album['album_id'], 'mod', 'DESC'); } else { if (isset($_GET['picture_id'])) { $pic = get_picture_by_id($_GET['picture_id'], $album['album_id']); if ($pic) { $pictures = array($pic); } else { $pictures = array(); } } else { if (isset($_GET['comments']) || isset($_GET['comment_id'])) { $pictures = get_picture_ids($album['album_id'], 'mod', 'DESC'); } else { $pictures = array(); } }
<div class="masonry-item"> <div class="masonry-item-content"> <?php if ($show_fields == false or in_array('thumbnail', $show_fields)) { ?> <?php $second_picture = false; ?> <a href="<?php print $item['link']; ?> " class="bgimage-fader"> <?php $second_pictures = get_pictures($item['id']); if (isset($second_pictures[1]) and isset($second_pictures[1]['filename'])) { $second_picture = $second_pictures[1]['filename']; } ?> <span class="<?php print $second_picture ? 'multiple-thumbnails' : 'single-thumbnail'; ?> " style="background-image: url(<?php print thumbnail($item['image'], $tn[0], $tn[1]); ?> );"></span> <?php if ($second_picture) {