latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

boudewijn lutgerink


My Latest Replies (From Various Topics)

Viewing 25 replies - 76 through 100 (of 168 total)
Author Replies
Author Replies
Posted: Friday Dec 14th, 2012 at 11:11 am #34667

Well well, with the last update the weird error is gone…
HOWEVER… (always an however)
I now had paypal and visa as possibilities
Selecting PayPal still brought up the billing address options…
I will check against other plug-ins, “I’ll be back”

BL

Posted: Wednesday Dec 12th, 2012 at 4:54 pm #34423

It might be a parse error. What happens is that the site doesn’t show up at all.
Just a beautiful white page, in IE, Chrome and FF. But not quite the page I need to see.

The longer I work on this the more I am convinced that my suggestion to add all these options in the $options array is the simplest one.

Still the $original, $domain, $context and $translated variables are as clear as thick fog to me.
Can I use these in a simple function in the functions.php?

Posted: Tuesday Dec 11th, 2012 at 6:45 pm #34306

Sure I could, but it worked before the upgrade and I did not change anything else.

Posted: Tuesday Dec 11th, 2012 at 6:35 pm #34305

that hangs the site completely.

Posted: Tuesday Dec 11th, 2012 at 1:05 am #34207

I am totally lost now on the use of MU plugins.
I tried calling the function in a PHP script but that doesn’t seem to work.
It definetely looks like mu plugins fire once, at startup time only and that they are not callable in scripts whatsoever.
So how do I go along and make this login box/profile box dynamical?
maybe my initial idea to add all the options into the $profile array is not so bad after all.

Posted: Sunday Dec 9th, 2012 at 4:47 pm #34077

Where do I find info on the $translated, $original, $content and $domain variables?
I looked in the docs but cannot find it.

Posted: Sunday Dec 9th, 2012 at 3:40 am #34042

What I notice is that the title of the loginbox does change after logging in. (My Profile / Mijn Profiel)
The rest of the text is not changing at all.
It looks like the mu-plugin is not firing at all. The chamges that appear are in the php script I made.
Is there any way I can include your code in the schript I have?
And no, editing the file as you suggest is not an option. That makes the login box static again and I need it to be dynamic based on the language the logged in user speaks.
So once more my suggestion to add the strings to the $options array.

Posted: Thursday Dec 6th, 2012 at 4:39 pm #33778

doesn’t seem to work. All I get is the English version, no matter how I set the user language.
I repeat, maybe the solution I propose is the simplest one…

(add the options for those texts to the $options array)

BL

Posted: Thursday Dec 6th, 2012 at 4:02 pm #33761

I get a 500 error…
SIgh, maybe the solution I propose is still the better one…

Posted: Thursday Dec 6th, 2012 at 3:00 am #33672

Hi Bruce,

Thanks for the code. I tried it and it seems to work … nearly
The code you gave does work ok.
HOWEVER (there is always a however).
I have subscribers who either speak Dutch or English.
I have one user-field in the profile called _taal_ it contains either “NL” or “EN” (Netherlands / English).
So I adjusted your code a bit to the following:

<?php
add_filter('gettext_with_context', 's2hack_translate_login_widget', 10, 4);
function s2hack_translate_login_widget($translated, $original, $context, $domain) 
{
	$Lang = get_user_field("_taal_");
	switch ($Lang) 
	{
	    case "NL":
			if ($domain === 's2member' && $context === 's2member-front' && $original === 'My Account' )
				$translated = 'Mijn Account';
			elseif($domain === 's2member' && $context === 's2member-front' && $original === 'Edit My Profile' )
				$translated = 'Mijn Profiel';
	        break;
	
	    case "EN":
			if ($domain === 's2member' && $context === 's2member-front' && $original === 'My Account' )
				$translated = 'My English Account';
			elseif($domain === 's2member' && $context === 's2member-front' && $original === 'Edit My Profile' )
				$translated = 'English Profile';
	        break;
	}
	
return $translated;
} 

For some reason it is not working even though, as far as I can see, the code only fires AFTER logging in.
In the future I want to add more languages (German, French, Spanish and Russian) and I want to offer a site that is as much localized as I can. Therefore I need to be able to translate things like “edit my profile”, “My Account” etc…
How do I do that? The best option possible I see now is what I asked already, to add those translations into the $options array. But that comes from a total lack of knowledge about PHP (so forgive me if I say something entirely stupid.)

Posted: Monday Dec 3rd, 2012 at 4:14 pm #33366

Hmmm, this is not what I am looking for.
My site has visitors from different countries like USA, Canada, Germany, Spain and Holland. (Russian in preparation). For each registered visitor I have a pofile with the language they speak.

Based on that I want to show them content in their own language.
I use the get_user_field() function to retrieve the local language.
what I see now is that the title of the login widget can be different (using the $options[“profile_title”] etc…)
I would like to have a different text for the “My Account” and “Edit My Profile” based on the user language.

Posted: Monday Dec 3rd, 2012 at 5:13 am #33279

I use the more tag to protect the main part of my articles. The introduction is a teaser for readers.

Posted: Thursday Nov 29th, 2012 at 1:44 am #32871

Entering the subject of database design hey?
OK then. There is no need for a different database, you need another table.
FYI, a database is a big container where tables reside and all the meta info like relation between tables, indexes etc. In MySQL (AFAIK) tables can not stand on themselves.

I assume here that the type of info you want to store for each user is basically the same.
What I would do is create a table with as primary index the user ID from the user meta table that WP creates.
Once you have the user ID from the get_current_user_ID function you can then query your table for a record for that user and read the info you need.
I am not really familiar (yet) how to do that in PHP, but I have no doubt that this info can be found in a PHP manual.

Posted: Thursday Nov 29th, 2012 at 1:17 am #32869

spot on… ;-)

Posted: Thursday Nov 29th, 2012 at 1:08 am #32867

I had a similar problem and changed my workflow.
What I did is create a payment button using paypal. (login to paypal, go to profile->options->sales preference (the last option in the left hand menu) then, under online ssales select manage Paypal Buttons.

Mind you that under step 3 (advanced option you need to fill the notify URL like:
notify_url=http://www.YourWebSite.com/?s2member_paypal_notify=1

Just above that part you can also give a redirect URL for successful payments and cancellations.

I use the code that is generated there on my page.

The flow I use now is: a page describing the options for members with under every option the paypal button for that option.
Then they are redirected to PayPal (leaving your site).
When the payment is successful they are redirected to a page where they can fill a profile.

I know, not really what you want but this is a workaround that might help you for the time being (until the problem is solved).

Posted: Thursday Nov 29th, 2012 at 12:37 am #32859

maybe this can be of help http://codex.wordpress.org/Function_Reference/get_user_meta and http://codex.wordpress.org/WPMU_Functions/get_current_user_id

  • This reply was modified 4 years, 1 month ago by  boudewijn lutgerink. Reason: added get_current_user_id
Posted: Monday Oct 22nd, 2012 at 1:46 am #29232

@Eduan, I see now that even though the user can still access his/her account the level access is no longer possible. Thanks for the time anyway. (Learned something again.)

Posted: Sunday Oct 21st, 2012 at 1:17 am #29186

Tx Christian, I looked at the videos and it looks like this is the solution indeed.
I do need to make a bit more study on this so maybe I will have some Q’s in the (nearby?) future.

Boudewijn

Posted: Friday Oct 12th, 2012 at 2:31 am #28193

If you upload the s2member-pro version you should have a folder in your wp-content/plugins folder named s2member-pro.
In that folder you must have the files and subfolders being:
– Images
– Includes
– Licensing
other files in that folder should be:
index.php
pro-modules.php
readme.txt

That should do the trick.
HTH
Boudewijn

Posted: Wednesday Jul 4th, 2012 at 2:06 am #18242

I see, thanks Raam.

Posted: Monday Jul 2nd, 2012 at 10:03 am #18086

I found that spoiler shortcode is conflicting with s2member. David, is it text you want to hide or other things?

Posted: Sunday Jul 1st, 2012 at 1:11 am #18003

AHA!! Thanks Raam, much appreciated! Will take a deep look into that. Right now I have some other work to do (Shear 80 sheep)

Posted: Friday Jun 29th, 2012 at 10:12 am #17856

To Thou My Lord I bow deep. exec-php is the magic wand here. It works wonderful!
Thanks so much!

before I forget, it so seemed that the dreaded ISP did some maintenance at the time I was testing. Thus making the site unavailable. Duuuhhh… (OMG, I feel stupid!)

BL

Posted: Friday Jun 29th, 2012 at 9:59 am #17855

To you my Lord of the sacret s2Member knowledge I bow deep, take off my hat and most respectfully greet thou unchallenged knowledge. Teach us thou magic!
But nonetheless, it is not helping me much now. Even thios does NOT show the post to its more tag.
Am I asking the impossible?
ALL i want is to know how I can show posts (WITH THE –MORE– TAG) on a page. This is the 17th or 18th reply in this thread but I still have no answer.

Posted: Thursday Jun 28th, 2012 at 1:44 am #17724

this is what I tested today.
First I used Raam’s code, BTW Raam, I changed the !is_user_logged_in() to is_user_logged_in() so I could see the text if I was logged in.
That works fine. with all widgets in place.

Then I add the following

Testing the language
[s2If get_user_field("taal_language_sprache")=="NL"]
Nederlands
[/s2If]

it actually causes the whole widget to disappear.
Something worse happened as well. I cannot even log in to my own website. I contacted the helpdesk of my isp already, hoping they can stop some weird process that apparently blocks the server.

Viewing 25 replies - 76 through 100 (of 168 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.