Sunday, November 10, 2013

[How to] Install PhpBB in Drupal

In this module, I'll explain how to Integrate PhpBB in Drupal. I checked a lot over Internet and the results seems to confusing than problem solving. Somehow, I found the solution by reading documentations (Read me files) at PhpBB website and Drupal website.


PREREQUISITE : The module requires php5 to run.
  1. Back up your Drupal and Phpbb3 folders.
  2. Install PhpBB by following instructions from this post. While copying the decompressed files, copy them to the Drupal folder.
  3. In order to integrate, we need to use phpbbdrupalbridge module in PhpBB3 and Phpbbforum module in Drupal. By using these two, we can create a link between them.
  4. First lets go with bridge. Download the phpbbdrupalbridge-3.0.10.zip MOD from http://phpbb.drupalbridge.org/download
  5. Unpack the phpbbdrupalbridge-3.0.10.zip archive directory.
  6. Open root folder in the phpdrupalbridge directory.
  7. Copy the contents in folders includes/ & styles/ to /phpBB3/  folder.
    Example 1 : phpdrupalbridge-3.0.10/root/includes/phpdrupalbridge/phpbb_api.php to /phpBB3/includes/phpdrupalbridge/phpbb_api.php
    Example 2 : phpdrupalbridge-3.0.10/root/styles/prosilver-embed to /phpBB3/styles/prosilver-embed
  8. If any files are asking for overwriting, click yes and overwrite them.
  9. Copy ../root/images directory to Drupal images directory.
  10. Do not forget to add a line " Disallow: /images/ " (without quotes) to your robots.txt file (I'm not sure about this line. I didn't do this. If something goes wrong, perform this step and try)
  11. Goto PhpBB installed location in your browser
  12. Login using admin credentials
  13. Goto ACP (Administrative Control Panel) (Most probably Link is available at the bottom of your webpage)
  14. Go to General tab --> Server settings 

    (
     Note : These are Example settings. Let's say I hosted XYZ website in subfolder of abc.com. Even though I have xyz.com as my domain, I should point to base domain only in this case. That is the meaning of base url below )

    • Domain name : www.abc.com/xyz$base_url = 'www.abc.com/xyz';

      or
    • Domain name : abc.com/xyz$base_url = 'http://abc.com/xyz';

      Look for " 
      $base_url " in the file /sites/default/settings.php and change that to match the address to your drupal installation. You shouldn't put trailing slash. Drupal will add it for you dynamically.
    • Script path: /xyz/phpBB3
      If you have drupal and phpBB3 installed in subdirectory you must enter
      Script path: /subdirectory/phpBB3
      ( 
      NOTE : I have phpBB3 installed in subfolder of my drupal. Drupal is installed in abc/xyz folder. phpBB is installed in abc/xyz/phpBB3/
    • Force server URL settings: (*) Yes  () No.
  15. Go to General tab --> Cookie settings

    Cookie domain: .xyz.com
    Cookie name: [any random name of your choice]

    My Example.. Cookie name: phpbb3_1f2g9
    Cookie path: /

    ( Note: your domain name .example.com with leading dot. )
  16. Go to General tab --> User registration settings
    • Account activation: () Disable () None (*) By User[Email-verification] () By
    • AdminUsername length: 3 - 30
    • Password length: 6 - 30
  17. Go to General tab --> Security settings
    • Check IP against DNS Blackhole List: () Yes (*) No
    • This can be enabled if security attacks are increasing
    • Check e-mail domain for valid MX record: () Yes (*) No
    • If enabled, the e-mail domain provided on registration and profile changes is checked for a valid MX record.
  18. Go to General tab --> Load settings
      • Session length: 22100Sessions will expire after this time, in seconds. So, set this value according your needs.
    1. Go to ACP --> Styles tab 
        • prosilver-embed --> Install
              or/and
          • subsilver2-embed --> Install

            In the Install style make sure that the style is active. Do not make it default.
        1. Clear phpBB cache. To do this,

          Go to General tab -->  In the middle of the page (vertically) you can find, 
        2. By default, the phpbbdrupalbridge MOD installs phpbbdrupalbridge API files into the ../phpBB3/includes/phpbbdrupalbridge/ directory.
        3. Move it to the sites/all/modules/phpbbforum/includes/ directory.
          Example : Move /phpBB3/includes/phpbbdrupalbridge/phpbb_api.php to sites/all/modules/phpbbforum/includes/phpbbdrupalbridge/phpbb_api.php 
          ( Note : You should use only one copy of /phpbbdrupalbridge directory )
        4. Now we have to install to Phpbbforum module in Drupal. To do this, Download the phpBBforum module from http://drupal.org/project/phpbbforum
        5. Unpack the archive.
        6. Copy all the contents to sites/all/modules/phpbbforum/

          Example
          : Downloaded phpbbforum/css/phpbbforum.css to server sites/all/modules/phpbbforum/css/phpbbforum.css
        7. Remember that we didn't test our http://xyz.com/PhpBB3   after installing the bridge and module. We need to check now. To test how you will be authenticated, login to your phpBB forum as admin.
        8. Next step is to go back to Drupal admin dashboard. Login to Drupal site as admin
        9. Go to Modules tab.
        10. Enable the phpBBforum module.
        11. In order to run phpBB inside of drupal page correctly, clean URLs must be enabled.
        12. To do this, go to Dashboard >> Configuration >> Clean URLs --> Enable and save.
        13. Go to Dashboard >> Configuration >> phpBBforum settings.
        14. You can see the erroneous phpBBforum status. 
        15. Even if you fill correct settings here, it throws you an error.
        16. This is because of bug in bridge/module.
        17. So replace the ../phpbb3/includes/functions_user.php with this file.
        18. Now go to Dashboard >> Configuration >> phpBBforumsettings.
        19. To see the success message, fill the settings as below
          • phpBB forum root path : /home/ .. /public_html/ .. /phpBB3/
          • Path to phpBB api file  :  /home/../public_html/../sites/all/modules/phpbbforum/includes/phpbbdrupalbridge/
          • phpBB api file name : phpbb_api.php 

            ( Note : If you ignore trailing slashes or if you don't give full path here, Drupal won't read PhpBB database )
        20. If you didn't move the folders, as mentioned in steps 21 & 22 above, above gives you error again. 
        21. In the same page, scroll down for the section phpBB page settings. Fill the following.
          phpBB display way : In the Drupal page
        22. Scroll to Profile fields mapping section.
        23. You can see field names like field_gender  over there. These fields are nothing but attributes of a user in the website.
        24. These field names should match with the Drupal user registration form field names. By default, these fields doesn't exist in a Drupal fresh install. So we need to create them. To create fields, leave the webpage like that and open a new browser tab, go to Dashboard --> Configuration --> Account Settings --> Manage fields tab (On top right corner)
        25. Create fields that match with the name i.e same name as in previous phpBBforumsettings page.
          Example : field_gender
        26. After creating all those fields, save them
        27. Now come back to phpBBforumsettings tab make sure that you checked Drupal master for Select master registration system in phpBB/Drupal settings. If this is in phpBB master, users will get Access Denied error when users try to click on Create New Account in Drupal homepage. 
        28. Set other settings if you want and Save configuration.
        29. After above steps, the phpBBstatus field which showed error before, displaya success message.
        30. Navigate to Dashboard --> Structure --> Blocks
        31. Enable phpBBforum: Hidden authentication block.
        32. Configure its settings as below.
          Show block on specific pages :  * Show on every page except the listed pages.Pages:    " user/reset/* " Hit Enter
              " user/password " ( without quotes )
           
        33. If you want advanced synchronization, do not disable it in the future even. Enable the phpBBforum blocks you want to use (optional).
        34. Check whether the link http://xyz.com/phpbbforum  is working fine in your browser.
        35. If page phpbbforum is not found, Go to Dashboard >> Configuration >> Performance -->  Clear cached data
        36. To setup a link to phpbbforum page, go to Dashboard >> Structure >> Menus >> Navigation
        37. See Menu item with blank title in state (Disabled)
        38. You may enable it if you do want phpbbforum in Navigation menu too. Note that Menu link title is mandatory.

          ( Note : To remove this in future, you need to remove the page title )
        39. Go to Dashboard >> Structure >> Menus >> Add links -->  Enter Menu item as phpbbforum.
        40. The name that appears in URLs for PhpBB forums is phpbbforum
        41. To change this name you should add URL aliases. For URL aliasing, go to Dashboard --> Configuration --> URL Aliases     
        42. Let us say, we want to use the term 'forums' instead of phpbbforum in URLS.
        43. Click Add Alias. Add each alias as below.
          1.     phpbbforum -> forums
          2.     phpbbforum/index.php -> forums/index.php
          3.     phpbbforum/viewtopic.php -> forums/viewtopic.php
          4.     phpbbforum/viewforum.php -> forums/viewforum.php
          5.     phpbbforum/viewonline.php -> forums/viewonline.php
          6.     phpbbforum/memberlist.php -> forums/memberlist.php  
          7.     phpbbforum/posting.php -> forums/posting.php
          8.     phpbbforum/search.php -> forums/search.php
          9.     phpbbforum/ucp.php -> forums/ucp.php
          10.     phpbbforum/mcp.php -> forums/mcp.php
          11.     phpbbforum/faq.php -> forums/faq.php
          12.     phpbbforum/report.php -> forums/report.php
          13.     phpbbforum/adm/index.php -> forums/adm/index.php
        44. If existing path is : http://xyz.com/phpbbforum , it comes as http://xyz.com/forums( Note :  Use a relative path and don't add a trailing slash or the URL alias won't work. )
            
        45. To setup content submission to phpBB forum go to Dashboard --> Structure --> Content types   --> Add content type
        46. Give name as phpBBforum. 
        47. Go to phpbbforum submission settings ( left bottom of same page )
          Drupal to phpBB submission: (*) Enabled
          This requires Drupal to phpBB node submission : enabled in phpBB topic submission settings in phpBBforum settings in Dashboard --> Configuration
        48. Download my patch files from here
        49. Copy all those to your /PhpBB3 folder on server in. If asked, click yes to override
        50. You're done with integration. Have a coffee. :)

          NOTE : PhpBB forum links in menus and navigation appears only after login as authenticated user





        If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

        [How to] clear PhpBB cache

        In PhpBB3,


          1. Login to phpBB using admin credentials
          2. Goto ACP (Administrative Control Panel) (Most probably Link is available at the bottom of your webpage)
          3. Go to General tab -->  In the middle of the page (vertically) you can find, 





          If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

          Error in PhpBB3 | Solution

          I've encountered the following error after patching my PhpBB3 installation.

          Fatal error: Call to undefined function phpbb_version_compare() in /home/ someusername /public_html/ subfolder /phpBB3/includes/acp/acp_main.php on line 419

          This error is displayed when I click on General tab in ACP (Administrative Control Panel)

          Solution : Error is misguiding. Just replace ../phpBB3/includes/functions.php with original version you've backed up.



          If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

          Tuesday, October 29, 2013

          [How to] Install PhpBB

          My version of PhpBB is 3.0.12.

          1. Download the zip file from here.
          2. Decompress the phpBB3 archive to a local directory on your system.
          3. Upload all the files contained in this archive (retaining the directory structure) to a web accessible directory on your server or hosting account.
          4. Change the permissions on config.php to be writable by all (666 within your FTP Client)
          5. Change the permissions on the following directories to be writable by all (777 within your FTP Client): store/, cache/, files/ and images/avatars/upload/
          6. Point your web browser to the location where you uploaded the phpBB3 files with the addition of install/index.php or simply install/,
            Ex 1 : http://www.example.com/phpBB3/install/index.phpEx 2 : http://www.example.com/forum/install/
          7. Click the INSTALL tab, follow the steps and fill out all the requested information.
          8. It is a good practice to give a prefix for database tables when asked as you can maintain same database for multiple purposes/websites.
          9. Change the permissions on config.php to be writable only by yourself (644 within your FTP Client)
          10. phpBB3 should now be available.
          11. You should remove/rename the /install directory from your server folder as you will only be able to access the Administration Control Panel whilst it is present.






          If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

          Saturday, October 26, 2013

          Enable IMAP in your Gmail settings


          1. Sign in to Gmail.
          2. Click the gear in the top right.
          3. Select Settings.
          4. Click Forwarding and POP/IMAP.
          5. Select Enable IMAP.
          6. Click Save Changes.





          If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

          [How to] Configure email in Drupal

          Did you get " unable to send e-mail. contact the site administrator if the problem persists "  error after installing Drupal or whenever a user registers for an account ?

          Then this the best place for you to get rid of it !
          I use gmail here to send mails.
          How to :


          1. You need to configure Email server on your hosting server or your PC.
          2. Enable IMAP on gmail first.
          3. Next, login as administrator in your drupal site.
          4. Goto modules
          5. Click on Install new module.
          6. Give URL of package available in this page and install it
          7. Go to modules and enable it
          8. Turn on the module at the Install options fieldset at the top.
          9. SMTP server settings:
          10. smtp server: smtp.gmail.com
          11. smtp backup server: leave blank.
          12. smtp port: 465
          13. use encrypted protocol: select "use SSL"
          14. SMTP authentication:
            Enter a valid Gmail email address and password.
          15. Email options:
            Set the same email address that you used at SMTP Authentication. Using a different account is upto you. Not an issue
          16. Send test email: set an email to receive a sample email.
          17. Enable debugging: yes
          18. Click on submit and verify that the email was submitted and that you received it. 
          19. If not, read carefully the debug information at the top of the screen. 
          20. Once satisfied, remember to deactivate the debug checkbox






          If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

          Error while installing Drupal 7.23

          I've encountered the following error while trying to install Drupal 7.23 on a shared linux web server.

          " Fatal error: Call to undefined function field_attach_load() in / .. /includes/entity.inc on line 316 "


          When you refresh this page, by default your URL home page loads and shows as " page not found at /your site url / "
          According to this post, this is a bug in Drupal and considered to be major one. There is no fixed solution for this and different options works on different systems.


          My case is that the database already contains some tables and I am trying to write onto the same tables again.

          FIX 1:

          1. Drop previous tables from database
          2. Delete your settings.php file in /sites/default/
          3. Start installation by typing " yoursiteurl/install.php "
          FIX 2 :

            1. Delete your settings.php file in /sites/default/
            2. Copy the default.settings.php as settings.php
            3. Start installation by typing yoursiteurl/settings.php
            4. When asked for database details, goto Advanced options --> table prefix.
            5. Give a prefix like " mysitename_ " without quotes.
            I applied second fix as I don't have access to cpanel of the web server.

            NOTE : If you are stuck anywhere, comment and I'll try to reply.


            If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged