Jump to content

Check if page got title or is filename


JelleG

Recommended Posts

Hi,

 

Inside my /orderforms/template/domainoptions.tpl I want to check if the template is "adddomain".

 

I want to check if the template where the domainoptions are displayed is /orderforms/template/adddomain.tpl

 

How can I achieve that? Or can I achieve that by using a custom titlename?

So how can I add a custom pagetitle to the adddomain.tpl?

 

I want to use a code like this in my domainoptions.tpl:

 

{if $pagetitle eq 'adddomain'}
<form class="domainresults domainfrm" action="cart.php?a=add&domain=register" method="post">
{/if}

Edited by JelleG
Link to comment
Share on other sites

I suspect the only way (well there may be others but this is the only one occurring to me!) is to see if the referring URL contains a product ID... if it does, then it must be coming from configureproductdomain.tpl; if it doesn't, then it must be adddomain.tpl - I don't think there's a 3rd option.

 

to prove this, add the following to the top of domainoptions.tpl and go through the initial order process steps of registering a domain and adding a product with required domain and the output should be correct for each.

 

{if !$smarty.server.HTTP_REFERER|strstr:'pid='}
adddomain
{else}
configureproductdomain
{/if}

Link to comment
Share on other sites

I suspect the only way (well there may be others but this is the only one occurring to me!) is to see if the referring URL contains a product ID... if it does, then it must be coming from configureproductdomain.tpl; if it doesn't, then it must be adddomain.tpl - I don't think there's a 3rd option.

 

to prove this, add the following to the top of domainoptions.tpl and go through the initial order process steps of registering a domain and adding a product with required domain and the output should be correct for each.

 

{if !$smarty.server.HTTP_REFERER|strstr:'pid='}
adddomain
{else}
configureproductdomain
{/if}

 

Thanks for your reply!

 

Tried that, works great! :)

 

I have somethings a other strange thing.

When I check a domain, it says it is already registered, but instead the domain is still available.

But when I directly check it again, it works well and I can register it.

 

How can I solve this issue?

Edited by JelleG
Link to comment
Share on other sites

i've seen that occur previously - often it can be a caching issue within WHMCS... or you're hitting whois lookup limits and getting false positives.

 

what I tend to do, when testing domainchecker (or the cart+domain search), is to go slower and try not to do too many searches too quickly/often... sometimes to ensure I do, I enable captcha and/or reduce the number of suggestion tlds.

 

it can be a real pain with testing domain search templates/hooks on WHMCS, especially when you're making multiple minor tweaks to the code and start getting incorrect/inconsistent answers. :roll:

Link to comment
Share on other sites

i've seen that occur previously - often it can be a caching issue within WHMCS... or you're hitting whois lookup limits and getting false positives.

 

what I tend to do, when testing domainchecker (or the cart+domain search), is to go slower and try not to do too many searches too quickly/often... sometimes to ensure I do, I enable captcha and/or reduce the number of suggestion tlds.

 

it can be a real pain with testing domain search templates/hooks on WHMCS, especially when you're making multiple minor tweaks to the code and start getting incorrect/inconsistent answers. :roll:

 

Thanks!

 

So the only solution to the problem, will be to reduce the number of searches?

Inside the cart we do not use suggestion tlds, so that should not be the problem.

 

There is no workaround to solve this?

Because when the cart is used by many customers at the same time, the error will also appear, I guess :(.

Link to comment
Share on other sites

So the only solution to the problem, will be to reduce the number of searches?

Inside the cart we do not use suggestion tlds, so that should not be the problem.

without seeing the problem occur on your site, it's difficult to say... (and I know how hard it can be to reproduce it on demand!) - certainly, if you aren't using suggestions, then whois limits (in terms of quantity) shouldn't be the issue - frequency might be an issue if you were doing multiple searches quickly.

 

There is no workaround to solve this?

depends on the cause.

 

Because when the cart is used by many customers at the same time, the error will also appear, I guess :(.

i've ran into during testing (ob v5 & 6) - but never heard of it occurring live for customers... probably because they aren't searching as quick as we would during testing. :idea:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated