Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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. hmm

Thank you

Edited By: netfly
28-Dec-13 21:07:56

netfly
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Metamod + K2 + Revenue sharing

Thank you very much metamodguy. This is exactly what I need. Perfect smile

netfly
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Metamod + K2 + Revenue sharing

Great :-)
Have a very happy New Year smile

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4397
Newest User:
tull687318
Members Online:
0
Guests Online:
145

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked