Marbl in PD9Soft MegaBBS 2.2

Installation

Extract the contents of the zip into a suitable location. For this guide we will use

/forums/plugins/marbl

After extraction you will have the following file system structure on the server:

  • /forums/plugins/marbl/css
  • /forums/plugins/marbl/images
  • /forums/plugins/marbl/js
  • /forums/plugins/marbl/readme.txt

In a HTML editor or your preferred text editor, open your forum template file at

/forums/templates/<template name>/fragments/template-begin.asp

You will see a series of CSS and JavaScript code block declairations wrapped in Response.Write. After the last </script> or </style> block add

Response.Write "<script type='text/javascript' src='/forums/plugins/marbl/js/Marbl.js?ver=0.9.8'></script>" & CRLF
Response.Write "<link rel='stylesheet' href='/forums/plugins/marbl/css/main.css' type='text/css' />" & CRLF

Note: If you intend to use your own CSS style sheet definitions, you do not need to include the main.css file.

Save and close the file.

 

Enabling Amazon Links

Go to your MegaBBS forum Settings and Administration section. In the settings navigation select “Edit MBBS codes”.

Copy/paste the following into a text editor

<script type="text/javascript">
var marblAmazon = new MarblLink('amazon' '/forums/plugins/marbl/');
    marblAmazon.addAssociateId('CA', 'hpcfactor0e-20');
    marblAmazon.addAssociateId('UK', 'hpcfactor-21');
    marblAmazon.addAssociateId('US', 'hpcfactor-20');
    marblAmazon.DisplayFlags=true;
    marblAmazon.OpenInNewWindow=true;
    marblAmazon.createLink("ALL", "", "{param}", "", "", 16, marblAmazon.IMAGE);
</script>

Edit the configuration as required, adding your own Affiliate link codes and other national programmes (MX, DE, FR, BR, AU etc.) by adding or removing marblAmazon.addAssociateId('<country code>', '<your Affiliate Code>'); lines.

Customise createLink() as required.

Now remove all line breaks from it so that the entire code block appears on a single line e.g.

<script type="text/javascript">var marblAmazon = new MarblLink('amazon', '/forums/plugins/marbl/');marblAmazon.addAssociateId('CA', 'hpcfactor0e-20');marblAmazon.addAssociateId('UK', 'hpcfactor-21');marblAmazon.addAssociateId('US', 'hpcfactor-20');marblAmazon.DisplayFlags=true;marblAmazon.OpenInNewWindow=true; marblAmazon.createLink("ALL", "", "{param}", "", "", 16, "image");</script>

NB: If you manually edit this string in the database you must flush the forum cache in the administrative menu before proceeding.

In the ‘Code’ textbox type:

[amazon={param}]

In the HTML text box copy/paste your edited script tag in, ensuring that there are no new-line characters present.

Leave the Closing tag (optional) and Closing HTML (optional) text boxes blank.

Click the submit button to add it to the MBBS Codes list.

Create a new test forum post and enter

[amazon=Fire TV]

Submit the post. You should now see displayed in-line within the body of the post.

 

Adding an Amazon link button to the Post Editor Toolbar

If you want to display an ‘Amazon Link’ Button on the of the post WYSIWYG editor, you must edit some additional files.

/forums/jscripts/post_toolbar/mbbs_code.js

Add the following near the bottom:

function tag_amazon() {
  var FoundErrors = '';
  var strFreetext = prompt('Enter Amazon product search phrase, ASIN or ISBN', "");

  if (!strFreetext) {
    FoundErrors += " " + 'You must provide a search term';
  }

  if (FoundErrors) {
    alert("Error!"+FoundErrors);
    return;
  }

  doInsert("[amazon="+strFreetext+"]", "", false);
}

/forums/jscripts/post_toolbar/toolbar_settings.js

Add the following at the bottom:

var help_amazon = "Insert Sponsored Amazon Link (alt+ a)";

/forums/templates/<template name>/BBC/forum/thread-post.asp

Around half-way down the page, insert the button directly into the source code at your preferred location. Formal, position and style as required.

Response.Write "<input class='bbsbutton' onmouseover=""hstat('amazon')"" accesskey='a' onclick=""tag_amazon()"" type='button' value=' Amazon Link ' name='Amazon'>"

Upload the files to the server and refresh the post editor to see the changes.

 

Enabling eBay Links

Go to your MegaBBS forum Settings and Administration section. In the settings navigation select “Edit MBBS codes”.

Copy/paste the following into a text editor

<script type="text/javascript">
var marblEbay = new MarblLink('ebay' '/forums/plugins/marbl/');
    marblEbay.PartnerId = '1234567890';
    marblEbay.CampaignId = '9876543210';
    marblEbay.addRegions('UK,US,CA,AU,AT,BE,CH,DE,ES,FR,IE,IT,NL');
    marblEbay.DisplayFlags=true;
    marblEbay.OpenInNewWindow=true;
    marblEbay.createLink("ALL", "", "{param}", "", "", 16, marblEbay.IMAGE);
</script>

Edit the configuration as required

  • Add your eBay Partner Network ID
  • Enter your Default Campaign ID
  • Add your desired national programmes by editing themarblEbay.addRegions('<country code>,<country code>...''); line
  • Customise createLink() as required

Now remove all line breaks from it so that the entire code block appears on a single line e.g.

<script type="text/javascript">var marblAmazon = new MarblLink('amazon', '/forums/plugins/marbl/');marblAmazon.addAssociateId('CA', 'hpcfactor0e-20');marblAmazon.addAssociateId('UK', 'hpcfactor-21');marblAmazon.addAssociateId('US', 'hpcfactor-20');marblAmazon.DisplayFlags=true;marblAmazon.OpenInNewWindow=true; marblAmazon.createLink("ALL", "", "{param}", "", "", 16, "image");</script>

NB: If you manually edit this string in the database you must flush the forum cache in the administrative menu before proceeding.

In the ‘Code’ textbox type:

[ebay={param}]

In the HTML text box copy/paste your edited script tag in, ensuring that there are no new-line characters present.

Leave the Closing tag (optional) and Closing HTML (optional) text boxes blank.

Click the submit button to add it to the MBBS Codes list.

Create a new test forum post and enter

[ebay=Intel NUC]

Submit the post. You should now see displayed in-line within the body of the post.

 

Adding an eBay link button to the Post Editor Toolbar

If you want to display an ‘Amazon Link’ Button on the of the post WYSIWYG editor, you must edit some additional files.

Open: /forums/jscripts/post_toolbar/mbbs_code.js

Add the following near the bottom:

function tag_ebay() {
  var FoundErrors = '';
  var strFreetext = prompt('Enter an eBay product search phrase', "");

  if (!strFreetext) {
    FoundErrors += " " + 'You must provide a search term';
  }

  if (FoundErrors) {
    alert("Error!"+FoundErrors);
    return;
  }

  doInsert("[ebay="+strFreetext+"]", "", false);
}

 

Open: /forums/jscripts/post_toolbar/toolbar_settings.js

Add the following at the bottom:

var help_ebay           = "Insert Sponsored eBay Link (alt + e)";

 

Open: /forums/templates/<template name>/BBS/forum/thread-post.asp

Around half-way down the page, insert the button directly into the source code at your preferred location. Format, position and style as required.

Response.Write "<input class='bbsbutton' onmouseover=""hstat('ebay')"" accesskey='e' onclick=""tag_ebay()"" type='button' value=' eBay Link ' name='eBay'>"

Upload the files to the server and refresh the post editor to see the changes.