Block not showing problem

  • Ankhaa

    Ankhaa - 2008-12-03

    Hi, everybody!
    I'm new in XoopsCube, i trying to build block in my module using []  tutorial, but my block is not showing :( i would be very appreciate if someone even read my post.

    my xoops_version.php

    $modversion['name'] = 'MyModule';
    $modversion['dirname'] = basename(dirname(__FILE__));

    $modversion['hasMain'] = 1;

    $modversion['templates'][0]['file'] = 'mymod_index.html';

    $modversion['hasAdmin'] = 1;

    $modversion['sub'][0]['name'] = '2page';
    $modversion['sub'][0]['url'] = 'index.php?page=1';

    $modversion['blocks'][0]['name'] = 'Myblock';
    $modversion['blocks'][0]['file'] = 'myblock.php';
    $modversion['blocks'][0]['class'] = 'myblock';
    $modversion['blocks'][0]['template'] = 'myblocktemp.html';
    $modversion['blocks'][0]['func_num'] = 1;
    $modversion['blocks'][0]['visible'] = '1';
    $modversion['blocks'][0]['description'] = '';
    $modversion['blocks'][0]['show_func'] = '';


    my xoops/modules/mymod/blocks/myblock.php

    class myblock extends Legacy_BlockProcedure
        function myblock(&$block)
        function execute()
            $render =& $this->getRenderTarget();
            $render->setAttribute('blockdata', 'myblock');
            $root =& XCube_Root::getSingleton();
            $renderSystem =& $root->getRenderSystem($this->getRenderSystemName());




    that's all, is there any mistake?
    thanks for reading.

    • Ankhaa

      Ankhaa - 2008-12-03

      By the way i'm running Xoopscube on Japanese language, is there any need to define name of the block in modinfo.php of languages?

    • mumin

      mumin - 2008-12-04

      Hi, ankhaa.
      Legacy module search and create '{Dirname}_{class}' instance.
      Maybe change block class name from 'myblock' to 'Mymod_myblock'.

      see : /modules/legacy/class/Legacy_Utils.class.php L99-140

    • Ankhaa

      Ankhaa - 2008-12-04

      Thanks Mumin very much, that's solved my problem :)
      When i changed class name to Mymod_myblock it displayed well.
      Thanks again.

      BTW one more begiiner question:
      Where can i set configuration to allow php scripts in a xoopscube template? (my module uses smarty template)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks