Only show a tab/page only for an IP - html

Hello so basically I want to make an hidden page/tab that will only show for a specific IP
<ul class="right" id="menu">
<li>
<a class="selected" href="#msg">TEST</a>
</li>
</ul>

You'll need some PHP for this.
<?php
// The <ul> is only showed for this IP adress
if($_SERVER["REMOTE_ADDR"]=='0.0.0.0'){ ?>
<ul class="right" id="menu">
<li>
<a class="selected" href="#msg">TEST</a>
</li>
</ul>
<?php } ?>

Related

Materialize v1.0.0 hide-on-med-and-down not working in chrome

hide-on-med-and-down works fine in firefox 68.0b1 and safari 12.1 which means that with a screen width <= 992px my ul with the class .hide-on-med-and-down is not shown and when > 992px, it is shown as expected. As this menu appears in chrome with another code, it is seems not related to the chrome browser.
BUT on chrome only, when the screen is > 992px, the content of the ul keep not showing! But with another
I have tried the replace the class hide-on-med-and-down with show-on-large but the result is also unexpected (the ul keep showing on small screen).
<nav class="teal">
<div class="container">
<div class="nav-wrapper">
AMV
<a href="#" data-target="mobile-nav" class="sidenav-trigger>
<i class="material-icons">menu</i>
</a>
<ul class="right hide-on-med-and-down">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
</ul>
</div>
</div>
</nav>
<ul class="sidenav " id="mobile-nav">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
</ul>
<script type="text/javascript" src="js/materialize.js">
$(document).ready(function(){
$('.sidenav').sidenav();
});
</script>
The issue was related to the screen who was magnified and I did not care about this parameter. As I reset the zoom to 100%, the menu was showie as expected.
That is because you are not using variable sign or double quotes for string deceleration in <a href="<?php echo URLROOT; ?>
and you have also missed double quotes in class="sidenav-trigger>
so if you run your code the sidevav wont work Anymore
Try Fixing href in all of the <a href="<?php echo URLROOT; ?> tag of your ul
eg. example
<nav class="teal">
<div class="container">
AMV
<div class="nav-wrapper">
<a href="#" data-target="mobile-nav" class="sidenav-trigger">
<i class="material-icons">menu</i>
</a>
<ul class="right hide-on-med-and-down">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
</ul>
</div>
</div>
</nav>
<ul class="sidenav " id="mobile-nav">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
</ul>
<script type="text/javascript" src="js/materialize.js">
$(document).ready(function(){
$('.sidenav').sidenav();
});
</script>

How to stop yii2 from surfing into my commented code

How to prevent Yii2 from compiling commented code.
I am new to yii2 and I need to comment some code for later use. Of course the commented code is not working (And that is why it is commented for now) but yii2 prompts errors from amongst them.
<ul class="nav nav-tabs">
<li class="active">
آمار
</li>
<li>
مشخصات
</li>
<!--
<li>
سفارش ها: <?=$model['dataProviderCourierOrders_totalConut']?>
</li>
-->
<li class="disabled">
پیام ها
</li>
</ul>
I get:
Undefined Index: dataProviderCourierOrders_totalConut
Is there a way to stop the commeted code from getting processed in yii2?
You should use the proper comment for php too eg:
<ul class="nav nav-tabs">
<li class="active">
آمار
</li>
<li>
مشخصات
</li>
<!--
<li>
<a href="javascript:void();" id="link_customer_orders">سفارش ها:
<?php // echo $model['dataProviderCourierOrders_totalConut'] ?> </a>
</li>
-->
<li class="disabled">
پیام ها
</li>
</ul>
First solution to comment html with php code show below example
use <?php /* Comment Html or PHP Code Here */ ?> show below
<ul class="nav nav-tabs">
<li class="active">
آمار
</li>
<li>
مشخصات
</li>
<?php /*
<li>
سفارش ها: <?=$model['dataProviderCourierOrders_totalConut']?>
</li>
*/ ?>
<li class="disabled">
پیام ها
</li>
Second solution to comment only php code show below example
use <?= PHP Code ?> to <?php // PHP Code ?> show below
<ul class="nav nav-tabs">
<li class="active">
آمار
</li>
<li>
مشخصات
</li>
<!--
<li>
سفارش ها: <?php // $model['dataProviderCourierOrders_totalConut'] ?>
</li>
-->
<li class="disabled">
پیام ها
</li>
Refer Yii 2 Core Framework Code Style maybe help full to you

Change tabs according to the link

How can i switch tabs with the links?
This is my current state
<div class="tabbable-panel">
<div class="tabbable-line">
<ul class="nav nav-tabs">
<li class="active">
Home
</li>
<li class="">
Sources
</li>
<li>
Contact Us
</li>
</ul>
</div>
</div>
I can switch between tabs just fine but when i try to make it so that the href lead to another link, it doesn't work. when i change
Home
to
Home
it doesn't work. but then i tried removing the data-toggle and it opens the link but it doesn't show that the tab is active.
Remove the data-toggle and replace it with class="active"
<div class="tabbable-panel">
<div class="tabbable-line">
<ul class="nav nav-tabs">
<li class="active">Home</li>
<li>Sources</li>
<li>Contact Us</li>
</ul>
</div>
</div>
There could be two issues
1. bootstrap.min.js file is not added to the page
2.Specify the data-toggle="tab" on each tab, as well as create a .tab-pane with unique ID for every tab and wrap them in .tab-content.
Codepen- http://codepen.io/nagasai/pen/JKEYod
I figured it out with using some php. here's my code
<div class="tabbable-panel">
<div class="tabbable-line">
<?php
$hom = #_URL.'/home.php';
$sorc = #_URL.'/sources.php';
$cont = #_URL.'/contact.php';
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"
?>
<ul class="nav nav-tabs">
<li class="<?php if($link==$hom){echo "active";}else{echo "";} ?>">
Home
</li>
<li class="<?php if($link==$sorc){echo "active";}else{echo "";} ?>">
Sources
</li>
<li class="<?php if($link==$cont){echo "active";}else{echo "";} ?>">
Contact Us
</li>
</ul>
</div>
</div>
and now it works perfectly

HTML UL LI a href links not working

I am working on a website and for the menu I have the following code:
<header>
<div class="sticky-nav">
<a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>
<nav id="menu">
<ul id="menu-nav">
<li>Home
</li>
<li>Clubs
</li>
<li>Campaigns
</li>
<li>Movement
</li>
<li>Events
</li>
<li>The Talk
</li>
<li>Resources
</li>
<li>Donate
</li>
<li>#Aevidum
</li>
<li>Contact
</li>
</ul>
</nav>
</div>
</header>
But when I click on the home link it doesn't go anywhere or do anything. Anyone know what the issue could be?
Here is a link to the directory I'm working on it in: http://aevidum.com/brushed/
I think some java-script or jquery function is overriding your current functionality, because the code which you posted works fine without any includes.
<header>
<div class="sticky-nav">
<a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>
<nav id="menu">
<ul id="menu-nav">
<li>Home
</li>
<li>Clubs
</li>
<li>Campaigns
</li>
<li>Movement
</li>
<li>Events
</li>
<li>The Talk
</li>
<li>Resources
</li>
<li>Donate
</li>
<li>#Aevidum
</li>
<li>Contact
</li>
</ul>
</nav>
</div>
</header>
I guess you may be using the Brushed Template by Alessio Atzeni?
I had the same problem. Below is the full nav section I have, and where I added a class 'linkfix_LogIn' to the link I needed to be not a relative anchor.
<header>
<div class="sticky-nav">
<a id="mobile-nav" class="menu-nav" href="#menu-nav"></a>
<div id="logo">
<a id="goUp" href="#home-slider" title="Home">Home</a>
</div>
<nav id="menu">
<ul id="menu-nav">
<li class="current">Home</li>
<li>What Is This</li>
<li>Contact</li>
<li class="linkfix_LogIn">Outside Link</li>
</ul>
</nav>
</div>
</header>
Also in the main.js file, amend the following inside this function:
BRUSHED.listenerMenu = function(){
And add this little method at the bottom:
// Fix outside links.
$('.linkfix_LogIn a').on('click',function() {
window.location.href = "http://www.YourURL.com"; // Change This
});
If you use "Brushed Template by Alessio Atzeni", It seems to be caused by "plugin.js".
Get "jquery.nav.js" from the following page.
https://github.com/davist11/jQuery-One-Page-Nav
Then overwrite the code of "jQuery One Page Nav Plugin" in the last part of "plugin.js" (near the 30th line to the end) with the contents of "jquery.nav.js".
I was able to solve the same problem in this way.
I hope this helps someone.
Issue might be with the jquery come with your template. If nothing worked out use a javascript onclick function on the 'href' tag to redirect
onclick="window.open('https://www.yoursite.com/mypage')"
If you want to mention the target type use this instead
onclick="window.open('https://www.yoursite.com/mypage', '_blank')"
I had the same problem. I just added diplay: block on the a tag. It's worked for me!
ul li a {
display: block;
}
Proceed like this everything is gonna work perfectly .
<ul class="nav-links">
<li> Home</li>
<li> Tours</li>
<li> Explore </li>
<li>About</li>
</ul>

How can I keep the user's last stage when the user's navigate to other's page and come back?

Hi I have html pages and jsp page
<div id="body">
<div id="header">
<div>
<div class="logo">
</div>
<ul id="navigation">
<li>
Features
</li>
<li>
News
</li>
<li>
About
</li>
<li>
Contact
</li>
<!-- <li class="active">
Login
</li> -->
</ul>
</div>
</div>
I have no idea how can I do when the user logged in and went back to features.html or other pages and coming back to the page the user's had logged in I want to show the last stage that user is in.Please help me.How can I do that?
Thanks