Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

Need help with NewPoints Shop Hook
#1

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?
Reply
#2

'\{use\}' should be '{use}'
I am not quite sure what you're trying to escape, it's a literal string.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#3

(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?
Reply
#4

What do you mean by it doesn't get the content of $post?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#5

Sorry. I mean the content of $page.

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

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.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#7

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?
Reply
#8

Why are you trying to echo the page?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#9

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

Use die("".$page);
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply




Users browsing this thread: 2 Guest(s)