Sheye,
I’ve corrected the bug in your LinkLocker installation, and will update my version of code in the next few days so that others don’t experience this bug. Thanks for bringing the issue to my attention and providing the required access to quickly fix the issue.
Best of luck! Brad
Thank you Brad for handling this so quickly.
I’ve been working on the template SQL for display… here is what I have so far. Can you help refine this a bit?
{exp:query sql="SELECT d.member_id, m.gen_id, ip, download_count, link_id, last_download, username, screen_name, avatar_filename, screen_name, email, bio, location
FROM exp_linklocker_gen m JOIN exp_linklocker_user2gen c ON m.gen_id = c.gen_id JOIN exp_members d ON c.member_id = d.member_id ORDER BY last_download DESC"}
The goal is to list documents and how many downloads per member.
Any help is appreciated.
Ok, well if I understand what you want correctly, it is to list the files, the following query should pull the info you need and group it by url, link_group, and link_label:
SELECT d.member_id, m.gen_id, ip, m.download_count, m.link_id, m.last_download, username, screen_name, avatar_filename, screen_name, email, bio, location,l.link_url,l.link_label,l.link_group
FROM exp_linklocker_gen m
JOIN exp_linklocker_user2gen c ON m.gen_id = c.gen_id
JOIN exp_members d ON c.member_id = d.member_id
JOIN exp_linklocker_link l on m.link_id = l.link_id
GROUP BY l.link_url,l.link_label,l.link_group
ORDER BY last_download DESC
Not quite.
The site has 6 Documents total. I want a simple Member stats page for the admin’s to easily view a list of members and then 6 column of docs with the number of downloads.
TOP ROW: Member info | Doc 1 | Doc 2 | Doc 3 | Doc 4 | MEMBERS: John Doe @ info… | 2 | 0 | 3 | 2 | Jane Doe @ info… | 4 | 1 | 2 | 5 |
So it lists a member then gets the number of download for each document. It’s simple to do in PHP but not quite so simple in EE.
Hello again, Brad (sorry for misnaming you earlier) …
The “LinkLocker Member Download Stats” report does not seem to be working correctly – it is not displaying any member IDs above 120 (we currently have 720+ member IDs).
Unfortunately, all our paid members have IDs above 600, so we have no access to data on their download usage, which is important to the “business logic” of our site.
Any ideas why this might be happening? The code we use to generate the LL tag is:
<a href="http://{exp:linklocker">Click to download this PDF</a>
I can PM you an admin login if you’d like to look at it.
Update: I am noticing that the number of rows in the “Link Statistics” report is identical to the “Member Download Stats” report – which should not be the case … so I am wondering if that is a clue!
Tony.
A new version of LinkLocker (2.4.5) is available.
This version fixes several pagination problems and re-enables the ability to restrict download links to logged in members and even particular member groups. A big “thank you” to Tony for pointing out several issues, and his patience while I fixed them. Usually when I’ve updated the module, I’ve simply emailed a copy of the module out to all of those who have purchased. That will not be the case this time around, as I’m trying to better organize my records. If you have purchased a copy of the module and would like the newest version, please email me noting the PayPal email you used to purchase and the URL of the site using the module. At your request I will email version 2.4.5 of LinkLocker. My email is brad at brad-street.com (remove spaces, @ sign instead of at).
Thanks, Brad
Just want to make sure before I (unfortunately) discount LinkLocker - Everything looks great except for the fact that files cannot be served from outside the web root – that is the case, right? You cannot set a “path” like Download Lock that will allow this. (Although LinkLocker does sooo much more, which I need, but client needs force the decision)
I definitely will be buying the pro version next time something comes up where I can leave downloads available in a web-accessible location.
Thanks, Marty
Brad,
Just a quick question.
Is it possible to track the total number of downloads per members in a particular weblog?
The reason I ask is that for a site we’re looking at we’ll have 3 member groups.
Group 1 - can’t download any files. Group 2 - can download a maximum of 20 files per year. Group 3 - unlimited downloads.
What I want to know is can I use LinkLocker so that in the templates, it checks to see how many downloads a member has made (if User Group 2) and will allow the user to download if it’s less than 20.
Or is it possible to have a hidden field in the user profile that decreases by 1 each time a download is made?
Thanks, Euan
Euan,
I believe what you would want to do is a custom sql query. You would want to retrieve the count of the number of files the logged in member has downloaded (or perhaps given download links for). Then, do an EE if statement that says if the member group == 2 and download count < 20, display the code for the links, otherwise, give a message. Something similar to the following - see the EE docs for specifics:
{exp:query sql="SELECT count(*) as download_count FROM exp_linklocker_gen WHERE member_id = '{logged_in_member_id'"}
{if member_group == "2" && download_count < 20}
<a href="http://{exp:linklocker">Download FileA</a>
{if:else}
You have reached your download limit. Buy more.
{/if}
{/exp:query}
Brad,
Thanks for the response, particularly for the code example which makes it a lot clearer.
Will investigate further but I think we’ve found an alternative structure for our content which will make dealing with the membership levels much easier and simpler - both for us and our potential customers.
Regards, Euan
Hi, I purchased the plugin and it is working well for me except for one thing. I am trying to send the LinkLocker URL in an email, but it doesn’t render fully.
I am using PHP mail() to send the mail. PHP parsing is enabled and set to output.
The LinkLocker URL is stored as $download_url. When I echo this to the page it looks and works fine….but in the email I receive it contains some unevaluated code and is broken.
Specifically,
echo $download_url;
produces:
http://example.com/?ACT=26&url=1&linklocker=NjkuMTI5LjYzLjQ2MC4wNTI0NDIwMCAxMjQ1ODY4MzIw
(works fine).
But the same variable in the email message shows up like this when it arrives in my inbox:
http://example.com/?ACT={AID:Linklocker:process_link}&url=1&linklocker=NjkuMTI5LjYzLjQ2MC4wNTI0NDIwMCAxMjQ1ODY4MzIw
Note the {AID:Linklocker:process_link} in the URL.
I’m sure I’ve overlooked something, but just can’t seem to find a way to send the LinkLocker URL as an email. Is there a way to do that?
I’ve included the larger context below. Any suggestions on how to get the LinkLocker URL to show up correctly in the email would be appreciated. Thanks.
$download_url = '{exp:linklocker url="{site_url}/d8ix83hs4m3t9dxF/wheels.zip" max_downloads="1"}';
// set up email
$toaddress = $email;
$subject = "Your Download Link";
$mailcontent = "Customer name: ".$name."\n".
"Customer email: ".$email."\n".
"Your download link is:" . $download_url ."\n".
"This is a one time download only, so please do not begin download until you are ready. \n".
$fromaddress = "From: [email protected]";
echo "Thank you, <strong>" . $name . "</strong>. An email has been sent to <strong>" .$email. "</strong> with a link to your download. This is a one-time-only download. It will not expire until you click it to begin download. Only click this link if you are ready to redeem your one-time-only download at this time.
<a href="http://">BEGIN DOWNLOAD »</a>";
echo $download_url;
//invoke mail() function to send mail
mail($toaddress, $subject, $mailcontent, $fromaddress);
From the research I’ve done, it appears this is happening because it is actually returning a template variable, which is one of the last things to be parsed in the template. I can’t yet answer exactly why it isn’t working the way you describe that it should - I would expect the same as you. As for sending emails in conjunction with the module, it isn’t “officially” supported and I don’t actually know how you would do it. I have another module I’ve written that uses the module as a library - so you can do it with straight PHP, though this is an “undocumented feature” and could easily be broken in future versions. I wish I could offer more assistance - perhaps someone else subscribed to this thread has seen this before and can offer another view.
Thanks, Brad
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.