AIML Bot Response According To Time - chatbot

How to make bot response according to time? This is the code
<aiml>
<category>
<pattern>GOOD MORNING</pattern>
<template>
<think><set name="hour"><date format="%H:%M"/></set></think>
<condition name="hour">
<li value="10:54">Hello and how are you this morning?</li>
<li value="11:35">Hello and how are you this morning?</li>
</condition>
</template>
</category>
</aiml>
I want my bot respond according to hour and minute how to do this? Is there anything wrong with the code

While that will work, you will need to make <li> tags for every minute of the day! You may also need to remove your : depending on your normalization file.
You only really need to check the hour though, the minute doesn't matter.
<category>
<pattern>GOOD MORNING</pattern>
<template>
<think><set name="hour"><date format="%H"/></set></think>
<condition name="hour">
<li value="00">Hello, it's more like the middle of the night than morning.</li>
<li value="01">Hello, it's only just morning. How are you this morning?</li>
<li value="02">Hello, it's only just morning. How are you this morning?</li>
<li value="03">Hello and how are you this morning?</li>
<li value="04">Hello and how are you this morning?</li>
<li value="05">Hello and how are you this morning?</li>
<li value="06">Hello and how are you this morning?</li>
<li value="07">Hello and how are you this morning?</li>
<li value="08">Hello and how are you this morning?</li>
<li value="09">Hello and how are you this morning?</li>
<li value="10">Hello and how are you this morning?</li>
<li value="11">Hello and how are you this morning?</li>
<li value="12">You're a bit late. It's lunchtime here.</li>
<li value="13">You're a bit late. It's lunchtime here.</li>
<li value="14">Morning?! It's the afternoon here.</li>
<li value="15">Morning?! It's the afternoon here.</li>
<li value="16">Morning?! It's the afternoon here.</li>
<li value="17">Morning?! It's nearly evening.</li>
<li value="18">Morning?! It's evening here.</li>
<li value="19">Morning?! It's evening here.</li>
<li value="20">Morning?! It's evening here.</li>
<li value="21">Morning?! It's night time here.</li>
<li value="22">Morning?! It's night time here.</li>
<li value="23">Morning?! It's night time here.</li>
</condition>
</template>
</category>

Related

TYPO3 10.4: Menu of subpages with image

I would like to expand the content element "menu of subpages" with images from page resources.
In TYPO3 8.7 the following code did everything i needed:
<f:if condition="{menu}">
<ul class="pagemenu-img">
<f:for each="{menu}" as="page">
<li>
<a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')} title="{page.title}">
<f:image src="fileadmin/{page.files.0.originalFile.identifier}" />
<span>{page.title}</span>
</a>
</li>
</f:for>
</ul>
</f:if>
With TYPO3 10.4 this isn't working anymore.
Is there another way? Preferably without using VHS.
It's still working.
I have tested your HTML-Template and the result is as expected:
Your problems seem to be something other...
Maybe there were some pages which didn't have any images with them...
You should therefore check if there is an image present:
[and get rid of the hardcoded fileadmin/ link there by< just using {page.files.0.originalFile}]
<f:if condition="{menu}">
<ul class="pagemenu-img">
<f:for each="{menu}" as="page">
<li>
<a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')} title="{page.title}">
<f:if condition="{page.files.0}">
<f:image image="{page.files.0.originalFile}" />
</f:if>
<span>{page.title}</span>
</a>
</li>
</f:for>
</ul>
</f:if>

Dropdown Sidebar Menu Items in Laravel Backpack

In the Laravel Backpack docs they show an image that appears to have dropdown menus for the sidebar navigation menu, but I can't find anywhere that says how to use them. Is there a built in way or do I have to write my own styles?
In resources/views/vendor/backpack/base/inc/sidebar.blade.php you can add your own menu-items. Using .treeview and .treeview-menu you can make those items expandable:
See also the source code of that image.
<li class="treeview">
<i class="fa fa-key"></i> <span>Roles & Permissions</span> <i class="fa fa-angle-left pull-right"></i>
<ul class="treeview-menu">
<li>
<span>Roles</span>
</li>
<li>
<span>Permissions</span>
</li>
</ul>
</li>
As Oscar Torres pointed out, the new demo source for a nested menu lives here.
Backpack now uses Bootstrap's nav-dropdown class(es) to achieve these results:
<li class="nav-item nav-dropdown">
<a class="nav-link nav-dropdown-toggle" href="#"><i class="nav-icon la la-group"></i> Authentication</a>
<ul class="nav-dropdown-items">
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('user') }}"><i class="nav-icon la la-user"></i> <span>Users</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('role') }}"><i class="nav-icon la la-group"></i> <span>Roles</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('permission') }}"><i class="nav-icon la la-key"></i> <span>Permissions</span></a></li>
</ul>
</li>

Bootstrap navbar menu toggle not working

the toggle in my bootstrap navbar used to work but now has stopped doing so and won't show the menu when I decrease the screen size. The code I used is:
</head>
<body>
<div class="container-fluid" id="wrapper">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar2" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span><span class="icon-bar"></span></button>
<img src="images/logo.png" id="navbarlogo"></div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="defaultNavbar2">
<ul class="nav navbar-nav">
<li class="active"></li>
<li></li>
<li class="dropdown">
<ul class="dropdown-menu">
<li>Kontakt</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Über uns</li>
<li>Services</li>
<li class="dropdown">Kontakt<span class="caret"></span>
<ul class="dropdown-menu">
<li>Adresse</li>
<li>Impressum</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
Any ideas what's happened? Thanks!
I should start by checking that my support files are in place (css and js). navbar needs javascript in order to work properly.

JSTree formatting issue - jstree-icon floating to the right

I am having a problem with JSTree. I am using very basic examples but the <ins class="jstree-icon"> </ins> are floated all the way over to the right hand side of the tree area.
Here is the JS that fires it off:
$('#adminMenuArea').jstree({
"plugins" : ["html_data","ui","themes"]
});
Here is the HTML that I am using:
<div id="adminMenuArea">
<ul>
<li><a id='menu-4' href='menu-4'>About Us</a></li>
<li>
<a id='menu-6' href='menu-6'>Services</a><!-- in -->
<ul>
<li><a id='menu-7' href='menu-7'>Service 1</a></li>
<li><a id='menu-8' href='menu-8'>Service 2</a></li>
<li>
<a id='menu-9' href='menu-9'>Service 3</a><!-- in -->
<ul>
<li><a id='menu-18' href='menu-18'>Sub Services1</a></li>
<li><a id='menu-17' href='menu-17'>Sub Services 2</a></li>
</ul>
</li>
</ul>
</li>
<li><a id='menu-13' href='menu-13'>Employment</a></li>
<li><a id='menu-14' href='menu-14'>Contact Us</a></li>
</ul>
</div>
Any help is much appreciated.
The problem was that all of the anchor tags <a> were floating left due to some other CSS in my system.

A select form alternative with list

neHello, I would like to make 3 selectable item in my advanced serach but I want use <select> and <option>.
I would like to use <ul><li> and a SEND like a button submit.
Do you know some tutorial or website where explain this?
I would prefer to use jquery.
After the submit, I want go to the page
avanced_search.php?label_1=&&label_2=paris&&label_3=S
I have this :
<ul id="label_1">
<li title="">All</li>
<li title="Belgique">Belgique</li>
<li title="France">France</li>
<li title="Espagne">Espagne</li>
<li title="USA">USA</li>
</ul>
<ul id="label_2">
<li title="">All</li>
<li title="Gantt">Gantt</li>
<li title="Bruges">Bruges</li>
<li title="Paris">Paris</li>
<li title="Marseille">Marseille</li>
<li title="Madrid">Madrid</li>
<li title="Barcelone">Barelone</li>
<li title="NY">NY</li>
<li title="LA">LA</li>
</ul>
<ul id="label_3">
<li title="">All</li>
<li title="N">Nord</li>
<li title="E">Est</li>
<li title="S">Sud</li>
<li title="O">OUEST</li>
</ul>
<a id="send_all">SEND</a>
It's not required to select an option. (default is nothing)
For design, I would to have "All" selected, when I clik on, the list appear and when I click on Paris (for example) I have Paris selected and "All" unselected .
More but not required, if it's possible, when I choose USA in the label 1 Can I have just LA and NY?
Thanks for your help!