-
AuthorSearch Results
-
Jun 20, 2022 at 1:10 am #173655
Sid MedonzaParticipantThis reply has been marked as private.Jun 12, 2022 at 2:21 pm #173053
Nayeem RiddhiModeratorHello Andrew Beniams,
Hope you are well. And sorry for the inconvenience.
For issue #1, For updating from the older version it will update to the latest version, not the next version. For the Memberships Pro add-on, it will work for most of the themes. please share the related URL. if possible, please, give your temporary wp-admin login details in a private reply for checking the issue.
And For issue #2, Ordering and styles will also work fine. if possible, please, give your temporary wp-admin login details in a private reply for checking the issue.
Thank you and regards
May 30, 2022 at 10:09 am #172633In reply to: Short codes not working at all
Elodie CEMOIParticipantHello Nayeem,
I have placed a screen capture with the related URL here:
https://mega.nz/file/pyQ3DZSa#7qAKy3D1EQbZk1U3XCvTeBVOZxnxLzj-6RMVVGnNnsgand I have added a few comments in red color to help you.
Thank you
May 29, 2022 at 6:32 pm #172621In reply to: Issue with importing Download migration
Davide GaioMemberThis reply has been marked as private.May 26, 2022 at 10:22 am #172543Topic: Separate Profile page for users.
in forum Download Manager Pro
Abusufean AliParticipantHow can i create separate profile page where they can edit there display name, avatar & password etc? I am trying to use this url domainname.com/messages/#wppmsgsettings but it is only opening domainname.com/messages/. I have a page where i am calling username of who ever is logged in and i want to add custom icon of edit and link it to that user page where they can change details.
May 25, 2022 at 11:34 am #172494In reply to: Removing Billing Address for PayPal Subscription
Don WakefieldParticipantThis reply has been marked as private.May 24, 2022 at 3:31 pm #172448In reply to: Invalid File Type
Vince SlateParticipantThis reply has been marked as private.May 11, 2022 at 9:37 am #172039
Thandi ViljoenParticipantThis reply has been marked as private.May 9, 2022 at 5:06 pm #171961In reply to: Hello i need urgent help
Gayan FernandoParticipantHello Thank for your respond , no when i downgraded to lowest there is option visible and even i cant add new item under client perches . client was make perches and but item didn’t add to his account and empty , even i cant add manual . please check screenshot
https://tinyurl.com/y28568na
https://tinyurl.com/y3kxe5mu-
This reply was modified 4 years, 2 months ago by
Gayan Fernando.
Apr 28, 2022 at 5:16 am #171682In reply to: User added file listed as pending
Paul DParticipantThis reply has been marked as private.Apr 22, 2022 at 4:36 pm #171484In reply to: Download Manager does not work with WooCommerce
Nayeem RiddhiModeratorHello Mario,
Hope you are well. For premium packages and payment gateway options, you can use our this add-on,
and elaborating more on your issue, can you please share the related URL, if possible, please, give your temporary wp-admin login details in a private reply for checking the issue.
Thank you and regards
Apr 18, 2022 at 4:00 pm #171339In reply to: [wpdm_frontend] cant upload files
BFM Group IncParticipantThis reply has been marked as private.Apr 15, 2022 at 2:46 am #171260In reply to: AJAX and PHP Error and
Piers BarberMemberHi. We are still getting the error. Below is a code snippet from the functions.php file from our template for your review. maybe you can see something I cannot.
/**
* @usage Callback function for shortcode [wpdm_package id=PID]
* @param mixed $params
* @return mixed
*/
function directLinkCrypt($params, $content = “”)
{
extract($params);
global $wpdb;$filedata = get_post_meta($params[‘id’], ‘__wpdm_files’);
if(is_array($filedata[0])):
foreach($filedata[0] as $file):
$filepath = $file;
endforeach;
endif;
//var_dump($filepath);
$ind = (!empty($filepath)) ? “&ind=” . \WPDM\__\Cryp::Encrypt($params) : “”;if(\WPDM\Package::isLocked($params[‘id’]))
$linkURL = get_permalink($params[‘id’]);
else
$linkURL = “index.php?wpdmdl=”.$params[‘id’].$ind.”&#zoom=100″;
$target = isset($params[‘target’])?”target={$params[‘target’]}”:””;
$class = isset($params[‘class’])?”target={$params[‘class’]}”:””;
$id = isset($params[‘id’])?”target={$params[‘id’]}”:””;
$linkLabel = isset($params[‘label’]) && !empty($params[‘label’])?$params[‘label’]:get_post_meta($params[‘id’], ‘__wpdm_link_label’, true);
$linkLabel = empty($linkLabel)?’Download ‘.get_the_title($params[‘id’]):$linkLabel;
return “$linkLabel“;}
add_shortcode(‘wpdm_direct_link_crypt’, ‘directLinkCrypt’);
/*
* redirect logged in users to members version of home page
*/Apr 13, 2022 at 5:38 pm #171239In reply to: File not found! message
TanvirSpectatorHello @Amanda,
Yes WPDM Block Hotlink add-on will help you to block hot links to download URLs from external sites. Any such request will be redirected to the item details page or any other page specified by you.
However, You can also provide temporary admin access of your website in a private reply to check the issue further.Thanks
Nayeem RiddhiModeratorHello Gergi,
Hope you are well. Which type of websites you are searching for, for demos and design, you can check this URL,
For #2, using QR code with Download manager, you can check this add-on,https://www.wpdownloadmanager.com/download/wpdm-android/
For #3, Yes, for WPDM – Gutenberg Blocks – All download table block, you can search the title for now.
I hope you have understood.
Thank you and regards
-
This reply was modified 4 years, 3 months ago by
Shahjada.
Apr 7, 2022 at 1:13 pm #171018
Alex TetleyParticipantThis reply has been marked as private.Apr 6, 2022 at 2:14 pm #170966In reply to: AJAX and PHP Error and
TanvirSpectatorHello,
It seems wpdm is conflicting with your theme.
I would suggest you to change the theme and check if the issue still persists.
You can, however, try enabling/disabling plugins to identify if the issue is causing by any conflict with other plugin.
Also please update wpdm and all other addons of wpdm to the latest version. Latest version of wpdm is 6.1.5.In case the issue persists after following the steps, please provide the related urls and temporary admin access to me in a private message.
Thanks
Apr 6, 2022 at 9:27 am #170950In reply to: WPDM Package Create Question
Sumit dattParticipantI’m using this to create wpdm package via PHP
WPDM()->package::create([
‘post_title’ ► ‘Download’,
‘post_name’ ► ”,
‘post_content’ ► ”,
‘post_excerpt’ ► ”,
‘post_status’ ► ‘publish’,
‘post_type’ ► ‘wpdmpro’,
‘post_author’ ► 1,
‘ping_status’ ► get_option(‘default_ping_status’),
‘post_parent’ ► 0,
‘menu_order’ ► 0,
‘to_ping’ ► ”,
‘pinged’ ► ”,
‘post_password’ ► ”,
‘guid’ ► ”,
‘post_content_filtered’ ► ”,
‘files’ ► array(),
‘fileinfo’ ► array(),
‘package_dir’ ► ”,
‘link_label’ ► __(“Download”, “download-manager”),
‘download_count’ ► 0,
‘view_count’ ► 0,
‘version’ ► ”,
‘stock’ ► 0,
‘package_size’ ► $size,
‘package_size_b’ ► 0,
‘access’ ► ”,
‘individual_file_download’ ► -1,
‘cache_zip’ ► -1,
‘template’ ► ‘page-template-doc-preview.php’,
‘page_template’ ► ‘page-template-doc-preview.php’,
‘password_lock’ ► ‘0’,
’email_lock’ ► ‘0’,
‘icon’ ► ”,
]);I want to know how can I add link to download, File access to ‘All Visitors’ and set Custom Page URL via post_name. I’m stuck in these 3 things only.
Apr 4, 2022 at 4:25 am #170847
Beau SpicerParticipantWe’ve tried to apply updates on our installation website this morning and found the Download Manager plugin failed to update again. It was the same as last time where the downloaded “zip” file was HTML text with an “Invalid Access!” error. I’m sure it would have worked if I clicked update in the admin UI which did work last time, but as I’d mentioned our process is to apply all updates with “wp-cli” so this needs to work.
Our Developer comments:
I dug into things a bit and saw an error being logged:
PHP Notice: Undefined index: HTTP_HOST in <local path>/wp-content/plugins/download-manager/src/__/Updater.php on line 147I had a look at line 147 of that file, and it’s as follows:
$domain = strtolower(str_replace(“www.”, “”, $_SERVER[‘HTTP_HOST’]));The issue here is that “$_SERVER[‘HTTP_HOST’]” is not valid when called by wp-cli as this is not a web server. I backed up the file, edited the line and replaced “$_SERVER[‘HTTP_HOST’]” with “our-website.com”. After that “wp plugin update download-manager” worked and successfully updated the plugin to the latest version. That’s only a one-time fix though.
I’m sure when they see the problem, they’ll understand how to fix it. There are other ways they can get this URL, e.g. via WP’s “siteurl” option, etc. There’s already a base64 encoded string being added to the download URL which has “our-website.com” embedded in it, so that must have been worked out somehow without needing to look at the $_SERVER variable.
Please advise solution/fix, thanks
Mar 31, 2022 at 9:26 pm #170660In reply to: User added file listed as pending
Paul DParticipantThis reply has been marked as private.Mar 24, 2022 at 5:44 pm #170328In reply to: REST API Issues
TanvirSpectatorHello,
Please check the Package Properties from here,As per other Attributes, you shall find files object, here you can bind id with file name. Thus you will be able to attach/upload file thereby. I hope you have understood.
If you have kept just the file name you should keep the files in
wp-content/uploads/download-manager-filesdir too. And for local files, you will not be able to attach files from the local PC drive directly, or you may please attach a live server file URL there. It will also help you upload files properly.The JSON response will look like the following example:
{ "id": 6488, "title": "The Alchemist", "slug": "the-alchemist", "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.", "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.", "author": 1, "status": "publish", "parent": 0, "tags": [ "novel", "paulo-coelho" ], "categories": [ 16 ], "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg", "additional_previews": [ "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg", "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg" ], "version": "3.0.0", "link_label": "Download", "quota": 0, "download_limit_per_user": "100", "view_count": 80, "download_count": 14, "package_size": "811.84 KB", "access": [ "guest", "subscriber", "administrator" ], "user_access": [ "admin" ], "individual_file_download": "1", "cache_zip": "-1", "template": "link-template-calltoaction1", "page_template": "page-template-1col-flat", "files": { "1": "The Alchemist.pdf" }, "fileinfo": { "1": { "title": "The Alchemist", "password": "", "license_price": { "statdard": "", "extended": "", "unlimited": "" }, "price": "" } }, "package_dir": "", "publish_date": "2019-04-01 12:00 am", "expire_date": "2019-08-31 12:00 am", "terms_lock": "1", "terms_title": "Agree to terms", "terms_conditions": "You can't redistribute without prior authorization.", "terms_check_label": "Checkbox Label", "password_lock": "1", "password": "[123][456]", "password_usage_limit": "2", "linkedin_lock": "1", "linkedin_message": "LinkedIn Share Lock message", "linkedin_url": "https://www.wpdownloadmanager.com/", "tweet_lock": "1", "tweet_message": "Custom tweet message", "twitterfollow_lock": "1", "twitter_handle": "Shahriar", "facebooklike_lock": "1", "facebook_like": "", "email_lock": "1", "email_lock_title": "Subscribe To Download", "email_lock_msg": "", "email_lock_idl": "0", "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png", "base_price": "12.00", "sales_price": "10.00", "sales_price_expire": "2019-08-31 12:00 am", "pay_as_you_want": "0", "license": { "statdard": { "active": "1" }, "extended": { "price": "22", "active": "1" }, "unlimited": { "price": "32", "active": "1" } }, "discount": { "subscriber": "10", "contributor": "20", "author": "30", "editor": "40", "administrator": "50" }, "enable_license": "1", "enable_license_key": "1", "free_downloads": [ "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf" ], "meta_input":{ "meta_key" : "Hello" } }here file attach should be like this,
"files": { "1": "The Alchemist.pdf" }And for this default format, the file should be residing in
wp-content/uploads/download-manager-files, thus the package should create with fa file. Please let me know if you have other queriesThanks
Mar 23, 2022 at 2:45 pm #170267
natalie wintersParticipantThis reply has been marked as private.Mar 16, 2022 at 8:10 am #169900In reply to: Column Width in Tables not working
HumayonSpectatorHello there,
To apply the custom CSS, you need to get the column class name / ID from HTML code and add the CSS in theme customizer as shown in reply #169701. However, if you want us to write the CSS, give us the exact column name and the table page URL.
Thanks
Mar 9, 2022 at 9:23 am #169520In reply to: DEAR WPDM TEAM NEED YOUR HELP PLEASE
Ikram DirujiiParticipantsir, it is giving an error. please i ma sending my PHP file please add the code
`<?php
namespace WPDM\Package;
use WPDM\__\__;
use WPDM\__\Crypt;
use WPDM\__\Session;class FileList
{/**
* @var null Package
*/
private $package = null;function __construct($package = null)
{}
private function fileEntrySimple()
{}
/**
* @usage Callback function for [file_list] tag
* @param $package
* @param bool|false $play_only
* @return string
*/
public static function table($ID, $play_only = false)
{$current_user = wp_get_current_user();
$package = WPDM()->package->init($ID);
$fileinfo = maybe_unserialize(get_post_meta($ID, ‘__wpdm_fileinfo’, true));
if (function_exists(‘wpdmpp_effective_price’) && wpdmpp_effective_price($ID) > 0) return self::premium($ID, $play_only);
$files = maybe_unserialize($package->files);
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$fhtml = ”;
$idvdl = $package->isSingleFileDownloadAllowed();
$pd = $package->avail_date ? strtotime($package->avail_date) : 0;
$xd = $package->expire_date ? strtotime($package->expire_date) : 0;$nodl = $play_only ? ‘style=”display: none”‘ : “”;
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$download_url = $permalink . $sap . “wpdmdl={$ID}”;$cur = is_user_logged_in() ? $current_user->roles : array(‘guest’);
if (($xd > 0 && $xd < time()) || ($pd > 0 && $pd > time())) $idvdl = 0;
$button_label = apply_filters(“single_file_download_link_label”, __(“Download”, “download-manager”), $package);
if (count($files) > 0) {
$pwdlock = (int)get_post_meta($ID, ‘__wpdm_password_lock’, true);
//Check if any other lock option applied for this package
$olock = 0;
$noaccess = 0;$swl = 0;
if ($package->quota <= 0) $package->quota = 9999999999999;
if (is_user_logged_in()) $cur[] = ‘guest’;
if (!$package->userCanDownload()) {
$noaccess = 1;
}
if ($package->isLocked()) {
$olock = 1;
}$pwdcol = $dlcol = ”;
if ($noaccess === 0) {
if ($pwdlock && $idvdl) $pwdcol = “<th>” . __(“Password”, “download-manager”) . “</th>”;
if ($idvdl && ($pwdlock || !$olock)) {
$dlcol = “<th>” . __(“Action”, “download-manager”) . “</th>”;
$swl = 1;
}
}$allfiles = $files;
$cattr = $data = “”;
if (count($allfiles) > 5)
$data = ‘<input placeholder=”‘ . __(“Search File…”, “download-manager”) . ‘” style=”margin:10px 0;border-radius: 0″ type=”search” class=”form-control bg-white wpdm-pack-search-file” data-filelist=”#wpdm-filelist-area-‘ . $ID . ‘” />’;
$fhtml = “<div {$cattr} data-packageid='{$ID}’ id=’wpdm-filelist-area-{$ID}’ class=’wpdm-filelist-area wpdm-filelist-area-{$ID}’ style=’position:relative’>{$data}<table id=’wpdm-filelist-{$ID}’ class=’wpdm-filelist table table-hover’><thead><tr><th>” . __(“File”, “download-manager”) . “</th>{$pwdcol}{$dlcol}</tr></thead><tbody>”;
if (is_array($allfiles)) {
$pc = 0;
foreach ($allfiles as $fileID ► $sfile) {$individual_file_actions = $individual_file_actions_locked = ”;
$individual_file_actions = apply_filters(“individual_file_action”, $individual_file_actions, $ID, $sfile, $fileID);
$individual_file_actions_locked = apply_filters(“individual_file_action_locked”, $individual_file_actions_locked, $ID, $sfile, $fileID);$ind = $fileID; //\WPDM_Crypt::Encrypt($sfile);
$pc++;//if (!isset($fileinfo[$fileID]) || !@is_array($fileinfo[$fileID])) $fileinfo[$fileID] = array();
$filePass = wpdm_valueof($fileinfo, “{$fileID}/password”);
$fileTitle = wpdm_valueof($fileinfo, “{$fileID}/title”);
$fileTitle = $fileTitle ?: preg_replace(“/([0-9]+)_/”, “”, wpdm_basename($sfile));
$fileTitle = wpdm_escs($fileTitle);
$fileVersion = wpdm_valueof($fileinfo, “{$fileID}/version”);
$fileVersion = $fileVersion ? ” — {$fileVersion}” : ”;
$lastUpdate = wpdm_valueof($fileinfo, “{$fileID}/update_date”);
$lastUpdate = $lastUpdate ? ” — Updated on {$lastUpdate}” : ”;if ($swl) {
$mp3 = explode(“.”, $sfile);
$mp3 = end($mp3);
$mp3 = strtolower($mp3);
$play = in_array($mp3, array(‘mp3’)) ? “<i style=’margin-top:0px’ class=’fa fa-play’></i>” : “”;if ($filePass == ” && $pwdlock) $filePass = $package->isPasswordProtected();
$fhtml .= “<tr><td>{$fileTitle}{$fileVersion}{$lastUpdate}</td>”;
$passField = ”;
if ($pwdlock && !$noaccess)
$passField = “<input style=’width:150px’ onkeypress=’jQuery(this).removeClass(\”input-error\”);’ size=10 type=’password’ value=” id=’pass_{$ID}_{$ind}’ placeholder='” . __(“Password”, “download-manager”) . “‘ name=’pass’ class=’form-control input-sm inddlps d-inline-block’ />”;
//$fhtml .= “<td width=’120′ class=’text-right’><input onkeypress=’jQuery(this).removeClass(\”input-error\”);’ size=10 type=’password’ value=” id=’pass_{$ID}_{$ind}’ placeholder='”.__( “Password” , “download-manager” ).”‘ name=’pass’ class=’form-control input-sm inddlps’ /></td>”;
if ($filePass != ” && $pwdlock && !$noaccess)
$fhtml .= “<td style=’white-space: nowrap;text-align: right’>{$passField}<button class=’inddl btn btn-primary btn-sm’ data-pid='{$ID}’ data-file='{$fileID}’ rel='” . $permalink . $sap . “wpdmdl={$ID}” . “&ind=” . $ind . “‘ data-pass=’#pass_{$ID}_{$ind}’><i class=’fa fa-download’></i> ” . $button_label . “</button> {$individual_file_actions}</td></tr>”;
else {
$ind_download_link = “getDownloadURL($ID, array(‘ind’ ► $ind, ‘filename’ ► wp_basename($sfile))) . “‘>” . $button_label . ““;
$ind_download_link = apply_filters(“wpdm_single_file_download_link”, $ind_download_link, $fileID, (array)$package);
$fhtml .= “<td style=’white-space: nowrap;’ class=’text-right’>{$ind_download_link}{$play} {$individual_file_actions}</td></tr>”;
}
} else {
$fhtml .= “<tr><td>{$fileTitle}</td><td style=’white-space: nowrap;’ class=’text-right’>{$individual_file_actions_locked}</td></tr>”;
}
}}
$fhtml .= “</tbody></table></div>”;
$siteurl = home_url(‘/’);}
return $fhtml;
}
/**
* @usage Callback function for [file_list_extended] tag
* @param $package
* @return string
* @usage Generate file list with preview
*/
public static function extended($ID, $w = 88, $h = 88, $cols = 3)
{$current_user = wp_get_current_user();
$package = WPDM()->package->init($ID);
$fileinfo = maybe_unserialize(get_post_meta($ID, ‘__wpdm_fileinfo’, true));
if (function_exists(‘wpdmpp_effective_price’) && wpdmpp_effective_price($ID) > 0) return self::premium($ID);
$files = maybe_unserialize($package->files);
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$fhtml = ”;
$idvdl = WPDM()->package->isSingleFileDownloadAllowed($ID); //isset($package[‘individual_file_download’]) ? $package[‘individual_file_download’] : 0;
$pd = $package->avail_date ? strtotime($package->avail_date) : 0;
$xd = $package->expire_date ? strtotime($package->expire_date) : 0;$cur = is_user_logged_in() ? $current_user->roles : array(‘guest’);
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$download_url = $permalink . $sap . “wpdmdl={$ID}”;Session::set(‘wpdmfilelistcd_’ . $ID, 1);
if (($xd > 0 && $xd < time()) || ($pd > 0 && $pd > time())) $idvdl = 0;
$button_label = apply_filters(“single_file_download_link_label”, __(“Download”, “download-manager”), $package);
if (count($files) > 0) {
$pwdlock = (int)get_post_meta($ID, ‘__wpdm_password_lock’, true);
//Check if any other lock option apllied for this package
$olock = $package->isLocked();$swl = 0;
$package->quota = $package->quota > 0 ?: 9999999999999;
if (is_user_logged_in()) $cur[] = ‘guest’;
//if (!isset($package[‘access’]) || count($package[‘access’]) == 0 || !wpdm_user_has_access($ID) || wpdm_is_download_limit_exceed($ID) || $package[‘quota’] <= $package[‘download_count’]) $olock = 1;if ($idvdl && ($pwdlock || !$olock)) {
$swl = 1;
}$allfiles = $files;
$fhtml = “<div id=’xfilelist’><div class=’row’>”;
if (is_array($allfiles)) {$classes = array(‘1’ ► ‘col-md-12’, ‘2’ ► ‘col-md-6’, ‘3’ ► ‘col-md-4’, ‘4’ ► ‘col-md-3’, ‘6’ ► ‘col-md-2’);
$class = isset($classes[$cols]) ? $classes[$cols] : ‘col-md-4′;foreach ($allfiles as $fileID ► $sfile) {
$fhtml .= “<div class='{$class} col-sm-6 col-xs-6′><div class=’panel panel-default card mb-4’>”;
$ind = $fileID; //\WPDM_Crypt::Encrypt($sfile);$filePass = wpdm_valueof($fileinfo, “{$fileID}/password”);
$fileTitle = wpdm_valueof($fileinfo, “{$fileID}/title”);
$fileTitle = $fileTitle ?: preg_replace(“/([0-9]+)_/”, “”, wpdm_basename($sfile));
$fileTitle = wpdm_escs($fileTitle);if ($filePass == ” && $pwdlock) $filePass = $package[‘password’];
$fhtml .= “<div class=’panel-heading card-header ttip’ title='{$fileTitle}’>{$fileTitle}</div>”;
$imgext = array(‘png’, ‘jpg’, ‘jpeg’, ‘gif’);
$ext = explode(“.”, $sfile);
$ext = end($ext);
$ext = strtolower($ext);
$filepath = file_exists($sfile) || __::is_url($sfile) ? $sfile : UPLOAD_DIR . $sfile;
$thumb = “”;$thumb = WPDM()->package->getThumbnail($ID, $fileID, [$w, $h]);
$cssclass = in_array($ext, $imgext) ? ‘file-thumb wpdm-img-file’ : ‘file-thumb wpdm-file wpdm-file-‘ . $ext;
if ($thumb) {
//$file_thumb_attrs = apply_filters(“”, $file, $fileID, $thumb, $w, $h);
$fhtml .= “<div class=’panel-body card-body text-center’></div><div class=’panel-footer card-footer footer-info’>” . wpdm_file_size($sfile) . “</div><div class=’panel-footer card-footer text-center’>”;
} else
$fhtml .= “<div class=’panel-body card-body text-center’></div><div class=’panel-footer card-footer footer-info text-center’>” . wpdm_file_size($sfile) . “</div><div class=’panel-footer card-footer text-center’>”;
if ($swl) {
if ($filePass != ” && $pwdlock)
$fhtml .= “<div class=’input-group input-group-sm’><input onkeypress=’jQuery(this).removeClass(\”input-error\”);’ size=10 type=’password’ value=” id=’pass_{$ID}_{$ind}’ placeholder=’Password’ name=’pass’ class=’form-control inddlps’ />”;
if ($filePass != ” && $pwdlock)
$fhtml .= “<span class=’input-group-btn input-group-append’><button class=’inddl btn btn-secondary btn-light btn-block’ data-pid='{$ID}’ data-file='{$fileID}’ data-pass=’#pass_{$ID}_{$ind}’><i class=’fas fa-arrow-alt-circle-down’></i></button></span></div>”; //rel='” . $download_url . “&ind=” . $ind . “‘
else {
$ind_download_link = “” . $button_label . ““;
$ind_download_link = apply_filters(“wpdm_single_file_download_link”, $ind_download_link, $fileID, (array)$package);
$individual_file_actions = ”;
$individual_file_actions = apply_filters(“individual_file_action”, $individual_file_actions, $ID, $sfile, $fileID);
$fhtml .= $ind_download_link . ” {$individual_file_actions}”;
}
}$fhtml .= “</div></div></div>”;
}}
$fhtml .= “</div></div>”;
$siteurl = home_url(‘/’);
//$fhtml .= “<script type=’text/javascript’ language=’JavaScript’> jQuery(‘.inddl’).click(function(){ var tis = this; jQuery.post(‘{$siteurl}’,{wpdmfileid:'{$ID}’,wpdmfile:jQuery(this).attr(‘file’),actioninddlpvr:1,filepass:jQuery(jQuery(this).attr(‘pass’)).val()},function(res){ res = res.split(‘|’); var ret = res[1]; if(ret==’error’) jQuery(jQuery(tis).attr(‘pass’)).addClass(‘input-error’); if(ret==’ok’) location.href=jQuery(tis).attr(‘rel’)+’&_wpdmkey=’+res[2];});}); </script> “;}
return $fhtml;
}
/**
* @usage Callback function for [file_list] tag
* @param $package
* @param bool|false $play_only
* @return string
*/
public static function premium($ID, $play_only = false)
{if (!function_exists(‘wpdmpp_effective_price’)) return self::table($ID, $play_only);
$current_user = wp_get_current_user();
$package = WPDM()->package->init($ID);
$files = $package->files;$fileinfo = maybe_unserialize(get_post_meta($ID, ‘__wpdm_fileinfo’, true));
$fhtml = ‘<div class=”list-group premium-files premium-files-‘ . $ID . ‘” id=”premium-files-‘ . $ID . ‘”>’;
$currency = wpdmpp_currency_sign();
if (count($files) > 0) {
$post_id = $ID;
$license_req = get_post_meta($post_id, “__wpdm_enable_license”, true);
$license_pack = get_post_meta($post_id, “__wpdm_license_pack”, true);
//wpdmprecho($license_pack);
$fileinfo = get_post_meta($post_id, ‘__wpdm_fileinfo’, true);
$allfiles = $files;if (is_array($allfiles)) {
$pc = 0;
foreach ($allfiles as $fileID ► $sfile) {$individual_file_actions = ”;
$individual_file_actions = apply_filters(“individual_file_action”, $individual_file_actions, $ID, $sfile, $fileID);
$file_price = isset($fileinfo[$fileID][‘price’]) ? number_format((double)$fileinfo[$fileID][‘price’], 2) : 0;
$ind = $fileID; //\WPDM_Crypt::Encrypt($sfile);
$pc++;$fileTitle = wpdm_valueof($fileinfo, “{$fileID}/title”);
$fileTitle = $fileTitle ?: preg_replace(“/([0-9]+)_/”, “”, wpdm_basename($sfile));
$fileTitle = wpdm_escs($fileTitle);$data = $data_prices = “”;
$pre_licenses = wpdmpp_get_licenses();
$active_lics = array();
$zl = 0;
$file_availabiliy_lic = [];
if ($license_req == 1 && is_array($fileinfo)) {
foreach ($pre_licenses as $licid ► $lic) {
$lic[‘price’] = !isset($fileinfo[$fileID][‘license_price’]) || !isset($fileinfo[$fileID][‘license_price’][$licid]) || $fileinfo[$fileID][‘license_price’][$licid] == ” ? (isset($fileinfo[$fileID][‘price’]) && $zl == 0 ? $fileinfo[$fileID][‘price’] : 0) : $fileinfo[$fileID][‘license_price’][$licid];
$prc = number_format((double)$lic[‘price’], 2);
if ($zl == 0)
$file_price = $prc;
$active_lics[$licid] = $lic;
if ($lic[‘price’] > 0) {
$data .= ” data-{$licid}='{$currency}{$prc}’ “;
$data_prices .= ” data-{$licid}='{$prc}’ “;
}
if (isset($license_pack[$licid])) {
if (in_array($fileID, $license_pack[$licid]))
$file_availabiliy_lic[] = “file_avail-{$licid}”;
} else
$file_availabiliy_lic[] = “file_avail-{$licid}”;
$zl++;
}//if(count($active_lics) <= 1)
// $data = $data_prices = “”;
}$file_availabiliy_lic = implode(” “, $file_availabiliy_lic);
if ($file_price > 0)
$fhtml .= “<label class=’list-group-item eden-checkbox premium-file {$file_availabiliy_lic}’><div {$data} class=’badge badge-default pull-right’>{$currency}{$file_price}</div><input type=’checkbox’ {$data_prices} data-pid='{$ID}’ data-file='{$fileID}’ value='{$file_price}’ class=’wpdm-checkbox file-price file-price-{$ID}’> $fileTitle</label>”;
else
$fhtml .= “<label class=’list-group-item eden-checkbox free-file’>$fileTitle</label>”;}
}
}
return $fhtml . “</div>”;
}
/**
* @usage Callback function for [image_gallery_WxHxC] tag
* @param $package
* @return string
* @usage Generate file list with preview
*/
public static function imageGallery($ID, $w = 400, $h = 400, $cols = 3)
{$current_user = wp_get_current_user();
$package = WPDM()->package->init($ID);
$fileinfo = maybe_unserialize(get_post_meta($ID, ‘__wpdm_fileinfo’, true));
if (function_exists(‘wpdmpp_effective_price’) && wpdmpp_effective_price($ID) > 0) return self::premium($ID);
$files = maybe_unserialize($package->files);
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$fhtml = ”;
$idvdl = WPDM()->package->isSingleFileDownloadAllowed($ID);$pd = $package->avail_date ? strtotime($package->avail_date) : 0;
$xd = $package->expire_date ? strtotime($package->expire_date) : 0;$cur = is_user_logged_in() ? $current_user->roles : array(‘guest’);
$permalink = get_permalink($ID);
$sap = strpos($permalink, ‘?’) ? ‘&’ : ‘?’;
$download_url = $permalink . $sap . “wpdmdl={$ID}”;Session::set(‘wpdmfilelistcd_’ . $ID, 1);
//Publish and expire date check
if (($xd > 0 && $xd < time()) || ($pd > 0 && $pd > time())) $idvdl = 0;$button_label = apply_filters(“single_file_download_link_label”, __(“Download”, “download-manager”), $package);
if (count($files) > 0) {
$pwdlock = (int)get_post_meta($ID, ‘__wpdm_password_lock’, true);
//Check if any other lock option apllied for this package
$olock = $package->isLocked();$swl = 0;
$package->quota = $package->quota > 0 ?: 9999999999999;
if (is_user_logged_in()) $cur[] = ‘guest’;if ($idvdl && ($pwdlock || !$olock)) {
$swl = 1;
}$fhtml = “<div id=’wpdm-image-gallery’><div class=’row’>”;
$classes = array(‘1’ ► ‘col-md-12’, ‘2’ ► ‘col-md-6’, ‘3’ ► ‘col-md-4’, ‘4’ ► ‘col-md-3’, ‘6’ ► ‘col-md-2’);
$class = isset($classes[$cols]) ? $classes[$cols] : ‘col-md-4′;foreach ($files as $fileID ► $sfile) {
$fhtml .= “<div class='{$class} col-sm-6 col-xs-6′><div class=’card mb-4’>”;
$ind = $fileID; //\WPDM_Crypt::Encrypt($sfile);if (!isset($fileinfo[$sfile]) || !@is_array($fileinfo[$sfile])) $fileinfo[$sfile] = array();
if (!@is_array($fileinfo[$fileID])) $fileinfo[$fileID] = array();$filePass = isset($fileinfo[$sfile][‘password’]) ? $fileinfo[$sfile][‘password’] : (isset($fileinfo[$fileID][‘password’]) ? $fileinfo[$fileID][‘password’] : ”);
$fileTitle = isset($fileinfo[$sfile][‘title’]) && $fileinfo[$sfile][‘title’] != ” ? $fileinfo[$sfile][‘title’] : (isset($fileinfo[$fileID][‘title’]) && $fileinfo[$fileID][‘title’] != ” ? $fileinfo[$fileID][‘title’] : preg_replace(“/([0-9]+)_/”, “”, wpdm_basename($sfile)));//$fileTitle = esc_html($fileTitle);
if ($filePass == ” && $pwdlock) $filePass = $package[‘password’];
//$fhtml .= “<div class=’panel-heading card-header ttip’ title='{$fileTitle}’></div>”;
$imgext = array(‘png’, ‘jpg’, ‘jpeg’, ‘gif’);
$ext = explode(“.”, $sfile);
$ext = end($ext);
$ext = strtolower($ext);
$filepath = file_exists($sfile) ? $sfile : UPLOAD_DIR . $sfile;
$thumb = “”;if ($ext == ”) $ext = ‘unknown’;
if (in_array($ext, $imgext))
$thumb = WPDM()->fileSystem->imageThumbnail($filepath, $w, $h, true);
if ($thumb) {
//$file_thumb_attrs = apply_filters(“”, $file, $fileID, $thumb, $w, $h);
$fhtml .= “” . “<div class=’card-body’><strong class=’d-block’>{$fileTitle}<small>” . wpdm_file_size($sfile) . “</small></div><div class=’card-footer’>”;
} else
$fhtml .= “” . “<div class=’card-body’><strong class=’d-block’>{$fileTitle}<small>” . wpdm_file_size($sfile) . “</small></div><div class=’card-footer’>”;
if ($swl) {
if ($filePass != ” && $pwdlock)
$fhtml .= “<div class=’input-group input-group-sm’><input onkeypress=’jQuery(this).removeClass(\”input-error\”);’ size=10 type=’password’ value=” id=’pass_{$ID}_{$ind}’ placeholder=’Password’ name=’pass’ class=’form-control inddlps’ />”;
if ($filePass != ” && $pwdlock)
$fhtml .= “<span class=’input-group-btn input-group-append’><button class=’inddl btn btn-secondary btn-light btn-block’ data-pid='{$ID}’ data-file='{$fileID}’ data-pass=’#pass_{$ID}_{$ind}’><i class=’fas fa-arrow-alt-circle-down’></i></button></span></div>”; //rel='” . $download_url . “&ind=” . $ind . “‘
else {
$ind_download_link = “” . $button_label . ““;
$ind_download_link = apply_filters(“wpdm_single_file_download_link”, $ind_download_link, $fileID, (array)$package);
$individual_file_actions = ”;
$individual_file_actions = apply_filters(“individual_file_action”, $individual_file_actions, $ID, $sfile, $fileID);
$fhtml .= $ind_download_link . ” {$individual_file_actions}”;
}
}$fhtml .= “</div></div></div>”;
}$fhtml .= “</div></div>”;
}
return $fhtml;
}
}
Feb 22, 2022 at 3:49 pm #168519
Nayeem RiddhiModeratorHello Natalie,
For tag-related issues, can you please check with this add-on for the WPDM plugin’s latest version?
https://www.dropbox.com/s/olxlius9wpy0rh4/wpdm-tag-importer.zip
And for PDFs related issues, can you please share the related URLs, if possible, please, give your temporary wp-admin login details in a private reply for checking the issue.
Thank you and regards
-
This reply was modified 4 years, 2 months ago by
-
AuthorSearch Results
Search Results for 'Add Url'
-
Search Results
-
We’ve tried to apply updates on our installation website this morning and found the Download Manager plugin failed to update again. It was the same as last time where the downloaded “zip” file was HTML text with an “Invalid Access!” error. I’m sure it would have worked if I clicked update in the admin UI which did work last time, but as I’d mentioned our process is to apply all updates with “wp-cli” so this needs to work.
Our Developer comments:
I dug into things a bit and saw an error being logged:
PHP Notice: Undefined index: HTTP_HOST in <local path>/wp-content/plugins/download-manager/src/__/Updater.php on line 147I had a look at line 147 of that file, and it’s as follows:
$domain = strtolower(str_replace(“www.”, “”, $_SERVER[‘HTTP_HOST’]));The issue here is that “$_SERVER[‘HTTP_HOST’]” is not valid when called by wp-cli as this is not a web server. I backed up the file, edited the line and replaced “$_SERVER[‘HTTP_HOST’]” with “our-website.com”. After that “wp plugin update download-manager” worked and successfully updated the plugin to the latest version. That’s only a one-time fix though.
I’m sure when they see the problem, they’ll understand how to fix it. There are other ways they can get this URL, e.g. via WP’s “siteurl” option, etc. There’s already a base64 encoded string being added to the download URL which has “our-website.com” embedded in it, so that must have been worked out somehow without needing to look at the $_SERVER variable.
Please advise solution/fix, thanks