I had installed G2 and tried to incorporate it to DF CMS module. Installation went well but when I click on the link for the Gallery instead of sending me to mydomain\modules\gallery it redirect to mydomain\main.php instead. How can I fix this problem.
PLESE HELP!
Posts: 32509
see docs/EMBEDDING for proper embedUri, embedPath and relativeG2Path values for GalleryEmbed::init
Posts: 19
I had read the file, but I am still confused. Where do I edit the integration code as indicated in the EMBEDING file? It does not tell my where or what file to go to so I can make changes.
Posts: 32509
there are no changes required.
you must create your own file, a wrapper. your file should be called by your CMS (cpgnuke) and your file will load G2.
see the sample wrapper file from the sticky embedding and integrations topic, attached to the first post.
Posts: 19
OK! With a lot of modification and many try to get it working. I got the G2 integrated in and able to view it through the CMS. But I have no admin function or login link at all. What did I missed? See attachment to see what I mean.
Posts: 32509
when embedded with GalleryEmbed, we donöt show a login link.
it's meant that way.
you should forward the activeUserId of the cpg user to G2 in GalleryEmbed::init.
Posts: 19
How and what is the command line?
Posts: 32509
see docs/EMBEDDING and take a look at existing integrations for examples.
@command line
where did you read something about the command line?
google for command line for a comprehensive answer. command line = shell = tool to enter your commands on an operating system.
Posts: 19
Opps! I did mean the command line as in shell tool, missed use of words. What I was trying to say was "what code" or something like that. I'll look over the EMBEDING again. May be I missed something after the last look.
Posts: 32509
then the answer is again:
please take a look at existing integrations. or some other forum topics in the g2 interations forum.
i've answered this already a few times.
yeah, we need better docs. but learning from examples (other integrations) should be ok for now.
Posts: 19
I know you had said that you had answer this already, but other integrations did not help me in getting user integration part done.
I had follow every instruction I can find in the othe post. But still the same outcome. NO User integration I dont even see the side bar at the left when calling the gallery from the CMS.
Posts: 32509
look into
GalleryEmbed::init activeUserId argument if the cms user has already been mapped / created in g2
GalleryEmbed::addExternalIdMapEntry for existing users
GalleryEmbed::createUser for when users sign up on your website
Posts: 19
I think I have GalleryEmbed::init activeUserId correct. But I dont know if I do.
How do I add these other 2 line here.
GalleryEmbed::addExternalIdMapEntry for existing users
GalleryEmbed::createUser for when users sign up on your website
I dont have these in the embed file yet.
Posts: 32509
as i said, wp, drupal, joomla, ... they're all doing it correctly. much code to learn from.
sorry, don't have time to explain it right now. but learning from other code is quite normal.
Posts: 19
That what I had been doing to get where I am at. I seen those command somewhere. I'll go ahead and find it again and study somemore of that part of the code.
Posts: 19
This was the error I had when I changed activeUserId to $userinfo['$username']
And when I tried to use addExternalIdMapEntry.
$ret = GalleryEmbed::addExternalIdMapEntry($username);
or
$ret = GalleryEmbed::addExternalIdMapEntry($userinfo['$username]);
I get this error:
Posts: 19
OK I had also added this
$ret = GalleryEmbed::createUser($userinfo['$username]); below $ret = GalleryEmbed::addExternalIdMapEntry($userinfo['$username]);
and now I am getting this error.
I am not sure what to use for the parameter. DAZE AND CONFUSED! And still no user integration.
Posts: 32509
$ret = GalleryEmbed::addExternalIdMapEntry($username);
that's incorrect.
see modules/core/classes/GalleryEmbed.class for the proper usage of this function
@param above the function name are the parameters it expects
@return is what it returns.
and i'd like to encourage you again to take a look at existing integrations. functions like this are used in every integration. by mimicking the usage, you get it right automatically.
also, do not call ::createUser AND ::addexternalIdMapEntry.
call either ::createUser OR ::addexternalmapentry.
why and when to use what?
call createUser for users that don't exist in g2 yet (all users but admin, anonymous). createUser automatically also call addexternalMapentry (take a look at the source code of createuser).
call it only once for each user. do not call it on each request.
call addexternalmapentry for admin and anonymous. just once and then never again.
Posts: 19
OK! I have another problem. I first setup the test server and everything is fine uploaded images show up correctly. But when I setup on a live server the uploaded image will not show up.
See link below:
http://www.cbfauna.com/index.php?name=Projects_Gallery
Posts: 32509
maybe you need to use another embedPath relativeG2Path, ... there?
maybe it's a misconfigured webserver.
just browse to one of the img urls:
http://www.cbfauna.com/modules/Projects_Gallery/main.php?g2_view=core.DownloadItem&g2_itemId=91&g2_serialNumber=2
and you'll see the error.
Posts: 19
Fixed that problem, it's the .htaccess file that was blocking the pics.
Posts: 3
Dear WebSiteGuru and valiant
Can you upload you module to other site, and explain how to integrate Gallery v2.x.x in to DragonflyCMS aka CPG Nuke?