News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding an affiliate page on the SimplePortal Mod

Started by DemonicInfluence, June 03, 2005, 07:46:52 AM

Previous topic - Next topic

DemonicInfluence

Okay, so i wanted a affiliate page to go with my home page made by the
SimplePortal mod. so i tried this bit of code on these documents:

Index.php:

'.xml' => array('News.php', 'ShowXmlFeed'),
               'forum' => array('BoardIndex.php', 'BoardIndex'),
               'affiliates' => array('Portal.php', 'Affiliates'),

I added the affiliates one.

Portal.php:
Function Affiliates()
{

       global $boardurl,$txt, $scripturl,  $db_prefix;
       global $ID_MEMBER;
       global $context, $user_info, $db_prefix;

       $context['page_title'] = $context['forum_name'];
       LoadTemplate('Affiliates');
       LoadLanguage('Portal');
}

i added that after:

Function Portal()
{

       global $boardurl,$txt, $scripturl,  $db_prefix;
       global $ID_MEMBER;
       global $context, $user_info, $db_prefix;

       $context['page_title'] = $context['forum_name'];
       LoadTemplate('Portal');
       LoadLanguage('Portal');
}


I changed portal.english.php so it had the affiliate text this way:

<add after>$txt['portal_24'] = '<a
href="http://dev.nesian.info/">NesianDev</a><br />
<a href="http://simplemachines.org">Simple Machines Forum</a><br />';</add>

$txt['portal_25'] = "Affiliates";


I changed portal.template.php so it had an affiliate link this way:
<add after><a
href="index.php?action=forum">'.$txt['portal_16'].'</a><br /></add>

<a href="index.php?action=affiliates">'.$txt['portal_25'].'</a><br />


I created a new file named PortalAffiliates.php in the Blocks folder
with this format on the images with links:

function PortalAffiliates($output_method = 'echo')
{
<a href="affiliatesite.com"><img src="http://affiliatesite.com"
border="0" /></a>

}


Finally, i created a duplicate of portal.template.php and called it
affiliate.template.php with these additions:
<replace>if ($showannounce == '1') {

echo '
<table class="tborder" border="0" width="95%" cellspacing="1" cellpadding="4">
<tr><td class="titlebg">'.$txt['portal_10'].'</td>
</tr>
<tr><td class="windowbg2">';
include('./Blocks/PortalNews.php');
PortalNews($newsboard = $newsb, $limit = $newslimit);
echo '</td>
</tr></table>';

}</replace>

if ($showannounce == '1') {

echo '
<table class="tborder" border="0" width="95%" cellspacing="1" cellpadding="4">
<tr><td class="titlebg">'.$txt['portal_10'].'</td>
</tr>
<tr><td class="windowbg2">';
include('./Blocks/PortalAffiliates.php');
PortalAffiliates();
echo '</td>
</tr></table>';

}


I was trying to replace the announcement box with the affiliates box.
Now my question is what did i do wrong, cause i get this error when i
try to get into www.libo.myfxh.com/index.php?action=affiliates:
QuoteUnable to load the 'main' template.

How do i fix this. where did i go wrong?

[Unknown]

LoadTemplate('Affiliates');

Means you need an Affiliates.template.php.

-[Unknown]

DemonicInfluence

i did. i made a copy of portal.template.php and named it Affiliates.template.php. with the additions. I frogot to add that :(. I put that in the ./themes/default directory.

[Unknown]

Are you sure that template has a "template_main" function in it?

-[Unknown]

DemonicInfluence

it didnt. i changed the function to template_main. that made it work. thanks [Unknown] ;D :D. now it works.

Advertisement: