I want to add a custom field that will only display to someone who is loged in.
For example, when viewing a photo I have a custom field for credits that shows to all who can view. I want an additional custom field "source" that will only show to those who are logged in - not to the general public.
How and what do I need to add?
-I am comfortable altering php with good instructions, but am not at all well versed in php coding from scratch - thanks!
- k
The following information is required to get an answer:
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): (not yet public)
Gallery version: 1.5.4
Apache version: Apache1.3.33
PHP version (don't just say PHP 4, please):4.3.11
Graphics Toolkit: ImageMagick
Operating system: linux
Web browser/version (if applicable):
Posts: 27300
in view_photo.php
find
and change to
Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!
Posts: 14
Thanks Dave,
but Won't that make ALL my customfields viewable only by logging in?
I need to isolate only one particular customfield (one called "source") to those logged in -
the others (details and donor) should be seen with and without log-in.
thanks!
Posts: 27300
that is a bunch more work
Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!
Posts: 27300
What I would do is look for
in /lib/content.php
Then do a bunch of if/else statments for the fields you want to show.
Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!
Posts: 14
Thanks - I thought it might come to that - They'll just have to live without for now!
- k
Posts: 5
Where would this go now? Gallery doesn't seem to have a view_photo.php anymore.
Posts: 27300
FAQ: What information is required when I ask for help in the forums?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
Sorry,
I have the CustomField module installed. What I'm trying to do is get that info to only display to logged in viewers. I've tried wrapping the entire {if !empty($block.customfield.LoadCustomFields.fields0} if statement in the CustomFields.tpl file in an {if $user.isRegisteredUser} statement, but that didn't do anything. In fact if I delete the entire file, the thing still shows the field.
I'm working on a local server, so no link for that. PHP info is rather long, but it's version 5.2.6 and Gallery is working fine.
G2/system information:
Gallery URL = http://vmserver/gallery2/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6-3ubuntu4.2 apache2handler
Webserver = Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch mod_scgi/1.12
Database = mysqli 5.1.31-1ubuntu2, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, ImageMagick
Acceleration = none, none
Operating system = Linux vmserver 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:45:36 UTC 2009 x86_64
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13
Rows in GalleryAccessMap table = 12
Rows in GalleryAccessSubscriberMap table = 3
Rows in GalleryUser table = 3
Rows in GalleryItem table = 3
Rows in GalleryAlbumItem table = 1
Rows in GalleryCacheMap table = 0
Posts: 27300
This is a G1 thread.
Please start a new thread in the G2 customization forums if clearing template cache does not help.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team