Problems to display images in wordpress without login
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
Hello, I use WPG2 plug-in and wpg2id tag to insert photos in my Wordpress blog, I want to put some permissions to my albums to limit access to registered persons. The problem is when you arrive on the blog, photos are not display for guest users and I want to display them on the blog for all persons, and when they click on they arrive on the login window or it do nothing... |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
hmm, found a funny solution for that. in gallery 2.2 (current nightly snapshot), there's a module called "multiroot". you can go there and generate a new multiroot. as option you should specify a name for a new guest user, you can leave the rest empty.
you should place that in your wpg2 integration right after the GalleryEmbed::init call. so much for code changes. all wpg2 guests will act as embedGuest while all standalone gallery guests act as the normal guest in g2. btw: gallery 2.2 should be 100% compatible with any wpg2 integration that works with gallery 2.1 already. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
Thank you very much for your fast answer. I have gallery2 2.2 version. I generate the multiroot, it generates the ID and all seem to be OK; just one thing goes wrong: when I display the modules list, multiroot state is displayed with a red cross...however the user is in the permissions list. My problem is that I can't find the place where I must insert: Quote:
$gallery->setConfig('anonymousUserId', 1055); I just found the "GalleryEmbed::init call" in modules/core/classes/GalleryEmbed.class Quote:
class GalleryEmbed { |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
that the multiroot module shows as red cross is fine. it's module that cannot be activated. after installing it, you can use its configuration view. and you don't need to edit modules/core/classes/GalleryEmbed.class. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
I find the file "wp-content/plugins/wpg2/g2embed.php" but I didn't arrive to find the right place to insert the ligne. in this script there is 2 functions: Quote:
function g2_init() { g2_login Quote:
function g2_login() { I trie to insert the line in different places and nothing work. It think that I must insert the line in the function g2_login but I don't find how and where... |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
do it in g2_init after the GalleryEmbed::init(...) call. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
I try this before and in other places but it doesn't work!! The line I insert: |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
How can I test the new guest user in gallery2 to be sure that I put the right permissions. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
Hello, I make a file test.php and I include the script who is generate by the multiroot plug-in Quote:
<?php the file work well and albums permissions are correct. have you another ideas to include the 'anonymousUserId' in g2embed.php (maybe I must wait for the official gallery2 version 2.2 ) Thank you very much for your help |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
i don't know the wpg2 integration. Maybe a developer of wpg2 could help you based on this information. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
Thank you valiant, I try to have more suggetions on the wpg2 forum, if I have the solution I'will post here a new message to give the information. |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
Hi, I know that it's an old post but I hope that I can resolve it now. Quote:
// Otherwise Guest After that, when you arrive on the first page of my site you can see all thumbnails and you are not login in WP. If you enter your login and your password you override the last g2_login and everything run as I want. Something goes wrong; when you are guest and you click on a thumbnail you can acces to all my albums. My idea is to use the g2_logout function when the page finish to load but I don't know how and where I can do this. If someone have any suggestions or other proposition !!! Best regards |
|
ozgreg
![]()
Joined: 2003-10-18
Posts: 1378 |
![]() |
Hiya Bigs, Firstly you will need to change that code back... and after that line of code add what Valiant has pointed out to you in the first posting.. $gallery->setConfig('anonymousUserId', 36); Hope this helps.. ____________________________________ |
|
bigs
Joined: 2006-10-25
Posts: 20 |
![]() |
In my case the ID 36 correspond to a WP User and not to a G2 user. At first I try to creat a user in WP who is link with a guest user generate by the multiroot module but it's not possible because the guest user didn't appear to grant it in WP. Maybe it's possible to link the guest user of wordpress with the alternative guest user generate by the multiroot module. |
|