Jump to content

Header Solution Wordpress/blablabla


Nathum

Recommended Posts

Hi,

 

After pointless hours of reading through the forums, google and plugins that won't work without bugs. I have figured out a way to implement the header from wordpress into WHMCS.

 

This is a little dirty but it works with one fault which maybe someone could come up with a solution.

 

Ok so 1st

Open your theme's header.tpl file.

Remove....

<div id="whmcsheader">
   <div class="whmcscontainer">
       <div id="whmcstxtlogo"><a href="index.php">{$companyname}</a></div>
       <div id="whmcsimglogo"><a href="index.php"><img src="templates/{$template}/img/whmcslogo.png" alt="{$companyname}" /></a></div>
   </div>
</div>

 

Insert....

{php} 
$header = file_get_contents('http://www.clanhost.com.au/index.php', true);
$header = substr($header, 0, strpos( $header, '<div class="outer planner">'));
echo $header;
{/php}

 

So basically what this does.... Downloads your website's front page into a string $header

Finds the line in your front pages html

<div class="outer planner">

and deletes everything after.

 

Then echo everything from the start of your code to the next <div>.

 

The only downside... Which I am unable to figure out yet is, the div layer sits behind WHMCS so drop down menus appear behind WHMCS.

 

Anyway that's my solution to the header that works flawlessly almost.

 

Nathum

 

- - - Updated - - -

 

I figured out the the bug,

 

Place the {php} code after

 

<div class="navbar navbar-fixed-top">

 

:)

Link to comment
Share on other sites

As for the footer.tpl

 

Which was more tricky.

 

I replaced....

<div class="whmcscontainer">
   <div class="footer">
       <div id="copyright">{$LANG.copyright} © {$date_year} {$companyname}. {$LANG.allrightsreserved}.</div>
       {if $langchange}<div id="languagechooser">{$setlanguage}</div>{/if}
       <div class="clear"></div>
   </div>
</div>

 

 

{php}
$headerstring = file_get_contents('http://www.clanhost.com.au/index.php', true);
$headerscripts = substr($headerstring, 0, strpos( $headerstring, '<div id="header">'));
$footer = strstr($headerstring, '<div class="outer footsy">');
echo $headerscripts . " " . $footer;
{/php}

 

Let me explain.

I needed the java/scripts from my site so line 1 puts the site into a string. Line 2 remove anything before <div id="header"> so all I get are the scripts. Line 3 removes anything before the footer div so all I get is the footer. Then I simply echo the scripts and then the footer :)

 

Nathum

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