Promo tools

From Mansion Productions WIKI
Jump to: navigation, search

Contents

ADDING CUSTOM PROMOTOOLS

Creating the tool template

Create a XSL file in “.mpa/xsl/affiliates/tools/” for your tool (for example promo). Copy this code into the XSL file:

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="utf-8" indent="yes" />
		<xsl:include href="../index.xsl"/>
		<xsl:include href="tabs.xsl"/>
		<xsl:template name="content">          
		<!-- CONTENT STARTS HERE -->                              
  
		<iframe frameborder="0" width="100%" height="500" scrolling="auto" src="http://yourmpa3url.com/affiliates/yourtool.php" />
  
		</xsl:template>
 </xsl:stylesheet>

Then change the value of iframe src to your tool location.


Adding to the menu

To add a new tool to the webmaster’s menu you should edit affiliates_menu.xsl located in the .mpa3/working/ directory. Find <promo_tools> node. Below are located the options in the tools menu. Just insert this code there:

 
<row visible="yes">
     <title>your tool name</title>
     <action>tools_promo</action>
</row>

Please make sure that the value between <action> and </action> starts with "promo_" and ends with the XSL template name(without the .xsl extension - promo_tools for this example).

Also, create a file in .mpa3/core/classes/affiliates/tools/promo.class.php (where "promo" is the template name and will change if yours is different). Paste this content in it:

<?php
class Affiliates_Tools_Promo extends Affiliates_Tools_BaseController
{
    public function defaultAction()
    {

    }
}
?>

You should be able to see the additional menu option in the affiliate area now, and when you open it you should see the content of the iframe.


Other options

There is an option to use the affiliate’s id in your new integrated tool. Just use the $_COOKIE['aff_id'] parameter in your php script, which will be equal to the id of the affiliate accessing the tool. Please note that the php script needs to be placed in then mpa3root/affiliates/ folder for the cookie to be available.

Personal tools
Namespaces

Variants
Actions
Products
Navigation
Toolbox