TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,116
  • Total Topics: 21,345
  • Online today: 1,426
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 316
  • Total: 317
  • lurkalot

How to Target a New Button

Started by marzi, October 30, 2006, 03:17:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marzi

I am using TP 0.9.6 with SMF 1.1 RC3 with the Default Theme.

I have installed an additional button named 'contact' on the navigation bar using the 2 pieces of code  below.

How do I target my contact.html page to load under the top section which contains the  navigation bar? I would like the contact.html page to load and display like, for example, as the register page does, the help page does, etc., under the main top section. Now clicking on the button  just opens the page into the current browser window. I am stumped and help from the more knowledgeable would be appreciated.


if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'contact')))
$current_action = $context['current_action'];

      


// Show the [contact] button.
   echo ($current_action=='contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action=='contact' ? 'active_back' : 'back' , '">
               <a href="http://www.mydomain.com/forum/acontact.html">CONTACT</a>
            </td>' , $current_action=='contact' ? '<td class="maintab_active_last">&nbsp;</td>' : '';


akulion

Put your contact form in an article and then put the link for it like this:

', $scripturl, '?action=XX

instead of

http://www.mydomain.com/forum/acontact.html

Where XX will be the number of the article

marzi

Thanks for the help.
I think I followed your directions but the article does not show up.
I tried changing the action in the Location Window from article7 to only 7 but without positive results.

The URL for the site is:
http://www.marscafe.com/oxforum/index.php

Here is he code I am using:
// Show the [contact] button.
   echo ($current_action=='contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action=='contact' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=article7">' , $txt[1006] , '</a>
            </td>' , $current_action=='contact' ? '<td class="maintab_active_last">&nbsp;</td>' : '';



akulion

oh sorry instead of action put this:

<a href="', $scripturl, '?page=7">

marzi

That did it and thank you very much for you clear assistance.

akulion


marzi

Is there anyway to constrain the use of the 'contact article' to only registered users?
That way the form user has had to pass through the Captacha registration process.

I am afraid of possible spamming of the form if it is in plain HTML and have not bee able get the php option to work at all even with the simplest of php code.

Thank you

akulion

hopefully this will do the trick:


// Show the [contact] button.
    global $user_info;
    if ($user_info['is_guest'])

   echo ($current_action=='contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action=='contact' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?page=X">' , $txt[1006] , '</a>
            </td>' , $current_action=='contact' ? '<td class="maintab_active_last">&nbsp;</td>' : '';

    else

   echo ($current_action=='contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action=='contact' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?page=7">' , $txt[1006] , '</a>
            </td>' , $current_action=='contact' ? '<td class="maintab_active_last">&nbsp;</td>' : '';



with this code u will have to create another article for "guests" explaining to them to register inorder to contact the site admin

And then once that article is created look at the 1st part of the code where it says: page=X - change X to the number of the new article

jacortina

Quote from: marzi on October 31, 2006, 01:19:40 AM
Is there anyway to constrain the use of the 'contact article' to only registered users?
That way the form user has had to pass through the Captacha registration process.

I am afraid of possible spamming of the form if it is in plain HTML and have not bee able get the php option to work at all even with the simplest of php code.

Thank you

I would really give this some re-consideration.

A major use of a Contact form would be specifically FOR unregistered users (registered users can PM and/or get the admin's email from profile).

If somebody's trying to get in touch to point out that they're having trouble registering and/or logging in...

akulion

#9
yup i agree with JA

plus i think spambots are over rated really

in my one year history of my site ive only gotten 1 spambot in the forum who got banned.

Apart from that I'm luckily free of them :D

Just remember - dont go to dodgy sites - and they wont follow ya back home :D lol

This website is proudly hosted on Crocweb Cloud Website Hosting.