Issue with navbar









up vote
1
down vote

favorite












I have been trying to solve this for the past couple of days and I just can't figure out why this is happening. So, I have a navbar which I have added my discord channel and a link to an external website with icons. I have placed it in the middle of the existing code. If I try to move it to the end of the navbar the entire website turns into a link to one of the links. Here is my code.



This is my function I created so that my discord and external link shows up.



function showCustomHeader ($nameOfHeader,$url)

if($nameOfHeader == "Discord")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/discord2.png' width='28' height='28'>";


if($nameOfHeader == "Equihash Pool")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle; margin:
-5px;' src='/images/equihashpool.png' width='25' height='25'>";





echo '<div class="nav-wrapper">';
echo '<div class="tabmenu-out">';
echo '<div class="tabmenu-inner">';
echo '<a href="/">';
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/header.png' width='28' height='28'>";
echo '&nbsp'.YAAMP_SITE_NAME.'';
echo '</a>';
$action = controller()->action->id;
$wallet = user()->getState('yaamp-wallet');
$ad = isset($_GET['address']);


Then this is the rest of the code. If I move my custom headers further down near the bottom the entire on the website turns into a link and I cannot seem to figure out why...



showItemHeader(controller()->id=='site' && $action=='index' && !$ad, '/', 
'Home');
showItemHeader($action=='mining', '/site/mining', 'Pool');
showItemHeader(controller()->id=='site'&&($action=='index' ||
$action=='wallet') && $ad, "/?address=$wallet", 'Wallet');
showItemHeader(controller()->id=='stats', '/stats', 'Graphs');
showItemHeader($action=='miners', '/site/miners', 'Miners');
// Custom Header for Discord + Equihash pool
showCustomHeader('Discord','https://discord.gg/7cB9amA');
showCustomHeader('Equihash Pool','https://equihash.thedirtydozenpool.com');
if (YIIMP_PUBLIC_EXPLORER)
showItemHeader(controller()->id=='explorer', '/explorer', 'Explorers');


if (YIIMP_PUBLIC_BENCHMARK)
showItemHeader(controller()->id=='bench', '/bench', 'Benchs');



if (YAAMP_RENTAL)
showItemHeader(controller()->id=='renting', '/renting', 'Rental');



I apologise in advance if this is not formatted correctly or if I have put too much information out but I am truely stumped. Thank you for any assistance you can give me it is much appreciated./










share|improve this question





















  • I'm guessing you should end the anchor tags inside your if-statements?
    – Heiruspecs
    Nov 10 at 23:12










  • Wow, jeeze I feel like an idiot now. Thank you very much!
    – Eketubol
    Nov 10 at 23:23














up vote
1
down vote

favorite












I have been trying to solve this for the past couple of days and I just can't figure out why this is happening. So, I have a navbar which I have added my discord channel and a link to an external website with icons. I have placed it in the middle of the existing code. If I try to move it to the end of the navbar the entire website turns into a link to one of the links. Here is my code.



This is my function I created so that my discord and external link shows up.



function showCustomHeader ($nameOfHeader,$url)

if($nameOfHeader == "Discord")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/discord2.png' width='28' height='28'>";


if($nameOfHeader == "Equihash Pool")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle; margin:
-5px;' src='/images/equihashpool.png' width='25' height='25'>";





echo '<div class="nav-wrapper">';
echo '<div class="tabmenu-out">';
echo '<div class="tabmenu-inner">';
echo '<a href="/">';
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/header.png' width='28' height='28'>";
echo '&nbsp'.YAAMP_SITE_NAME.'';
echo '</a>';
$action = controller()->action->id;
$wallet = user()->getState('yaamp-wallet');
$ad = isset($_GET['address']);


Then this is the rest of the code. If I move my custom headers further down near the bottom the entire on the website turns into a link and I cannot seem to figure out why...



showItemHeader(controller()->id=='site' && $action=='index' && !$ad, '/', 
'Home');
showItemHeader($action=='mining', '/site/mining', 'Pool');
showItemHeader(controller()->id=='site'&&($action=='index' ||
$action=='wallet') && $ad, "/?address=$wallet", 'Wallet');
showItemHeader(controller()->id=='stats', '/stats', 'Graphs');
showItemHeader($action=='miners', '/site/miners', 'Miners');
// Custom Header for Discord + Equihash pool
showCustomHeader('Discord','https://discord.gg/7cB9amA');
showCustomHeader('Equihash Pool','https://equihash.thedirtydozenpool.com');
if (YIIMP_PUBLIC_EXPLORER)
showItemHeader(controller()->id=='explorer', '/explorer', 'Explorers');


if (YIIMP_PUBLIC_BENCHMARK)
showItemHeader(controller()->id=='bench', '/bench', 'Benchs');



if (YAAMP_RENTAL)
showItemHeader(controller()->id=='renting', '/renting', 'Rental');



I apologise in advance if this is not formatted correctly or if I have put too much information out but I am truely stumped. Thank you for any assistance you can give me it is much appreciated./










share|improve this question





















  • I'm guessing you should end the anchor tags inside your if-statements?
    – Heiruspecs
    Nov 10 at 23:12










  • Wow, jeeze I feel like an idiot now. Thank you very much!
    – Eketubol
    Nov 10 at 23:23












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have been trying to solve this for the past couple of days and I just can't figure out why this is happening. So, I have a navbar which I have added my discord channel and a link to an external website with icons. I have placed it in the middle of the existing code. If I try to move it to the end of the navbar the entire website turns into a link to one of the links. Here is my code.



This is my function I created so that my discord and external link shows up.



function showCustomHeader ($nameOfHeader,$url)

if($nameOfHeader == "Discord")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/discord2.png' width='28' height='28'>";


if($nameOfHeader == "Equihash Pool")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle; margin:
-5px;' src='/images/equihashpool.png' width='25' height='25'>";





echo '<div class="nav-wrapper">';
echo '<div class="tabmenu-out">';
echo '<div class="tabmenu-inner">';
echo '<a href="/">';
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/header.png' width='28' height='28'>";
echo '&nbsp'.YAAMP_SITE_NAME.'';
echo '</a>';
$action = controller()->action->id;
$wallet = user()->getState('yaamp-wallet');
$ad = isset($_GET['address']);


Then this is the rest of the code. If I move my custom headers further down near the bottom the entire on the website turns into a link and I cannot seem to figure out why...



showItemHeader(controller()->id=='site' && $action=='index' && !$ad, '/', 
'Home');
showItemHeader($action=='mining', '/site/mining', 'Pool');
showItemHeader(controller()->id=='site'&&($action=='index' ||
$action=='wallet') && $ad, "/?address=$wallet", 'Wallet');
showItemHeader(controller()->id=='stats', '/stats', 'Graphs');
showItemHeader($action=='miners', '/site/miners', 'Miners');
// Custom Header for Discord + Equihash pool
showCustomHeader('Discord','https://discord.gg/7cB9amA');
showCustomHeader('Equihash Pool','https://equihash.thedirtydozenpool.com');
if (YIIMP_PUBLIC_EXPLORER)
showItemHeader(controller()->id=='explorer', '/explorer', 'Explorers');


if (YIIMP_PUBLIC_BENCHMARK)
showItemHeader(controller()->id=='bench', '/bench', 'Benchs');



if (YAAMP_RENTAL)
showItemHeader(controller()->id=='renting', '/renting', 'Rental');



I apologise in advance if this is not formatted correctly or if I have put too much information out but I am truely stumped. Thank you for any assistance you can give me it is much appreciated./










share|improve this question













I have been trying to solve this for the past couple of days and I just can't figure out why this is happening. So, I have a navbar which I have added my discord channel and a link to an external website with icons. I have placed it in the middle of the existing code. If I try to move it to the end of the navbar the entire website turns into a link to one of the links. Here is my code.



This is my function I created so that my discord and external link shows up.



function showCustomHeader ($nameOfHeader,$url)

if($nameOfHeader == "Discord")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/discord2.png' width='28' height='28'>";


if($nameOfHeader == "Equihash Pool")
echo "<a href='$url' target='_blank' title='$nameOfHeader'>";
echo "<img style='display: inline-block; vertical-align:middle; margin:
-5px;' src='/images/equihashpool.png' width='25' height='25'>";





echo '<div class="nav-wrapper">';
echo '<div class="tabmenu-out">';
echo '<div class="tabmenu-inner">';
echo '<a href="/">';
echo "<img style='display: inline-block; vertical-align:middle'
src='/images/header.png' width='28' height='28'>";
echo '&nbsp'.YAAMP_SITE_NAME.'';
echo '</a>';
$action = controller()->action->id;
$wallet = user()->getState('yaamp-wallet');
$ad = isset($_GET['address']);


Then this is the rest of the code. If I move my custom headers further down near the bottom the entire on the website turns into a link and I cannot seem to figure out why...



showItemHeader(controller()->id=='site' && $action=='index' && !$ad, '/', 
'Home');
showItemHeader($action=='mining', '/site/mining', 'Pool');
showItemHeader(controller()->id=='site'&&($action=='index' ||
$action=='wallet') && $ad, "/?address=$wallet", 'Wallet');
showItemHeader(controller()->id=='stats', '/stats', 'Graphs');
showItemHeader($action=='miners', '/site/miners', 'Miners');
// Custom Header for Discord + Equihash pool
showCustomHeader('Discord','https://discord.gg/7cB9amA');
showCustomHeader('Equihash Pool','https://equihash.thedirtydozenpool.com');
if (YIIMP_PUBLIC_EXPLORER)
showItemHeader(controller()->id=='explorer', '/explorer', 'Explorers');


if (YIIMP_PUBLIC_BENCHMARK)
showItemHeader(controller()->id=='bench', '/bench', 'Benchs');



if (YAAMP_RENTAL)
showItemHeader(controller()->id=='renting', '/renting', 'Rental');



I apologise in advance if this is not formatted correctly or if I have put too much information out but I am truely stumped. Thank you for any assistance you can give me it is much appreciated./







javascript php html






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 23:03









Eketubol

62




62











  • I'm guessing you should end the anchor tags inside your if-statements?
    – Heiruspecs
    Nov 10 at 23:12










  • Wow, jeeze I feel like an idiot now. Thank you very much!
    – Eketubol
    Nov 10 at 23:23
















  • I'm guessing you should end the anchor tags inside your if-statements?
    – Heiruspecs
    Nov 10 at 23:12










  • Wow, jeeze I feel like an idiot now. Thank you very much!
    – Eketubol
    Nov 10 at 23:23















I'm guessing you should end the anchor tags inside your if-statements?
– Heiruspecs
Nov 10 at 23:12




I'm guessing you should end the anchor tags inside your if-statements?
– Heiruspecs
Nov 10 at 23:12












Wow, jeeze I feel like an idiot now. Thank you very much!
– Eketubol
Nov 10 at 23:23




Wow, jeeze I feel like an idiot now. Thank you very much!
– Eketubol
Nov 10 at 23:23

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244282%2fissue-with-navbar%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244282%2fissue-with-navbar%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Darth Vader #20

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Ondo