Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

PAP integration debugging ?

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
12 years 1 month ago #216442 by activha
Replied by activha on topic Re: PAP integration debugging ?
Would this code work in the auto action ?
if yes this could solve it for me
Code:
$query = mysql_query( "SELECT `userid` FROM `qu_pap_users` WHERE `refid` = '" . mysql_real_escape_string ('[cb_newafid]' ) ); $PAPid = mysql_result( $query, 0 ); if ( $PAPid ) { cbimport( 'cb.session' ); CBCookie::setcookie( 'PAPVisitorId', htmlspecialchars( '[cb_newafid]' ) ); }

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216443 by krileon
Replied by krileon on topic Re: PAP integration debugging ?
As long as you established a database connection, yes. If your PAP tables are on the same database as Joomla then you can just use Joomla or CB API to perform your query.


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 or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
12 years 1 month ago #216444 by activha
Replied by activha on topic Re: PAP integration debugging ?
OK
So will this work in auto action ?
Code:
$Db = JFactory::getDBO(); $Query = "SELECT * FROM qu_pap_users WHERE refid = '[cb_newafid]'"; $Db->setQuery($Query); $PaPid = $Db->loadResult(); if($PaPid){ cbimport( 'cb.session' ); CBCookie::setcookie( 'PAPVisitorId', htmlspecialchars( '[cb_newafid]' ) ); }

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216446 by krileon
Replied by krileon on topic Re: PAP integration debugging ?
It should, but you need to escape the substitution to avoid SQL vulnerability. No need to keep asking if it'll work or not as I have no idea, just try it and see what happens after making a backup.


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 or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
12 years 1 month ago #216451 by activha
Replied by activha on topic Re: PAP integration debugging ?
Test indicates that I also need to pass the new value of cb_newafid to cb_afid that I send by post to PAP logging php page

Can I simply write this
Code:
$Db = JFactory::getDBO(); $Query = "SELECT * FROM qu_pap_users WHERE refid = '" . mysql_real_escape_string ('[cb_newafid]' ) . "'"; $Db->setQuery($Query); $PaPid = $Db->loadResult(); if($PaPid){ cbimport( 'cb.session' ); CBCookie::setcookie( 'PAPVisitorId', htmlspecialchars( '[cb_newafid]' ) ); [cb_afid]=[cb_newafid]; }

With the last line to indicate the new value ? Or have I a mistake somewhere ?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216488 by krileon
Replied by krileon on topic Re: PAP integration debugging ?
No, you need to update the user object which I'm not sure will work but try the below.

$user->cb_afid = htmlspecialchars( '[cb_newafid]' );


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum