Home › Forums › David Welch
David Welch
My Latest Replies (From Various Topics)
Author | Replies |
---|---|
Author | Replies |
Posted: Wednesday Sep 26th, 2012 at 1:30 pm #26605 | |
|
|
Ok, so it looks like this form is created by a class function and not a template in s2member. So, one option would be to copy the code BETWEEN:
AND:
in this file:
Then create your own function in wp-content/mu-plugins/s2-hacks.php (you may need to create this directory and file) like this:
That should override their form with yours. Assuming you keep their functionality and stuff, I think it should still work fine. Hope that helps. Dave PS. This is not perfect because it uses the exit() function which kills all the rest of the processing and could mess up other s2 functions being called at the same time.
|
|
Posted: Wednesday Sep 26th, 2012 at 12:59 pm #26598 | |
|
|
I would set it to: Required: No Add this in the Other Attributes (optional) Section:
This should disable the field if the user clicks on it but should allow the admin to edit it in the admin section. Not sure about Editor Level access. You may have to use a role editor plugin to add that functionality. Hope that helps, Dave |
|
Posted: Wednesday Sep 26th, 2012 at 12:17 pm #26588 | |
|
|
wrap the content with this shortcode:
if you use “current_user_can(access_s2member_level2)” then anyone at or above that level will see it. The above function says they must BE at that level. That should do it. Dave PS. or you could use CCaps. However, I think if you use CCaps, it will send them to the membership options page if they don’t have that CCap. (not sure) Which you may or may not want, depending on the type of site you are building.
|
|
Posted: Wednesday Sep 26th, 2012 at 12:12 pm #26584 | |
|
|
Another thing you could do… Create different membership forms / buttons, some that are full memberships and some that are 3 weeks. Then add Custom Capability codes to your product pages based on the package they are part of. (package_1, package_2, etc.) Add all the CC codes to the forms for regular memberships, and then just one CC code for each of the 3 week memberships or however you plan to sell them. That’s probably the easiest way to do it… you just have to update all your pages with different CC based on the product they are attached to. I always think of the hard way first… lol Dave
|
|
Posted: Wednesday Sep 26th, 2012 at 12:08 pm #26583 | |
|
|
There is no “Easy” way to do this. My suggestion would be to work it like this: Sell Custom Capabilities for each “product.” Update your product pages to check if the user is a member at X level OR has the CC that was purchased. Then update your membership options page to list both memberships and individual trial access to the products with CC buttons. The biggest issue is that CC’s are lifetime access. So you would need to hook into the payment processing, store the time when it is purchased in a user meta field, then check that field when the user attempts to access it to see if it has been more than 3 weeks since the time that is stored as the purchase date. Simple right? lol The easiest thing would be to sell access to specifict posts / pages. However, that doesn’t play well with pages that are already protected via a membership level per the S2member documentation. I think this can be done but it’s going to take some work and some technical know-how. Dave |
|
Posted: Wednesday Sep 26th, 2012 at 11:42 am #26577 | |
|
|
All paid registration times for each level are stored in the same user meta variable called “wp_s2member_paid_registration_times”. This is a serialized array of all registration times for that user. That function you are using should be working. If not, try this one. It should call the same info being called by that function:
Call the above function like this:
Hope that helps, Dave
|
|
Posted: Wednesday Sep 26th, 2012 at 11:24 am #26575 | |
|
|
I haven’t looked at that template, but if it uses the same css layout and html structure for the form elements, I don’t see why it wouldn’t. Dave |
|
Posted: Monday Sep 24th, 2012 at 1:45 am #26262 | |
|
|
Any reason why you wouldn’t just use multiple levels instead of 1 level with different purchase amounts? With Pro you can create as many levels as you want. Then just use the example in the s2member guides for adding your protected downloads. Then just create your paypal buttons, one for each level with the payment amount you want for that level. Hope that helps. Dave |
|
Posted: Monday Sep 24th, 2012 at 1:32 am #26261 | |
|
|
Have you tried adding the captcha to your forms to see if that makes a difference? That’s where I would start. Other than that, I’m not sure how they could be registering. Dave |
|
Posted: Monday Sep 24th, 2012 at 1:29 am #26260 | |
|
|
If you are using the Pro version under Paypal or any other gateway should be a “free” option for registration shortcodes. So, under Paypal Pro Forms => Paypal Pro / Free Registration Forms is probably what you are looking for. NOTE: I’ve not used s2member with an MU set-up so I’m just assuming you have the option… lol. Dave |
|
Posted: Monday Sep 24th, 2012 at 1:26 am #26259 | |
|
|
Are you sure that this is pulling the registration timestamp? What do you get when you echo $level2_payment_time? Not trying to make you feel silly just trying to get all the info to help trouble shoot. The reason I ask is because if they have not paid, it would return a 0… which is less than the timestamp of 1 day ago. Which means it would show the content. You’ve tested this on with a different user’s account that is at that specific level or has paid for it? Dave |
|
Posted: Thursday Sep 20th, 2012 at 2:35 pm #25982 | |
|
|
One issue is that everywhere s2member prints a commented code:
wordpress is adding paragraph tags to them, which increase the space used. I’m not sure why it’s doing that, but you might try something like this to keep them from affecting your spacing:
Hope that helps some. I might check on it later to see if there are other suggestions. Dave |
|
Posted: Thursday Sep 20th, 2012 at 11:24 am #25961 | |
|
|
ah, gracias |
|
Posted: Thursday Sep 20th, 2012 at 8:15 am #25924 | |
|
|
I agree with Janet, Custom Capabilities is the easiest way to grant access to any member at any level for any thing. Dave |
|
Posted: Thursday Sep 20th, 2012 at 8:07 am #25922 | |
|
|
Thanks, I’m actually ignoring free users for this function. My biggest concern is making sure it gets fired if the free user uses an update form. I guess I’ll just have to test it out. Dave |
|
Posted: Thursday Sep 20th, 2012 at 12:35 am #25880 | |
|
|
My first thought is that you don’t have a plugin that allows you to put php code into your wordpress pages. See, wordpress does not natively parse php code that is put into the page editor, even if it’s in the “html” side. You need a plugin that will force wordpress to parse the php code in your button form so it will enter the correct data. Probably the most common, and the one recommended by S2member is http://wordpress.org/extend/plugins/php-execution-plugin/ You can also find it by searching in the new plugins section of wordpress for “php execution.” That should solve the problem, unless you already have it installed and it’s still not working. Hope that helps, Dave |
|
Posted: Wednesday Sep 19th, 2012 at 11:35 pm #25876 | |
|
|
I think this is what you are looking for. It’s under the “shortcode attributes (explained)” section:
Hope that helps, Dave |
|
Posted: Wednesday Sep 19th, 2012 at 6:07 pm #25860 | |
|
|
Just took a look at your site… I think you accidentally commented out your own code…
Should be
See if that fixes your issue. Dave |
|
Posted: Wednesday Sep 19th, 2012 at 5:48 pm #25859 | |
|
|
Could you re-add that code and wrap it with the “code” or “code w/hilite” tags (green buttons, far left)? I think just pasting it in is messing it up and making some of it unreadable. Dave |
|
Posted: Wednesday Sep 19th, 2012 at 5:40 pm #25858 | |
|
|
*NOTE: You should only use this function if you have a legal copy of s2member pro. Much of this code was copied from the s2member files. I created a quick little class that you can put in an mu-plugin to add some of this functionality. It’s not perfect but it seems to work for me when I use it this way. Again, I have not done extensive testing on this function. Step 1 -> Create a directory / file in this location:
Step 2 -> Add this code to that file (s2-hacks.php):
Step 3 -> Place this line of code in your template where you want your custom field to be. You will use the Unique ID for that field to call it.
If you have any questions, let me know. If it doesn’t work let me know too.. again this has been tested very little. lol Hope it helps, Dave |
|
Posted: Wednesday Sep 19th, 2012 at 4:23 pm #25853 | |
|
|
ok, so it looks like Payflow might use some different variables… of course.. lol. You might try this if you aren’t getting any success with the other one:
Hope that helps, Dave |
|
Posted: Wednesday Sep 19th, 2012 at 4:13 pm #25850 | |
|
|
It stands for Must Use Plugins. Here is a link to a very detailed page on the wordpress codex: http://codex.wordpress.org/Must_Use_Plugins S2member uses a function called apply_filters(); This searches for any “add_filter()” functions created by any plugin or mu-plugin that calls it’s specific “tag.” Wordpress handles all of this in the background. But as long as you add_filter() using the same tag that S2member used, you can “break in” to the s2member processes without messing with their original code. (good for updates) Dave
|
|
Posted: Wednesday Sep 19th, 2012 at 4:10 pm #25849 | |
|
|
Another issue is that in order to program for a specific code, you have to know which code it is that is being thrown. Which means you won’t know ahead of time what to filter until it happens to a user. One option would be to not filter the message code and just print it out with an explanation that the processor sent it, like this function below:
This would return:
Hope that makes sense. Dave |
|
Posted: Wednesday Sep 19th, 2012 at 3:55 pm #25847 | |
|
|
OK Folks… Here is the deal. These messages are a compilation of multiple pieces from the payment processor(s). Of course they all send different variables, so S2member handles each one individually instead of with one function… lol The short answer is, yes you can change the message. The long answer is that it will take some “programming.” If you don’t have this directory/file, make it now:
Now, in this file (s2-hacks.php), let’s put the following code:
Now, that *should* hook into the process and change the message. The issue is that this function is only set up to work with Paypal (not sure it that includes pro). If I get time later tonight, I’ll see if I can put together a switch function to handle more than one payment type. I don’t use Paypal, but I tested it with Auth.net and this solution worked for me. Hope that helps and let me know if you have any questions. Dave |
|
Posted: Wednesday Sep 19th, 2012 at 1:46 pm #25835 | |
|
|
I believe this message may actually come from the processor, not S2 but I’m not 100% sure. I’ve seen the code for this but I’ll have to look it back up. What payment option are you using? Dave |