Be the first to know about special offers and new products for web developers and Internet business owners.
I will never share your email address with the bad boys. Period.
|
Be the first to know about special offers and new products for web developers and Internet business owners. I will never share your email address with the bad boys. Period.
The latest
|
Some code for nodeapi overridingSubmitted by alexis on Tue, 2007-06-26 14:51.
These are a few ideas of my code. In mymodule.module: function _mymodule_implode_date($date, $hour, $minute, $ampm) { function mymodule_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { switch ($op) { In mymodule.install: function mymodule_install() { This is how the event_nodeapi_overriders should be created from event.install, or any other part in your code if you're using this method for other modules: db_query("CREATE TABLE {event_nodeapi_overriders} ( And the original module you want to override should use something like this, in my example the functions modified are event_admin_overview_settings and event_nodeapi. These are some of the select boxes for the settings page: $form['event_nodeapi_overriders'] = array( $form['event_nodeapi_overriders']['event_nodeapi_delete'] = array( $form['event_nodeapi_overriders']['event_nodeapi_deleterevision'] = array( $form['event_nodeapi_overriders']['event_nodeapi_insert'] = array( $form['event_nodeapi_overriders']['event_nodeapi_load'] = array( This is a helper function: function _event_nodeapi_overriders($op) { And finally code like this in event_nodeapi: function event_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { This is not code to be copied and pasted, it requires some more thought but you may get the idea from it. Alexis Bellido »
Reply |
Want to launch a online store, need a new look for your website, market your services on the Net or build a virtual community? Not a problem, let's talk about it. Where To Host Your Sites? |
Recent comments
5 days 17 hours ago
6 days 12 hours ago
6 days 20 hours ago
1 week 19 hours ago
1 week 1 day ago
2 weeks 5 days ago
3 weeks 5 days ago
3 weeks 6 days ago
4 weeks 5 days ago
5 weeks 4 days ago