[SOLVED] CBSubs URL Integration plugin scripts

7 years 3 months ago - 7 years 3 months ago #290119 by xborg
Hello team

I am trying to configure CBSubs URL Integration plugin. I've read thru the manual but it's does not explain how to use it in scripts.
How do you pass the userid and username to the script?

For example, I've created a myscript.php like the example in the manual, assuming the variables in the url are passed to the script.
www.mysite.com/myscript.php?username=[username]&user_id=[user_id]&action=new

<?php
echo $user_id;
echo $username;
// Create userID file
$file = fopen("/mywebsite/$user_id.php", "w") or die("Unable to open file!");
// Write $juser=userID
$txt = "This is from CBSubs URL Integration plugin";
fwrite($file, $txt);
fclose($file);
?>

|'ve successful created external scripts which works when the user is login using
<?php
$user = JFactory::getUser();
$juser=$user->get('id');
?>

But I am not sure how CBSubs URL Integration plugin talk to scripts. Can you provide me more details or an example?

With that being said my objective is
When a user First Subscribed or renewal the user's username and id is pass to the script which can then be used in variables.

Thanks for your support

Please Log in to join the conversation.

7 years 3 months ago #290136 by krileon
Replied by krileon on topic CBSubs URL Integration plugin scripts

How do you pass the userid and username to the script?

With substitutions as part of the URL if using GET or as part of the "Post" parameter if using POST.

But I am not sure how CBSubs URL Integration plugin talk to scripts. Can you provide me more details or an example?

It sends an HTTP request to the URL supplied. It isn't a PHP include or anything. It's like sending a cURL request to a URL. You'll have no access to Joomla or CB APIs from your script unless it's an internal component ajax path in Joomla or something of the sort.

When a user First Subscribed or renewal the user's username and id is pass to the script which can then be used in variables.

In that case for a GET usage your URL is correct.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

7 years 3 months ago #290151 by xborg
Replied by xborg on topic CBSubs URL Integration plugin scripts
Hi Kyle

With your info I figured it out. I used $_GET[] as a variable value in myscript.php using url

www.mysite.com/myscript.php?name=[user_id]

myscript.php
<?php
$juser= $_GET["name"];
echo $juser;
?>

Thanks for the quick reply

cheers
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.179 seconds

Facebook Twitter LinkedIn