Fork me on GitHub

put the block in pnblocks, right?  Bottom

  • Hello, me again lol... may we should change this to category to "Support for Lobos" LOL

    OK I what do you have to do to make a block show up in the block admin? I have copied an exisitng block from another module and put it in the pnblocks folder of my module and what ever I do the damn thing does not show up in the drop down list for blocks admin....

    here is the code of the file I have called latest.php which is in the pnblocks folder...



    now I have taken this code from the quotes module and have not changed much more than the function names, but the damn thing should show up in the blocks admin, shouldn't it?

    Thanks and regards

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • heya Lobos.. change the name of the file to bookmarker_bmblock.php and then give it a go..

    -IR
  • Thanks, but nope still no go... I tell ya this process seems to me unduly complicated, what the freakin hell is stopping the block showing up like it would in any other module? ... I am thinking just to add the block into the includes folder and be done with it LOL

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • ..something should be showing up in your servers error log.. might want to add error displays for those queries as well.. they'll help you to debug the probs.. it's not easy, but error logging is your friend :) ..takes a lot of error out of "trial and error"..

    -IR
  • If the function name is bookmarker_bmblock_display() the file name should be bm.php IMHO.

    --
    "He is not dangerous, he just wants to play...."
  • Landseer

    If the function name is bookmarker_bmblock_display() the file name should be bm.php IMHO.


    Thank you :) This is the solution and I am a happy man - amazing how such little things can make your day....

    Thanks for your time as well IR :)

    REgards

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Actually if this is the case it must mean that the function names are dynamic - so it is possible to have dynamic function names?, like this?

    $bookmarker_bmblock_display()

    well that doesn't seem right, but is it possible to assign variables to function names?

    Regards

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • haha.. that will just have to be one of the many posts I look back on and wonder "wtf was I thinking?" ..

    ..thanks for the correction Frank.. & i'm glad it worked out for you Lobos

    ..got work to do.. see ya!
  • Lobos

    Actually if this is the case it must mean that the function names are dynamic - so it is possible to have dynamic function names?


    Not sure if I understand you right, but you can name the functions in a block as you want as long as you declare them correctly:

    Code

    /**
     * info
     *
     */

    function pnForum_centerblock_info()
    {
        return array( 'func_display' => 'pnForum_centerblock_display',
                      'text_type' => 'pnForum_centerblock',
                      'text_type_long' => 'pnForum Centerblock',
                      'allow_multiple' => true,
                      'form_content' => false,
                      'form_refresh' => false,
                      'show_preview' => true);
    }


    This is an except from the center.php block of pnForum 2.0.0. If you rename the display function to bookmarker_bmblock_showmeallthestuffwehave() you have to adjust the array too.

    Generally the blocks functions are build like

    <modulename>_<blockname>block_<functionname>

    Frank

    --
    "He is not dangerous, he just wants to play...."</functionname></blockname></modulename>
  • ..i suppose a function name could be made dynamic by calling an API function, but it wouldn't change the content without conditionals (if/else)..etc. not sure what the implications might be or even how useful it would be.. but i suppose it's possible anyway.

    -IR

    PS: completely missed that question.. hahaha.. sometimes it's necessary to cover one eye to stop the room from spinning. icon_lol

This list is based on users active over the last 60 minutes.