Difference between revisions of "Gallery2:Modules:g2drupal" - Gallery Codex
Personal tools

Difference between revisions of "Gallery2:Modules:g2drupal"

From Gallery Codex

m (Description)
(Initial Documentation)
Line 1: Line 1:
 
G2Drupal: Drupal Integration Module<br />
 
G2Drupal: Drupal Integration Module<br />
 
Integrates Gallery2 and Drupal CMS<br />
 
Integrates Gallery2 and Drupal CMS<br />
Version: 0.0.0 (Coming Soon)<br />
+
Author: [http://www.dakanji.com Dayo Akanji] <br />
Author: [http://dakanji.com Dayo Akanji] <br />
+
Download the module files [http://www.dakanji.com/creations/g2drupal here].<br />
Download the module files [http://dakanji.com/creations.php here].<br />
+
Visit the [http://www.dakanji.com/creations/support Support Site] for enquiries and support requests.<br />
Visit the [http://dakanji.com/scripts/download.php?id=3 Support Site] for enquiries and support requests.<br />
+
 
+
  
 
=Requirements=
 
=Requirements=
 
* Gallery 2.3.0+  
 
* Gallery 2.3.0+  
 
* Drupal 7
 
* Drupal 7
 +
* PHP 5.0.4+
 
* Both Gallery2 and Drupal must be installed under the same document root.
 
* Both Gallery2 and Drupal must be installed under the same document root.
 +
<br>
  
 
=Description=
 
=Description=
The G2Drupal Module allows users to organize their photos and other multimedia files in Gallery2 while managing other content using G2Drupal.  
+
The G2Drupal Module allows users to organise their photos and other multimedia files in Gallery2 while managing other content using Drupal.  
 
* The module runs within the Gallery2 Framework resulting in a single set of normal Gallery2 URLs. This removes the usual setup of having a separate gallery address from the embedded address. Users can now maintain search engine rankings and can provide direct links to gallery pages.
 
* The module runs within the Gallery2 Framework resulting in a single set of normal Gallery2 URLs. This removes the usual setup of having a separate gallery address from the embedded address. Users can now maintain search engine rankings and can provide direct links to gallery pages.
* The module is called just before output is displayed after all the normal Gallery2 process have been run. It then connects to Drupal and retrieves Drupal html output which is then wrapped around the Gallery2 html. This combined output is then displayed. A benefit of this is that previously cached pages would have been sent to the user before the module is called resulting in faster speeds and lower resource usage.
+
* The module is called just before output is displayed after all the normal Gallery2 process have been run (using a new manually added event) . It then connects to Drupal and retrieves Drupal html output which is then wrapped around the Gallery2 html and this combined output is then displayed.<br /> A benefit of this is that by using the Gallery2 caching system, previously cached pages can be sent to the user before the module is called resulting in faster speeds and lower resource usage.
 
===Other features are:===
 
===Other features are:===
 
* The Drupal and Gallery2 folders can be located at any offset relative to the other as long as they lie under the same document root.
 
* The Drupal and Gallery2 folders can be located at any offset relative to the other as long as they lie under the same document root.
* Unified login from Drupal (users logged into Drupal are automatically logged into Gallery2).
+
* Unified login from Drupal (users logged into Drupal are automatically logged into Gallery2 when user integration is activated).
* Unified registration via Drupal
+
* Unified registration via Drupal when user integration is activated
* Auto resolves most javascript and css conflicts.
+
* Auto points Gallery2 login, logout, account settings and registration links to Drupal when user integration is activated
* Auto points Gallery2 login, logout and registration links to Drupal when user integration is activated
+
 
 +
===Package Contents:===
 +
The package comes in two folders as follows:
 +
* Gallery2: Contains the following files to be installed in gallery2
 +
** g2drupal.zip: This contains the Gallery module files.
 +
** lib.zip: This contains required additional code.
 +
* Drupal: Contains the following file to be installed in Drupal
 +
** g2drupal.tar.gz: This contains the Drupal module files.
 +
 
 +
===Notes===
 +
* Install and post bug notifications to the support site. Subscribe to the announcement forum there to receive notifications. You can also subscribe to the forum post here but this may generate additional emails.
 +
* Implement the [[Gallery2:Performance_Tips|Gallery 2 Performance Tips]] to improve performance. Similar issues should also be considered on the Drupal side.
 +
* Make sure you have the Site Administrator registered with the same details on both applications before activating the plugin.
 +
* The Gallery2 session is subordinate to the Drupal session. If a user is not logged into Drupal, they will be logged out of Gallery2 by the module. Similarly, they will be logged into Gallery2 by the module if logged into Drupal.
 +
* You can create a full community site by using a similar [http://cvs.prohost.org/index.php/Drupal Fudla Bridge] for FUDforum written by the same author.
 +
 
 +
=Installation=
 +
===Drupal===
 +
* Make sure the Drupal Administrator has the same User Name, Full Name and Email as the Gallery2 Administrator.
 +
* Install the g2drupal module (<font color="red"><b>g2drupal.tar.gz</b></font>).
 +
 
 +
===Gallery2===
 +
* Make sure the Gallery2 Administrator has the same User Name, Full Name and Email as the Drupal Administrator.
 +
* Make sure the elements required to the installed in Drupal have been completed.
 +
* Make sure both the RefineHTML and JoomG2 modules are not active
 +
* Unpack <font color="red"><b>lib.zip</b></font> into the main gallery2 folder so that the contents are in "gallery2/lib/xyz"
 +
* Around Line 526 of gallery2/main.php is ...
 +
<blockquote>
 +
{| style="background-color: #eee; width:75%"
 +
|
 +
/*<br />
 +
* Session: Find out whether we need to send a cookie & need a new session (only if<br />
 +
* we don't have one yet)<br />
 +
*/<br />
 +
$session =& $gallery->getSession();<br />
 +
$ret = $session->start();<br />
 +
if ($ret) {<br />
 +
    return array($ret, null);<br />
 +
}<br />
 +
<br />
 +
list ($ret, $shouldCache) = GalleryDataCache::shouldCache('write', 'full');<br />
 +
if ($ret) {<br />
 +
    return array($ret, null);<br />
 +
}<br/>
 +
<br />
 +
if ($embedded) {<br/>
 +
    $html = $theme->splitHtml($html, $results);<br/>
 +
}
 +
|}
 +
 
 +
<br /><b><big>Add the following lines above "if ($embedded) {":</big></b><br /><br />
 +
 
 +
{| style="background-color: #eee; width:75%"
 +
|
 +
/* Added Event: BeforeOutput */<br />
 +
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeOutput.event');
 +
|}
 +
<br /><b><big>To give:</big></b><br /><br />
 +
{| style="background-color: #eee; width:75%"
 +
|
 +
/*<br />
 +
* Session: Find out whether we need to send a cookie & need a new session (only if<br />
 +
* we don't have one yet)<br />
 +
*/<br />
 +
$session =& $gallery->getSession();<br />
 +
$ret = $session->start();<br />
 +
if ($ret) {<br />
 +
    return array($ret, null);<br />
 +
}<br />
 +
<br />
 +
list ($ret, $shouldCache) = GalleryDataCache::shouldCache('write', 'full');<br />
 +
if ($ret) {<br />
 +
    return array($ret, null);<br />
 +
}<br/>
 +
<br />
 +
/* Added Event: BeforeOutput */<br />
 +
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeOutput.event');<br />
 +
<br />
 +
if ($embedded) {<br/>
 +
    $html = $theme->splitHtml($html, $results);<br/>
 +
}
 +
|}
 +
</blockquote>
 +
* Unpack the module file (<font color="red"><b>g2drupal.zip</b></font>) to the "gallery2/modules/" folder.
 +
* Install, configure and activate.
 +
<br>
 +
 
 +
=Troubleshooting=
 +
<blockquote>
 +
{|class="gallery" style="background-color: #eee; width:90%"
 +
!Problem!!Solution
 +
|-
 +
|I get a message saying my username/email is associated with multiple Drupal accounts.
 +
|You probably bridged an existing instance of the module to a new Drupal installation. You will need to manually disable the module, login into G2 and then uninstall and reinstall the module.
 +
|-
 +
|Some javascript functionality doesn't work anymore.
 +
|Do a search online for "JQuery Conflict" and apply the solutions to your conflicting JQuery code or contact the JQuery code author and ask them to consider using the non conflicting jquery syntax.
 +
|-
 +
|My site is dog slow when using this module.
 +
|The notes above offers the suggestion of using the G2 Performance Tips ... read and apply these.
 +
|-
 +
|My site is messed up visually when the module is installed.
 +
|This means you have css conflicts. You will have to manually resolve these.<br>
 +
Note that some Gallery2 themes are more suitable than others. "Matrix" and "Siriux" have been tested to generally work out of the box. "Carbon", for instance, is very difficult to use.<br><br>
 +
There is an option to override CSS files from the module configuration screen.<br>
 +
<ul>
 +
<li>
 +
If you select "Contain Gallery2", the module will look in the module's "data" folder for a CSS file to use in place of the standard "theme.css" file. These should be named using the theme Id (e.g., matrix.css). There are versions distributed for the matrix and siruix themes and if you inspect these, you will notice they include a "#G2Drupal" addition for most of the CSS entries. This helps restrict the theme css to the gallery part of the page. Use such overrides to amend CSS files and leave the actual theme.css intact. 
 +
</li>
 +
<li>
 +
If you select "Override Gallery2", the module will simply not load any Gallery2 CSS files and only use Drupal CSS files. 
 +
</li>
 +
<li>
 +
If you select "Override Drupal", the module will load Gallery2 CSS files (including the standard "theme.css" file). As these are loaded last, any CSS they contain will prevail on the page.
 +
</li>
 +
</ul>
 +
|}
 +
 
 +
 
  
=Notes:=
 
* The module is pending release.
 
 
 
[[Category:Gallery 2:Modules|g2drupal]]
 
[[Category:Gallery 2:Modules|g2drupal]]
 
[[Category:Gallery 2:Contributed modules|g2drupal]]
 
[[Category:Gallery 2:Contributed modules|g2drupal]]

Revision as of 12:42, 26 September 2012

G2Drupal: Drupal Integration Module
Integrates Gallery2 and Drupal CMS
Author: Dayo Akanji
Download the module files here.
Visit the Support Site for enquiries and support requests.

Requirements

  • Gallery 2.3.0+
  • Drupal 7
  • PHP 5.0.4+
  • Both Gallery2 and Drupal must be installed under the same document root.


Description

The G2Drupal Module allows users to organise their photos and other multimedia files in Gallery2 while managing other content using Drupal.

  • The module runs within the Gallery2 Framework resulting in a single set of normal Gallery2 URLs. This removes the usual setup of having a separate gallery address from the embedded address. Users can now maintain search engine rankings and can provide direct links to gallery pages.
  • The module is called just before output is displayed after all the normal Gallery2 process have been run (using a new manually added event) . It then connects to Drupal and retrieves Drupal html output which is then wrapped around the Gallery2 html and this combined output is then displayed.
    A benefit of this is that by using the Gallery2 caching system, previously cached pages can be sent to the user before the module is called resulting in faster speeds and lower resource usage.

Other features are:

  • The Drupal and Gallery2 folders can be located at any offset relative to the other as long as they lie under the same document root.
  • Unified login from Drupal (users logged into Drupal are automatically logged into Gallery2 when user integration is activated).
  • Unified registration via Drupal when user integration is activated
  • Auto points Gallery2 login, logout, account settings and registration links to Drupal when user integration is activated

Package Contents:

The package comes in two folders as follows:

  • Gallery2: Contains the following files to be installed in gallery2
    • g2drupal.zip: This contains the Gallery module files.
    • lib.zip: This contains required additional code.
  • Drupal: Contains the following file to be installed in Drupal
    • g2drupal.tar.gz: This contains the Drupal module files.

Notes

  • Install and post bug notifications to the support site. Subscribe to the announcement forum there to receive notifications. You can also subscribe to the forum post here but this may generate additional emails.
  • Implement the Gallery 2 Performance Tips to improve performance. Similar issues should also be considered on the Drupal side.
  • Make sure you have the Site Administrator registered with the same details on both applications before activating the plugin.
  • The Gallery2 session is subordinate to the Drupal session. If a user is not logged into Drupal, they will be logged out of Gallery2 by the module. Similarly, they will be logged into Gallery2 by the module if logged into Drupal.
  • You can create a full community site by using a similar Fudla Bridge for FUDforum written by the same author.

Installation

Drupal

  • Make sure the Drupal Administrator has the same User Name, Full Name and Email as the Gallery2 Administrator.
  • Install the g2drupal module (g2drupal.tar.gz).

Gallery2

  • Make sure the Gallery2 Administrator has the same User Name, Full Name and Email as the Drupal Administrator.
  • Make sure the elements required to the installed in Drupal have been completed.
  • Make sure both the RefineHTML and JoomG2 modules are not active
  • Unpack lib.zip into the main gallery2 folder so that the contents are in "gallery2/lib/xyz"
  • Around Line 526 of gallery2/main.php is ...

/*
* Session: Find out whether we need to send a cookie & need a new session (only if
* we don't have one yet)
*/
$session =& $gallery->getSession();
$ret = $session->start();
if ($ret) {
return array($ret, null);
}

list ($ret, $shouldCache) = GalleryDataCache::shouldCache('write', 'full');
if ($ret) {
return array($ret, null);
}

if ($embedded) {
$html = $theme->splitHtml($html, $results);
}


Add the following lines above "if ($embedded) {":

/* Added Event: BeforeOutput */
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeOutput.event');


To give:

/*
* Session: Find out whether we need to send a cookie & need a new session (only if
* we don't have one yet)
*/
$session =& $gallery->getSession();
$ret = $session->start();
if ($ret) {
return array($ret, null);
}

list ($ret, $shouldCache) = GalleryDataCache::shouldCache('write', 'full');
if ($ret) {
return array($ret, null);
}

/* Added Event: BeforeOutput */
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeOutput.event');

if ($embedded) {
$html = $theme->splitHtml($html, $results);
}

  • Unpack the module file (g2drupal.zip) to the "gallery2/modules/" folder.
  • Install, configure and activate.


Troubleshooting

advertisements