The website is for sale. Check here for more information.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.
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="" 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="" onclick="startGateway(\'NTUxMTU3\');" />'
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.

  • View a Printable Version

Users browsing this thread: 1 Guest(s)

About MyBB-Plugins

Plug Yourself into the best MyBB AddOn.

Copyright © 2009-2021 MyBB-Plugins Forums.


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

Impressed? For sure
Check Full Stats here