Drupal Module Tutorial-ban leírt dolog nem müködik
Sziasztok
A modul készítés rejtelmeibe szeretnék bele mélyedni. Elkezdtem olvasni és lépésről lépésre csinálni az itt leírtakat. ( http://drupal.org/node/17914 )
Szép és jó amit leírnak. Kezdésnek pont elég, bár már látom hogy én sokkal több mindent szeretnék megtudni.
A lényeg hogy ezen az oldalon bemutatott dolog nem működik. http://drupal.org/node/22797
A baj az hogy mikor a modulhoz tartozó blokk beállítási oldalára megyek akkor nem jelenik meg az a szövegmező, hanem csak ez a szöveg:
Array
PHP akkor csinál ilyet amikor tömböt akar string-re konvertálni.
Drupal verzión4.6Majd lesznek még további kérdéseim is. :)
Türelmesen várom a gyors válaszokat ;-D
Köszönöm
Sweetchack.
■ A modul készítés rejtelmeibe szeretnék bele mélyedni. Elkezdtem olvasni és lépésről lépésre csinálni az itt leírtakat. ( http://drupal.org/node/17914 )
Szép és jó amit leírnak. Kezdésnek pont elég, bár már látom hogy én sokkal több mindent szeretnék megtudni.
A lényeg hogy ezen az oldalon bemutatott dolog nem működik. http://drupal.org/node/22797
A baj az hogy mikor a modulhoz tartozó blokk beállítási oldalára megyek akkor nem jelenik meg az a szövegmező, hanem csak ez a szöveg:
Array
PHP akkor csinál ilyet amikor tömböt akar string-re konvertálni.
Drupal verzión4.6
- <?php
- function kaListasUser_help($section='') {
- $output = '';
- switch ($section) {
- case "admin/modules#description":
- $output = t("HELP KIMENET Displays links to nodes created on this date");
- break;
- }
- return $output;
- }//function kaListasUser_help *************************************************
- function kaListasUser_perm() {
- return array('access content');
- }//function kaListasUser_perm() ***********************************************
- function kaListasUser_block($op='list', $delta=0) {
- // listing of blocks, such as on the admin/block page
- if ($op == "list") {
- $block[0]["info"] = t('ka Listás User blokk');
- return $block;
- }else{
- // our block content
- // content variable that will be returned for display
- $block_content = '';
- // Get today's date
- $today = getdate();
- // calculate midnight one week ago
- $start_time = mktime(0, 0, 0,$today['mon'],
- ($today['mday'] - 7), $today['year']);
- // we want items that occur only on the day in question, so
- //calculate 1 day
- $end_time = $start_time + 86400;
- // 60 * 60 * 24 = 86400 seconds in a day
- $limitnum = variable_get("kaListasUser_maxdisp", 3);
- $query = "SELECT nid, title, created FROM " .
- "{node} WHERE created >= '" . $start_time .
- "' AND created <= '". $end_time . "' LIMIT " . $limitnum;
- // get the links
- $queryResult = db_query($query);
- while ($links = db_fetch_object($queryResult)) {
- $block_content.= '<a href="/'.url('node/'.$links->nid).'">'.$links->title.'</a><br />';
- }
- // check to see if there was any content before setting up the block
- if ($block_content == '') {
- // no content from a week ago, return nothing.
- //return;
- $block_content='Nincsen NODE';
- }
- // set up the block
- $block['subject'] = 'kaListásUser Blokkja';
- $block['content'] = $block_content;
- return $block;
- }
- }//function kaListasUser_block() **********************************************
- function kaListasUser_settings() {
- // only administrators can access this module
- die('bent a settingsben');
- if (!user_access("admin kaListasUser")) {
- return message_access();
- }
- $output .= form_textfield(
- t("Maximum number of links"),
- "kaListasUser_maxdisp",
- variable_get("kaListasUser_maxdisp", "3"),
- 2,
- 2,
- t("The maximum number of links to display in the block.")
- );
- return $output;
- }
- ?>
Türelmesen várom a gyors válaszokat ;-D
Köszönöm
Sweetchack.
drupal.hu
De igen.
Amúgy köszi.