Hi,

My plan is to allow users to go directly to the bug tracker from our support forum, so i need a way back to the forum which i have done.

I changed some nav items and on one of them i am having a problem with adding the actual url in the code. The only way i can get back to the root domain is to use ../ but i dont like to do that.

When i use the root url it converts the url and ends up doing this

https://example.com/osticket/https://example.com

I just want https://example.com (no osticket dir)

I tried using php $_SERVER array and also tried to find something in OsTicket that was defined as the root but those did not work either, same issue.

The code i changed is in class.nav.php

//begin dave mod 
    //this mod will change the links and text in the landing page nav bar
    //so that i can use that space for other links
    //there is no reason to have double links to the same place on the same page
    //open new ticket link and check status link are already listed in the sidebar
            
            
            if ($cfg->getClientRegistrationMode() != 'disabled'
                    || !$cfg->isClientLoginRequired())
                    
                //original code     
                //$navs['new']=array('desc'=>__('Open a New Ticket'),'href'=>'open.php','title'=>'');
                
                //new code by dave 
                $navs['ddws']=array('desc'=>__('Back to DDWS Forum'),'href'=>'../','title'=>'');
                
                
            if($user && $user->isValid()) {
                if(!$user->isGuest()) {
                    $navs['tickets']=array('desc'=>sprintf(__('Tickets (%d)'),$user->getNumTickets($user->canSeeOrgTickets())),
                                           'href'=>'tickets.php',
                                            'title'=>__('Show all tickets'));
                } else {
                    $navs['tickets']=array('desc'=>__('View Ticket Thread'),
                                           'href'=>sprintf('tickets.php?id=%d',$user->getTicketId()),
                                           'title'=>__('View ticket status'));
                }
            } else {
                
                //original code 
                // $navs['status']=array('desc'=>__('Check Ticket Status'),'href'=>'view.php','title'=>'');
                
                //new code by dave
                $navs['contactus']=array('desc'=>__('Contact Us'),'href'=>'../memberlist.php?mode=contactadmin','title'=>'');
                
//end dave mod

As you can see in both new $navs i created i have to use ../

Is there a way i can put the literal url https://example.com rather than ../

I have not yet found where it converts the urls yet.

Thanks

  • I think the answer is simpler than you might expect. Use 'href'=>''.
    For the second link of course 'href'=>'memberlist.php?mode=contactadmin'.

    Explanation:
    In the file \include\class.nav.php there is a note on line 333: //Paths are based on the root dir.
    The completion of the full address is then done in the file \include\client\header.inc.php on line 157: ...ROOT_PATH.$nav['href']...

I think the answer is simpler than you might expect. Use 'href'=>''.
For the second link of course 'href'=>'memberlist.php?mode=contactadmin'.

Explanation:
In the file \include\class.nav.php there is a note on line 333: //Paths are based on the root dir.
The completion of the full address is then done in the file \include\client\header.inc.php on line 157: ...ROOT_PATH.$nav['href']...

Write a Reply...