New Module: Contact Owner
dazza
Joined: 2005-04-24
Posts: 21 |
Posted: Fri, 2006-04-28 22:39 | |||
Hi, Attached is a zip file for a module I have written that allows a seperate page for contacting the gallery owner through a form. Very simple to install/use: Unpack in the modules directory, go to the site admin modules screen and install the module, configure it by putting your details in the relevent fields, save it and activate the module. There will then be a "Contact" link in the top right links area that will display a form for people to fill in and then the message is emailed to the address given in the setup. I have tested it with G2.1 Matrix theme and PGThemes. Hope it is of use to somebody...
|
||||
Posts: 48
WOW!!!!!
I have been working on this exact thing. Yours is much nicer though.
Oh, thank you for your work.
It is wonderful!!!!
Posts: 11
installed it, it *almost* works -- it asks for a subject in configuration, but then asks for a subject in the contact for m itself--i presume it's asking to *append* that subject to the mail, then the message.
instead i get a blank body and simply a dash after my custom subject line.
will look into to debug, but incase you can fix it more quickly, that'd be great.
---
smartbrother.org
Posts: 21
hi,
The subject in the config page is what you will receive in the subject of the email to you (as the gallery owner)
The subject on the user form gets put into the body of the email, under the subject heading.
I did it this way so I could have an automagic email rule set up based upon the known subject line from G2...
If you want to change it so the subject on the user form is used as the subject in the email to you, open Send.inc, find the lines:
$ret = GalleryCoreApi::sendTemplatedEmail(
'modules/contactowner/templates/Email.tpl', $email, $form['custEmail'], $toEmailAddress, $toSubject, $headers);
and replace $toSubject with $form['custSubject']
hope this helps
d.
Posts: 21
If you want to append the user subject to the config one, edit as above, but change to $toSubject . $form['custSubject']
(not tested, but should work)
d.
Posts: 5
Hi dazza! I am a huge fan of your modules. Thank you so much your time and work! Quick question, what part of the code would I have to delete/change to make the contact link come up without a user being logged in? Many thanks again!
Posts: 21
hi,
glad you like the modules...
the contact link doesn't check any permissions and should be there always.
if you are running another theme, it might be worth dropping back to matrix and checking the link is in the top right corner.
it is probably worth flushing your template cache as well.
hope this helps
d.
Posts: 5
Yeah, the contact link showed up after like 30 minutes. Sorry!
BTW, Do you do custom stuff? my site is www.fotoswitch.com and basically all I need is similar to your about page, but I need privacy policy, terms and user guide, and I prefer the links to be in the footer. I tried to manipulate one of your scripts and just could not do it. Newbie!! I could leave it as basic html like it is now, but I prefer it to look the same as all the other pages. Let me know if there is a deal we could work out. Thanks!!
Posts: 29
I got an error when trying to configure - anyone know how to solve this? It said it was a "security violation - the action you attempted is not permitted." I appreciate it, thanks.
Error (ERROR_BAD_PARAMETER) : /homepages/10/d91169952/htdocs/Gallery/modules/core/classes/helpers/../../../../modules/contactowner/Admin.inc
in modules/core/classes/GalleryView.class at line 194 (gallerycoreapi::error)
in modules/core/SiteAdmin.inc at line 145 (galleryview::loadview)
in modules/core/classes/GalleryView.class at line 317 (siteadminview::loadtemplate)
in main.php at line 386 (siteadminview::doloadtemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.1.1
PHP version 4.4.2 cgi
Webserver Apache/1.3.33 (Unix)
Database mysql 4.0.25-standard-log
Toolkits NetPBM, Gd
Operating system Linux infong 2.4 #1 SMP Wed Jan 18 14:53:29 CET 2006 i686 unknown
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Posts: 21
greigmg,
can you check the permissions of the contact module directory and files are all correct - my contactowner directory is 0755, and the files within are 0644.
i think the problem is happening when it's trying to load the Admin template for configure, so as well as the permissions above, check all the files have unpacked in the right places and the capitalisation is correct.
hth
d.
Posts: 21
stargirlnine,
glad it's working now.
I don't normally do custom stuff as i don't get time, but I think you are just asking for the functionality for 3 About pages, but with different captions/data for each?
If so, that might be easy to fix up. I have a couple of photo jobs on over the next week but will take a look when I get a chance.
I suspect adding the links to the footer would be simple enough to do within the theme files, but havn't ever looked.
If you are not worried about saving the Navigation return page (displayed on left when in the About page) you could just put the links in the footer as you have now, but use a URL simaler to this:
http://fotoswitch.com/gallery2/main.php?g2_view=core.UserAdmin&g2_subView=aboutpage.About
this will load your about page
hth
d.
Posts: 59
Hello,
Very useful module.. thank you.
Unfortunately Gmail marks all of these emails as spam..
Why is that?
Posts: 1023
Hi Dazza,
just tried your module - the mails are sent fine, but in my case the messagebody stays empty - any idea what to check?
CU,
Lutz
Gallery version = 2.2-svn core 1.1.9
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.2 (Win32) DAV/2 PHP/5.1.4 mod_ssl/2.2.2 OpenSSL/0.9.8b
Database = mysql 5.1.9-beta-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de
Posts: 1023
Dazza,
I've changed line 139 of send.inc to
an get now proper E-Mail sent.
Seems I've needed the $custMessage.
CU
Lutz
Gallery version = 2.2-svn core 1.1.9
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.2 (Win32) DAV/2 PHP/5.1.4 mod_ssl/2.2.2 OpenSSL/0.9.8b
Database = mysql 5.1.9-beta-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de
Posts: 6
How would one go about getting the referer into the sent message? I'd like to see where the person was coming from when sending the email. thanks
Posts: 59
LFrank, your change fixed also the problem that gmail junked all the emails sent via Contact Owner.. thank you
Posts: 29
It was the permissions - I uninstalled, re-unpacked and made sure the permissions were right before I installed. Works great now, thank you for a simple yet useful tool.
Posts: 8
Same here! Thank you very much. I always love those fixes, if someone need some explaining, feel free to pm me.
Posts: 565
dazza----
Very useful... my thanks;~)
stargirlnine----
You can call the Contact Owner module 'directly' using:
dazza----
I don't have logged-in users (other than admin).
Whilst the above linker for stargirlnine---- works
calling up the module things fall apart after the
fail number is reached. OK the admin logs out and
logs back in... but my anonymous posters cannot
log out for they were never logged in initially;~/
Workaround? Other than disabled numbers of emails?
dazza----
Has the module been proved against injection exploits?
----best wishes, Robert
Posts: 1
Is there a way to use the contact module to contact the owner of a particular album? On my site I recieve emails intended for the owners of the album with comments on the work.
Posts: 10
This is fantastic - solves our problem big time - great mod... THANK YOU
Posts: 59
The possibility of contacting the owner of an album would be so much apperciated..With a donation..
Posts: 324
I have a few questions about this module:
1) Is there a way to make "Contact" appear as the browser page title?
2) Is there any way to change the position of the contact link? It's currently the first link and i would like to make it the last system link
3) How do I remove the login block that appears on the left hand side of the contact and email sent page?
Thanks!
New York Architectural Photography
Washington DC Photography
Photos of New York City Landmarks
Black and White Photography
Posts: 57
Hey,
Make this Contact.tpl and put it in a local folder if you are using PG Theme. This will make the Contact Page match the theme.
If anyone could tell me how to get the sidebar gone for these add-on pages I would appreciate it. It says "change password" "back" etc.
Posts: 11
Hi Dazza,
Thanks for the super module. I can't get it to work though. I set the same permissions as you mentioned above, but I still get the following errors. Please help. I'm still learning, so please be patient... Thanks
JohnDoeLives
Notice: Undefined index: badname in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 26
Notice: Undefined index: bademail in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 26
Notice: Undefined index: badsubject in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 26
Notice: Undefined index: badmessage in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 26
Name:
Notice: Undefined index: badname in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 33
Email Address:
Notice: Undefined index: bademail in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 39
Subject:
Notice: Undefined index: badsubject in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 48
Message:
Notice: Undefined index: badmessage in C:\Sites\xxxxx\xxxxx\secure\g2data\smarty\templates_c\%%313289441\%%D7^D7E^D7EE5B68%%Contact.tpl.php on line 54
Posts: 25
Thanks for that great module, dazza!
I had to make LFranks modification to send.inc to make it work. However - the result look slightly different:
Note that the message body comes also on top of the email message...
... I can't get rid of that, but I am not at all a PHP crack. Can somebody help me correct that code to look the email message like it is intended to look?
Thanks all
-Simon
Posts: 324
Is there a way to make the contact link the last link in the system links rather than the first one?
Posts: 565
Yes.
Posts: 1023
icpix, cool answer :/
(Sorry - couldn't resist)
Gallery version = 2.2-svn core 1.1.18
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 565
Nor could I. Accurate. 100% to the point. Busy.
Posts: 324
Yes tres cool! Now, does anyone know how to move the link position from 1st to last? Thanks
Posts: 565
It wasn't cool or even meant to be cool.
It answered your question specifically and I
got called away to resolve server difficulties.
No need to get huffy. See you've been generally getting
wads of answers and help;~) I'll sort out your situation...
{g->block type="core.SystemLinks" order="core.SiteAdmin"}
...now you sort out my predicament - bots/permissions;~)
http://gallery.menalto.com/node/55356#comment-204588
----best wishes, Robert
Posts: 324
Not getting huffy...I thought you were being a smart a$$...sorry for the a$$umption...it's hard to tell sometimes in posts. Thanks for the code i will try it. I left a post re excluding bots at the post above
Andrew
Posts: 324
Robert...I'm not sure what the code you posted refers to. Can you elaborate? Thanks
Andrew
Posts: 565
BT (British Telecom) took me off line for some 24hrs
...no reason, perhaps just because they can;~|
Code refers to the mechanism by which you can re-order
the way the links are presented onscreen. I thought
that that was what you wanted to do.
{g->block type="core.SystemLinks" order="core.SiteAdmin special.tweak core.fancybit"}
----best wishes, Robert
Posts: 34
icpix,
Thank you for such a useful module and your help on this thread.
I am trying to create a "Contact" page which will show just your module. I can't figure out how to do it.
You said:
You can call the Contact Owner module 'directly' using:
<a href="{g->url arg1="view=contactowner.Contact"}">{g->text text="contact"}</a>
So, if I have the Contact file as http://www.innasart.com/contact.php, and I include your line in the contact.php file body, it doesn't work. How do I modify it?
Many thanks in advance,
Mihael
Posts: 565
It's not my module. I just make use of it. Not sure if I can
explain it 'properly' as I am not a programmer (photographer).
You have to install the module normally from the control panel.
Then you amend your settings in its place in the admin options.
I call it directly from my own (static) frontend, this is the
exact code behind the simple text linker 'contact':
<a href="{g->url arg1="view=contactowner.Contact"}">{g->text text="contact"}</a>
FWIW I'm not fond of being 'thanked in advance', it really
puts me right off helping people who utter it. You're very
welcome to thank me after I (may) have helped you out.
Posts: 34
Well, thanks now then, icpix.
Can you provide a link to your site, to see if I can figure by example?
Posts: 565
It's unlikely to be any clearer for installation
purposes, it'll only show you how I've used the
actual module on my own site.
http://icpixREMOVE.coBOGUS.ukANTIHARVEST/contact
(filter out the bot stopping capitalisation)
----best wishes, Robert
Posts: 1642
Can anyone please help indicate how to activate Captcha for the contact page?
.
Gallery Version: 2.1.2
Gallery Theme: PGTheme 1.1.0 (RC01)
Web Site: http://dakanji.com
Posts: 565
Install the Captcha module in the admin control panel.
Then activate the Captcha module in the admin control panel.
What is the problem?
----best wishes, Robert
Posts: 1642
I have the Captcha module installed ok and the question wasn't on installing Captcha. The problem is that when using the contact module, the form comes up whenthe link is clicked as it should but I want to add Captcha validation to the form.
.
Gallery Version: 2.1.2
Gallery Theme: PGTheme 1.1.0 (RC01)
Web Site: http://dakanji.com
Posts: 565
The 'activation' of Captcha is part of the 'installing' process
of Captcha... I experienced no similar difficulty implementing
Captcha in the contactowner module (with my own theme).
I think you should raise this as a theme issue.
----best wishes, Robert
Posts: 1642
OK. Thanks
.
Gallery Version: 2.1.2
Gallery Theme: PGTheme 1.1.0 (RC01)
Web Site: http://dakanji.com
Posts: 25
Where do you change the text part of the module to make "contact" show up as "contact album owner" instead, thanks!
Paul Wilson
:::::Stay Gold:::::
Posts: 164
I recently had to toss my favorite PGtheme, until I can figure it out, due to multiple php crashes and unknown foo. I have been converting to carbon.
The contact contrib, which I need badly, does not invoke the CAPTCHA challenge. I have flushed every cache I can find.
I also switched to matrix, the old standby, and the contact page does not use CAPTCHA for this theme either.
Any help or thoughts? I am using the most recently nightly.
thanks.
regards,patrick
http://www.idyll.com/gallery2
Gallery version = 2.2-svn core 1.1.23
PHP version = 4.3.9 apache2handler
Webserver = Apache/2.0.52 (Red Hat)
Database = postgres7 , lock.system=flock
Toolkits = Exif, ArchiveUpload, Ffmpeg, ImageMagick, NetPBM, Gd, Dcraw, LinkItemToolkit
Acceleration = full/21600, full/21600
Operating system = Linux 2.6.9-11.ELsmp #1 SMP Fri May 20 18:25:30 EDT 2005 x86_64
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Rows in GalleryAccessMap table = 46
Rows in GalleryAccessSubscriberMap table = 969
Rows in GalleryUser table = 4
Rows in GalleryItem table = 966
Rows in GalleryAlbumItem table = 111
Rows in GalleryCacheMap table = 8
Posts: 358
Thanks for the module. I was trying to integrate it with the carbon theme and have the sidebar actually show.
In case anyone else might find this useful, I made the two following changes:
to
Posts: 21
If I put some more thought into this, I imagine it could be more elegant, but since its late, I'll give you the down and dirty. To log IP and referer:
update Send.inc on line 128:
This will store the two new variabls $custReferer and $custIP that you can use in the templates/Email.tpl file found in the contactowner module's directory. Add this to templates/Email.tpl:
If you wanted to go a step farther, you could cross check an file that lists known bots or regions of the world you wanted to block from this, and also check to ensure that the referer was a local (from your website) page before allowing an email.
Posts: 19
I've installed this module and it's just what I need. However there may be a bug. When I had the module set up to send to a 'regular' email address, everything worked perfectly. When I aim the submissions at a gmail account, the email bodies are lost. It may be a gmail bug, but thought I'd ask here too to see if anyone had info on it. I've tested a good bit and it's 100% consistent.
In the gmail acct if I select "Show Original", I see the contact form submission text ok. Not sure why gmail can't pick it up? It's like this:
----- Name -----
Tester
----- Email -----
----- Subject -----
123123
----- Message -----
this is a test with the site contact form, this is the body.
Posts: 29
Pengi2, I am having the same problem with the Contact page with gmail. The email bodies are lost as well. I think it might be a gmail bug. Anyone have a fix for this or how to resolve.
Thank you,
Posts: 2
I have been looking for a way to do this when I stumbled upon this. Thanks so much took all of 1 minute to get it up and running on Carbon Theme. Thanks
http://www.simonwootton.com