MyBB-Plugins Forums

Full Version: Need help with NewPoints Shop Hook
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently working on a plugin for NewPoints, it will make it possible to use some of the items.

There will be difference types of items, which can be used in difference way.

But on my try to make add a "Use" button to list of your items, I got stuck.

I have added `{use}` into `newpoints_shop_myitems_item`, and then I am trying to make a hook, at `newpoints_shop_end`, which is purposed to change `{use}` into `Work!` just while developering.

My Hook looks like this:
PHP Code:
function hooks_newpoints_shop_end(&$page)
{
    
$pagestr_replace('\{use\}''Work!'$page);

Preview by the Hooks 1.2 plugin.

But for some reason it doesn't get the $page proberly.
Any ideas?
'\{use\}' should be '{use}'
I am not quite sure what you're trying to escape, it's a literal string.
(04-03-2013, 01:55 AM)Pirata Nervo Wrote: [ -> ]'\{use\}' should be '{use}'
I am not quite sure what you're trying to escape, it's a literal string.

Oh. Yea. Thanks, but it still doesn't use, it seems like it doesn't get the content of $post? As if I try to print it out, nothing comes out.

So am I doing it wrong?
What do you mean by it doesn't get the content of $post?
Sorry. I mean the content of $page.

As if I try to print it out in my hook, nothing comes out.
newpoints_shop_end doesn't pass any $page so I'm not sure what you're trying to get as an argument, it will obviously be null.

globalize $page instead of receiving as an argument.
Thanks, but still without luck.

PHP Code:
function hooks_newpoints_shop_end()
{
    global 
$page
    echo 
$page;


Do you have any other ideas how to solve it?
Why are you trying to echo the page?
The echo is just for testing, untill I get the content of $page into the hook.
Use die("".$page);