Hello,

I was wondering how I can add twitter_pull_render ($twitkey, $title = NULL, $num_items = NULL, $themekey = NULL) without use PHP filter on a block?
I have tried to add a custom block on template.php

/**
 * Implementation of hook_block_list().
 */
function twitter_pull_block_info() {
  $blocks = array();

  $blocks['twitter_pull_default'] = array(
    'info' => t('Twitter stream'),
    'weight' => 0,
    'status' => 0,
    'cache' => DRUPAL_CACHE_GLOBAL,
  );

  return $blocks;
}


/**
 * Implementation of hook_block_view().
 */
function twitter_pull_block_view($delta = '') {
  $block = array();

  switch ($delta) {
    case 'twitter_pull_default':
      $block = array(
        'subject' => t('Twitter stream'),
        'content' => twitter_pull_render('@ openpublish', 'OpenPublish', 6),
      );
      break;
  }

  return $block;
}

But no luck, so if someone have a great code I can put in template.php to create a block for Twitter. Because I like the way Facebook Pull has since they have a own 'Facebook Pull'-block.

I appreciate for help.

Comments

truls1502 created an issue. See original summary.

joachim’s picture

Status: Active » Fixed

> I have tried to add a custom block on template.php

Your block code needs to go in a module, not in your theme.

Alternatively, use the plugin for Boxes module.

truls1502’s picture

Thank you @joachim, problem if I add this on module and later update to newer version, then the code will be removed. Therefore I wish to add the code in my theme. Do you have any idea without need to download more module? I want to minimize number of modules due of performance.

truls1502’s picture

Status: Fixed » Active
joachim’s picture

Status: Active » Fixed

> problem if I add this on module and later update to newer version, then the code will be removed. Therefore I wish to add the code in my theme.

No, you add this in a custom module of your own, not into a contrib module.

truls1502’s picture

Do you have a link about how to make a custom module? And how to combine a new custom module to an already existing module?

joachim’s picture

You should be able to find plenty of documentation and tutorials on that, and there are other sources of help such as IRC.
I'm afraid my free time is pretty limited, so I can't spend that long on support requests.

Good luck!

truls1502’s picture

Status: Fixed » Closed (fixed)

Thank you anyway! :)