Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HubertZ

Pioneers
  • Posts

    1
  • Joined

  • Last visited

Everything posted by HubertZ

  1. hi, i'm using a fresh installed v2.3.4 Now i want to add some text (under the navbar) through a module (editable via admin) This is what i tried: <?php // includes/modules/content/foo/foo.php class foo { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function foo() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_FOO_TITLE; $this->description = MODULE_FOO_DESCRIPTION; if ( defined('MODULE_FOO_STATUS') ) { $this->sort_order = MODULE_FOO_SORT_ORDER; $this->enabled = (MODULE_FOO_STATUS == 'True'); } } function prepare() { global $oscTemplate; /* whats this for */ } function build() { global $oscTemplate; $output = 'where am i built: '. MODULE_FOO_TEXT; $oscTemplate->addContent($output, $this->group); } function execute() { global $oscTemplate; $output = 'where am i executed: '. MODULE_FOO_TEXT; $oscTemplate->addBlock($output, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_FOO_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('foo Module', 'MODULE_FOO_STATUS', 'True', 'Enable foo?', '6', '', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_FOO_SORT_ORDER', '1500', 'Sort order halt.', '6', '', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Text', 'MODULE_FOO_TEXT', 'buy this it\'s good', 'Enter text', '6', '8', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_FOO_STATUS', 'MODULE_FOO_SORT_ORDER', 'MODULE_FOO_TEXT'); } } ?> then <?php // includes/languages/english/modules/content/foo/foo.php define('MODULE_FOO_TITLE', 'foo title'); define('MODULE_FOO_DESCRIPTION', 'foo descr'); ?> I can enable/disable this as admin in 'content, foo' edit and save text, but i don't see the text nowhere in the index.php page (source) when i reload it afterwards. What am i missing? I 'stole' that code from some example modules i downloaded, as i didn't find any docs on this topic... ciao, HubertZ
×
×
  • Create New...