Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: Patman504 on December 20, 2004, 11:01:42 PM

Title: Affilates Page
Post by: Patman504 on December 20, 2004, 11:01:42 PM
Is there a way you could make a button saying affilates and when the users click on it a whole new page comes up with all of the sites affilates? Please let me know.

I hope I wasnt to brief.
Title: Re: Affilates Page
Post by: Jerry on December 20, 2004, 11:35:32 PM
it is actually very easy ;)

Here is one way to do it:

Open /index.php
Find
'admin' => array('Admin.php', 'Admin'),
Add After
'affiliates' => array('Affiliates.php', 'Affiliates'),
Create /Sources/Affiliates.php
contents:
<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

function
Affiliates() {
global
$context;
// This is gonna be needed...
$context['page_title'] = "Affiliats";
loadTemplate('Affiliates');
}
?>

Create /Themes/default/Affiliates.template.php
contents:
<?php
function template_main()
{
       global
$context, $settings, $options, $scripturl, $txt;

       
// Show the link tree.
       
echo '
               <table width="100%" cellpadding="3" cellspacing="0">
                       <tr>
                               <td>'
, theme_linktree(), '</td>
                       </tr>
               </table>'
;
       
// The content
       
echo 'CONTENT HERE, html, anything really. . .';

}
?>

after all that you can access your new page by index.php?action=affiliates
Title: Re: Affilates Page
Post by: Patman504 on December 21, 2004, 12:13:49 AM
Ok thanks very much, I will let you know if it works.
Title: Re: Affilates Page
Post by: DoW Kid Rock on January 22, 2005, 01:26:09 PM
this works, but was wondering if a mod could be made that you could access from the admin panel and add affiliates and links etc......I guess a link exchange would be good, where people could submit links and then the admin could approve them or not
Title: Re: Affilates Page
Post by: AGMR_Rhino on February 05, 2005, 05:59:15 PM
i did every thing it said to do here but how do i get to the affilates page it doesnt show up any were please help
Title: Re: Affilates Page
Post by: Jerry on February 05, 2005, 06:03:14 PM
if you do that, it would be
http://yourforums/index.php?action=affiliates
Title: Re: Affilates Page
Post by: AGMR_Rhino on February 05, 2005, 06:42:53 PM
thanx now i no its there how do you add the button ive never done that before?
Title: Re: Affilates Page
Post by: Jerry on February 05, 2005, 06:48:02 PM
if you search the forums you can find a post on how to add a button to the menu :)
Title: Re: Affilates Page
Post by: AGMR_Rhino on February 05, 2005, 08:35:24 PM
Thanx got it  now i have a Affiliates page