| View previous topic :: View next topic |
| Author |
Message |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
|
| Back to top |
|
 |
esaramago
Joined: 04 Aug 2009 Posts: 4
|
Posted: Tue Aug 04, 2009 9:19 pm Post subject: |
|
|
But how can I add a download area?
I can't seem to make it work. Not even with Jumi and adding the PHP
snippet from DLGuard.
It says that I must login before seeing the download links, but I'm already logged on.
Best,
Johnny. |
|
| Back to top |
|
 |
espradley Moderator
Joined: 29 Nov 2008 Posts: 844 Location: USA - Georgia
|
|
| Back to top |
|
 |
esaramago
Joined: 04 Aug 2009 Posts: 4
|
Posted: Wed Aug 05, 2009 2:47 am Post subject: |
|
|
Well, everything works great up until the point I try to add this code, somewhere in my joomla page:
<?php include($pathToDLG."members/displaydownloads.php"); ?>
That's where everything stops working.
If I add it with a plugin to an article, it will tell me to login even though I'm already in the members area.
If I add it directly to the template, it shows the link but when I click it and try to download the software, it tells me that I should be logged on.
:/ |
|
| Back to top |
|
 |
espradley Moderator
Joined: 29 Nov 2008 Posts: 844 Location: USA - Georgia
|
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
Posted: Wed Aug 05, 2009 2:52 am Post subject: |
|
|
Hi esaramago,
I'll need to run some tests on this - a similar thing happened with Wordpress, but I've added some code to handle this for WP.
The fastes way would be to simply create your own download page outside of Joomla, and paste that code onto it.
Or if you'd like me to take a look at getting it going, if you can open a support ticket and send me temporary FTP login details, your DLGuard login URL and details, and your Joomla admin login URL and details, I'll login and check it out!
cheers
Sam _________________ Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard |
|
| Back to top |
|
 |
esaramago
Joined: 04 Aug 2009 Posts: 4
|
Posted: Wed Aug 05, 2009 5:24 am Post subject: |
|
|
| admin wrote: | Hi esaramago,
I'll need to run some tests on this - a similar thing happened with Wordpress, but I've added some code to handle this for WP.
The fastes way would be to simply create your own download page outside of Joomla, and paste that code onto it.
Or if you'd like me to take a look at getting it going, if you can open a support ticket and send me temporary FTP login details, your DLGuard login URL and details, and your Joomla admin login URL and details, I'll login and check it out!
cheers
Sam |
That's exactly what I did. I created an HTML template quickly in order to do it.
The only problem is that whenever I'm leaving the joomla site to go to the html site, I have to log in again.
But no worries, it's all good now. Better than before
Thanks guys, I really appreciate it.
P.S. It would be lovely if you could create a Joomla module or component! It would truly add a lot of value to DLGuard. |
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
Posted: Wed Aug 05, 2009 11:05 pm Post subject: |
|
|
Great to hear you got it sorted!
Since you have to login again, it sounds like there are some cookie sharing issues there (make sure you've put the download page on the some domain name (not a subdomain) where Joomla is running).
I agree, I'll be looking into setting up a Joomla specific integration.
cheers
Sam _________________ Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard |
|
| Back to top |
|
 |
davidbailey
Joined: 14 Jun 2010 Posts: 17
|
Posted: Sat Jun 19, 2010 2:16 am Post subject: Re: How to make a membership site in Joomla |
|
|
Sam! I didn't even think about using Joomla. I just thought everyone used Wordpress. I love Joomla...and it would be way better.
The only question I have is...how would I have to modify this code below so I could have a bronze, silver, and gold folders protected?
| admin wrote: | Directly after the <?php tag, and before the copyright details, paste this code:
| Code: | if (eregi("members", $_SERVER['REQUEST_URI'])) {
$pathToDLG = $_SERVER['DOCUMENT_ROOT']."/dlg/";
$dlgMemberGroup = "1";
include ($pathToDLG."members/dlgmembers.php");
} |
|
I understand how this would work for a single level membership...but if I wanted to protect different levels...would that be this simple too?
Thanks in advance,
David _________________ Learn English
http://EXLenglish.com |
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
Posted: Sun Jun 20, 2010 1:48 am Post subject: |
|
|
Hi David!
No worries, I haven't tested this code, but should work:
| Code: | if (eregi("members", $_SERVER['REQUEST_URI'])) {
$pathToDLG = $_SERVER['DOCUMENT_ROOT']."/dlg/";
$dlgMemberGroup = "1";
if (eregi("bronze", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "1";
if (eregi("silver", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "2";
if (eregi("gold", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "3";
include ($pathToDLG."members/dlgmembers.php");
} |
It's not the prettiest of code, but that'll make it more simple to modify than if I had used funky constructs.
Notice the three lines in the middle that are setting the dlgMemberGroup variable?
We already know it's a "members" folder, so now we're checking to see if it has bronze, silver, or gold in the URL, and setting it to the appropriate member group for each one.
So group 1 is bronze, 2 is silver, 3 is gold.
So your URL's in Joomla would be:
www.example.com/members/bronze/
www.example.com/members/silver/
www.example.com/members/gold/
Make sense?
cheers
Sam _________________ Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard |
|
| Back to top |
|
 |
davidbailey
Joined: 14 Jun 2010 Posts: 17
|
Posted: Mon Jun 21, 2010 9:09 pm Post subject: Great Sam! |
|
|
Thanks for the Joomla code Sam.
I just ordered DLguard and will play around with it.
Is there similar code that can be used in wordpress to protect a category of posts in the same way by using permalinks?
I'm sure there is...but I haven't seen yet.
Can someone point me in the right direction please? _________________ Learn English
http://EXLenglish.com |
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
|
| Back to top |
|
 |
davidbailey
Joined: 14 Jun 2010 Posts: 17
|
Posted: Wed Jun 23, 2010 1:57 am Post subject: |
|
|
Hey Sam,
So, if I wanted Gold Level members to have access to all three sections then would I add all three groups to that section like this...
| Code: | | if (eregi("gold", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "1,2,3"; |
Is that correct?
| admin wrote: |
| Code: | if (eregi("members", $_SERVER['REQUEST_URI'])) {
$pathToDLG = $_SERVER['DOCUMENT_ROOT']."/dlg/";
$dlgMemberGroup = "1";
if (eregi("bronze", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "1";
if (eregi("silver", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "2";
if (eregi("gold", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "3";
include ($pathToDLG."members/dlgmembers.php");
} |
Notice the three lines in the middle that are setting the dlgMemberGroup variable?
We already know it's a "members" folder, so now we're checking to see if it has bronze, silver, or gold in the URL, and setting it to the appropriate member group for each one.
So group 1 is bronze, 2 is silver, 3 is gold.
So your URL's in Joomla would be:
www.example.com/members/bronze/
www.example.com/members/silver/
www.example.com/members/gold/
|
[/code] _________________ Learn English
http://EXLenglish.com |
|
| Back to top |
|
 |
davidbailey
Joined: 14 Jun 2010 Posts: 17
|
Posted: Wed Jun 23, 2010 2:08 am Post subject: |
|
|
Wordpress strongly recommends that you not start a permalink with the %category% as it could slow down performance.
| Quote: | | %category% - A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI. Starting Permalinks with %category% is strongly not recommended for performance reasons. |
They suggest using a numerical structure tag
| Quote: | | For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID. |
Would using a numerical slug like %post_id% mess up the code used for Wordpress memberships like in Joomla?
| Code: | if (eregi("members", $_SERVER['REQUEST_URI'])) {
$pathToDLG = $_SERVER['DOCUMENT_ROOT']."/dlg/";
$dlgMemberGroup = "1";
if (eregi("bronze", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "1";
if (eregi("silver", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "2";
if (eregi("gold", $_SERVER['REQUEST_URI'])) $dlgMemberGroup = "3";
include ($pathToDLG."members/dlgmembers.php");
} |
Or would adding the %post_id% throw DLG off and mess things up? _________________ Learn English
http://EXLenglish.com |
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9131 Location: Australia
|
Posted: Wed Jun 23, 2010 2:43 am Post subject: |
|
|
Hi David,
Yes, that Gold level code you showed is correct!
With Wordpress, if you don't use the category titles in the URL, and instead use a numerical value, then just modify the code to check for the numerical value in the URI instead of the category name.
Does that make sense?
cheers
Sam _________________ Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard |
|
| Back to top |
|
 |
|