1

Topic: Contact

Contact

Simple contact plugin for Monstra CMS


Usage:

Shordcode for content

{contact recipient="admin@site.org"}

Code for templates

<?php Contact::display('admin@site.org'); ?>

Download: contact.zip
GitHub: https://github.com/Awilum/monstra-cms-contact

Monstra Loves You! Give some love back!

2

Re: Contact

Thx for the contact plugin.
Possible to add more fields in administration for a futur update ?

Sorry for my little english sad

3

Re: Contact

Any preview?

4

Re: Contact

stradfred
which fields you want in this form?

5

Re: Contact

And can someone post a demo or screenshot?

6

Re: Contact

ypow, why do you need a screenshot or a demo, a common form of feedback from the three fields (name, mail, message) smile

7 (edited by 4script 2012-05-14 03:01:13)

Re: Contact

Hello everybody! First of all I want to thank you!

I wanted to make some change in the plugin.

1. I wanted to change the word "name" to "имя" in ru.lang.php 'Name' => 'Имя',
this is by default but script show another word "Название" see screenshot below

I  tried to change but I did not change nothing.
Q. How to Change this word "Название" on "Имя"?


2. When I send a message, the recipient can not know from whom the message was received because  there is a small mistake. I mean, that the subject of the message and the name looks the same. So I  decided to make changes to the code


form.view.php Line: 9-10 added

<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php if (Notification::get('error')) Alert::error(Notification::get('error')); ?>
<br />
<form method="post">
    <label><?php echo __('Name'); ?></label><br />
    <input class="span3" type="text" name="contact_name" size="40" value="<?php echo $name; ?>" /><br />
    <label><?php echo __('Email'); ?></label><br />
    <input class="span3" type="text" name="contact_email" size="40" value="<?php echo $email; ?>" /><br />
    <label><?php echo __('Subject'); ?></label><br />
    <input class="span3" type="text" name="contact_subject" size="40" value="<?php echo $subject; ?>" /><br />
    <label><?php echo __('Message'); ?></label><br />
    <textarea class="span7" rows="10" cols="100" name="contact_body"><?php echo $body; ?></textarea><br /><br />
    <?php if (count($errors) > 0) { ?>
    <ul>
    <?php foreach($errors as $error) { ?>
        <li><?php echo $error; ?></li>
    <?php } ?>             
    </ul>             
    <?php } ?>    
    <input type="submit" class="btn" value="<?php echo __('Send'); ?>" name="contact_submit"/>
</form>

contact.plugin.php Line: 43 added

$name  = Request::post('contact_name');            
$email = Request::post('contact_email');
$subject = Request::post('contact_subject');            
$body  = Request::post('contact_body');

Line: 63 added

$recipient = $recipient;
$name = $name;
$subject = $subject;
$header = "From: ". $name . " <" . $email . ">\r\n";

Line: 79 added

->assign('name', $name)
->assign('email', $email)
->assign('subject', $subject)
->assign('body', $body)
->assign('errors', $errors)
->render();

Now I have additional field "Subject" , and Now,  the recipient sees the  correct Name and Subject!

And Thank You Very Much again! GREAT CMS EVER I SAW!


stradfred wrote:

Possible to add more fields in administration for a futur update ?

Try this!

8

Re: Contact

4script
Maybe this bug in Monstra or not..
Monstra use dictionary to translate And translation for word Name maybe Название And it maybe added with high priority plugin. e.g. Pages or System.

Monstra Loves You! Give some love back!

9

Re: Contact

Hello, Awilum!
Think so too, but other words like Сообщение and Емейл it takes from the file ru.lang.php and replaces them with correctly. Very strange for me smile How to fix this?
Thank You!

10

Re: Contact

I found a solution! smile

I looked in the file:
\plugins\box\users\languages\ru.lang.php

Found a word: 'Firstname' => 'Имя',

Then I replaced here:
\plugins\contact\languages\ru.lang.php
from 'Name' => 'Имя', to 'Firstname' => 'Имя',

and here:
\plugins\contact\views\frontend\form.view.php

Now is looks correctly and perfectly! Thank you very much for the advice!

11

Re: Contact

Awilum wrote:

Contact

Contact plugin for Monstra!


Usage:

Shordcode for content

{contact recipient="admin@site.org"}

Code for templates

<?php Contact::display('admin@site.org'); ?>

Download: contact.zip

First thanks for this plugin!:)


I don't know about you guys but wouldn't captcha be something that should be by default to avoid spammers mailbombing your inbox?
I am trying to add this feature with help with the captcha helper but I can not figure out how to sad

Third how can I add the SITE_URL(Domainname) to be present in the body or even better in the $subject?
Problem is that if you are running 10 sites with monstra and use this plugin there is no way telling from what site the message was posted.

Cheers to all!

12

Re: Contact

Contact 1.0.4
+ Captcha added
+ Translates updated.

Monstra Loves You! Give some love back!

13

Re: Contact

Good wink

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

nakome's Website

14 (edited by RedStar )

Re: Contact

Awilum wrote:

Contact 1.0.4
+ Captcha added
+ Translates updated.

Excellent!

Btw I dont know if this is a bug or I am having problems locally but No matter what the words wont change for
Name
Email
Message

I have tried changing to russian language but still no translation. Using latest monstra with latest contact plugin.
Can someone verify this?
Past 2 hours I have pull may hair out trying to understand where things are wrong.
Edit
Think I found the problem in plugings/contact/views/form_view.php
Strange no body else has said something lol
Should be

'Name', 'contact'

and so on....i think smile

15

Re: Contact

RedStar wrote:

Strange no body else has said something lol

I talked about this, see above

16

Re: Contact

Hello! Tell me please how to disable captcha in contact form?

pesterevilya's Website

17

Re: Contact

How to make in contact form "Choose File" for send any file to admin email adress? please help.

Werasu's Website

18 (edited by RedStar 2013-03-13 22:02:00)

Re: Contact

Is it just me but I think the contact plugin is broken with Monstra version 2.1.3?
I made a New clean install of monstra 2.1.3.
Installed contact plugin and tried to post message...does not work. I always get "Letter was not send" even though all fields filled in
and correct captcha is provided.

Bug in captcha plugin?

19

Re: Contact

RedStar i am using monstra 2.1.3 with the contact plugin and just tested it, and it works fine i am using the short code. You should try to delete the plugin and install a fresh copy but its probably something from your side ?

20

Re: Contact

The problem on the server mailer.
Try using the monstra 2.2.0 beta.

21

Re: Contact

SnaikBG wrote:

RedStar i am using monstra 2.1.3 with the contact plugin and just tested it, and it works fine i am using the short code. You should try to delete the plugin and install a fresh copy but its probably something from your side ?

Dante wrote:

The problem on the server mailer.Try using the monstra 2.2.0 beta.

It was a local problem and I tested on remote host and it worked fine. Maybe it was an ubuntu update that broke things?
Thanks for the replies!
*I bow*

22

Re: Contact

there is a bug in

monstra/plugins/contact/views/frontend/form.view.php

on line 14

Awilum... please change

<label><?php echo __('Captcha', 'users'); ?><label>

to

<label><?php echo __('Captcha', 'users'); ?></label>


also i translated contact to german

de.lang.php
<?php
    return array(
        'contact' => array(
            'Contact' => 'Contact',
            'Contact plugin for Monstra' => 'Kontakt Plugin für Monstra',
            'Name' => 'Name',
            'Email' => 'Email',
            'Message' => 'Nachricht',
            'Send' => 'Senden',
            'Empty required fields!' => 'Pflichtfelder angeben!',
            'Email address is not valid!' => 'E-Mail-Adresse ist nicht gültig',
            'A letter has been sent!' => 'Die Nachricht wurde gesendet!',
            'A Letter was not sent!' => 'Die Nachricht wurde nicht gesendet!',
            'Wrong captcha!' => 'Captcha falsch!',
        ),
    );

23

Re: Contact

i added <label for="..."> and removed whitespaces of the script

monstra/plugins/contact/views/frontend/form.view.php

<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php if (Notification::get('error')) Alert::error(Notification::get('error')); ?>
<br />
<form method="post">
<?php echo (Form::hidden('csrf', Security::token())); ?>
<label for="contact_name"><?php echo __('Name', 'contact'); ?></label>
<input type="text" name="contact_name" id="contact_name" class="input-xlarge" value="<?php echo $name; ?>" /><br/>
<label for="contact_email"><?php echo __('Email', 'contact'); ?></label>
<input type="text" name="contact_email" id="contact_email" class="input-xlarge" value="<?php echo $email; ?>" /><br/>
<label for="contact_body"><?php echo __('Message', 'contact'); ?></label>
<textarea class="input-xxlarge" rows="10" name="contact_body" id="contact_body"><?php echo $body; ?></textarea><br/><br/>
<?php if (Option::get('captcha_installed') == 'true') { ?>
<label for="answer"><?php echo __('Captcha', 'users'); ?></label>
<input type="text" name="answer" id="answer">
<?php if (isset($errors['captcha_wrong'])) echo Html::nbsp(3).'<span class="error">'.$errors['captcha_wrong'].'</span>'; ?>
<?php CryptCaptcha::draw(); ?>
<?php } ?>
<br/>
<?php if (count($errors) > 0) { ?>
<ul>
<?php foreach($errors as $error) { ?>
<li><?php echo $error; ?></li>
<?php } ?>
</ul>        
<?php } ?>
<input type="submit" class="btn" value="<?php echo __('Send', 'contact'); ?>" name="contact_submit"/>
</form>

also tested it successfully

24

Re: Contact

Contact 1.1.1
- PHPMailer used
- PSR coding fixes

Monstra Loves You! Give some love back!

25

Re: Contact

Awilum its uninstallable.
there are missing files in folder "Install" i could not istall it via admin panel pls reload the plugin smile

only

contact.manifest.xml

exist

(с) Roman Art
So far So good wink

RomanArt's Website