Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Metamod + K2 + Revenue sharing
Metamod + K2 + Revenue sharing
Metamod + K2 + Revenue sharing
Hello,
I'm looking for a solution to share the advertising revenue with K2 authors (i.e. 20% for me and 80 % for the authors). I'm using K2 to display articles on my site. Is it possible to do it with Metamod Pro?
I saw a recipe to controle modules based on Joomla authors : http://www.metamodpro.com/metamod/recip … cle-author
I don't know php and can't create a code for my needs.
Thank you
28-Dec-13 21:07:56
Re: Metamod + K2 + Revenue sharing
Hi Netfly,
How are you proposing to share the revenue? i.e. what would MetaMod actually have to control in order for that to happen?
Could it be as simple as:
1 - set up a module that contains your ad code
2 - set up a module for each author containing the ad code that embeds their payment details or whatever
3 - set up a MetaMod, assigned to K2 item pages, that does an 80:20 random split between showing the module with the ad code for the particular author, and the ad code for *you*?
If that's the case, then it should be easy to set up as long as you don't have a large number of authors to maintain (e.g. a handful of authors would work very well):
$k2 = JomGenius("k2");
if ($k2->check("pagetype = item.view")) {
$my_module = AAA; // replace AAA with the module id of the ad module for YOU
$authors_to_modules = array( XXX=>BBB, YYY=>CCC, ZZZ=>DDD);
// replace XXX, YYY, ZZZ with the user ids of the different K2 authors,
// and BBB, CCC, DDD with the module ids holding their advertising codes.
$r = mt_rand(1, 5); // random number between 1 and 5 inclusive
if ($r == 1) return $my_module; // 1 in 5 chance that your one gets shown
// otherwise, the author's one gets shown:
$author = k2->info("item_created_by");
$authors_module = @$authors_to_modules[$author]; // gets it from the array above
if ($authors_module != null) return $authors_module; // make sure it's valid.
}
Ok, so the only lines you have to modify there are these ones:
$my_module = AAA; // replace AAA with the module id of the ad module for YOU
$authors_to_modules = array( XXX=>BBB, YYY=>CCC, ZZZ=>DDD);
Replace XXX, YYY, ZZZ with the user ids of the different K2 authors, and BBB, CCC, DDD with the module ids holding their advertising codes.
You can find the user ids in the user manager in the backend of Joomla.
Best regards,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Metamod + K2 + Revenue sharing
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8026
- Newest User:
- rivas48750
- Members Online:
- 1
- Guests Online:
- 147
- Online:
- rivas48750
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked