robertg

+Clients
  • Content count

    8
  • Joined

  • Last visited


About robertg

  • Rank
    IPB Newbie

Profile Information

  • Gender Male

robertg's Activity

  1. robertg added a post in a topic: Check if user logged in from outside IPB issue   

    Hey all,

    Now I've used the following document:
    http://community.inv...-logged-in-r328
    to implement this, and it seems pretty straightforward. However, on the page I'm using it on, it seems to be redirecting the page or changing something in the headers. I changed the code a bit based on this post:
    http://community.inv...b/#entry2207375
    But it still wants to redirect the page. For example, my page is at domain.com/index2.php and when I visit that URL, it instead tries to go to domain.com/forum/index2.php and then displays the message "No input file specified". I commented out every line and went one by one to see which line was causing it, and its this line:

    Is there something I'm missing here? Any help would be appreciated :smile:
    $registry->init();
  2. robertg added a post in a topic: Using generateInvoice(), assign the invoice to a member   

    Hey everyone,

    I'm in the process of merging two different user databases, from my site into my Invision board, using a PHP script I wrote. For the users who have purchased "memberships" from my site previously, I am assigning them to a certain member group within the forums and generating an invoice for their purchase using the generateInvoice() function from the nexusApi. I have been able to do this fine, the invoices appear under the Invoices page within Nexus, but when I create these invoices for each member, I want them to appear under their respective Client Areas and assigned to their accounts within the ACP. Is there any way I can do this with some API methods or code?
  3. robertg added a post in a topic: Using generateInvoice, assign invoice to member   

    I'm in the process of merging two different user databases, from my site into my Invision board, using a PHP script I wrote. For the users who have purchased "memberships" from my site previously, I am assigning them to a certain member group within the forums and generating an invoice for their purchase. I have been able to do this fine, they appear under the Invoices page, but when I create these invoices for each member, I want them to appear under their respective Client Areas and assigned to their accounts within the ACP. Is there any way I can do this with some API methods or code?
  4. robertg added a post in a topic: Calling IPSMember functions from custom script   

    Wow, I'm missing a bunch of semicolons. My fault. Sorry for wasting everyone's time, I must be too used to Lua lol. Thank you all for your help though!
  5. robertg added a post in a topic: Calling IPSMember functions from custom script   

    Alright, so I'm using the template provided for the custom actions script, with the onPaid() and other functions like I showed above. I include my own script within the function. Here is my code:


    Now the function, onPaid(), in the provided template, passes in $member , so I should be able to access $member["email"] or $member["member_id"]. But I need some fields from pfields_content, so I added the line above, but I got an error.
    <?php include("Utilities.class.php"); /* Constant Declarations */ define("SEARCHURL", "https://crm.zoho.com/crm/private/xml/Contacts/getSearchRecords"); define("INSERTURL", "https://crm.zoho.com/crm/private/xml/Contacts/insertRecords"); define("UPDATEURL", "https://crm.zoho.com/crm/private/xml/Contacts/updateRecords"); /* user related parameter */ define("AUTHTOKEN", "1234567890"); define("SCOPE", "crmapi"); /* create a object */ $utilObj = new Utilities(); /* set parameters */ $parameter = ""; $parameter = $utilObj->setParameter("scope", SCOPE, $parameter); $parameter = $utilObj->setParameter("authtoken", AUTHTOKEN, $parameter); $parameter = $utilObj->setParameter("selectColumns", "All", $parameter); $searchCondition = "(Email|=|".$member['email'].")"; $parameter = $utilObj->setParameter("searchCondition", $searchCondition, $parameter); /* Call API */ /* returns the XML data */ $response = $utilObj->sendCurlRequest(SEARCHURL, $parameter); if ($result == "NO_RECORDS") { /* no records, meaning new member */ /* run the insert algorithm */ $xmldata = "<Contacts>"; $xmldata .= "<row no=\"1\">" /* load a new member array that retrieves the custom fields */ $member_updated = IPSMember::load( $member["email"], 'pfields_content' ); //$member_updated = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'pfields_content', 'where' => 'id=' .$member["member_id"])); /* field_11 = First Name field_12 = Last Name */ if ($member_updated["field_11"] != NULL && $member_updated["field_12"] != NULL) { $firstName = $member_updated["field_11"]; $lastName = $member_updated["field_12"]; } else { /* create first and last name */ if (strpos($member["member_display_name"]," ")) { $name = explode(" ",$member["member_display_name"]); $firstName = $name[0]; $lastName = $name[1]; } else { $firstName = $member["member_display_name"]; $lastName = $member["member_display_name"]; } } $xmldata .= "<FL val=\"First Name\">".$firstName."</FL>"; $xmldata .= "<FL val=\"Last Name\">".$lastName."</FL>"; $xmldata .= "<FL val=\"Email\">".$member['email']."</FL>"; $xmldata .= "<FL val=\"AIPMM Member\">Yes</FL>"; $xmldata .= "<FL val=\"Members Name\">".$firstName." ".$lastName."</FL>"; $xmldata .= "<FL val=\"Join Date\">".date(Y-m-d h:i:s)."</FL>"; $xmldata .= "<FL val=\"KitSent\">No</FL>"; $xmldata .= "</row>" $xmldata .= "</Contacts>" /* now that the XML is ready, execute the cURL request */ $parameter = ""; $parameter = $utilObj->setParameter("authtoken", AUTHTOKEN, $parameter); $parameter = $utilObj->setParameter("scope", SCOPE, $parameter); $parameter = $utilObj->setParameter("newformat", 1, $parameter); $parameter = $utilObj->setParameter("xmlData", $xmldata, $parameter); $response = $utilObj->sendCurlRequest(INSERTURL, $parameter); } else { /* record exists, meaning update member */ /* run the update algorithm */ /* parse the XML into a SimpleXML object to access the data easier */ $memberdata = $utilObj->parseXML($response); $xmldata = "<Contacts>"; $xmldata .= "<row no=\"1\">" $xmldata .= "<FL val=\"AIPMM Member\">Yes</FL>"; $xmldata .= "<FL val=\"Join Date\">".date(Y-m-d h:i:s)."</FL>"; $xmldata .= "</row>" $xmldata .= "</Contacts>" /* now that the XML is ready, execute the cURL request */ $parameter = ""; $parameter = $utilObj->setParameter("authtoken", AUTHTOKEN, $parameter); $parameter = $utilObj->setParameter("scope", SCOPE, $parameter); $parameter = $utilObj->setParameter("newformat", 1, $parameter); $parameter = $utilObj->setParameter("id", $memberdata->result->Contacts->row[1]->FL[1]['CONTACTID'], $parameter); $parameter = $utilObj->setParameter("xmlData", $xmldata, $parameter); $response = $utilObj->sendCurlRequest(INSERTURL, $parameter); } ?> The error that I'm getting is the following: Parse error : syntax error, unexpected T_VARIABLE in ...../www/htdocs/forum/admin/applications_addon/ips/nexus/sources/actions/onPaidZoho.php on line 40 The code pasted above isn't quite formatted the way it is on my text editor, but line 40 is $member_updated = IPSMember::load( $member["email"], 'pfields_content' );
  6. robertg added a post in a topic: Calling IPSMember functions from custom script   

    I tried that but I was still getting an error: Syntax error: unexpected T_VARIABLE in /forum/admin/application_addons..../onPaidZoho.php on line 43. I checked the line and the lines next to it, no missing punctuation, so I'm guessing it's not detecting it as a function. Should I maybe use this?

    require_once( 'initdata.php' ); require_once( CP_DIRECTORY.'/sources/base/ipsRegistry.php' ); $registry = ipsRegistry::instance(); $registry->init(); // Fetch member details $member = $registry->member()->fetchMemberData(); // Print the display name print $member['members_display_name'];
  7. robertg added a post in a topic: Calling IPSMember functions from custom script   

    Hey everyone,

    I'm writing a custom script for one of my packages in IP.Nexus, and I need to access some member information that's in the Custom Fields table. Now I know the function provided


    (where $member["email"] is taken from the $member array passed into the function)
    but it breaks, I'm guessing because the scope is wrong, or the script can't access methods from ipsRegistry or whatever. Is there a way I can run IPSMember methods from my script? Any help would be appreciated.

    Thanks!
    /** * Item Purchased (run before onPurchaseGenerated) * * @param array The member purchasing * @param array Package data (combined array with row from nexus_packages and nexus_packages_*, depending on the package type) * @param invoice Invoice Model * @return void */ public function onPaid( $member, $package, $invoice ) { } passes in the member array, but does it include any of the additional member tables like pfields_content or profile_portal ? I tried to load my own member array with pfields_content using the following: /* load a new member array that retrieves the custom fields */ $member_updated = IPSMember::load( $member["email"], 'pfields_content' );

About Me

Status Feed