Advertisement:

Author Topic: Adding PHP Contents in the DOZEN PAGES Mod  (Read 1231 times)

Offline Nabil1

  • Semi-Newbie
  • *
  • Posts: 41
Adding PHP Contents in the DOZEN PAGES Mod
« on: December 13, 2008, 05:43:42 PM »
Hi ,
I think something is missing in the Dozen Pages Mod, which is adding PHP contents so I added some Code and made it functional with php contents,  here is the additional Code which will make adding PHP Pages possible :

in DosenPages.template.php find :

Code: [Select]
function template_main()
{
global $context;

echo theme_linktree();

echo '
<div class="tborder" style="margin-top: 1ex;">
<div class="helpmenu titlebg" style="padding: 4px;">
', $context['dozen_pages_menu'], '
</div>
<div style="padding: 2ex;" id="helpmain" class="windowbg2">
', $context['dozen_pages_contents'], '
</div>
</div>
';
}

Replace with :
Code: [Select]
function template_main()
{
global $context,$pcontent;
$pcontent=$context['dozen_pages_contents'];

echo theme_linktree();
if (preg_match('/<?/',$pcontent)){
$pcontent=str_replace('<br />',"\n",$pcontent);
$pcontent=str_replace('&nbsp;',' ',$pcontent);
$pcontent=str_replace('&#039;',"'",$pcontent);
$fp=fopen("changable.php","w");
fputs($fp,$pcontent);
fclose($fp);
echo '
<div class="tborder" style="margin-top: 1ex;">
<div class="helpmenu titlebg" style="padding: 4px;">
', $context['dozen_pages_menu'], '
</div>';
echo '<div style="padding: 2ex;" id="helpmain" class="windowbg">';
include("changable.php");
echo '</div></div>'; } else {
echo '
<div class="tborder" style="margin-top: 1ex;">
<div class="helpmenu titlebg" style="padding: 4px;">
', $context['dozen_pages_menu'], '
</div>
<div style="padding: 2ex;" id="helpmain" class="windowbg2">
', $context['dozen_pages_contents'], '
</div>
</div>
';
}
};

add an empty php page in the root Directory of your forum call it 'changable.php' ,  it should have a file permission of 766 (or it depends on your server).
The addition of the php content should be with its start and end Signs
adding other Contents like [HTML] , [CODE ] ,etc. remain unchanged.
« Last Edit: December 13, 2008, 05:48:19 PM by Nabil1 »

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,920
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Adding PHP Contents in the DOZEN PAGES Mod
« Reply #1 on: December 14, 2008, 10:42:36 PM »
Michael Eshom
Cincy Space - now open!