hi,

i installed biblio on a multi-site shared database drupal install.
like i did for other modules, i added this to $db_prefix = array :
'biblio' => 'shared_',
'biblio_author_index' => 'shared_',
'biblio_fields' => 'shared_',
'biblio_has_author' => 'shared_',
'biblio_types' => 'shared_',
'biblio_type_details' => 'shared_',
in every site i wanted to use the biblio module.
i then added a couple of article to find out i cant see the article i added from other sites.
for exemple i added an article to biblio.ptuniverse.net
then wanted to add a block to blogs.ptuniverse.net but there is no data.
am i missing a database???
thanks!
pht3k

Comments

physiotek’s picture

i added a biblio node from blogs.ptuniverse.net.
now i have a block but only with the node i added from this subdomain.
when i look at the database i can see biblio nodes from both subdomains
so i suppose the module is not looking at every nodes added to the biblio database but instead look prior to the general website node database to findout biblio nodes and then go to the biblio database to extract the info.
is that right?
if it is, then is there a way to bypass this behavior to extract all the biblio nodes whatever the subdomain it was added from??
thanks,
pht3k

physiotek’s picture

ok i did it by changing the biblio_block function...

function biblio_block($op = 'list', $delta = 0) {
  if (user_access('access content')) {
    if ($op == 'list') {
      $blocks[0]['info'] = t('Most recent publications');
      return $blocks;
    } else if ($op == 'view') {
      // Retrieve the latest pubs
      $num_in_block = variable_get('biblio_rowsperblock', 4);
      $block_order  = variable_get('biblio_block_order', 'n.created'); 
         $result=mysql_query("SELECT nid FROM shared_biblio");
         $nb = mysql_numrows($result);
         if (db_num_rows($result)) {
            $j=0;
            $block['subject'] = t(variable_get('biblio_block_title', 'New Publications'));
            $block['content'] .= '<div class="item-list"><ul>';
            while ($j<$nb)
                  {
                  $nid = mysql_result($result,$j,"nid");
                      $result2=mysql_query("SELECT title FROM biblio_node WHERE nid='$nid'");
                      $nb2 = mysql_numrows($result2);
                      $k=0;
                      while ($k<$nb2)
                            {$title = mysql_result($result2,$k,"title");
                            $k++;}
                  $block['content'] .= '<li><a href="http://biblio.ptuniverse.net/node/'.$nid.'">'.$title.'</a></li>';
                  $j++;
                  }
            $block['content'] .= '</ul>';
            $block['content'] .= '</div>';
            }
         return $block;
    }
  }
}

maybe not the most secure code in town but it works...
my php knowledge is limited to the newbie knowledge...
i must add the biblio via the biblio.ptuniverse.net subdomain tho
but it works. i am pretty happy
any comments?
now what i have to do is make the works from the other subdomain so it can be usefull to make it available from other subdomains...

physiotek’s picture

just added ORDER BY nid DESC... so biblio_block function is:

function biblio_block($op = 'list', $delta = 0) {
  if (user_access('access content')) {
    if ($op == 'list') {
      $blocks[0]['info'] = t('Most recent publications');
      return $blocks;
    } else if ($op == 'view') {
      // Retrieve the latest pubs
      $num_in_block = variable_get('biblio_rowsperblock', 4);
      $block_order  = variable_get('biblio_block_order', 'n.created');
         $result=mysql_query("SELECT nid FROM shared_biblio ORDER BY nid DESC");
         $nb = mysql_numrows($result);
         if (db_num_rows($result)) {
            $j=0;
            $block['subject'] = t(variable_get('biblio_block_title', 'New Publications'));
            $block['content'] .= '<div class="item-list"><ul>';
            while ($j<$nb)
                  {
                  $nid = mysql_result($result,$j,"nid");
                      $result2=mysql_query("SELECT title FROM biblio_node WHERE nid='$nid'");
                      $nb2 = mysql_numrows($result2);
                      $k=0;
                      while ($k<$nb2)
                            {$title = mysql_result($result2,$k,"title");
                            $k++;}
                  $block['content'] .= '<li><a href="http://biblio.ptuniverse.net/node/'.$nid.'">'.$title.'</a></li>';
                  $j++;
                  }
            $block['content'] .= '</ul>';
            $block['content'] .= '</div>';
            }
         return $block;
    }
  }
}
physiotek’s picture

I have an other problem...

now my biblio module is working great from my multiple sites:
blogs.ptuniverse.net
biblio.ptuniverse.net
etc

i can add a recent bibliography block from any of the subsites and it works great.

but...

let's say i am connected to blogs.ptuniverse.net and i post a blog entry and use the footnote module to call a reference from the biblio module...
the reference will not be the actual called reference but the node with the same id as the one on the biblio subsite.

i suppose i would have to used shared nodes to work.

so i tried domain access module: not ok for what i want to acheive.
crossite module gave me errors
and i tried a fresh drupal install with the node table shared but it didnt work.

i havn't found much info about shared node table in a mutisite install.

any suggestions?
any workaround?
thanks.

Liam Morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.