Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16

Discussione: Joomla e forum phpbb

  1. #1

    Joomla e forum phpbb

    Sul mio sito Joomla ho deciso di mettere un forum, ho utilizzato un phpbb3. ho fatto tutto e funziona.

    Ora voglio sincronizzare il forum con joomla utilizzando il componente rokbridge, faccio tuto istallo il componente e mi siconosce dopo il settaggio le patch. Però quando vado ad istallare la patch del bridge mi compare il seguente errore:

    Fatal error: Call to undefined method JException::setQuery() in /home/mhd-01/www.xxxxxxx.org/htdocs/administrator/components/com_rokbridge/admin.rokbridge.php on line 653

    la linea 653: $forum_db->setQuery($sql)


    come faccio a risolvere questo incoveniente??

    Grazie

  2. #2
    Utente di HTML.it L'avatar di neroux
    Registrato dal
    Aug 2009
    Messaggi
    1,973
    Da dove prendi $forum_db? Sembra che non ti venga dato l'oggetto che aspetti ma una exception.

    www.sitemeer.com » Quando un sito pare irraggiungibile

    Se ti piace ci puoi trovare anche su Facebook

  3. #3
    il database del forum e lo stesso del sito, un db mysql.

    ti posto la parte finale della pagina:
    Codice PHP:
    ..........$mainframe->enqueueMessage(sprintf(JText::_('BRIDGE_NOT_VALID'),$folder),"error");      } }  function movebridge() {     global $mainframe;          $params =& getRokBridgeParams();     $bridge_path = $params->get('bridge_path','forum');          jimport( 'joomla.filesystem.folder' );     jimport( 'joomla.filesystem.file' );          if (JFolder::exists( JPATH_SITE.DS.$bridge_path )) {         //folder exists, is it the bridge?         if ( JFile::exists( JPATH_SITE.DS.$bridge_path.DS."includes".DS."hooks.php")) {             $mainframe->enqueueMessage(JText::_('BRIDGE_ALREADY_INSTALLED'),"error");         }          return;     }               $src = JPATH_ADMINISTRATOR.DS."components".DS."com_rokbridge".DS."forum";     $dest = JPATH_SITE.DS.$bridge_path;               if (!JFolder::exists($dest)) {         if (!JFolder::create($dest)) {             $mainframe->enqueueMessage(JText::_('ERROR_CREATING_DIR').": ".$dest,"error");              return;         }             }           if (!JFolder::copy($src,$dest,null,true)) {         $mainframe->enqueueMessage(JText::_('BRIDGE_INSTALL_ERROR'),"error");          return;     }               $mainframe->enqueueMessage(JText::_('BRIDGE_INSTALL_SUCCESS'));            }  function installphpbb3plg() {     global $mainframe;          $params =& getRokBridgeParams();     $phpbb3_path = $params->get('phpbb3_path','distribution');          $src    = JPATH_ADMINISTRATOR.DS."components".DS."com_rokbridge".DS."phpbb".DS."includes".DS."auth".DS."auth_joomla.php";     $dest   = JPATH_SITE.DS.$phpbb3_path.DS."includes".DS."auth";              jimport( 'joomla.filesystem.file' );          if (!JFile::copy($src,$dest.DS."auth_joomla.php")) {        $mainframe->enqueueMessage(sprintf(JText::_('CANNOT_WRITE'),$dest),"error");         return;     }          $mainframe->enqueueMessage(JText::_('PHPBB3_AUTHPLG_INSTALL_SUCCESS'));       }  function removephpbb3plg() {     global $mainframe;          $params =& getRokBridgeParams();     $phpbb3_path = $params->get('phpbb3_path','distribution');          jimport( 'joomla.filesystem.file' );      $file   = JPATH_SITE.DS.$phpbb3_path.DS."includes".DS."auth".DS."auth_joomla.php";      if (!JFile::delete($file)) {        $mainframe->enqueueMessage(JText::_('PHPBB3_AUTHPLG_REMOVE_ERROR'),"error");         return;     }          $mainframe->enqueueMessage(JText::_('PHPBB3_AUTHPLG_REMOVE_SUCCESS'));       }     function firstSave() {          // strip leading / if provided     $post['params']['bridge_path'] = 'forum';     $post['params']['phpbb3_path'] = 'distribution';     $post['params']['sef_enabled'] = 0;     $post['params']['sef_rewrite'] = 0;     $post['params']['force_remember'] = 0;     $post['params']['link_format'] = 'bridged';     $post['option'] = 'com_rokbridge';     JRequest::set($post,'post');      save(false); }   function save($verbose=true) {     global $mainframe;          $component = 'com_rokbridge';      $table =& JTable::getInstance('component');     if (!$table->loadByOption( $component ))     {         JError::raiseWarning( 500, 'Not a valid component' );         return false;     }          $post = JRequest::get( 'post' );          // strip leading / if provided     if (isset($post['params']['bridge_path'])) $post['params']['bridge_path'] = trim($post['params']['bridge_path'],"/");     if (isset($post['params']['phpbb3_path'])) $post['params']['phpbb3_path'] = trim($post['params']['phpbb3_path'],"/");          $post['option'] = $component;     $table->bind( $post );      // pre-save checks     if (!$table->check()) {         JError::raiseWarning( 500, $table->getError() );         return false;     }      // save the changes     if (!$table->store()) {         JError::raiseWarning( 500, $table->getError() );         return false;     }           //save out bridge configuration file to 'source' and bridge_path if possible     $params =& getRokBridgeParams();     jimport( 'joomla.filesystem.file' );     $bridge_path = $params->get('bridge_path','forum');     $phpbb3_path = $params->get('phpbb3_path','distribution');      $installed_config_file = JPATH_SITE.DS.$bridge_path.DS."configuration.php";     $installed_htaccess_file = JPATH_SITE.DS.$bridge_path.DS.".htaccess";     $src_config_file = JPATH_ADMINISTRATOR.DS."components".DS."com_rokbridge".DS."forum".DS."configuration.php";     $src_htaccess_file = JPATH_ADMINISTRATOR.DS."components".DS."com_rokbridge".DS."forum".DS.".htaccess";      $remember_login = $params->get('force_remember')==0?'false':'true';          $registry =& JFactory::getConfig();     $full_live_site = $live_site = $registry->getValue('live_site');     if ($live_site != '') {         $full_live_site = $live_site . "/".$bridge_path;     }          $bridge_config = "<?php  class JConfigForum  {     var \$phpbb_path '".$phpbb3_path."';     var \$sef '".$params->get('sef_enable')."';     var \$sef_rewrite '".$params->get('sef_rewrite')."';     var \$remember_login ".$remember_login.";     var \$live_site '" .$full_live_site ."'; } ?> ";      $htaccess = "RewriteEngine on RewriteBase ".str_replace('\\','/',JURI::Root(true).DS.$bridge_path.DS)."  # Standard phpBB3 files matching RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} \.php$ RewriteRule (.+)\.php$ index.php?rb_v=$1&%{QUERY_STRING} [L]";          if ($params->get('sef_rewrite',0) == 1) {         $htaccess .= " # RokBridge SEF rewrite RewriteCond %{REQUEST_FILENAME}                 !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+) index.php?$1&%{QUERY_STRING} [L]";     }      //if bridge installed and config file exists     if (JFolder::exists(JPATH_SITE.DS.$bridge_path)) {         JFile::write($installed_config_file, $bridge_config);     }     if (JFolder::exists(JPATH_SITE.DS.$bridge_path)) {         JFile::write($installed_htaccess_file, $htaccess);     }               //update src anyway     if (!JFile::write($src_config_file, $bridge_config)) {         $mainframe->enqueueMessage(JText::_('CONFIGURATION_WRITE_FAIL'),"error");      }     if (!JFile::write($src_htaccess_file, $htaccess)) {         $mainframe->enqueueMessage(JText::_('HTACCESS_WRITE_FAIL'),"error");      }      //$this->setRedirect( 'index.php?option=com_config', $msg );     if ($verbose) $mainframe->enqueueMessage(JText::_('CONFIGURATION_WRITE_SUCCESS')); }   function getRokBridgeParams($component="com_rokbridge")  {     static $instance;     if ($instance == null)     {         $table =& JTable::getInstance('component');         $table->loadByOption( $component );          // work out file path         $option    = preg_replace( '#\W#', '', $table->option );         $path    = JPATH_ADMINISTRATOR.DS.'components'.DS.$option.DS.'config.xml';         if (file_exists( $path )) {             $instance = new JParameter( $table->params, $path );         } else {             $instance = new JParameter( $table->params );         }     }     return $instance; }  function strstrbi($haystack, $needle, $before_needle=FALSE, $last_occurance=FALSE, $include_needle=TRUE) {     if($last_occurance) {         $pos=strrpos($haystack,$needle);     } else {         $pos=strpos($haystack,$needle);     }     if($pos===FALSE) return FALSE;     if($before_needle==$include_needle) $pos+=strlen($needle);     if($before_needle) return substr($haystack,0,$pos);     return substr($haystack,$pos); }  function versionCompare($ver1,$ver2) {     preg_match_all('/[\d]+/',$ver1,$matches);     $ver1_primary = $matches[0][0];     $ver1_secondary = $matches[0][1];     $ver1_tertiary = $matches[0][2];      preg_match_all('/[\d]+/',$ver2,$matches);     $ver2_primary = $matches[0][0];     $ver2_secondary = $matches[0][1];     $ver2_tertiary = $matches[0][2];              if ($ver1_primary < $ver2_primary) return 1;     else {         if ($ver1_secondary < $ver2_secondary) return 1;         else {             if ($ver1_tertiary < $ver2_tertiary) return 1;             elseif ($ver1_primary == $ver2_primary and                     $ver1_secondary == $ver2_secondary and                     $ver1_tertiary == $ver2_tertiary) return 0;             else return -1;         }     } }  function getAuthMethod() {      require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );     $rokbridge =& new RokBridgeHelper();     $forum_db =& $rokbridge->phpbb_db;      $sql = "SELECT * from #__config where config_name='auth_method'";      $forum_db->setQuery($sql);      $auth_method = $forum_db->loadObject();          return $auth_method->config_value;     }   function addIndexes() {     global $mainframe;     if (!checkForRokBridgeIndexes()) {         if (!addRokBridgeIndexes()){             $mainframe->enqueueMessage(JText::_('PHPBB3_ADDED_ROKBRIDGE_INDEXES_ERROR'));          }     }     $mainframe->enqueueMessage(JText::_('PHPBB3_ADDED_ROKBRIDGE_INDEXES_SUCCESS'));  }  function dropIndexes() {     global $mainframe;     if (checkForRokBridgeIndexes()) {         if (!dropRokBridgeIndexes()){             $mainframe->enqueueMessage(JText::_('PHPBB3_DROP_ROKBRIDGE_INDEXES_ERROR'));          }     }     $mainframe->enqueueMessage(JText::_('PHPBB3_DROP_ROKBRIDGE_INDEXES_SUCCESS'));  }  function checkForRokBridgeIndexes() {     $post_time_index_name = "rokbridge_post_time_r";      $post_time_index_exists = false;          require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );     $rokbridge =& new RokBridgeHelper();     $forum_db =& $rokbridge->phpbb_db;      $sql = "SHOW INDEXES from #__posts";     $forum_db->setQuery($sql);     $post_indexs = $forum_db->loadObjectList();     if ($post_indexs != null) {          foreach ($post_indexs as $index) {             if ($index->Key_name == $post_time_index_name){                 $post_time_index_exists = true;             }         }     }     return $post_time_index_exists; }  function addRokBridgeIndexes(){     $post_time_index_name = "rokbridge_post_time_r";      $ret = false;     require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );     $rokbridge =& new RokBridgeHelper();     $forum_db =& $rokbridge->phpbb_db;          $sql = "ALTER TABLE `#__posts` ADD INDEX `".$post_time_index_name."` (`post_time` DESC)";     $forum_db->setQuery($sql);     $ret = $forum_db->query();     if ($ret){         $ret = true;     }          return $ret; }  function dropRokBridgeIndexes(){     $post_time_index_name = "rokbridge_post_time_r";      $ret = false;     require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );     $rokbridge =& new RokBridgeHelper();     $forum_db =& $rokbridge->phpbb_db;      $sql = "ALTER TABLE ".$rokbridge->phpbb_db->nameQuote('#__posts')." DROP INDEX  ".$rokbridge->phpbb_db->nameQuote($post_time_index_name);     $forum_db->setQuery($sql);     $ret = $forum_db->query();     if ($ret){         $ret = true;     }          return $ret; }  function setAuthMethod($newauth) {          require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );     $rokbridge =& new RokBridgeHelper();     $forum_db =& $rokbridge->phpbb_db;      $sql = "SELECT * from #__config where config_name='auth_method'";      $forum_db->setQuery($sql);      $auth_method = $forum_db->loadObject();              $auth_method->config_value = $newauth;      if (!$forum_db->updateObject( '#__config', $auth_method, 'config_name' )) {         echo $forum_db->stderr();         return false;     }         return $newauth; }  $bits = new stdClass(); $bits->bridge_url = JURI::root().$bridge_path; $bits->patch_intalled = $patch_installed; $bits->patch_note = $patch_note; $bits->joomla_authplg_installed = $joomla_authplg_installed; $bits->joomla_userplg_installed = $joomla_userplg_installed; $bits->phpbb3plg_installed = $phpbb3plg_installed; $bits->phpbb3plg_note = $phpbb3plg_note; $bits->phpbb3_installed = $phpbb3_installed; $bits->bridge_installed = $bridge_installed; $bits->bridge_note = $bridge_note; $bits->bridge_url = $bridge_url; $bits->current_bridge_path = $bridge_path; $bits->bridge_install_enable = $bridge_install_enable; $bits->phpbb3_version = $phpbb3_version; $bits->patch_full = $patch_full; $bits->indexes_installed=$indexes_installed; $bits->indexes_note = $indexes_note;  displayRokBridgeConfig($params, $bits);  ?>

    scusa ma non sono un genio nel linguaggio php, credo si sia capito.

  4. #4
    Utente di HTML.it L'avatar di neroux
    Registrato dal
    Aug 2009
    Messaggi
    1,973
    No, scusa, parlavo della variabile $forum_db, per qualche motivo è del tipo JException (sarà stata lanciata una prima) ma il codice si aspetta un altro tipo che contiene il metodo setQuery().

    www.sitemeer.com » Quando un sito pare irraggiungibile

    Se ti piace ci puoi trovare anche su Facebook

  5. #5
    Originariamente inviato da neroux
    No, scusa, parlavo della variabile $forum_db, per qualche motivo è del tipo JException (sarà stata lanciata una prima) ma il codice si aspetta un altro tipo che contiene il metodo setQuery().
    Ci sono possibilità di inserire altri script che correggono questo errore?

  6. #6
    Utente di HTML.it L'avatar di neroux
    Registrato dal
    Aug 2009
    Messaggi
    1,973
    No, ho guardato che script sia e trovato http://www.rockettheme.com/extension...1006-rokbridge, giusto?

    Quindi il codice dovrebbe essere

    Codice PHP:
    function checkForRokBridgeIndexes() {
        
    $post_time_index_name "rokbridge_post_time_r"
        
    $post_time_index_exists false;
        
        require_once(
    JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );
        
    $rokbridge =& new RokBridgeHelper();
        
    $forum_db =& $rokbridge->phpbb_db;

        
    $sql "SHOW INDEXES from #__posts";
        
    $forum_db->setQuery($sql); // linea 653
        
    $post_indexs $forum_db->loadObjectList();
        if (
    $post_indexs != null) { 
            foreach (
    $post_indexs as $index) {
                if (
    $index->Key_name == $post_time_index_name){
                    
    $post_time_index_exists true;
                }
            }
        }
        return 
    $post_time_index_exists;

    sembra che $forum_db viene presa da RokBridgeHelper()->phpbb_db, purtroppo non lo conosco, così è un pò difficile dire qualcosa senza analizzare tutto il code.
    Penso che ti possono aiutare meglio su http://www.rockettheme.com/forum, perché lì lo dovrebbero conoscere.

    L'unica cosa che mi venga in mente e che avevo trovato velocemente su Google era qualcosa con la configurazione. Sei sicuro che è tutta giusta?

    www.sitemeer.com » Quando un sito pare irraggiungibile

    Se ti piace ci puoi trovare anche su Facebook

  7. #7
    Originariamente inviato da neroux
    No, ho guardato che script sia e trovato http://www.rockettheme.com/extension...1006-rokbridge, giusto?

    Quindi il codice dovrebbe essere

    Codice PHP:
    function checkForRokBridgeIndexes() {
        
    $post_time_index_name "rokbridge_post_time_r"
        
    $post_time_index_exists false;
        
        require_once(
    JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rokbridge'.DS.'helper.php' );
        
    $rokbridge =& new RokBridgeHelper();
        
    $forum_db =& $rokbridge->phpbb_db;

        
    $sql "SHOW INDEXES from #__posts";
        
    $forum_db->setQuery($sql); // linea 653
        
    $post_indexs $forum_db->loadObjectList();
        if (
    $post_indexs != null) { 
            foreach (
    $post_indexs as $index) {
                if (
    $index->Key_name == $post_time_index_name){
                    
    $post_time_index_exists true;
                }
            }
        }
        return 
    $post_time_index_exists;

    sembra che $forum_db viene presa da RokBridgeHelper()->phpbb_db, purtroppo non lo conosco, così è un pò difficile dire qualcosa senza analizzare tutto il code.
    Penso che ti possono aiutare meglio su http://www.rockettheme.com/forum, perché lì lo dovrebbero conoscere.

    L'unica cosa che mi venga in mente e che avevo trovato velocemente su Google era qualcosa con la configurazione. Sei sicuro che è tutta giusta?

    Queello che hai postato è giusto, è un estenzione di rocketthem. Ho chieso sul forum ma l'unic apersona che mi ha risposto non ha saputo risolvere il problema, anzi mi ha scritto che devo fare tutto a mano e non tramite l'istaller di joomla.

    Per la configurazione h seguito la guida del sito fornitore, per sicurezza mi ricontrollo i settaggi sia del forum che di joomla.

    Bhe se ti vengono altre idee in merito, son bene accette visto che ho necessità di far funzionare questo ponte e ti ringrazio per la tua dispnibilità.

  8. #8
    Utente di HTML.it L'avatar di neroux
    Registrato dal
    Aug 2009
    Messaggi
    1,973
    L'unica idea sarebbe di controllare le impostazioni del database.
    RokBridgeHelper()->phpbb_db sembra di essere preso da JDatabase::getInstance() che deva dare una connessione.

    www.sitemeer.com » Quando un sito pare irraggiungibile

    Se ti piace ci puoi trovare anche su Facebook

  9. #9
    Moderatore di PHP L'avatar di Alhazred
    Registrato dal
    Oct 2003
    Messaggi
    12,505
    Se invece di ammattirti usi un altro bridge? Tipo JFusion?

  10. #10
    Originariamente inviato da Alhazred
    Se invece di ammattirti usi un altro bridge? Tipo JFusion?
    Ho provato anche questo, molto più complesso da settare ed i risultati sono stati gli stessi.


    Non vorrei che fosse un incompatibilità con il modulo login di Jomsocial, o quello di k2 ( i due funzionano bene ed anche quello di joomla).

    Altro dubbio potrebbe essere una cattiva configurazione del forum, ma dai controlli effettuati non sembra.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.