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"> </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"> </td>' : '';
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
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"> </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"> </td>' : '';
oh sorry instead of action put this:
<a href="', $scripturl, '?page=7">
That did it and thank you very much for you clear assistance.
welcome :up:
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
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"> </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"> </td>' : '';
else
echo ($current_action=='contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </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"> </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
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...
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
Mr. Cortina and Aku,
I will seriously consider you suggestions.
Better yet, I am going to abandon restricting the form's use to only registered users and allow the general public to use the form until I have reason to not to do so.
Thanks to the both of you.
Tried [ target="_blank">]?
Quote from: marzi on October 31, 2006, 05:13:04 PM
Mr. Cortina and Aku,
I will seriously consider you suggestions.
Better yet, I am going to abandon restricting the form's use to only registered users and allow the general public to use the form until I have reason to not to do so.
Thanks to the both of you.
You might also think about 'filtering' through something like gmail for these contact emails. Their basic spam filtering is OK and you can set your account to forward (or store and forward) to another (your 'real') address.
I have the new button installed on the navigation bar that hangs down from the Top Frame. of the Portal. It works fine when I click on it and displays the article associated with it http://www.marscafe.com/oxforum/index.php?page=7
The oddity is that no matter from which tab I come from to click on this new button's tab, the Home button is the one that is highlighted, not the new button. Curious if this is the way it is supposed to be.
http://www.marscafe.com/oxforum/
gracias.