Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 2 Years, 5 Months, 4 Weeks ago PHP Page | Page Manager | Pull Custom Template
#1
Solved: 2 Years, 5 Months, 4 Weeks ago
Hey there,

I'm wanting to pull a custom template into a php page made with page manager. I've tried the following:
<?php
global $headerinclude, $header, $theme, $footer, $db;
add_breadcrumb($pages['name']);
$template='<html><head><title>'.$mybb->settings['bbname']." - ".$pages['name'].'</title>{$headerinclude}</head><body>{$header}




Testing beep? <br /><br />

{$guidebook}



{$footer}</body></html>';
$template=str_replace("\'", "'", addslashes($template));
eval("\$page=\"".$template."\";");
eval("\$guidebook=\"".$templates->get.("guidebook")."\";");
output_page($page);
?>

The page loads but the
{$guidebook}

Does not load. The template is located in my global templates. I'm just not sure how to call it forth and show in the php page of the Page Manager plugin page.

Any help is appreciated! Smile
> SELECT finger FROM hand WHERE id='3'
Reply
#2
Solved: 2 Years, 5 Months, 4 Weeks ago
{header} & {footer} are global variables (not global templates)

Your own variables you have to define first before you can use them.

eval("\$guidebook= \"".$templates->get("guidebook")."\";");
Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#3
Solved: 2 Years, 5 Months, 4 Weeks ago
I think I might be misunderstanding you, I added that in before the other eval but now the page won't even load.

Am I supposed to put that elsewhere to call it first?
<?php
global $headerinclude, $header, $theme, $footer, $db;
add_breadcrumb($pages['name']);
$template='<html><head><title>'.$mybb->settings['bbname']." - ".$pages['name'].'</title>{$headerinclude}</head><body>{$header}




Testing beep? <br /><br />

{$guidebook}



{$footer}</body></html>';
$template=str_replace("\'", "'", addslashes($template));
eval("\$guidebook = \"".$templates->get("guidebook")."\";");
eval("\$page=\"".$template."\";");
output_page($page);
?>
> SELECT finger FROM hand WHERE id='3'
Reply
#4
Solved: 2 Years, 5 Months, 4 Weeks ago
<?php
global $headerinclude, $header, $theme, $templates, $footer, $db;

eval("\$guidebook = \"".$templates->get("guidebook")."\";");

$template='<html>
	<head>
		<title>'.$mybb->settings['bbname']." - ".$pages['name'].'</title>
		{$headerinclude}
	</head>
	<body>
		{$header}
		Testing beep? <br /><br />
		{$guidebook}
		{$footer}
	</body>
</html>';
$template=str_replace("\'", "'", addslashes($template));
add_breadcrumb($pages['name']);
eval("\$page=\"".$template."\";");
output_page($page);
?>

Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#5
Solved: 2 Years, 5 Months, 4 Weeks ago
That worked, thank you very much!!!
> SELECT finger FROM hand WHERE id='3'
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)