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.

New subscription not replacing the old one

Home Forums Community Forum New subscription not replacing the old one

This topic contains 16 replies, has 3 voices. Last updated by  Raam Dev 4 years, 1 month ago.

Topic Author Topic
Posted: Saturday Nov 24th, 2012 at 3:58 pm #32485
cassel
Username: cassel

I wanted to update the other thread on this but it was automatically closed.

I tried using the shordcode for a pro-form inside some php code so i can use the hack to get the particular timestamp i need. I know the hack works but i need to incorporate it in the shortcode, and that is where i am stuck, since i dont know enough php syntax to do it properly.

Here is what Raam suggested:

1.<?php2.	$my_ccaps="example";3.	echo do_shortcode('[s2Member-PayPal-Pro-Form ccaps=" . $my_ccaps . ".... /]'); 4.?>

Here is what i have:

<?php
	$my_ccaps="wm<?php echo date('Ym'); ?>,element,forum";
	echo do_shortcode('[s2Member-Pro-PayPal-Form modify="1" level="1" ccaps=" . $my_ccaps . " desc="Element Creation Tutorial - GOLD" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="scrapbookcampus.com" ta="0" tp="0" tt="D" ra="15" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]
?>

In short, if i had been using the php version of a Paypal button, i would have had ccaps = “wm,element,forum” but with the code above, i get an error with an unexpected T_STRING. I have no clue what it is, therefore i have no clue how to fix it. I suspect it is probably a tiny silly error. Can you see where i made a mistake?

BTW, if you can merge this with the initial thread here: http://www.s2member.com/forums/topic/help-new-subscription-not-replacing-old-one/page/2/ it might make the thread more logical for anyone searching.

List Of Topic Replies

Viewing 16 replies - 1 through 16 (of 16 total)
Author Replies
Author Replies
Posted: Saturday Nov 24th, 2012 at 7:36 pm #32493
Bruce
Username: Bruce
Staff Member

Hi Cassel,

Try this instead:

<?php
	$my_ccaps= 'wm' . date('Ym') . ',element,forum';
	echo do_shortcode('&#91;&#91;s2Member-Pro-PayPal-Form modify="1" level="1" ccaps="'. $my_ccaps . '" desc="Element Creation Tutorial - GOLD" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="scrapbookcampus.com" ta="0" tp="0" tt="D" ra="15" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /&#93;&#93;');
?>
  • This reply was modified 4 years, 1 month ago by  Bruce.
Posted: Saturday Nov 24th, 2012 at 7:43 pm #32495
cassel
Username: cassel

Are those periods and spaces supposed to be there??

Posted: Saturday Nov 24th, 2012 at 7:45 pm #32496
Bruce
Username: Bruce
Staff Member

Hi Cassel,

Are those periods and spaces supposed to be there??

Yes, when you’re putting a function’s or variable’s data into a PHP string/variable, you want to concatenate the function/variable with the other parts of the variable/string. That’s what those ‘.’s are.

Posted: Saturday Nov 24th, 2012 at 7:46 pm #32497
cassel
Username: cassel

I still get the same error message with the T_STRING while copying your code.

Posted: Saturday Nov 24th, 2012 at 7:48 pm #32498
Bruce
Username: Bruce
Staff Member

Can you please copy the exact error that you’re getting?

Posted: Saturday Nov 24th, 2012 at 7:54 pm #32499
cassel
Username: cassel

Here:

Parse error: syntax error, unexpected T_STRING in /home/creas1/public_html/scrapbookcampus.com/wp-content/themes/headway-2013/library/core/functions.php(90) : eval()’d code on line 142

  • This reply was modified 4 years, 1 month ago by  cassel.
Posted: Saturday Nov 24th, 2012 at 7:56 pm #32501
Bruce
Username: Bruce
Staff Member

Hi Cassel,

There are no syntax errors in that code as-is. I suspect that the problem lies in that you have the tags, you do not need to have these tags when you’re putting the code in.

Does that fix your issue?

Posted: Saturday Nov 24th, 2012 at 7:57 pm #32502
cassel
Username: cassel

How about this complete code:

<?php
	$my_ccaps= 'wm' . date('Ym') . ',element,forum';
	echo do_shortcode('[s2Member-Pro-PayPal-Form modify="1" level="1" ccaps="'. $my_ccaps . '" desc="Element Creation Tutorial - GOLD" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="scrapbookcampus.com" ta="0" tp="0" tt="D" ra="15" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]
?>
Posted: Saturday Nov 24th, 2012 at 7:58 pm #32503
Bruce
Username: Bruce
Staff Member

Hi Cassel,

You don’t have the ending ‘); on the third line, but otherwise it should be O.K.

Posted: Saturday Nov 24th, 2012 at 8:01 pm #32504
cassel
Username: cassel

I added the ‘); at the end, but i get the exact same error.

Posted: Saturday Nov 24th, 2012 at 8:04 pm #32505
Bruce
Username: Bruce
Staff Member

Ah, I’m sorry.

I got an error while I was posting one of my last replies. Try just adding:

$my_ccaps= 'wm' . date('Ym') . ',element,forum';
	echo do_shortcode('[s2Member-Pro-PayPal-Form modify="1" level="1" ccaps="'. $my_ccaps . '" desc="Element Creation Tutorial - GOLD" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="scrapbookcampus.com" ta="0" tp="0" tt="D" ra="15" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]');

My suspicion is that this error is being caused by the fact that you have the PHP tags in your code. Try taking them out.

Posted: Saturday Nov 24th, 2012 at 8:05 pm #32506
cassel
Username: cassel

I tried replacing this:
$my_ccaps= ‘wm’ . date(‘Ym’) . ‘,element,forum’;

by just this:
$my_ccaps= ‘element,forum’;

and i still get the error, so it is not in the function itself that the problem lies.

Posted: Tuesday Nov 27th, 2012 at 11:12 am #32709
cassel
Username: cassel

Checked with my developper and it seems that the theme does not allow such code to work. Any other way to have a php code for a Pro-form instead of a shortcode?

Posted: Tuesday Nov 27th, 2012 at 2:52 pm #32735
Raam Dev
Username: Raam
Staff Member

Hello,

Unfortunately I don’t believe there is any other way to call a Pro-Form. You must use the shortcode.

Posted: Tuesday Nov 27th, 2012 at 3:48 pm #32741
cassel
Username: cassel

Maybe something to suggest for a new version? I might not be the only one who could use that.

Posted: Wednesday Nov 28th, 2012 at 3:43 pm #32805
Raam Dev
Username: Raam
Staff Member

We will keep that in mind. Thank you.

Viewing 16 replies - 1 through 16 (of 16 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.