Home > CMS Tutorial > Empire CMS > Imperial cms universal tag realizes the method of automatically adding ellipses after title interception

Imperial cms universal tag realizes the method of automatically adding ellipses after title interception

silencement
Release: 2019-11-25 13:54:48
forward
2570 people have browsed it

Imperial cms universal tag realizes the method of automatically adding ellipses after title interception

Many webmasters who use Imperial CMS to build their websites will encounter situations where the title is too long, resulting in confusing page layout. At this time, it is often necessary to intercept the title and add an ellipsis to solve it. In this regard, the Empire CMS universal tag title will automatically add ellipses after intercepting it. If the word count is not reached, ellipses will not be added. You can use the following method to solve the problem:

1. Open e/class/connect.php

Query the ReplaceListVars function and find the

code at approximately line 2224:

if(!empty($subtitle))//截取字符
Copy after login

Add the code below:

The code is as follows:

if ($r[title] != $r[oldtitle])
{
$value=sub($value,0,$subtitle,false,'...');
}

The modified code is as follows:

The code is as follows:

if(!empty($subtitle))//Intercept characters
{
if($r[title] != $r[oldtitle])
{
$value=sub($value,0,$subtitle,false,'...');
}
}

2. Open e/class/t_functions.php

Find approximately at line 637:

The code is as follows:

$r[oldtitle]=$r[title];

Approximately at line 638, that is, add below $r[oldtitle]=$r[title];

The code is as follows:

$r[title]=sub ($r[title],0,$strlen,false);

The modified code is as follows:

The code is as follows:

while($r=$empire- >fetch($sql))
{
$r[oldtitle]=$r[title];
//Modify
$r[title]=sub($r[title], 0,$strlen,false);

The above is the detailed content of Imperial cms universal tag realizes the method of automatically adding ellipses after title interception. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template