hi, i'm a newbie with php. i would like to create a mail form that would be integrated into gallery (integrated for aesthetic reasons) and have a permenant link in the sidebar. i would very much appreciate it if someone could help me out with this. this would be a very useful module. thanks in advance!
Posts: 32509
like a "email this item (link) to a friend"? or has the email nothing to do with a specific item?
either way, we will not code the module for you, we just have not enough time for all feature requests at the moment. but we can help and support you if you decide to code it yourself.
Posts: 70
i understood that. it was really more directed at some of the knowledgable users here that happen to be generous. :D
yes, i would like a general mail form, so i'm sure this is a very simple task. i've been learning to customize certain things in G2 in baby steps but this task is over my head.
Posts: 70
anyone? is there a kind soul who might help out a fellow gallery user? i could trade some (unfortunately) slow server space for it. :D
Posts: 3236
Search the intarweb at google.com for php and mail, I imagine its quite easy and there has to be sample scripts. Once you have it working in a stand alone php file, post the code here and I am sure someone can tell you where to put it to show up in G2.
Posts: 70
thanks! i will.
Posts: 70
ok, i modified the phpnuke feedback form to work in standalone. i'm no php expert, for sure. its pretty much monkey see, monkey do for my php coding, but it seems to work, so here goes:
Posts: 32509
erm, G2 has built-in email functions, i.e. it sens emails on registration of new users. your job wouldn't be to create an email function, but to build a module with its logic and views to let you choose what you want to email to which users (view) and to handle the inputs from the view (controller).
Posts: 70
that's not exactly what i'm after. i have users and new user registration turned off. the only users are guest and admin. the purpose of the form is for general feedback or contact - basically a way to contact me without having to divulge my email address on the page.
a module is exactly what i'm hoping to achieve - a way to integrate the form into G2 so that its aesthetically the same as the rest of the site. this form works, and i could just link to it in the sidebar or something, but that's an ugly way to do it.
i was using phpnuke and embedded G1, which worked well, but the nuke site was too busy. people coming to my site just want to see pictures anyway. they don't want to mess around with logging in (i learned that from my experience with the nuke site). there are just a couple of features that i had in nuke that i would like to get into G2: a mail form and a site faq. if i can get over the hump here with the mail form, i'm sure i can do the faq on my own. i just need a nudge in the right direction.
by the way, one reason i dumped nuke altogether was that G2 works so well and is better looking. G2 is awesome! kudos on a great job! it works so well, i'm hosting a few G2 sites for friends and family (with kids... :D ).
also, thanks for your help so far.
Posts: 8601
a module can add links to the top bar (system links) or content in the sidebar (system content) and of course can add new pages (views). you can look at the cart module as a starting point.. it adds system content and has its own view. look at useralbum module to see how to add a system link (your album). http://smarty.php.net/ for documentation on the format of the tpl files.
Posts: 70
thanks! i'll give it a whack tonight.
Posts: 70
ok, thanks to bharat and krill, i've got the modules going. i made one faq module and i started the email module.
i added the php script to my email.inc file and the script works, but there are a couple of problems.
1) when the page loads, the email form appears above the page header and sidebar; and the formatting is all messed up.
2) the confirmation page is (as shown in the script above) email.php - so after you hit "send", email.php loads and there is no header, sidebar, etc - but it does say "thanks for sending email.. blah blah blah..."
i don't know how to call it back to the module. email.php is located in the root folder (that's the original thing i was playing around with).
Posts: 7994
Publish what you have and we'll take a look and give you feedback. Thanks!