(11-30-2012, 06:26 AM)Cyberuben Wrote: That's quite stupid, I admit. I just tried to see if I could echo anything, but one reason to not use templates, correct me if I'm wrong, is because I've read that http://php.net/manual/en/function.eval.php should always be avoided because of it being harmful.Don't be ignorant. That's what makes people stupid. eval can be harmful if used improperly. MyBB uses it for templates and we make sure PHP is not "injected" into them, that's why you get "security errors" when entering invalid template code in your Admin panel.
(11-30-2012, 06:26 AM)Cyberuben Wrote: Then, what doesn't make sense to me, is that I have a file, called "buy.php", a "buy credit plugin" that allows users to purchase points for Newpoints. There, I added some features like a "disclaimer", changed all of the text, added formatting for the numbers, added a tool to move the forum-newpoints to my server, using MySQL, where the users can purchase hats and such with it.I am sure you remember when you learned PHP that variables are not parsed when using single quotes.
There, they do the following:
Code:$page="
<html>
<head>
<title>{$mybb->settings[bbname]} - ".$lang->sprintf($lang->buycredit_title, $name)."</title>
{$headerinclude}
<style type=\"text/css\">
#donatenav {
color: #ffff00;
}
</style>
</head>
<body id=\"donate\">
Just as example.
Now, in my newpoints plugin, I'm trying to do the same:
Code:function newpoints_vipstatus($page)
{
global $mybb, $db, $lang, $cache, $theme, $header, $templates, $plugins, $headerinclude, $footer, $options, $inline_errors;
$page = '<html>
<head>
<title>{$lang->newpoints} - {$lang->newpoints_subscriptions}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
<td valign="top" width="180">
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
<tr>
<td class="thead"><strong>{$lang->newpoints_menu}</strong></td>
</tr>
{$options}
</table>
</td>
<td valign="top">
{$inline_errors}
Test
</td>
</tr>
</table>
{$footer}
</body>
</html>';
output_page($page);
}
I copied this code from subscriptions (it's a template-copy, but the buy.php doesn't use templates either and it works there), just to see if it works, but apparently this isn't possible because this is a plugin, and not a page.
I'm getting the following output:
http://puu.sh/1vHEx, and on the page itself: http://puu.sh/1vHEQ
(11-30-2012, 06:26 AM)Cyberuben Wrote: It's just really frustrating that I can't find out how to get it to work. I'm really easy with picking things up such as this, this is how I learnt PHP. Started doing simple tasks my dad gave me and I kept expanding. I can write some decent systems with "security" built in and such, but MyBB is just one blank sheet of paper, there's nothing that makes it clear for me. I don't understand how they accomplished to write a whole system where developers have to find out MyBB's way of doing stuff, without any form of documentation, not looking at the bad snippets on their website where not even a hyperlink works.Because it's easy, perhaps? It's not out fault that you haven't realized that you are using single quotes instead of double quotes.
(11-30-2012, 07:32 AM)Cyberuben Wrote: I understand that I'm a pain in the ass, but once I get it, it'll be no deal. I just need a push in the right direction.I didn't stop replying, I just got home. Just be patient
Sorry for doubleposting, was an accident. Thought post-merge time was a little longer.

(11-30-2012, 07:32 AM)Cyberuben Wrote: EDIT:I don't need money. You're going to learn it this way, trust me. You don't need better examples than you have been provided right now.
Could you help me to set this up? I just need a basic example how to alter the page that's being put out, with the menu on the left. I'm willing to pay you $10 if you can write me a small tutorial, templates would be nice. Even if the output is only "Test".
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.