Jump to content

Define systemURL and site hangs


Recommended Posts

Hey folks

 

Hope you can help. Designed a new theme for V6 and currently working on a dev install of WHMCS (6.3)

I have the new site template integrated with the V6 theme. I noticed when I browse to a page on the site and then click on a menu item from the whmcs client area , it is referencing the website path in the url for example http://www.domain.com/web-hosting/clientarea.php?action=services which of course wont work

 

So I put this at the top of the page which I assume should resolve the issue

 

{if $systemurl}<base href="{$systemurl}" />{/if}

 

But when I refresh the page it goes into some sort of loop and just hangs and some of the page wont load.

 

Any ideas why/what i might have done wrong ? Looks like its trying to pull in some code it cant find so the page is just hanging/timing out eventually .

 

Thanks

Martin

Link to comment
Share on other sites

Sorry you mean add <base href="{$systemurl}"> to the navbar.tpl ... just tried it and same results :(

 

- - - Updated - - -

 

sorry Brian we posted at the same time there , yes tried it , same results unfortunately .

 

Does this need anything configured in General Settings to work correctly ? I just have the WHMCS System URL entered in General Settings.

Link to comment
Share on other sites

Does this need anything configured in General Settings to work correctly ? I just have the WHMCS System URL entered in General Settings.

if that setting is correct, then it should be enough... though, of course, without knowing what you've modified in the template, it's hard to say for certain. :)

 

if in navbar.tpl, you add - <base href="http://www.google.com"> (and I mean google, not your domain!), is it changing the menu link URLs... you won't need to click (wouldn't work anyway!), it should show in the browser footer - I just want to see if it's accepting the base value.

Link to comment
Share on other sites

Hi Brian

 

Yes if I add that , it changes all my URLs to reference Google e.g

 

  <base href="http://www.google.com">
   <li menuItemName="Home" id="Primary_Navbar-Home">
       <a href="clientarea.php">
                       Home
                               </a>
           </li>
   <li menuItemName="Services" class="dropdown" id="Primary_Navbar-Services">
       <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                       Services
                        <b class="caret"></b>        </a>
                   <ul class="dropdown-menu">
                           <li menuItemName="My Services" id="Primary_Navbar-Services-My_Services">
                   <a href="clientarea.php?action=services">
                                               My Services
                                           </a>
               </li>
                           <li menuItemName="Services Divider" class="nav-divider" id="Primary_Navbar-Services-Services_Divider">
                   <a href="">
                                               -----
                                           </a>
               </li>
                           <li menuItemName="Order New Services" id="Primary_Navbar-Services-Order_New_Services">
                   <a href="cart.php">
                                               Order New Services
                                           </a>
               </li>
                           <li menuItemName="View Available Addons" id="Primary_Navbar-Services-View_Available_Addons">
                   <a href="cart.php?gid=addons">
                                               View Available Addons
                                           </a>
               </li>
                       </ul>

Link to comment
Share on other sites

i wonder is this some SSL thing ? When I enter the base url as https://mydomain and visit a page as http , the site loads fine and the links all work fine etc but if I click on a link its of course referencing https and then the site partially loads and hangs again ......?

 

- - - Updated - - -

 

I don't suppose there's anything in the activity log that could give you a clue ?

 

Good idea but no , nothing .

Link to comment
Share on other sites

with regards to the log, I suppose you do have Display Errors enabled in the general settings -> other

 

it feels like it might be an http/s issue...

 

you could try uploading it to your live site and using http://www.livedomain.com/index.php?systpl=*name of custom cart* to access it and see if it happens there too.

 

Yeah I enabled errors but its not showing me anything relating to this , that i can see anyway. :(

 

- - - Updated - - -

 

Do you have any value in General Settings -> System SSL URL?

 

Do you have .htaccess file in WHMCS main directory with Force SSL redirection?

 

No dont have any value in System SSL URL its blank.

 

Dont have anything in the htaccess relating to redirection either.. thanks for the suggestions tho.

Link to comment
Share on other sites

Ok ill check again .

 

I wonder has it something to do with my index.php setup for each page ?

 

example if I visit http://www.mydevdomain.com and am logged in as a customer (have the whmcs nav etc on screen) the homepage of the site loads fine but if I click into one of the sub pages like http://www.mydevdomain.com/personal-hosting/ the site hangs ......

 

 

<?php

use WHMCS\Database\Capsule;

define("CLIENTAREA", true);
//define("FORCESSL", true); // Uncomment to force the page to use https://

require("../init.php");

$ca = new WHMCS_ClientArea();

$ca->setPageTitle("personalhosting");

$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('mypage.php', 'Your Custom Page Name');

$ca->initPage();

//$ca->requireLogin(); // Uncomment this line to require a login to access this page

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$ca->assign('variablename', $value);

# Check login status
if ($ca->isLoggedIn()) {

 # User is logged in - put any code you like here

 # Here's an example to get the currently logged in clients first name

 $clientName = Capsule::table('tblclients')
     ->where('id', '=', $ca->getUserID())->pluck('firstname');

 $ca->assign('clientname', $clientName);

} else {

 # User is not logged in

}

# Define the template filename to be used without the .tpl extension

$ca->setTemplate('personalhosting');

$ca->output();

Link to comment
Share on other sites

I have it narrowed down to pages containing this code in my template

 

<ul class="tab-nav clearfix">
<li><a href="#tabs-1">Monthly</a></li>
<li><a href="#tabs-2">1 Year</a></li>
<li><a href="#tabs-3">2 Year</a></li>
</ul>

 

Which basically renders a different set of divs depending on which tab u click on , If i remove this code, the page loads fine ...

 

So this ahref is causing the page to crash if I have {if $systemurl}<base href="{$systemurl}" />{/if} in my header.

Link to comment
Share on other sites

so perhaps it's linked to whmcs.js in footer.tpl ? and maybe the value of $WEB_ROOT can be replaced with a full URL??

 

<script src="{$WEB_ROOT}/templates/{$template}/js/whmcs.js"></script>

 

Its something to do with jquery - if i comment out the call to the jquery file, the page loads but i lose some functionality .

 

head.tpl

<script src="{$BASE_PATH_JS}/jquery.min.js"></script>

 

uuuugh!!!

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