MyBB-Plugins Forums
Need help with NewPoints Shop Hook - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.6.x (http://forums.mybb-plugins.com/Forum-MyBB-1-6-x)
+---- Forum: NewPoints (http://forums.mybb-plugins.com/Forum-NewPoints)
+----- Forum: Development (http://forums.mybb-plugins.com/Forum-Development)
+----- Thread: Need help with NewPoints Shop Hook (/Thread-Need-help-with-NewPoints-Shop-Hook)



Need help with NewPoints Shop Hook - Mark Topper - 04-03-2013

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?


RE: Need help with NewPoints Shop Hook - Diogo Parrinha - 04-03-2013

'\{use\}' should be '{use}'
I am not quite sure what you're trying to escape, it's a literal string.


RE: Need help with NewPoints Shop Hook - Mark Topper - 04-03-2013

(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?


RE: Need help with NewPoints Shop Hook - Diogo Parrinha - 04-03-2013

What do you mean by it doesn't get the content of $post?


RE: Need help with NewPoints Shop Hook - Mark Topper - 04-03-2013

Sorry. I mean the content of $page.

As if I try to print it out in my hook, nothing comes out.


RE: Need help with NewPoints Shop Hook - Diogo Parrinha - 04-03-2013

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.


RE: Need help with NewPoints Shop Hook - Mark Topper - 04-03-2013

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?


RE: Need help with NewPoints Shop Hook - Diogo Parrinha - 04-03-2013

Why are you trying to echo the page?


RE: Need help with NewPoints Shop Hook - Mark Topper - 04-03-2013

The echo is just for testing, untill I get the content of $page into the hook.


RE: Need help with NewPoints Shop Hook - Diogo Parrinha - 04-03-2013

Use die("".$page);