Subscribers Mod - reward users, sell subscriptions etc
Posted by sheik
Re: Subscribers Mod - reward users, sell subscriptions etc November 06, 2006 02:50PM |
Registered: 16 years ago Posts: 99 |
Hi Sheik,
First let me says that Velum seem to have succeded in making module avialable to certain group only. I will let him post th emodule when ready.
For my question about stting, I solve the problem. Simply deactivating the add banners was not enough for me. What I wanted to do is offer different templates (color and look) to subscriber.
So I added the condition about subscriber in the cc_usersetting.php file and added some extra variable in the setting.php file. So when a subcriber is actif, he gets a different template that when he is not.
Regards,
yves
First let me says that Velum seem to have succeded in making module avialable to certain group only. I will let him post th emodule when ready.
For my question about stting, I solve the problem. Simply deactivating the add banners was not enough for me. What I wanted to do is offer different templates (color and look) to subscriber.
So I added the condition about subscriber in the cc_usersetting.php file and added some extra variable in the setting.php file. So when a subcriber is actif, he gets a different template that when he is not.
Regards,
yves
Re: Subscribers Mod - reward users, sell subscriptions etc July 14, 2007 05:20PM |
Registered: 17 years ago Posts: 45 |
I've installed this Module and I'm trying to use it as a 'Founding Member' flag or sorts. If the member is subscribed.. they are a 'Founding Member' of the community. Then when it see's they are a 'subscribed' member it shows the 'Founding Member' text. Simple enough.. it works in the users profile pages well.
However, I'm trying to get it to also display below the users name within the users messages, just like the User Rank module does. I've tried to get it to display but, I just haven't figured out how. Can you advise me on how to do this or what code to use?
However, I'm trying to get it to also display below the users name within the users messages, just like the User Rank module does. I've tried to get it to display but, I just haven't figured out how. Can you advise me on how to do this or what code to use?
July 28, 2009 06:29AM |
Registered: 19 years ago Posts: 687 |
This module works with Phorum 5.2.12a by the way, I will upload a revised package once a slight conflict is resolved.
(continued from another thread, @ Maurice)
Thanks Maurice, my module function doesn't accept an argument, and doesn't return anything. I wasn't aware it should return anything! :-) It kind of works in a similar fashion to Brian's Announcements mod, in that the main functions don't accept arguments, they then mess about with a few Phorum global data structures and then exit without returning anything.
Specifically, my module uses the common hook, checks a Phorum custom profile field, and based on that value changes the value of another custom profile field (in memory, no data is saved using the API).
i.e. it pretty much just does something like this:
However, this does seem to break your Google Map module, if I add it to the cc_save_user hook, so clearly I've done something that should be frowned on :-)
Or, maybe the problem was that I added my module to both the common and cc_save_user hooks at the same time?
Either way, it's not critical, as the module doesn't need to be run on cc_save_user anyway.
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
(continued from another thread, @ Maurice)
Quote
/\dam
I can only assume my module knackers the $user array at a critical point somehow.
Quote
Maurice
Does is knacker the $user array or did you forget to return $user; at the end of the hook? That is the most common error that I can think of.
Thanks Maurice, my module function doesn't accept an argument, and doesn't return anything. I wasn't aware it should return anything! :-) It kind of works in a similar fashion to Brian's Announcements mod, in that the main functions don't accept arguments, they then mess about with a few Phorum global data structures and then exit without returning anything.
Specifically, my module uses the common hook, checks a Phorum custom profile field, and based on that value changes the value of another custom profile field (in memory, no data is saved using the API).
i.e. it pretty much just does something like this:
Language: PHPglobal $PHORUM; $PHORUM["user"]["mycustomfield"] = true;
However, this does seem to break your Google Map module, if I add it to the cc_save_user hook, so clearly I've done something that should be frowned on :-)
Or, maybe the problem was that I added my module to both the common and cc_save_user hooks at the same time?
Either way, it's not critical, as the module doesn't need to be run on cc_save_user anyway.
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Re: Subscribers Mod - reward users, sell subscriptions etc July 28, 2009 06:42AM |
Admin Registered: 20 years ago Posts: 9,240 |
July 28, 2009 06:47AM |
Admin Registered: 18 years ago Posts: 8,532 |
Here's what the hook implementation should look like:
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Language: PHPfunction phorum_mod_foo_cc_save_user ($data) { // .... // Fiddle with your global vars here. // .... // Return the $data that was passed as the argument. // Phorum';s hook code will take this returned data and // feed it to the next cc_save_user hook function. // If you do not return the data, then Phorum will feed // NULL to the next hook in line. return $data; }
Maurice Makaay
Phorum Development Team



July 28, 2009 11:07AM |
Registered: 19 years ago Posts: 687 |
@ Thomas, that makes sense, thank you.
@ Maurice, do I still need to do the "return $data" if I'm only using the common hook?
Thanks to both of you,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
@ Maurice, do I still need to do the "return $data" if I'm only using the common hook?
Thanks to both of you,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Re: Subscribers Mod - reward users, sell subscriptions etc July 28, 2009 12:18PM |
Admin Registered: 20 years ago Posts: 9,240 |
July 28, 2009 12:30PM |
Registered: 19 years ago Posts: 687 |
Understood, I have now bookmarked the relevant docs. :-) (there are a lot more hooks now than when I last checked!)
Thanks again,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Thanks again,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

July 28, 2009 02:15PM |
Admin Registered: 18 years ago Posts: 8,532 |
See documentation -> developer -> docs for hook "common"
It tells that it gets no input and returns no input.
So for "common" it's okay to use
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
It tells that it gets no input and returns no input.
So for "common" it's okay to use
Language: PHPfunction phorum_mod_foo_common() { // Do your stuff, without returning any data. }
Maurice Makaay
Phorum Development Team



July 28, 2009 02:16PM |
Registered: 19 years ago Posts: 687 |
Yes, thanks, that's why I wrote "understood" ;-)
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Sorry, only registered users may post in this forum.