[Tutorial] Changing the default mailto on user index page - send them to a contact page

I personally dont like mailto, it has no real security (spam prevention) to it so i dont use it.

So for the Contact Administrator link on the user side index page i changed the index file code to send them to my contact page instead. The contact page has a security question on it which is much better.

Here is how i did it…

I edited the lists/index.php file and commented out the original code. The code starts at line 357 and ends at line 363

just comment it out like so:

   //original code commented out for mod
  /*  echo 
    '<p class=""><a href="'.
        preg_replace_callback('/./', function($m) {
            return '&#'.ord($m[0]).';';
        }
        , 'mailto:'.getConfig('admin_address')).
    '">'.$GLOBALS['strContactAdmin'].'</a></p>';
   */

the double slash is for one line comment
the slash star starts a milti line comment
the star slash ends the milti line comment

then add the mod after that

  //mod start
  //custom contact admin or support
  //i dont like using mailto
  //so lets send them to the contactUS page instead 
  //since we have a security question on the contactUS page
 
  echo '<a href="https://example.com/contact.php" target="_blank">Contact Support</a>';

 //mod end 

Use http or https and change the name of the page to whatever you call your conact page, html or php

save the file and done… now refresh your page or go to http://yoursite.com/lists and click on the contact support link, it should take them to your contact page. And when you hover over the link it shows a url instead of a email address at the bottom of the page…

Hope this helps… :slight_smile:
Dave