Contact: add new menu button to display a contact form with spam prevention - Page 5 Contact: add new menu button to display a contact form with spam prevention - Page 5
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Contact: add new menu button to display a contact form with spam prevention

Started by François Keller, October 22, 2006, 11:27:36 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Hein Traag

Quote from: Muurvaren on April 02, 2007, 07:04:52 PM
Never mind!
Still a noob but I found it myself  :)

remove <br/> on line 46 (contact.php)
remove <br><br> on line 49
remove <br> on line 63



Thanks, needed that.

rollabones


Nevermind... I'm blind.


I installed this plug-in and all works well.

I have one picky question. Look at any of the pages on my site. You'll see all tables in the middle are at top of page directly under "Rolla Area Photo Gallery".

Now, click on "Contact Us" link. Why is there so much white space between "Rolla Area Photo Gallery" and the form? I've looked at the html and can't see anything.

Any ideas anyone?

Thanks,
Steve
http://gallery.rollanet.org/

Zeder

Hello,
I installed V1.3 it worked for a while sending my self email.  No I do not get any emails.  A lot of people have tried to email me and I get nothing.  I am using 1.4.12 stabl.  Any ideas?

www.infocus-imagery.com

Cheers
Z

François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

dke


François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog


François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

dke

Quote from: Frantz on September 01, 2007, 10:33:26 PM
did you look the sub menu under the @ button ?

Ohh its added under there? Then that explains why i didn't find it as i removed that button from my gallery. Any chance you would be so kind on how to modify it to add a button out in the open among with the other buttons?

Thanks!

François Keller


for exemple:for displaying the contact button after the search button:
edit your codebase.php and find this function
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
  global $template_sys_menu, $template_sys_menu_spacer;

  $new_template=$template_sys_menu;
  $button=template_extract_block($new_template,'home');
 
   $params = array(
      '{HOME_LNK}' => $target,
      '{HOME_TITLE}' => $title,
      '{HOME_TGT}' => $href,
      'home' => $link,
   );
   $new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   template_extract_block($template_sys_menu,'home',"<!-- BEGIN home -->" . $button . "<!-- END home -->\n" .$new_button);
}

change with
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
  global $template_sub_menu, $template_sys_menu_spacer;

  $new_template=$template_sub_menu;
  $button=template_extract_block($new_template,'search');
 
   $params = array(
    '{SEARCH_LNK}' => $target,
      '{SEARCH_TITLE}' => $title,
      '{SEARCH_TGT}' => $href,
      'search' => $link,
   );
   $new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   template_extract_block($template_sub_menu,'search',"<!-- BEGIN search -->" . $button . "<!-- END search -->\n" .$new_button);
}

in your theme.php search
<td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>
    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">
            <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
    </td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <td width="50%"></td>
  </tr>
</table>

and change with
<td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <!-- BEGIN search -->
    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>
    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">
            <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
    </td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <!-- END search -->
    <td width="50%"></td>
  </tr>
</table>

with another theme be sure the <!-- BEGIN xxxxx --> and <!-- END xxxxx --> exist .
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

dke

Quote from: Frantz on September 02, 2007, 09:40:31 AM
for exemple:for displaying the contact button after the search button:
edit your codebase.php and find this function
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
  global $template_sys_menu, $template_sys_menu_spacer;

  $new_template=$template_sys_menu;
  $button=template_extract_block($new_template,'home');
 
   $params = array(
      '{HOME_LNK}' => $target,
      '{HOME_TITLE}' => $title,
      '{HOME_TGT}' => $href,
      'home' => $link,
   );
   $new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   template_extract_block($template_sys_menu,'home',"<!-- BEGIN home -->" . $button . "<!-- END home -->\n" .$new_button);
}

change with
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
  global $template_sub_menu, $template_sys_menu_spacer;

  $new_template=$template_sub_menu;
  $button=template_extract_block($new_template,'search');
 
   $params = array(
    '{SEARCH_LNK}' => $target,
      '{SEARCH_TITLE}' => $title,
      '{SEARCH_TGT}' => $href,
      'search' => $link,
   );
   $new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   template_extract_block($template_sub_menu,'search',"<!-- BEGIN search -->" . $button . "<!-- END search -->\n" .$new_button);
}

in your theme.php search
<td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>
    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">
            <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
    </td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <td width="50%"></td>
  </tr>
</table>

and change with
<td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <!-- BEGIN search -->
    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>
    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">
            <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
    </td>
    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
    <!-- END search -->
    <td width="50%"></td>
  </tr>
</table>

with another theme be sure the <!-- BEGIN xxxxx --> and <!-- END xxxxx --> exist .

thanks, it worked great, however the contact form looks really bad in macosx, how can i add white texture to the grey areas? And how can i make the "gap" between "contact" and "contact form" to be removed?

Thanks.

Hein Traag


dke

Quote from: Hein on September 02, 2007, 01:34:21 PM
Adjust the colours in the coppermine stylesheet file.

Hi,

I'm no high-end user, can you be a little bit more precise what i have to modify?

I've modified my style.css and looked for #7F7F7F which is "dark grey" but if i change this to #FFFFFF (which is white) my entire gallery looks weird, the dark line between thumbnails are removed etc. Is there a way to modify contact.php insted to suit my needs?

François Keller

just replace the entire code of the contact.php file with this
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

/*********************************************
  Plugin Coded by Frantz Based on Gizmo MOD
  
  Fixing contact button positioning & Added CAPTCHA confirmation
  by B.Mossavari (Sami)
**********************************************/

require('include/init.inc.php');
require (
'plugins/contact/include/init.inc.php');
pageheader($lang_plugin_contact['name']);

    
starttable("100%"$lang_plugin_contact['name'], 2);
    
?>

    <tr>
    <td colspan="2" class="tableh2" valign="top" align="center">
       <?php echo "<b>".$CONFIG['gallery_name'].":</b>".$lang_plugin_contact['intro']; ?>
    </td>
    </tr>
    <tr>
    <td colspan="2"  class="tableb" valign="top" align="left"><i><b><?php echo"<font color=red>""* ".$lang_plugin_contact['required']."</font color>"?></b></i></td>
    </tr>
<form method="post" action="index.php?file=contact/fcf_parse" name="contactform">
<tr>
<td class="tableb" valign="top" align="right" ><?php echo $lang_plugin_contact['your_name'];?> *: </td>
        <td class="tableb" align="left"><input name="Name" type="text" title="required" value="<?php if(isset($_SESSION['cnt_name'])) echo $_SESSION['cnt_name']; ?>" size="35"/></td>
</tr>
<tr>
<td class="tableb" valign="top" align="right"> <?php echo $lang_plugin_contact['your_mail'];?> *:</td>
      <td class="tableb" align="left"><input type="text" name="Email" size="35" title="required" value="<?php if(isset($_SESSION['cnt_email'])) echo $_SESSION['cnt_email']; ?>"/></td>
</tr>
<tr>
<td class="tableb" valign="top" align="right"> <?php echo $lang_plugin_contact['subject'];?> *:</td>
      <td class="tableb" align="left"><input type="text" name="Subject" size="35" title="required" value="<?php if(isset($_SESSION['cnt_subject'])) echo $_SESSION['cnt_subject']; ?>"/></td>
</tr><br/>
<tr><td colspan="2" class="tableb" valign="top" align="center"> <?php echo $lang_plugin_contact['text'];?> *:</td></tr>     
<tr><td class="tableb" colspan="2"align="center"><textarea rows="10" cols="60" name="Comments" title="required"><?php if(isset($_SESSION['cnt_comments'])) echo $_SESSION['cnt_comments']; ?></textarea></td></tr>
      <br><br>
<tr>
<td colspan="2" class="tableb" valign="top" align="center"><b> <?php echo $lang_plugin_contact['spam_question'];?></b></td>
</tr>
<tr>
<td class="tableb" valign="top" align="right"><?php echo $question;?></td>
        <td class="tableb" align="left"><img src="plugins/contact/captcha.php" align="absmiddle" />&nbsp;
        <input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput" style="width:50px; height:20px; font-size:12pt;">
        *</td>
</tr>
<tr><td colspan="2" class="tableb" valign="top" align="center">       
        <input type="hidden" value="captcha_check" id="contact_captcha" name="contact_captcha" />
        <input name="submit" type="submit" class="cfcSub" id="submit" value="<?php echo $lang_plugin_contact['submit'];?>" /></td>
</tr>
<br>
      </form>
   
    <?php
    endtable
();
pagefooter();
ob_end_flush();
?>
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

dke

Quote from: Frantz on September 02, 2007, 02:12:18 PM
just replace the entire code of the contact.php file with this

Thanks so much! Not to be a pain in the ass, but isn't there anyway to remove the gap between "Contact" and Contact Form, there seems to be nothing there, is it intended for something?

dke

Fixed my self, sorry for double post, i forgot i could modify my post.

Fixed by removing all <br> & </br> in contact.php

Thanks for this fantastic plugin!

dudegetalife

how do you add more words or a brief description to what appears when the user clicks the contact button?


Also, is their anyway that you can change what the menu says underneath contact whenever you are on top of it like you can with the menu buttons?

François Keller

Quotehow do you add more words or a brief description to what appears when the user clicks the contact button?
look in the contact.php file and modify accordingly
Quoteis their anyway that you can change what the menu says underneath contact whenever you are on top of it like you can with the menu buttons?
yes make the changes in the plugin lang file
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog


DangRabbit

my site: www.ModBookGallery.com

version: 1.4.13 (stable)

theme: gray_satin (customized)

Form: http://www.modbookgallery.com/index.php?file=contact/contact

Problem: The menu... it didn't add the button properly. It added a second "Home" button (I already  had a home button added myself to the theme) and it didn't add any button/link to the contact form...

Help :)