Home Backend Development PHP Tutorial CoreThink theme development (8) Using H-ui to develop blog themes before and after user login

CoreThink theme development (8) Using H-ui to develop blog themes before and after user login

Jul 29, 2016 am 08:50 AM
gt javascript lt script span

Thank you H-ui, thank you CoreThink!

Rendering:
CoreThink theme development (8) Using H-ui to develop blog themes before and after user login
After logging in
CoreThink theme development (8) Using H-ui to develop blog themes before and after user login
Login form
CoreThink theme development (8) Using H-ui to develop blog themes before and after user login
If I want to make a drop-down menu after logging in, I can't do it, so it will be displayed normally. . .
In the entire breadcrumb navigation, the modules are first traversed, and the modules are allowed to be displayed in the foreground. After that, it is judged whether the user has logged in. If already logged in, the personal center will be displayed, otherwise the login and registration buttons will be displayed.
Code:

1

2

3

4

5

<code><span>nav</span><span>class</span>=<span>"breadcrumb"</span>><span>div</span><span>class</span>=<span>"container"</span>><span>span</span><span>class</span>=<span>"c-gray en"</span>><span>i</span><span>class</span>=<span>"Hui-iconfont"</span>><span><span>i</span>></span><span>a</span><span>href</span>=<span>"#"</span>>您好,欢迎来到 {:C('WEB_SITE_TITLE')} !<span><span>a</span>></span><span><!-- 系统模块导航 开始--></span><span>opencmf:nav_list</span><span>name</span>=<span>"vo"</span><span>pid</span>=<span>"0"</span>><span>a</span><span>target</span>=<span>"{$vo.target}"</span><span>href</span>=<span>"{$vo.href}"</span>><span>span</span>> {$vo.title}<span><span>span</span>></span><span><span>a</span>></span><span><span>opencmf:nav_list</span>></span><span><!-- 系统模块导航 结束--></span><span><span>span</span>></span><span>present</span><span>name</span>=<span>"_user_auth"</span>><span>a</span><span>href</span>=<span>"#"</span> ><span>img</span><span>class</span>=<span>"round"</span><span>src</span>=<span>"{$_user_auth.avatar|get_cover='avatar'}"</span><span>height</span>=<span>"30px"</span><span>width</span>=<span>"30px"</span><span>alt</span>=<span>"{$_user_auth.nickname}"</span> /><span>span</span>>{$_user_auth.nickname}

                           <span>span</span>>

                               {$_new_message}

                           <span><span>span</span>></span><span><!-- 新消息数量 --></span><span><span>span</span>></span><span>span</span><span>class</span>=<span>"caret"</span>><span><span>span</span>></span><span><span>a</span>></span><span>a</span><span>href</span>=<span>"{:U('User/Index/home', array('uid' => $_user_auth['uid']), true, true)}"</span>><span>span</span><span>class</span>=<span>"label label-secondary radius"</span>>个人主页<span><span>span</span>></span><span><span>a</span>></span><span>volist</span><span>name</span>=<span>"_user_nav_main"</span><span>id</span>=<span>"vo_nav"</span>><span>a</span><span>href</span>=<span>"{:U($vo_nav['url'], null, true, true)}"</span><span>class</span>=<span>"{$vo_nav.class}"</span>><span>span</span><span>class</span>=<span>"label label-secondary radius"</span>>

                            {$vo_nav.title}<span><span>span</span>></span><span><span>a</span>></span><span><span>volist</span>></span><span>a</span><span>href</span>=<span>"{:U('User/User/logout', null, true, true)}"</span><span>class</span>=<span>"ajax-get"</span>><span>span</span><span>class</span>=<span>"label label-danger radius"</span>>注销登录<span><span>span</span>></span><span><span>a</span>></span><span>else</span>/><span>a</span><span>class</span>=<span>"btn btn-success-outline radius"</span><span>data-toggle</span>=<span>"modal"</span><span>href</span>=<span>"#register-modal"</span>>注册<span><span>a</span>></span><span>a</span><span>class</span>=<span>"btn btn-danger-outline radius"</span><span>data-toggle</span>=<span>"modal"</span><span>href</span>=<span>"#login-modal"</span>>登录<span><span>a</span>></span><span><span>present</span>></span><span><span>div</span>></span><span><span>nav</span>></span></code>

Copy after login

Blog/Home/Public/layout.html

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

<code><span><span>html</span>></span><span>head</span>><span>meta</span><span>charset</span>=<span>"utf-8"</span>><span>meta</span><span>name</span>=<span>"renderer"</span><span>content</span>=<span>"webkit|ie-comp|ie-stand"</span>><span>meta</span><span>http-equiv</span>=<span>"X-UA-Compatible"</span><span>content</span>=<span>"IE=edge"</span>><span>meta</span><span>name</span>=<span>"viewport"</span><span>content</span>=<span>"width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"</span>/><span>meta</span><span>http-equiv</span>=<span>"Cache-Control"</span><span>content</span>=<span>"no-siteapp"</span>/><span><!--[if lt IE 9]>

    <script type="text/javascript" src="__HOME_LIBS__/html5.js"></script>

    <script type="text/javascript" src="__HOME_LIBS__/respond.min.js"></script>

    <script type="text/javascript" src="__HOME_LIBS__/PIE_IE678.js"></script>

    <![endif]--></span><span>link</span><span>rel</span>=<span>"stylesheet"</span><span>type</span>=<span>"text/css"</span><span>href</span>=<span>"__HOME_CSS__/H-ui.min.css"</span>/><span>link</span><span>rel</span>=<span>"stylesheet"</span><span>type</span>=<span>"text/css"</span><span>href</span>=<span>"__HOME_LIBS__/Hui-iconfont/1.0.7/iconfont.css"</span>/><span>link</span><span>rel</span>=<span>"stylesheet"</span><span>type</span>=<span>"text/css"</span><span>href</span>=<span>"__HOME_LIBS__/icheck/icheck.css"</span>/><span>link</span><span>rel</span>=<span>"stylesheet"</span><span>type</span>=<span>"text/css"</span><span>href</span>=<span>"__HOME_CSS__/style.css"</span>/><span><!--[if IE 6]>

    <script type="text/javascript" src="__HOME_LIBS__/DD_belatedPNG_0.0.8a-min.js"></script>

    <script>DD_belatedPNG.fix('*');</script>

    <![endif]--></span><span>block</span><span>name</span>=<span>"title"</span>><span>title</span>>{:C('WEB_SITE_TITLE')}<span><span>title</span>></span><span><span>block</span>></span><span>meta</span><span>name</span>=<span>"keywords"</span><span>content</span>=<span>"关键词,5个左右,单个8汉字以内"</span>><span>meta</span><span>name</span>=<span>"description"</span><span>content</span>=<span>"网站描述,字数尽量空制在80个汉字,160个字符以内!"</span>><span><span>head</span>></span><span>body</span>><span>div</span><span>class</span>=<span>"clearfix hook hook-page-header"</span>>

    {:hook('PageHeader')} <span><!-- 文档开始钩子 --></span><span><span>div</span>></span><span><!-- 页面导航,支持二级菜单 --></span><span>header</span><span>class</span>=<span>"navbar-wrapper"</span>><span>div</span><span>class</span>=<span>"navbar navbar-black navbar-fixed-top"</span>><span>div</span><span>class</span>=<span>"container cl"</span>><span>a</span><span>class</span>=<span>"logo navbar-logo hidden-xs"</span><span>href</span>=<span>"/aboutHui.shtml"</span>>{:C('WEB_SITE_TITLE')}<span><span>a</span>></span><span>a</span><span>class</span>=<span>"logo navbar-logo-m visible-xs"</span><span>href</span>=<span>"/aboutHui.shtml"</span>>H-ui<span><span>a</span>></span><span>span</span><span>class</span>=<span>"logo navbar-slogan hidden-xs"</span>>{:C('WEB_SITE_SLOGAN')}<span><span>span</span>></span><span>a</span><span>aria-hidden</span>=<span>"false"</span><span>class</span>=<span>"nav-toggle Hui-iconfont visible-xs"</span><span>href</span>=<span>"javascript:;"</span>><span><span>a</span>></span><span>nav</span><span>class</span>=<span>"nav navbar-nav nav-collapse"</span><span>role</span>=<span>"navigation"</span><span>id</span>=<span>"Hui-navbar"</span>><span>ul</span><span>class</span>=<span>"cl"</span>><span>li</span>><span>a</span><span>href</span>=<span>"{:C('HOME_PAGE')}"</span>>首页<span><span>a</span>></span><span><span>li</span>></span><span>cms:category_list</span><span>name</span>=<span>"vo"</span><span>pid</span>=<span>"0"</span><span>group</span>=<span>"1"</span>><span>php</span>>if($vo['_child']):<span><span>php</span>></span><span>li</span><span>class</span>=<span>"dropDown dropDown_hover"</span>><span>a</span><span>href</span>=<span>"{$vo.href}"</span><span>class</span>=<span>"dropDown_A"</span><span>data-toggle</span>=<span>"dropdown"</span><span>role</span>=<span>"button"</span>>

                                {$vo.title} <span>span</span><span>class</span>=<span>"caret"</span>><span><span>span</span>></span><span><span>a</span>></span><span>ul</span><span>class</span>=<span>"dropDown-menu menu radius box-shadow"</span>><span>volist</span><span>name</span>=<span>"vo._child"</span><span>id</span>=<span>"vo1"</span>><span>li</span>><span>a</span><span>href</span>=<span>"{$vo1.href}"</span>>{$vo1.title}<span><span>a</span>></span><span><span>li</span>></span><span><span>volist</span>></span><span><span>ul</span>></span><span><span>li</span>></span><span>php</span>>else:<span><span>php</span>></span><span>li</span>><span>a</span><span>href</span>=<span>"{$vo.href}"</span>><span>span</span>> {$vo.title}<span><span>span</span>></span><span><span>a</span>></span><span><span>li</span>></span><span>php</span>>endif;<span><span>php</span>></span><span><span>cms:category_list</span>></span><span><span>ul</span>></span><span><span>nav</span>></span><span>nav</span><span>class</span>=<span>"navbar-userbar hidden-xs"</span>><span><span>nav</span>></span><span><span>div</span>></span><span><span>div</span>></span><span><span>header</span>></span><span>nav</span><span>class</span>=<span>"breadcrumb"</span>><span>div</span><span>class</span>=<span>"container"</span>><span>span</span><span>class</span>=<span>"c-gray en"</span>><span>i</span><span>class</span>=<span>"Hui-iconfont"</span>><span><span>i</span>></span><span>a</span><span>href</span>=<span>"#"</span>>您好,欢迎来到 {:C('WEB_SITE_TITLE')} !<span><span>a</span>></span><span><!-- 系统模块导航 开始--></span><span>opencmf:nav_list</span><span>name</span>=<span>"vo"</span><span>pid</span>=<span>"0"</span>><span>a</span><span>target</span>=<span>"{$vo.target}"</span><span>href</span>=<span>"{$vo.href}"</span>><span>span</span>> {$vo.title}<span><span>span</span>></span><span><span>a</span>></span><span><span>opencmf:nav_list</span>></span><span><!-- 系统模块导航 结束--></span><span><span>span</span>></span><span>present</span><span>name</span>=<span>"_user_auth"</span>><span>a</span><span>href</span>=<span>"#"</span> ><span>img</span><span>class</span>=<span>"round"</span><span>src</span>=<span>"{$_user_auth.avatar|get_cover='avatar'}"</span><span>height</span>=<span>"30px"</span><span>width</span>=<span>"30px"</span><span>alt</span>=<span>"{$_user_auth.nickname}"</span> /><span>span</span>>{$_user_auth.nickname}

                           <span>span</span>>

                               {$_new_message}

                           <span><span>span</span>></span><span><!-- 新消息数量 --></span><span><span>span</span>></span><span>span</span><span>class</span>=<span>"caret"</span>><span><span>span</span>></span><span><span>a</span>></span><span>a</span><span>href</span>=<span>"{:U('User/Index/home', array('uid' => $_user_auth['uid']), true, true)}"</span>><span>span</span><span>class</span>=<span>"label label-secondary radius"</span>>个人主页<span><span>span</span>></span><span><span>a</span>></span><span>volist</span><span>name</span>=<span>"_user_nav_main"</span><span>id</span>=<span>"vo_nav"</span>><span>a</span><span>href</span>=<span>"{:U($vo_nav['url'], null, true, true)}"</span><span>class</span>=<span>"{$vo_nav.class}"</span>><span>span</span><span>class</span>=<span>"label label-secondary radius"</span>>

                            {$vo_nav.title}<span><span>span</span>></span><span><span>a</span>></span><span><span>volist</span>></span><span>a</span><span>href</span>=<span>"{:U('User/User/logout', null, true, true)}"</span><span>class</span>=<span>"ajax-get"</span>><span>span</span><span>class</span>=<span>"label label-danger radius"</span>>注销登录<span><span>span</span>></span><span><span>a</span>></span><span>else</span>/><span>a</span><span>class</span>=<span>"btn btn-success-outline radius"</span><span>data-toggle</span>=<span>"modal"</span><span>href</span>=<span>"#register-modal"</span>>注册<span><span>a</span>></span><span>a</span><span>class</span>=<span>"btn btn-danger-outline radius"</span><span>data-toggle</span>=<span>"modal"</span><span>href</span>=<span>"#login-modal"</span>>登录<span><span>a</span>></span><span><span>present</span>></span><span><span>div</span>></span><span><span>nav</span>></span><span>block</span><span>name</span>=<span>"main"</span>><span><span>block</span>></span><span><!--页脚--></span><span>footer</span><span>class</span>=<span>"footer mt-20"</span>><span>div</span><span>class</span>=<span>"container"</span>><span>p</span>>{:C('WEB_SITE_COPYRIGHT')} <span>br</span>><span>a</span><span>rel</span>=<span>"nofollow"</span><span>target</span>=<span>"_blank"</span><span>href</span>=<span>"http://www.miitbeian.gov.cn/"</span>>

                {:C('WEB_SITE_ICP')}

            <span><span>a</span>></span><span><span>p</span>></span><span><span>div</span>></span><span><span>footer</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/jquery/1.9.1/jquery.min.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/layer/2.1/layer.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/laypage/1.2/laypage.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/My97DatePicker/WdatePicker.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/icheck/jquery.icheck.min.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/bootstrap-Switch/bootstrapSwitch.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/Validform/5.3.2/Validform.min.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/Validform/5.3.2/passwordStrength-min.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_JS__/H-ui.js"</span>><span><span>script</span>></span><span>script</span>><span><span>var</span> navigation = responsiveNav(<span>"Hui-navbar"</span>, {customToggle: <span>".nav-toggle"</span>});

 

    $(<span><span>function</span><span>()</span> {</span>

        $(<span>'.skin-minimal input'</span>).iCheck({

            checkboxClass: <span>'icheckbox-blue'</span>,

            radioClass: <span>'iradio-blue'</span>,

            increaseArea: <span>'20%'</span>

        });

        $(<span>"#demoform"</span>).Validform({

            tiptype: <span>2</span>

        });

    });

</span><span><span>script</span>></span><span><span>block</span>></span><span>div</span><span>class</span>=<span>"clearfix hook hook-page-footer"</span>>

    {:hook('PageFooter')} <span><!-- 文档末尾钩子 --></span><span><span>div</span>></span><span>include</span><span>file</span>=<span>"$_user_login_modal"</span>/><span><!-- 登录弹窗 --></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/bootstrap-modal/2.2.4/bootstrap-modalmanager.js"</span>><span><span>script</span>></span><span>script</span><span>type</span>=<span>"text/javascript"</span><span>src</span>=<span>"__HOME_LIBS__/bootstrap-modal/2.2.4/bootstrap-modal.js"</span>><span><span>script</span>></span><span>block</span><span>name</span>=<span>"script"</span>><span><span>block</span>></span><span><span>body</span>></span><span><span>html</span>></span><span><!--H-ui前端框架提供前端技术支持 h-ui.net @2015-8-4 --></span></code>

Copy after login

markdown is really easy to use

:)

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces CoreThink theme development (8) Using H-ui to develop blog themes before and after user login, including think and user login. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

How to use JavaScript and WebSocket to implement a real-time online ordering system How to use JavaScript and WebSocket to implement a real-time online ordering system Dec 17, 2023 pm 12:09 PM

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to implement an online reservation system using WebSocket and JavaScript How to implement an online reservation system using WebSocket and JavaScript Dec 17, 2023 am 09:39 AM

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

How to use insertBefore in javascript How to use insertBefore in javascript Nov 24, 2023 am 11:56 AM

Usage: In JavaScript, the insertBefore() method is used to insert a new node in the DOM tree. This method requires two parameters: the new node to be inserted and the reference node (that is, the node where the new node will be inserted).

See all articles