Jump to content

Subscriptions Manager


sijad

Recommended Posts


There's an example file in that directory, just use it as a base to work from. The class name, regardless of the name of the file, should always be customsubs.




Would this function correctly pull the member id of the member buying a subscription in the insert data:



function subs_paid($sub_array, $member=array(), $trx_id="")

{

$this->DB->insert('jlogica_awards_awarded', array(

 'award_id'   => 21,

 'user_id'    => $member['member_id'],

 'awarded_by' => 1,

 'approved'   => 1,

 'is_active'  => 1,

 'notes'      => "Thanks for your contribution to our community.",

 'date'       => IPS_UNIX_TIME_NOW,));


}

Link to comment
Share on other sites


I believe so, yes.



When I do that, I get this error:

Fatal error: Call to a member function insert() on a non-object in mysite/admin/applications_addon/other/subscriptions/sources/classes/custom/cus_example.php on line 30

Any idea why that might be? Seems like a simple insert should work.
Link to comment
Share on other sites

You haven't initialized the database object. This code should take care of that:

<?php


/**

 * Product Title:		Subscriptions Manager

 * Product Version:		1.2.0

 * Author:				Michael McCune

 * Website:				Invision Focus

 * Website URL:			http://invisionfocus.com/

 * Email:				michael.mccune@gmail.com

 */


//---------------------------------------

// Security check

//---------------------------------------


if ( ! defined( 'IN_IPB' ) )

{

	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";

	exit();

}


class customsubs

{

	protected $registry;

	protected $DB;


	public function __construct()

	{

		/* Make registry objects */

		$this->registry   =  ipsRegistry::instance();

		$this->DB         =  $this->registry->DB();

	}


	//---------------------------------------

	// Subscription Paid

	//---------------------------------------


	function subs_paid($sub_array, $member=array(), $trx_id="")

	{

		$this->DB->insert( 'jlogica_awards_awarded', array( 'award_id'   => 21,

															'user_id'    => $member['member_id'],

															'awarded_by' => 1,

															'approved'   => 1,

															'is_active'  => 1,

															'notes'      => "Thanks for your contribution to our community.",

															'date'       => IPS_UNIX_TIME_NOW ) );

	}



	//---------------------------------------

	// Subscription Failed / Cancelled

	//---------------------------------------


	function subs_failed($sub_array, $member=array(), $trx_id="")

	{



	}







}

Link to comment
Share on other sites


To my knowledge, nothing has changed with the IPN settings. I know there were issues with IPN set up that had been posted about with regards to Nexus, you may need to follow the steps Jason H listed in

this topic

.



If you have Nexus installed, you cannot use this app, period. IPS wants people to use their product, and so that have built code into it that will always hijack this application's URLs, and they won't change that or make it so there's any way to work around that. If you need stuff Nexus can do, then use Nexus.




So following instructions in that topic wont resolve the issue? even if IPN is eventually turned off and your sub system sends through the notify_url ? I really REALLY REALYYYY prefer your subscriptions system over their ability to do subs. I cant somehow rename the nexus folder and make it all run through a different name somehow?

To me its worth the effort as your system works much better for purpose.
Link to comment
Share on other sites

I don't know whether Jason's instructions are needed for this app or not, or whether something has changed with PayPal and how it handles IPN related to this app. I don't use this app myself, I just make sure it continues to be usable for new IP.Board versions. I would assume that if something did change with how PayPal handles stuff that would make this app break completely, then I'd be hearing lots of people reporting it here, but I'm not. So that leads me to believe that if you are having issues with PayPal and their IPN, that it's probably not something with this app, but rather it could be something specific to your setup.

If you have been trying to get this to run alongside of Nexus, that too could break any IPN stuff. As I said above, these two apps cannot work together in any fashion anymore. Even renaming the nexus folder won't help; you'd probably be able to install this app, but I don't think you could use nexus anymore after doing that.

Link to comment
Share on other sites


I don't know whether Jason's instructions are needed for this app or not, or whether something has changed with PayPal and how it handles IPN related to this app. I don't use this app myself, I just make sure it continues to be usable for new IP.Board versions. I would assume that if something did change with how PayPal handles stuff that would make this app break completely, then I'd be hearing lots of people reporting it here, but I'm not. So that leads me to believe that if you are having issues with PayPal and their IPN, that it's probably not something with this app, but rather it could be something specific to your setup.



If you have been trying to get this to run alongside of Nexus, that too could break any IPN stuff. As I said above, these two apps cannot work together in any fashion anymore. Even renaming the nexus folder won't help; you'd probably be able to install this app, but I don't think you could use nexus anymore after doing that.




All I have to say is damn you for making such a damn awesome app, because now even though I dont want to, I may have to drop it :(

IPN URL: index.php?app=subscriptions&module=incoming&section=receive&do=validate&type=paypal

I checked the IPN History and the links are all pointing to...
index.php?app=subscriptions&r_f_g=f3218d6d61######5be29fe1207f2341-paypal
index.php?app=subscriptions&r_f_g=f3218d6d61######5be29fe1207f2341-paypal
(###### is just censored)

Which if I recall they are correct because you send an inline url with the query to paypal in the first place?
The transactions both have 'There were no transaction logs to display.' in the logs section of subs.

Can we once and for all say that this is likely nexus or does this seem like a different issue?
Link to comment
Share on other sites

I honestly have no idea, as I said I don't use this app so I can't say for certain where it could be breaking down for you. If you're trying to run it alongside of Nexus and encountering issues, then it's quite possible it's Nexus doing it. I have to suspect that it's something specific you're doing as I'd expect to hear a lot more reports of this if it were a fundamental problem in this app itself.

Link to comment
Share on other sites

I finally got round to switching to nexus. Is it safe for me to remove the subscription app now or should I keep it installed (as far as I can tell, transfer was successful and all subs are now on nexus). Again, Michael, let me stress how awesome your work has been for this app!

Link to comment
Share on other sites

Again, Michael, let me stress how awesome your work has been for this app!



+1.

I don't remember when I first began using this application, but it has been a fantastic one, for sure. I will continue to use it, too.

You make some of the best modifications for IPS, a fantastic coder.

Thanks for all the work you do for us, the membership.
Link to comment
Share on other sites

lol to late :smile: i deleted everything and did a clean install using filezilla worked alot better than using the file manager in cpanel. all working now. well all installed gotta have a play when i'm not being distracted by other things.

thanks for the help

Link to comment
Share on other sites

  • 2 weeks later...

I have downloaded the version of Subscriptions Module for 3..3.2 and uploaded the files, but can't find any Install, even though I've recached as well.
I think my problem relates to something to do with how things are uploaded.

It seems quite standard to see a Master Folder under the Style Images and what I'm not clear on is whether I should have a Master Folder myself
Does it go under forumpublicstyle_images or does it go under forumpublic which is what is shown on the uncompressed structure.

Similarly with the JS. There is a js folder under forumpublic and there is a js folder under admin

So these things can be confusing and misleading. Perhaps some clarity would be helpful for me and others who are not so familiar and perhaps I can get the subscriptions module working as well.
Thanks

Link to comment
Share on other sites

No, there should not be 2 js folders, there should just be one under the /public directory.

If your system still says 1.0.1, then you haven't uploaded the files for this app to the correct location.

I can't speak for your site's activity and how many subscriptions you should be getting.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...