Nov 21, 2008, 07:39 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: 1 2 3 [4] 5 6 ... 10   Go Down
  Print  
Author Topic: [module] Gallery2 Module  (Read 46411 times)
0 Members and 2 Guests are viewing this topic.
rthrash
Foundation
*
Posts: 9,515



WWW
« Reply #45 on: Feb 01, 2007, 12:38 AM »

I don't know anyone on the core team with plans to touch this module for the foreseeable future.
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
muramoto
Jr. Member
*
Posts: 37


MODx is Great!


« Reply #46 on: Feb 02, 2007, 02:37 AM »

Nice to meet you.!
I'm Hisanori Muramoto from Japan.
I'm not good at English.

I modyfied the gallery2 Module.
It's for Gallery2 2.1.2!!!
I confirmed it on MODx 0.9.5 + Gallery2 2.1.2  to go to adminpage from Module.
Anyone help me to find bugs... maybe have some bugs.


* gallery_2_MODx_Module_1.1beta.zip (183.39 KB - downloaded 394 times.)
Logged
RaVen69
Jr. Member
*
Posts: 6


ModX Fan


« Reply #47 on: Feb 02, 2007, 05:43 AM »

I'm not good at English.
Grin As long as your programming skills are good, your English does not matter  Grin

I was waiting for this quite a long time.
So I will test this over the weekend and report my experiences (success & errors/problems) here.
Logged

Greetz from Vienna, Austria EUROPE

RaVen
Frisco
Member
**
Posts: 58



WWW
« Reply #48 on: Feb 02, 2007, 10:08 AM »

I modyfied the gallery2 Module.
It's for Gallery2 2.1.2!!!
I confirmed it on MODx 0.9.5 + Gallery2 2.1.2  to go to adminpage from Module.

Hi,

that's great, I'll try to test it on the weekend. Does your code work with friendly url's as well? It would be just perfekt to have friendly url's working with G2! If you take the coding, I'll test everything you give to me ;-)

Keep up the great work!

Cheers,
Frisco
Logged

sottwell
Documentation Team
*
Posts: 8,170



WWW
« Reply #49 on: Feb 02, 2007, 11:23 AM »

I got a fix for a friendly URL problem I was having on one server from the Gallery forums. It seems that you need to add
Quote
Options +FollowSymLinks
to the .htaccess file before starting the rewrite engine.
Logged

sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html
Frisco
Member
**
Posts: 58



WWW
« Reply #50 on: Feb 02, 2007, 01:21 PM »

I got a fix for a friendly URL problem I was having on one server from the Gallery forums. It seems that you need to add
Quote
Options +FollowSymLinks
to the .htaccess file before starting the rewrite engine.

Hi Susan,

it would be great to have it that easy - should I alter the .htaccess file of modx or the one of gallery2? Or even both? I think the one of modx is parsed first, but since both should be parsed it could be that it works in either of them?

For the time being I have "RewriteEngine Off" in both files - did you take the original .htaccess files and leave them as they were?

It would be great if you could check them both and tell me whether you have both enabled or not - I need FURLs desperatly! Wink

Cheers!
Frisco
Logged

Frisco
Member
**
Posts: 58



WWW
« Reply #51 on: Feb 02, 2007, 02:37 PM »

Hi,

I tested it right this moment, it seems to work fine! I put your modification in the modx .htaccess file and enabled the rewrite engine in both files. Afterwards I looked up the configuration section in the manager and enabled FURLs there as well. That's it.

Unbelievable a waited over six month, wrote uncountable forum messages and searched the net 'til my finger tips went numb and all necessary was this single, simple line!

Susan, thanks so much, you really made my day!

Cheers!
Frisco
Logged

muramoto
Jr. Member
*
Posts: 37


MODx is Great!


« Reply #52 on: Feb 02, 2007, 06:28 PM »

So I will test this over the weekend and report my experiences (success & errors/problems) here.
that's great, I'll try to test it on the weekend.

Thanks for Testing!  Cheesy

Additionally,I fixed "install/setup.info.php"  $moduleVersion = "1.0"; to $moduleVersion = "1.1";
I attach this fixed file.
But I tried on another machine, I didn't succeed to upgrade using  installer(1.0 to 1.1).
Installer displayed Upgrade Succeeded but no change.
To upgrade, it need to delete old module maybe.

 

I love MODx and Gallery2! Grin

* gallery_2_MODx_Module_1.1beta_2.zip (185.33 KB - downloaded 206 times.)
Logged
Frisco
Member
**
Posts: 58



WWW
« Reply #53 on: Feb 03, 2007, 12:54 AM »

Thanks for Testing!  Cheesy

Well, I haven't tested your code yet, I tested Susans .htaccess modification. For your module I need some more time, but don't worry, I'll test it definetly! Wink

Additionally,I fixed "install/setup.info.php"  $moduleVersion = "1.0"; to $moduleVersion = "1.1";
I attach this fixed file.
But I tried on another machine, I didn't succeed to upgrade using  installer(1.0 to 1.1).
Installer displayed Upgrade Succeeded but no change.
To upgrade, it need to delete old module maybe.
...
I love MODx and Gallery2! Grin

Well, that could be that uninstallation before is necessary. And I'm absolutly on your side, modx and G2 is THE combination for me! Smiley

Cheers!
Frisco
Logged

nicpan
Member
**
Posts: 54

I love MODx!


« Reply #54 on: Feb 03, 2007, 09:24 AM »

Thanks muramoto Smiley

Everthing seems to work fine, except my users aren't automaticaly logged into gallery.
In my gallery, only Regitered Members can see albums... so when i go to the gallery in embed mode, its works, but gallery ask me to log in... Huh

Any clue?

Thanks!
Logged
muramoto
Jr. Member
*
Posts: 37


MODx is Great!


« Reply #55 on: Feb 04, 2007, 03:49 AM »

Everthing seems to work fine, except my users aren't automaticaly logged into gallery.
In my gallery, only Regitered Members can see albums... so when i go to the gallery in embed mode, its works, but gallery ask me to log in... Huh

Hi nicpan

Modify the line of gallery2 plugin (near weblogin)

GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==GalleryStatus::success())

to

GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==null)

Good Luck!
« Last Edit: Feb 04, 2007, 03:52 AM by muramoto » Logged
nicpan
Member
**
Posts: 54

I love MODx!


« Reply #56 on: Feb 04, 2007, 01:17 PM »

Thanks for your reply muramoto.

I took your gallery module, with its plugin, every line where already replaced (GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==GalleryStatus::success()) by
GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==null) )

But i am still not logged into the gallery.

I wonder why there's not 'OnWebLogin' event checked, and why there's no management on this case in the plugin, as this was done for the smf connector...

I read (a bit) the doc for embedding the gallery, well it seems that you just have to map your user with gallery, and if you pass the active user id to the init function, the user should be logged.

I tried to use this, but i have this error :
Code:
Error (ERROR_MISSING_OBJECT) : 35 GalleryUser

Well, i'm a bit lost...

Any help would be appreciated!

Logged
Frisco
Member
**
Posts: 58



WWW
« Reply #57 on: Feb 05, 2007, 10:09 AM »

Hi muramoto,

I've tested your module now, but I have the following error when starting the module in the manager:

Warning: execute(/var/www/modx/gallery2embed.php) [function.execute]: failed to open stream: No such file or directory in /var/www/MODx-0.9.1/assets/modules/gallery/g2cms.admin.class.inc.php on line 24

Fatal error: execute() [function.require]: Failed opening required '/var/www/modx/gallery2embed.php' (include_path='/var/www/MODx-0.9.1/manager/includes/') in /var/www/MODx-0.9.1/assets/modules/gallery/g2cms.admin.class.inc.php on line 24

I upgraded G2 to 2.1.2-typical, modx is 0.9.5. I deleted the old files in assets/.... before installing via your web based installer.

As I have G2 in a subdirectory modx/gallery2 I modified the snippet, module and plugin in the manager.

But the only "embed-file" from G2 I can find is gallery2/embed.php, nothing in modx as requested in the error message above.

I tried a symlink in dir modx/gallery2embed.php -> gallery2/embed.php, which gets rid of the error message, but shows a crippled version of the admin interface. It seems as if there are images missing and such.

Any clue?

Cheers!
Frisco
Logged

nicpan
Member
**
Posts: 54

I love MODx!


« Reply #58 on: Feb 05, 2007, 12:53 PM »

Have you edited the configuration of the module? I forgot to did that the first time... Smiley
In fact, it seems the module seeks a wrong file in a wrong place, it might be a good place to start.

nicpan
Logged
nicpan
Member
**
Posts: 54

I love MODx!


« Reply #59 on: Feb 05, 2007, 01:36 PM »

Hi all,

Finally, i think this should work. With this, your user should be logged into the gallery.
Modify the plugin (add the lines in bold) to have :
Code:
/**
 * Gallery Plugin for MODx
 * Written by Raymond Irving, Sept 2005
 *  Modyfied by Hisanori Muramoto, Feb, 2007
 * Integrates Gallery2 with MODx
 *
 * Events:
 * OnWebChangePassword,OnWebDeleteUser,OnWebSaveUser,OnWebLogout
 *
 * Version: 1.1
 *
 */



$e = &$modx->event;

# build mod path
$modpath = $modx->config["base_path"].($mpth ? $mpth:"assets/modules/gallery/");

# include main class
include_once $modpath."g2cms.base.class.inc.php";
$g2base = new G2CMS_Base();

// include Gallery API
require_once($g2base->g2Path.'embed.php');
$ret = GalleryEmbed::init(array(
'embedUri' => $g2base->embedUri,
'g2Uri' => $g2base->g2Uri,
'activeUserId' => $modx->getLoginUserName()
));

if ($ret) {
$modx->logEvent(0,2,$ret->getAsHtml(),'Gallery');
exit;
}

// Event switch
switch($e->name) {

case "OnWebLogin":
$ret = GalleryEmbed::login($modx->getLoginUserName());
if ($ret) {
$modx->logEvent(0,2,$ret->getAsHtml(),'Gallery');
exit;
}
break;

case "OnWebLogout":
$ret = GalleryEmbed::logout(array(
'embedUri' => $g2base->embedUri,
'embedPath' => $g2base->embedPath
));
if ($ret) {
$modx->logEvent(0,2,$ret->getAsHtml(),'Gallery');
exit;
}
break;

case "OnWebSaveUser":

$uid = $username;
$args = array(
'username' => $username,
'fullname' => $userfullname,
'email' => $useremail,
'hashmethod' => 'md5',
'hashedpassword' => md5($userpassword)
);

if($mode=="new") {
$ret = GalleryEmbed::createUser($uid,$args);
if (!$ret->isSuccess()) {
$modx->logEvent(0,2,"Unable to create Gallery user account ($username)<br /><br />".$ret->getAsHtml(),"Gallery");
}
}
else if($mode=="upd"){
$uid=($oldusername ? $oldusername:$username);
if(GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==null) {
$ret = GalleryEmbed::updateUser($uid,$args);
if (!$ret->isSuccess()) {
$modx->logEvent(0,2,"Unable to update Gallery user account ($username)<br /><br />".$ret->getAsHtml(),"Gallery");
}
}
}
break;

case "OnWebChangePassword":
if(GalleryEmbed::isExternalIdMapped($username,'GalleryUser')==null) {
$ret = GalleryEmbed::updateUser($username,array(
'username'=>$username,
'password'=>$userpassword,
));
if (!$ret->isSuccess()) {
$modx->logEvent(0,2,"Unable to update Gallery user ($username) password<br /><br />".$ret->getAsHtml(),"Gallery");
}
}
break;

case "OnWebDeleteUser":
if(strpos(strtolower($ondel),'delete')!==false) {;
if(GalleryEmbed::isExternalIdMapped($username,'GalleryUser')==null) {
$ret = GalleryEmbed::deleteUser($username);
if (!$ret->isSuccess()) {
$modx->logEvent(0,2,"Unable to update Gallery user ($username) password<br /><br />".$ret->getAsHtml(),"Gallery");
}
}
}
break;

default:
return;
break;
}

i've add    'activeUserId' => $modx->getLoginUserName() to the gallery init, and the onweblogin event.
Finally tick "OnWebLogin" system event. I have to do more tests, be i think it's close to what i was looking for Smiley
If anyone can tell me if this is working on his website...

thanks

nicpan
« Last Edit: Feb 05, 2007, 01:40 PM by nicpan » Logged
Pages: 1 2 3 [4] 5 6 ... 10   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!