I plan on using DLMgr to restrict access to some file on my website (http://portlandyc.com) to members only. For this purpose, I would like the downloads to appear as simple links (i.e. without the download button or box). Is this possible?
I found how to hide the button. It doesn’t remove it in the sense that the space for it is still quite visible, but at least it’s a blank transparent image.
I still don’t know how to remove the border.
sorry not clear, which border, may you please give me your url to check
Shaon,
You can see an example of what I’m trying at http://portlandyc.com/test-2/
Additional Note: My son figured out how to make it work by creating a separate standard link with the URL from the button. Looks like I’m OK unless you can think of a flaw with this approach (e.g. if the GUID in the link changes during edit, which doesn’t appear to be the case.)
Thanks
Xavier
Additional thought: In the Insert Package or Category dialog, it would be nice to have the option to add a simple link such as shown on the last line of the test page above. Currently I have to create the package, add the shortcode to a test page, view the test page and copy the link location associated with the link displayed in the download button, then create a new link where I truly want to have it displayed.
Hello,
I had the same problem, I solved it like this:
theme: functions.php
remove_shortcode(‘wpdm_file’,’wpdm_downloadable_nsc’);
function link_wpdm_downloadable_nsc($params) {
global $wpdb;
extract($params);
$home = home_url(‘/’);
$sap = count($_GET) > 0 ? ‘&’ : ‘?’;
$data = $wpdb->get_row(“select * from ahm_files where id=’$id'”, ARRAY_A);
if ($title == ‘true’) {
$title = “” . $data[‘title’] . “”;
} else {
$title = ”;
}
if ($desc == ‘true’) {
$desc = $data[‘description’] . “”;
} else {
$desc = ”;
$desc = stripslashes($desc);
}
if ($data[‘show_counter’] != 0) {
$hc = ‘has-counter’;
}
if ($template == ”) {
$template = ‘wpdm-only-button’;
}
$wpdm_login_msg = get_option(‘wpdm_login_msg’) ? get_option(‘wpdm_login_msg’) : ‘Login Required’;
$link_label = $data[‘link_label’] ? $data[‘link_label’] : ‘Download’;
if ($data[‘access’] == ‘member’ && !is_user_logged_in()) {
$url = get_option(‘siteurl’) . “/wp-login.php?redirect_to=” . $_SERVER[‘REQUEST_URI’];
$uuid = uniqid();
$html = “$link_label“;
} else {
if ($data[‘password’] == ”) {
$url = home_url(‘/?wpdmact=process&did=’ . base64_encode($id . ‘.hotlink’));
$classrel = “”;
} else {
$classrel = ‘haspass’;
$url = home_url(‘/’);
$password_field = “Enter password”;
}
$html = “$link_label“;
}
return $html;
}
add_shortcode(‘wpdm_file’,’link_wpdm_downloadable_nsc’);
I also had the need to capture only the link for two pdf in multi language, I created two separate files in the plugin with two different id, then I created a page for each language by entering the appropriate code in the shortcode and added dell’footer this:
$page = get_page_by_path(“info-page”); // Slug Path
if ($page) {
$post = get_page($page->ID);
$content_link = apply_filters(‘the_content’, $post->post_content);
$content_link = preg_replace(“//”, “$1”, $content_link);
$content_link = str_replace(“”, “”, $content_link);
} else {
$content_link = “”;
}
I hope I have solved your problem.
The topic ‘Displaying download links without button or box’ is closed to new replies.