1
pablo103
Yogurt, LAST TRIBES block
  • 2009/7/8 19:11

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


I am trying hard to make a new block for yogurt displaying recently created groups based on Last pictures block.

So far I have done:
yogurt/xoops_version.php
added before ?>

$modversion['blocks'][3]['file'] = "blocks.php";
$modversion['blocks'][3]['name'] = _MI_TRIBES_LAST;
$modversion['blocks'][3]['description'] = _MI_TRIBES_LAST_DESC;
$modversion['blocks'][3]['show_func'] = "b_yogurt_tribes_show";
$modversion['blocks'][3]['options'] = "5";
$modversion['blocks'][3]['template'] = 'yogurt_block_lasttribes.html';


Then i created a file
yogurt/block/templates/yogurt_block_lasttribes.html
and writed this inside:

<{section name=j loop=$tribes}>
        <
div style="width:80%; text-align: center; page-break-after: always; margin: auto; page-break-before: always;">
            <
a href="{$xoops_url}>/modules/yogurt/tribes.php?tribe_id=<{$tribes[j].id}>"><img src="<{$xoops_upload_url}>/<{$tribes[j].img}>" alt="<{$tribes[j].title}>" title="<{$tribes[j].title}>" />a>
            
        div>
    <{/
section}>


and in the file
yogurt/blocks.php

I tried to create function function b_yogurt_lasttribes_show but it looks there is something wrong with this:


function b_yogurt_lasttribes_show($options) {
   global 
$xoopsDB$xoopsModule$xoopsModuleConfig;
   
$myts =& MyTextSanitizer::getInstance();
   
$block = array(); 



/**
 * Filter for fetch votes ishot and isnothot
 */


$criteria = new criteria('tribe_id',0,">");
$criteria->setSort("tribe_id");
$criteria->setOrder("DESC");
$criteria->setLimit($options[0]);

/**
 * Creating factories of tribes and votes
 */  
//$album_factory      = new Xoopsyogurt_imagesHandler($xoopsDB);
$tribes_factory      = new Xoopsyogurt_tribesHandler($xoopsDB);

$block $tribes_factory->getLastTribesForBlock($options[0]);

return 
$block;
}


Anyone could test it and finish this job? This is what I can do by myself to contribute but the rest is in your hands.

best

2
ghia
Re: Yogurt, LAST TRIBES block
  • 2009/7/8 22:22

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I think somewhere you have to use the $criteria in connection with a function where the data is retrieved from the database.
Does the Xoopsyogurt_tribesHandler and getLastTribesForBlock function exists or must you provide code for that?
Did you see any messages in debug?

3
pablo103
Re: Yogurt, LAST TRIBES block
  • 2009/7/16 0:29

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


I am more like copy and paste so i am not a programer. Can you help? I think a lot of people would be happy. Additionaly i would like a hack/module to see the last activities of the users, smth. like facebook...

4
pablo103
Re: Yogurt, LAST TRIBES block
  • 2009/7/18 23:23

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


Yes If you refer to yogurt_controler.php it seems they exist.
But I cant see any block in the block list of admin so cant even check whether I have some errors. I just dont know how to make it everything works toogether... To many elements, templates, blocks, smary, it s a mess...

5
pablo103
Re: Yogurt, LAST TRIBES block
  • 2009/10/17 17:48

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


PLease help

6
ghia
Re: Yogurt, LAST TRIBES block
  • 2009/10/18 0:45

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Try with
$block $tribes_factory->getTribes($criteria);

Login

Who's Online

376 user(s) are online (295 user(s) are browsing Support Forums)


Members: 0


Guests: 376


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits