本文整理汇总了PHP中FetchTemplate函数的典型用法代码示例。如果您正苦于以下问题:PHP FetchTemplate函数的具体用法?PHP FetchTemplate怎么用?PHP FetchTemplate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FetchTemplate函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $post;
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$sdc3 = $instance['sdc3'];
$cat = $instance['scat'];
$nop = $instance['nop1'] <= 0 ? 5 : $instance['nop1'];
$html = "";
$newp = new WP_Query(array('post_type' => 'wpdmpro', 'posts_per_page' => $nop, 'order_by' => 'publish_date', 'order' => 'desc', 'tax_query' => array(array('taxonomy' => 'wpdmcategory', 'terms' => array($cat), 'field' => 'id'))));
?>
<?php
echo $before_widget;
?>
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
echo "<div class='w3eden'>";
while ($newp->have_posts()) {
$newp->the_post();
$pack = (array) $post;
echo FetchTemplate($sdc3, $pack);
}
echo "</div>";
echo $after_widget;
wp_reset_query();
}
示例2: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $post;
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$sdc = $instance['sdc'];
$nop = $instance['nop1'];
$newp = new WP_Query(array('post_type' => 'wpdmpro', 'posts_per_page' => $nop, 'orderby' => 'date', 'order' => 'desc'));
?>
<?php
echo $before_widget;
?>
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
echo "<div class='w3eden'>";
while ($newp->have_posts()) {
$newp->the_post();
$pack = (array) $post;
echo FetchTemplate($sdc, $pack);
}
echo "</div>";
echo $after_widget;
wp_reset_query();
}
示例3: template
function template($params)
{
$style = isset($params['style']) ? $params['style'] : '';
$id = isset($params['id']) ? $params['id'] : false;
$align = "left";
if (strpos($style, "entered")) {
$align = 'center';
}
if (strpos($style, "ight")) {
$align = 'right';
}
if (!$id) {
return "";
}
$package = get_post($id, ARRAY_A);
$package = wpdm_setup_package_data($package);
$link_label = get_post_meta($id, '__wpdm_link_label', true);
$html = <<<HTML
<div class="w3eden clear" align="{$align}">
<div class="link-btn {$style}">
<div class="media">
<div class="pull-left">[icon]</div>
<div class="pull-left text-left"><strong class="ptitle">
[page_link]
</strong>
<div style="font-size: 8pt">[download_link] <i style="margin: 4px 0 0 5px;opacity:0.5"
class="fa fa-th-large"></i> [file_size]
</div>
</div>
</div>
</div>
</div>
</div>
<script>
jQuery(function(){
jQuery('.link-btn a.wpdm-download-link img').after('{$link_label}');
jQuery('.link-btn a.wpdm-download-link img').remove();
});
</script>
HTML;
return FetchTemplate($html, $package, 'link');
}
示例4: Preview
/**
* @usage Preview link/page template
*/
function Preview()
{
error_reporting(0);
$wposts = array();
$template = wpdm_query_var("template", "html");
$type = wpdm_query_var("_type", "html");
$args = array('post_type' => 'wpdmpro', 'posts_per_page' => 1);
$wposts = get_posts($args);
$html = "";
foreach ($wposts as $p) {
$package = (array) $p;
$html .= FetchTemplate($template, $package, $type);
}
if (count($wposts) == 0) {
$html = "<div class='col-md-12'><div class='alert alert-info'>" . __('No package found! Please create at least 1 package to see template preview', 'wpdmpro') . "</div> </div>";
}
$html = "<div class='w3eden'>" . $html . "</div><div style='clear:both'></div>";
echo $html;
die;
}
示例5: Package
/**
* @usage Callback function for shortcode [wpdm_package id=PID]
* @param mixed $params
* @return mixed
*/
function Package($params)
{
extract($params);
if (!isset($id)) {
return '';
}
$id = (int) $id;
$postlink = site_url('/');
if (isset($pagetemplate) && $pagetemplate == 1) {
$template = get_post_meta($id, '__wpdm_page_template', true);
$wpdm_package['page_template'] = stripcslashes($template);
$data = FetchTemplate($template, $id, 'page');
$siteurl = site_url('/');
return "<div class='w3eden'>{$data}</div>";
}
$template = isset($params['template']) ? $params['template'] : get_post_meta($id, '__wpdm_template', true);
if ($template == '') {
$template = 'link-template-calltoaction3.php';
}
return "<div class='w3eden'>" . \WPDM\Package::fetchTemplate($template, $id, 'link') . "</div>";
}
示例6: stripcslashes
if($idvdl==1)
$fhtml .= "<li><a rel='noindex nofollow' href='".wpdm_download_url($file)."&ind=".$ind."' class='ind-download'>$sfile</a></li>";
else
$fhtml .= "<li>$sfile</li>";
}
$fhtml .= "</ul>";
$file['file_list'] = $fhtml;
$file['description'] = stripcslashes($file['description']);
$file['page_template'] = stripcslashes($file['page_template']);
$k = 1;
$file['additional_previews'] = get_wpdm_meta($file[id],'more_previews');
$img = "<img id='more_previews_{$k}' title='' class='more_previews' src='".plugins_url()."/download-manager/timthumb.php?w=575&h=170&zc=1&src={$file[preview]}'/>\n";
$tmb = "<a href='#more_previews_{$k}' class='spt'><img title='' src='".plugins_url()."/download-manager/timthumb.php?w=100&h=45&zc=1&src={$file[preview]}'/></a>\n";
if($file['additional_previews']){
foreach($file['additional_previews'] as $p){
++$k;
$img .= "<img style='display:none;position:absolute' id='more_previews_{$k}' class='more_previews' title='' src='".plugins_url().'/download-manager/timthumb.php?w=575&h=170&zc=1&src=wp-content/plugins/download-manager/preview/'.$p."'/>\n";
$tmb .= "<a href='#more_previews_{$k}' class='spt'><img id='more_previews_{$k}' title='' src='".plugins_url().'/download-manager/timthumb.php?w=100&h=45&zc=1&src=wp-content/plugins/download-manager/preview/'.$p."'/></a>\n";
}}
$file['slider-previews'] = "<div class='slider' style='height:180px;'>".$img."</div><div class='tmbs'>$tmb</div>";
*/
echo FetchTemplate($file['page_template'], $file, 'popup');
?>
<br>
<div style="clear: both;"></div><br>
<br>
<?php
die;
示例7: wpdm_category_page
function wpdm_category_page($content)
{
global $post;
if (defined('WPDM_THEME_SUPPORT') || !is_tax('wpdmcategory')) {
return $content;
}
$id = get_the_ID();
$cpageinfo = get_option('__wpdm_cpage_info');
$data = wpdm_setup_package_data((array) $post);
$data['version'] = isset($data['version']) && $data['version'] != '' ? $data['version'] : '1.0.0';
//$data['download_link'] = str_replace("<a","<a style=\"padding:5px 10px;min-width:auto;font-size:8pt;\"", $data['download_link']);
if (is_archive() && get_post_type() == 'wpdmpro') {
if (get_option('__wpdm_cpage_style') == 'basic') {
$info = "<div class='w3eden'><div class='well wpdm-archive-meta' style='margin: 10px 0;box-shadow: none;background: #f5f5f5;padding: 10px 20px;color: #444444;border-radius: 2px;font-size: 10pt'>\n <ul class='nav nav-pills nav-justified' style='list-style: none;padding:0;margin:0;'>";
if (isset($cpageinfo['version'])) {
$info .= "<li><i class='fa fa-history'></i> " . __('Version', 'wpdmpro') . " {$data['version']}</li>";
}
if (isset($cpageinfo['view_count'])) {
$info .= "<li><i class='fa fa-eye'></i> {$data['view_count']} " . __('View(s)', 'wpdmpro') . "</li>";
}
if (isset($cpageinfo['download_count'])) {
$info .= "<li><i class='fa fa-download'></i> {$data['download_count']} " . __('Download(s)', "wpdmpro") . "</li>";
}
if (isset($cpageinfo['package_size'])) {
$info .= "<li><i class='fa fa-th'></i> {$data['package_size']}</li>";
}
if (isset($cpageinfo['download_link'])) {
$info .= "<li>{$data['download_link']}</li>";
}
$info .= "</ul>\n </div></div>";
return get_option('__wpdm_cpage_excerpt') == 'before' ? $info . $content : $content . $info;
}
if (get_option('__wpdm_cpage_style') == 'ltpl') {
return "<div class='w3eden'>" . FetchTemplate(get_option('__wpdm_cpage_template'), $data) . "</div>";
}
}
return $content;
}
示例8: wpdm_embed_category
function wpdm_embed_category($params = array('id' => '', 'items_per_page' => 10, 'title' => false, 'desc' => false, 'order_field' => 'create_date', 'order' => 'desc', 'paging' => false, 'toolbar' => 1, 'template' => ''))
{
extract($params);
if (!isset($id)) {
return;
}
if (!isset($items_per_page)) {
$items_per_page = 10;
}
if (!isset($template)) {
$template = 'link-template-panel.php';
}
$cols = 1;
if (!isset($toolbar)) {
$toolbar = 1;
}
$cwd_class = "col-md-" . (int) (12 / $cols);
$id = trim($id, ", ");
$cids = explode(",", $id);
global $wpdb, $current_user, $post, $wp_query;
$order_field = isset($order_field) ? $order_field : 'publish_date';
$order_field = isset($_GET['orderby']) ? $_GET['orderby'] : $order_field;
$order = isset($order) ? $order : 'desc';
$order = isset($_GET['order']) ? $_GET['order'] : $order;
$params = array('post_type' => 'wpdmpro', 'posts_per_page' => $items_per_page, 'tax_query' => array(array('taxonomy' => 'wpdmcategory', 'field' => 'slug', 'terms' => $cids)));
$params['orderby'] = $order_field;
$params['order'] = $order;
$page = isset($_GET['cp']) ? $_GET['cp'] : 1;
if (intval($page) > 1) {
$params['paged'] = $page;
}
$packs = new WP_Query($params);
$total = $packs->found_posts;
$pages = ceil($total / $items_per_page);
$start = ($page - 1) * $items_per_page;
if (!isset($paging) || $paging == 1) {
$pag = new wpdm_pagination();
$pag->items($total);
$pag->nextLabel(' ► ');
$pag->prevLabel(' ◄ ');
$pag->limit($items_per_page);
$pag->currentPage($page);
}
$burl = get_permalink();
$url = get_permalink();
$url = strpos($url, '?') ? $url . '&' : $url . '?';
$url = preg_replace("/[\\&]*cp=[0-9]+[\\&]*/", "", $url);
$url = strpos($url, '?') ? $url . '&' : $url . '?';
if (!isset($paging) || $paging == 1) {
$pag->urlTemplate($url . "cp=[%PAGENO%]");
}
$html = '';
//$template = "<div class='media'><div class='pull-left'>[icon]</div><div class='media-body'><b>[title]</b><br/>[download_link]</div></div>";
if (isset($template) && in_array($template, array('link-template-default', 'link-template-default-wdc', 'link-template-default-ext', 'link-template-button'))) {
$template = "{$template}.php";
} else {
$template = "link-template-default.php";
}
global $post;
while ($packs->have_posts()) {
$packs->the_post();
$pack = (array) $post;
$repeater = "<div class='{$cwd_class}'>" . FetchTemplate($template, $pack) . "</div>";
$html .= $repeater;
}
$html = "<div class='row'>{$html}</div>";
$cname = array();
foreach ($cids as $cid) {
$cat = get_term_by('slug', $cid, 'wpdmcategory');
if (is_object($cat)) {
$cname[] = $cat->name;
}
}
$cats = implode(", ", $cname);
//$category['title'] = stripcslashes($category['title']);
//$category['content'] = stripcslashes($category['content']);
$cimg = '';
$desc = '';
//if ($title == 1 && count($cids) == 1) $title = "<h3 style='margin:0px;font-size:11pt;line-height:normal'>$category[title]</h3>";
//if (get_option('__wpdm_cat_img', 0) == 1) $cimg = "<img src='{$category[icon]}' />";
//if ($desc == 1 && count($cids) == 1 || get_option('__wpdm_cat_desc', 0) == 1) $desc = wpautop($category['content']);
$subcats = '';
if (function_exists('wpdm_ap_categories') && $subcats == 1) {
$schtml = wpdm_ap_categories(array('parent' => $id));
if ($schtml != '') {
$subcats = "<fieldset class='cat-page-tilte'><legend>" . __('Sub-Categories', 'wpdmpro') . "</legend>" . $schtml . "<div style='clear:both'></div></fieldset>" . "<fieldset class='cat-page-tilte'><legend>" . __('Downloads', 'wpdmpro') . "</legend>";
$efs = '</fieldset>';
}
}
if (!isset($paging) || $paging == 1) {
$pgn = "<div style='clear:both'></div>" . $pag->show() . "<div style='clear:both'></div>";
} else {
$pgn = "";
}
global $post;
$sap = get_option('permalink_structure') ? '?' : '&';
$burl = $burl . $sap;
if (isset($_GET['p']) && $_GET['p'] != '') {
$burl .= 'p=' . $_GET['p'] . '&';
}
//.........这里部分代码省略.........
示例9: wpdm_embed_category
function wpdm_embed_category($params = array('id' => '', 'operator' => 'IN', 'items_per_page' => 10, 'title' => false, 'desc' => false, 'order_field' => 'create_date', 'order' => 'desc', 'paging' => false, 'toolbar' => 1, 'template' => '', 'cols' => 3, 'colspad' => 2, 'colsphone' => 1))
{
extract($params);
$fnparams = $params;
if (!isset($id)) {
return;
}
if (!isset($items_per_page)) {
$items_per_page = 10;
}
if (!isset($template)) {
$template = 'link-template-calltoaction3.php';
}
if (!isset($cols)) {
$cols = 1;
}
if (!isset($colspad)) {
$colspad = 1;
}
if (!isset($colsphone)) {
$colsphone = 1;
}
if (!isset($toolbar)) {
$toolbar = 1;
}
$taxo = 'wpdmcategory';
if (isset($tag) && $tag == 1) {
$taxo = 'post_tag';
}
$cwd_class = "col-md-" . (int) (12 / $cols);
$cwdsm_class = "col-sm-" . (int) (12 / $colspad);
$cwdxs_class = "col-xs-" . (int) (12 / $colsphone);
$id = trim($id, ", ");
$cids = explode(",", $id);
global $wpdb, $current_user, $post, $wp_query;
$order_field = isset($order_field) ? $order_field : 'publish_date';
$order_field = isset($_GET['orderby']) ? $_GET['orderby'] : $order_field;
$order = isset($order) ? $order : 'desc';
$order = isset($_GET['order']) ? $_GET['order'] : $order;
$operator = isset($operator) ? $operator : 'IN';
$cpvar = 'cp_' . $cids[0];
$cp = wpdm_query_var($cpvar, 'num');
if (!$cp) {
$cp = 1;
}
$params = array('post_type' => 'wpdmpro', 'paged' => $cp, 'posts_per_page' => $items_per_page, 'include_children' => false, 'tax_query' => array(array('taxonomy' => $taxo, 'field' => 'slug', 'terms' => $cids, 'operator' => $operator)));
if (get_option('_wpdm_hide_all', 0) == 1) {
$params['meta_query'] = array(array('key' => '__wpdm_access', 'value' => 'guest', 'compare' => 'LIKE'));
if (is_user_logged_in()) {
global $current_user;
$params['meta_query'][] = array('key' => '__wpdm_access', 'value' => $current_user->roles[0], 'compare' => 'LIKE');
$params['meta_query']['relation'] = 'OR';
}
}
$params['orderby'] = $order_field;
$params['order'] = $order;
$params = apply_filters("wpdm_embed_category_query_params", $params);
$packs = new WP_Query($params);
$total = $packs->found_posts;
$pages = ceil($total / $items_per_page);
$page = isset($_GET[$cpvar]) ? $_GET[$cpvar] : 1;
$start = ($page - 1) * $items_per_page;
if (!isset($paging) || $paging == 1) {
$pag = new \WPDM\libs\Pagination();
$pag->items($total);
$pag->nextLabel(' ► ');
$pag->prevLabel(' ◄ ');
$pag->limit($items_per_page);
$pag->currentPage($page);
}
$burl = get_permalink();
$url = $_SERVER['REQUEST_URI'];
//get_permalink();
$url = strpos($url, '?') ? $url . '&' : $url . '?';
$url = preg_replace("/[\\&]*{$cpvar}=[0-9]+[\\&]*/", "", $url);
$url = strpos($url, '?') ? $url . '&' : $url . '?';
if (!isset($paging) || $paging == 1) {
$pag->urlTemplate($url . "{$cpvar}=[%PAGENO%]");
}
$html = '';
$templates = maybe_unserialize(get_option("_fm_link_templates", true));
if (isset($templates[$template])) {
$template = $templates[$template]['content'];
}
global $post;
while ($packs->have_posts()) {
$packs->the_post();
$pack = (array) $post;
$repeater = "<div class='{$cwd_class} {$cwdsm_class} {$cwdxs_class}'>" . FetchTemplate($template, $pack) . "</div>";
$html .= $repeater;
}
wp_reset_query();
$html = "<div class='row'>{$html}</div>";
$cname = array();
foreach ($cids as $cid) {
$cat = get_term_by('slug', $cid, $taxo);
$cname[] = $cat->name;
}
$cats = implode(", ", $cname);
//Added from v4.2.1
//.........这里部分代码省略.........
示例10: DownloadPageContent
function DownloadPageContent($embedid = 0)
{
global $wpdb, $wp_query, $wpdm_package, $post;
if (is_singular('wpdmpro') || $embedid > 0) {
if ($embedid > 0) {
$linktemplates = maybe_unserialize(get_option("_fm_link_templates"));
}
$pagetemplates = maybe_unserialize(get_option("_fm_page_templates"));
if (!isset($wpdm_package['ID'])) {
$wpdm_package = get_post(get_the_ID(), ARRAY_A);
}
$wpdm_package['id'] = get_the_ID();
$wpdm_package = wpdm_setup_package_data($wpdm_package);
$wpdm_package['template'] = isset($wpdm_package['template']) ? $wpdm_package['template'] : 'link-template-default.php';
$wpdm_package['page_template'] = isset($wpdm_package['page_template']) ? $wpdm_package['page_template'] : 'page-template-default.php';
if (file_exists(dirname(__FILE__) . '/templates/' . $wpdm_package['template'])) {
$wpdm_package['template'] = @file_get_contents(dirname(__FILE__) . '/templates/' . $wpdm_package['template']);
} else {
$wpdm_package['template'] = isset($linktemplates) && !empty($linktemplates[$wpdm_package['template']]['content']) ? $linktemplates[$wpdm_package['template']]['content'] : $wpdm_package['template'];
}
if (file_exists(dirname(__FILE__) . '/templates/' . $wpdm_package['page_template'])) {
$wpdm_package['page_template'] = @file_get_contents(dirname(__FILE__) . '/templates/' . $wpdm_package['page_template']);
} else {
$wpdm_package['page_template'] = $pagetemplates[$wpdm_package['page_template']]['content'] ? $pagetemplates[$wpdm_package['page_template']]['content'] : $wpdm_package['page_template'];
}
$wpdm_package = apply_filters('wdm_pre_render_page', $wpdm_package);
if (isset($_GET['mode']) && $_GET['mode'] == 'popup') {
echo "<div class='w3eden'>";
echo FetchTemplate($wpdm_package['page_template'], $wpdm_package, 'popup');
echo '<br><div style="clear: both;"></div><br></div> ';
} else {
$wpdm_package['page_template'] = stripcslashes($wpdm_package['page_template']);
$data = FetchTemplate($wpdm_package['page_template'], $wpdm_package, 'page');
$siteurl = site_url('/');
return "<div class='w3eden'>" . $data . "<div style='clear:both'></div></div>";
}
}
}
示例11: DownloadPageContent
function DownloadPageContent($embedid = 0)
{
global $wpdb, $wp_query, $wpdm_package, $post;
if (is_singular('wpdmpro') || $embedid > 0) {
if ($embedid > 0) {
$linktemplates = maybe_unserialize(get_option("_fm_link_templates"));
}
$pagetemplates = maybe_unserialize(get_option("_fm_page_templates"));
if (!isset($wpdm_package['ID'])) {
$wpdm_package = get_post(get_the_ID(), ARRAY_A);
}
$wpdm_package['id'] = get_the_ID();
$wpdm_package = wpdm_setup_package_data($wpdm_package);
$wpdm_package['template'] = 'link-template-default.php';
//isset($wpdm_package['template']) ? $wpdm_package['template'] : 'link-template-default.php';
$wpdm_package['page_template'] = 'page-template-default.php';
//isset($wpdm_package['page_template']) ? $wpdm_package['page_template'] : 'page-template-default.php';
if (file_exists(dirname(__FILE__) . '/templates/' . $wpdm_package['template'])) {
$wpdm_package['template'] = @file_get_contents(dirname(__FILE__) . '/templates/' . $wpdm_package['template']);
} else {
$wpdm_package['template'] = $linktemplates[$wpdm_package['template']]['content'] ? $linktemplates[$wpdm_package['template']]['content'] : $wpdm_package['template'];
}
if (file_exists(dirname(__FILE__) . '/templates/' . $wpdm_package['page_template'])) {
$wpdm_package['page_template'] = @file_get_contents(dirname(__FILE__) . '/templates/' . $wpdm_package['page_template']);
} else {
$wpdm_package['page_template'] = $pagetemplates[$wpdm_package['page_template']]['content'] ? $pagetemplates[$wpdm_package['page_template']]['content'] : $wpdm_package['page_template'];
}
$wpdm_package = apply_filters('wdm_pre_render_page', $wpdm_package);
if (isset($_GET['mode']) && $_GET['mode'] == 'popup') {
echo "<div class='w3eden'>";
echo FetchTemplate($wpdm_package['page_template'], $wpdm_package, 'popup');
echo '<br><div style="clear: both;"></div><br></div> ';
} else {
$wpdm_package['page_template'] = stripcslashes($wpdm_package['page_template']);
$data = FetchTemplate($wpdm_package['page_template'], $wpdm_package, 'page');
$siteurl = site_url('/');
$data .= "<script type='text/javascript' language='JavaScript'> jQuery('.inddl').click(function(){ var tis = this; jQuery.post('{$siteurl}',{wpdmfileid:'{$wpdm_package['id']}',wpdmfile:jQuery(this).attr('file'),actioninddlpvr:jQuery(jQuery(this).attr('pass')).val()},function(res){ res = res.split('|'); var ret = res[1]; if(ret=='error') jQuery(jQuery(tis).attr('pass')).addClass('error'); if(ret=='ok') location.href=jQuery(tis).attr('rel')+'&_wpdmkey='+res[2];});}); </script> ";
return "<div class='w3eden'>" . $data . "<div style='clear:both'></div></div>";
}
}
}
示例12: is_array
//$sfile = preg_replace("/([0-9]+)_/","",$sfile);
//<a rel='noindex nofollow' href='".wpdm_download_url($file)."&ind=".$ind."' class='ind-download'>
if(!is_array($fileinfo[$sfile])) $fileinfo[$value] = array();
if($idvdl==1) {
if($fileinfo[$sfile]['password']==''&&get_wpdm_meta($file['id'],'password_lock',true)==1) $fileinfo[$sfile]['password'] = $file['password'];
$ttl = $fileinfo[$sfile][title]?$fileinfo[$sfile][title]:preg_replace("/([0-9]+)_/","",$sfile);
$fhtml .= "<tr><td>{$ttl}</td>";
$fhtml .= "<td width='90' align=right>";
if($fileinfo[$sfile]['password']!='')
$fhtml .= "<span><input onkeypress='jQuery(this).removeClass(\"error\");' size=10 type='text' value='Password' id='pass_{$file[id]}_{$ind}' onfocus='this.select()' onblur='if(this.value==\"\") this.value=\"Password\"' name='pass' />";
$fhtml .= "</td>";
if($fileinfo[$sfile]['password']!='')
$fhtml .= "<td width=90><button class='inddl wpdm-gh-button' file='{$sfile}' rel='".wpdm_download_url($file)."&ind=".$ind."' pass='#pass_{$file[id]}_{$ind}'>Download</button></td></tr>";
else
$fhtml .= "<td width=90><a class='wpdm-gh-button' href='".wpdm_download_url($file)."&ind=".$ind."'>Download</a></td></tr>";
}
else
$fhtml .= "<tr><td>{$fileinfo[$sfile][title]}</td></tr>";
}}
$fhtml .= "</table>";
if($idvdl!=1) $fhtml = "";
$file['file_list'] = $fhtml;
$dkey = is_array($file['files'])?md5(serialize($file['files'])):md5($file['files']);
$file['download_url'] = home_url("/?file={$file[id]}&downloadkey=".$dkey); */
$file['description'] = stripcslashes($file['description']);
$file['page_template'] = stripcslashes($file['page_template']);
$data = FetchTemplate($file['page_template'], $file, 'page');
$siteurl = site_url('/');
$data .= "<script type='text/javascript' language='JavaScript'> jQuery('.inddl').click(function(){ var tis = this; jQuery.post('{$siteurl}',{wpdmfileid:'{$file['id']}',wpdmfile:jQuery(this).attr('file'),actioninddlpvr:jQuery(jQuery(this).attr('pass')).val()},function(res){ res = res.split('|'); var ret = res[1]; if(ret=='error') jQuery(jQuery(tis).attr('pass')).addClass('error'); if(ret=='ok') location.href=jQuery(tis).attr('rel')+'&_wpdmkey='+res[2];});}); </script> ";
示例13: wpdm_package_info
echo wpdm_package_info('update_date');
?>
</td></tr>
<tr><td>Downloaded</td><td><?php
echo wpdm_package_info('download_count');
?>
times</td></tr>
<tr><td>Price</td><td><?php
echo wpdm_package_info('price');
?>
</td></tr>
</table><br>
<center>
<?php
echo (int) get_wpdm_meta(get_wpdm_ID(), 'price') >= 0 ? str_replace("wpdm-gh-button wpdm-gh-icon tag", "btn btn-info", FetchTemplate("[addtocart_form]", $package)) : str_replace("wpdm-gh-button wpdm-gh-icon arrowdown wpdm-gh-big", "btn btn-success btn-large", $package['download_link']);
?>
</center>
</div></div></div>
<?php
dynamic_sidebar('Single Post');
?>
</div>
</div>
</div>
<?php
get_footer();
示例14: wpdm_popup_data
function wpdm_popup_data()
{
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'popup') {
global $post;
$template = get_post_meta($post->ID, '__wpdm_page_template', true);
echo FetchTemplate($template, $post->ID, 'page');
die;
}
}