Search Results for 'Add Url'

Viewing 25 results - 301 through 325 (of 1,656 total)
  • Author
    Search Results
  • #172621

    Davide Gaio
    Member
    This reply has been marked as private.
    #172543
    #172494

    Don Wakefield
    Participant
    This reply has been marked as private.
    #172448

    In reply to: Invalid File Type


    Vince Slate
    Participant
    This reply has been marked as private.

    Thandi Viljoen
    Participant
    This reply has been marked as private.
    #171961

    Gayan Fernando
    Participant

    Hello 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

    #171682

    Paul D
    Participant
    This reply has been marked as private.
    #171484

    Nayeem Riddhi
    Moderator

    Hello Mario,

    Hope you are well. For premium packages and payment gateway options, you can use our this add-on,

    Premium Package – WordPress Digital Store Solution

    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

    #171339

    BFM Group Inc
    Participant
    This reply has been marked as private.
    #171260

    In reply to: AJAX and PHP Error and


    Piers Barber
    Member

    Hi. 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
    */

    #171239

    Tanvir
    Spectator

    Hello @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.

    WPDM Block Hotlink


    However, You can also provide temporary admin access of your website in a private reply to check the issue further.

    Thanks

    #171127

    In reply to: QR code


    Nayeem Riddhi
    Moderator

    Hello Gergi,

    Hope you are well. Which type of websites you are searching for, for demos and design, you can check this URL,

    WordPress Download Manager Pro Demo

    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 3 years, 5 months ago by Shahjada.

    Alex Tetley
    Participant
    This reply has been marked as private.
    #170966

    In reply to: AJAX and PHP Error and


    Tanvir
    Spectator

    Hello,
    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

    #170950

    Sumit datt
    Participant

    I’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.


    Beau Spicer
    Participant

    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 147

    I 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

    #170660

    Paul D
    Participant
    This reply has been marked as private.
    #170328

    In reply to: REST API Issues


    Tanvir
    Spectator

    Hello,
    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-files dir 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 queries

    Thanks


    natalie winters
    Participant
    This reply has been marked as private.
    #169900

    Humayon
    Spectator

    Hello 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

    #169520

    Ikram Dirujii
    Participant

    sir, 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’>{$fileTitle}</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’>{$fileTitle}</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 .= “{$fileTitle}” . “<div class=’card-body’><strong class=’d-block’>{$fileTitle}<small>” . wpdm_file_size($sfile) . “</small></div><div class=’card-footer’>”;
    } else
    $fhtml .= “{$fileTitle}” . “<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;

    }

    }


    Nayeem Riddhi
    Moderator

    Hello 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

    #168352

    Aaron Weinbaum
    Participant

    I’m using a filter plugin (LSCF Custom Filter). I need to call the download url so I can display the WPD download button into a custom template. The plugin requires a custom tag in order to call data from other plugin as shown below.  I’m not a programmer and have not figure out how to modify the code below to call the download url. Can you help me?

    add_action( ‘lscf_custom_tags’, ‘lscf_custom_tags_get_acf_fields’ );
    function lscf_custom_tags_get_acf_fields( &$args ) {
    $post_id = (int) $args[‘ID’];
    $acf_value = get_field( ‘my_field’, $post_id );
    $args[‘acf_field’] = $acf_value;
    }

    I need the custom tag to insert the download url in my custom download button:

    “a class=”wpdm-download-link download-on-click btn btn-primary ” download=”” rel=”nofollow” href=”#” data-downloadurl=”{{post.acf_field}}”>Download”

     

    #168302

    Tanvir
    Spectator

    Hello ,

    Sorry to hear about the issue.
    Could you please share the related page/file/package URL with us?
    Make sure that you are using the latest version of wpdm and all the addons of wpdm are latest version.
    If possible please also share the admin access of your website in a private reply.

    It helps us to quickly figure out the issue and resolve it immediately.

    Thank you

    #168273

    Jeremie Sinic
    Participant

    Hello, I found the fix, following a report from our hosting provider that they found an error showing that the bucket didn’t exist.
    It turns out that we were missing the “Region” info in the access URL.
    We were previously hosting our whole site on AWS and that might have been why we did not need to specify the AWS Bucket Region then.
    After adding the bucket region. It loaded instantly.

Viewing 25 results - 301 through 325 (of 1,656 total)