Purchase Credits 2.0.1 released and NewPoints 2.1.2 released .
Add javascript code to php
I want to edit the newpoint menu, but instead of adding a normal link to a page I want to add a javascript code that open a widget. Here is the edit I've done
PHP Code:
$menu[0] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php">'.$lang->newpoints_home.'</a>';
if (
$mybb->settings['newpoints_main_statsvisible'] == 1)
$menu[1] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=stats">'.$lang->newpoints_statistics.'</a>';
if (
$mybb->settings['newpoints_main_donationsenabled'] == 1)
$menu[2] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=donate">'.$lang->newpoints_donate.'</a>';
$menu[3] = '<img src="http://yourdomain.com/image.gif" onclick="startGateway('NTUxMTU3');" />'

It seem javascript doesn't work on php pages, any solution?
That's simply the code that is being output to the screen. If the javascript is correct, it will work properly. The last line of code should be:
PHP Code:
$menu[3] = '<img src="http://yourdomain.com/image.gif" onclick="startGateway(\'NTUxMTU3\');" />'
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.

Users browsing this thread: 1 Guest(s)

About MyBB-Plugins

Plug Yourself into the best MyBB AddOn.

Copyright © 2009-2020 MyBB-Plugins Forums.


  • 51,000+ Posts
  • 19,000+ Members
  • 3,600+ Threads

Impressed? For sure
Check Full Stats here