Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Can you Change/Customise the default contact page?  (Read 3483 times)

Datu Puti

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
Can you Change/Customise the default contact page?
« on: December 03, 2006, 04:43:29 am »

Would it be possible to add my name address phone numbers etc into this page? Or could it be replaced with a prebuilt flash form made from coffee cup flash form builder? Or maybe create the new flash form and instead of going to the contact page, have it link to or point to the created form?

Thnx..

I love u guyzzzzzzzzzz... ur the best....

 :P
Logged
Regards from the beautiful 7000 Islands of the Philippines! Mabuhay!

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Can you Change/Customise the default contact page?
« Reply #1 on: December 03, 2006, 10:31:23 am »

Entering additional info on contact page is possible, yes. You need to hardcode it though.

Open up your snews.php and search for the CONTACT FORM, the beginning of it looks like this:
Quote
// CONTACT FORM
function contact() {
   if ($_POST['contactform'] == '') {
      echo '

'.l('contact').'

';
      html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', db('website'), '');
      html_input('text', 'name', 'name', '', '* '.l('name'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'email', 'email', '', '* '.l('email'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('textarea', 'message', 'message', '', '* '.l('message'), '', '', '', '', '', '5', '5', '', '', '');
      echo '

';
      html_input('submit', 'contactform', 'contactform', l('submit'), '', '', '', '', '', '', '', '', '', '', '');
      echo '

';
   }
Now you need to be able to add XHTML code, and you do it in the way you want it, where the red line is in this piece of code benieth:
Quote
// CONTACT FORM
function contact() {
   if ($_POST['contactform'] == '') {
      echo '

'.l('contact').'

';
      echo '

HERE YOU ADD INFO AS YOU PLEASE

';

      html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', db('website'), '');
      html_input('text', 'name', 'name', '', '* '.l('name'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'email', 'email', '', '* '.l('email'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('textarea', 'message', 'message', '', '* '.l('message'), '', '', '', '', '', '5', '5', '', '', '');
      echo '

';
      html_input('submit', 'contactform', 'contactform', l('submit'), '', '', '', '', '', '', '', '', '', '', '');
      echo '

';
   }
OR you could do as suggested in the "1.5 tips and trix manual":
Quote
5. Using Extra Function
To place the extra function and start using it, in your index.php paste:

Extra function is used to display unlimited extra contents and to behave differently depending on the page or
category we're browsing.

The best way to learn how the Extra function works, login and go to your administration area. Add New Extra
contents and under customize fieldset select the category or page. Now browse the category or page you've
selected and see how the extra function behaves.

>>> Classic example of usage would be to create an About Us page and add extra contents with contact info
selected to appear only on that page. This way your whole page could be reorganized dynamically. For more
advanced solutions see chapter 6: Using Special Statements for Advance Content Positioning.
Logged
"It's only dead fish that goes with the flow... "
Updated

Datu Puti

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
Can you Change/Customise the default contact page?
« Reply #2 on: December 03, 2006, 02:36:47 pm »

ok Patric thnx..

Is there anyway to get rid of the contact form all together and just have it link to a FLASH?HTML form that i have created?
Logged
Regards from the beautiful 7000 Islands of the Philippines! Mabuhay!

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Can you Change/Customise the default contact page?
« Reply #3 on: December 03, 2006, 02:46:10 pm »

Of course there is... You need to do atleast two things in order to achieve this:

1. comment out the contact form. You do this by adding /* in front of function contact() { and by adding */ at the very end of the contact function...
 
Quote
/* function contact() {
function contact() {
   if ($_POST['contactform'] == '') {
      echo '

'.l('contact').'

';
      html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', db('website'), '');
      html_input('text', 'name', 'name', '', '* '.l('name'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'email', 'email', '', '* '.l('email'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('textarea', 'message', 'message', '', '* '.l('message'), '', '', '', '', '', '5', '5', '', '', '');
      echo '

';
      html_input('submit', 'contactform', 'contactform', l('submit'), '', '', '', '', '', '', '', '', '', '', '');
      echo '

';
   }
   if (isset($_POST['contactform'])) {
      $to = s('website_email');
      $subject = s('contact_subject');
      $name = clean(cleanXSS($_POST['name']));
      $mail = clean(cleanXSS($_POST['email']));
      $url = clean(cleanXSS($_POST['weblink']));
      $message = clean(cleanXSS($_POST['message']));
      $body = $name.", ".$url."\n\n".$message."\n";
      $from_header = 'From: '.strtolower($mail);
      if (strlen($name) > 3 && strlen($message) > 9 && strlen($mail) > 6) {
         mail($to, $subject, $body, $from_header);
         notification('','','');
         echo '

'.l('backhome').'

';
         echo '';
      }
      else {
         notification(l('contact_not_sent'),l('message_error'),'contact/');
         echo '';
      }
   }
}
*/
And then in Notepad++ all in this section turns green = commented out. (better keep it as commented out if you want to access it at a later date).

Then you need to make a link (green) to your external flash file. AND comment out the old contact link (red) You do that by adding a link to the pages function in snews.php, like:
Quote
// DISPLAY PAGES
function pages() {
   $categorySEF = get_id('category');
   $pageSEF = get_id('article');
   $home = s('home_sef');
   $class = (empty($categorySEF) || $categorySEF == $home && empty($pageSEF)) ? ' class="current"' : '';
   echo '
  • '.l('home').'
  • ';
       $class = ($categorySEF == 'archive') ? ' class="current"' : '';
       echo '
  • '.l('archive').'
  • ';
       $query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 ORDER BY id";
       $result = mysql_query($query);
       while ($r = mysql_fetch_array($result)) {
          $class = ($pageSEF == $r['seftitle'])? ' class="current"' : '';
          if ($r['id'] != s('display_page')) {echo '
  • '.$r['title'].'
  • ';}
       }

    //insert this with changes:
       $class = ($categorySEF == 'CONTACT SEF TITLE') ? ' class="current"': '';
       echo '
  • NEW CONTACT LINK
  • ';
    // stop insertion


       /*$class = ($categorySEF == 'contact') ? ' class="current"': '';
       echo '
  • '.l('contact').'
  • ';*/

       $class = ($categorySEF == 'sitemap') ? ' class="current"': '';
       echo '
  • '.l('sitemap').'
  • ';
    }
    Logged
    "It's only dead fish that goes with the flow... "
    Updated

    Datu Puti

    • Newbie
    • *
    • Karma: 0
    • Posts: 43
    Can you Change/Customise the default contact page?
    « Reply #4 on: December 03, 2006, 05:01:25 pm »

    So beautiful.. Im in love Patric..  :D

    Thnx alot man..

     :lol:
    Logged
    Regards from the beautiful 7000 Islands of the Philippines! Mabuhay!

    Patric Ahlqvist

    • Nobodys perfect, but Im pretty effing close
    • ULTIMATE member
    • ******
    • Karma: 65
    • Posts: 4867
    • I'm a self-made man and worships my creator.
      • p-ahlqvist.com
    Can you Change/Customise the default contact page?
    « Reply #5 on: December 03, 2006, 06:42:34 pm »

    Quote from: Ilo
    Im in love Patric..
    God,  I hope you're a girl :lol:
    Logged
    "It's only dead fish that goes with the flow... "
    Updated

    Datu Puti

    • Newbie
    • *
    • Karma: 0
    • Posts: 43
    Can you Change/Customise the default contact page?
    « Reply #6 on: December 03, 2006, 07:01:55 pm »

    :D LoLz..

    I meant with ur coding skills..

     :P
    Logged
    Regards from the beautiful 7000 Islands of the Philippines! Mabuhay!

    Patric Ahlqvist

    • Nobodys perfect, but Im pretty effing close
    • ULTIMATE member
    • ******
    • Karma: 65
    • Posts: 4867
    • I'm a self-made man and worships my creator.
      • p-ahlqvist.com
    Can you Change/Customise the default contact page?
    « Reply #7 on: December 04, 2006, 08:21:01 am »

    Oh, thanks ;)... No one never thought I had such skills... I don't really, that's just basic fiddling with snews. But thanks you never the less, ilocoskid.
    Logged
    "It's only dead fish that goes with the flow... "
    Updated