This hack allows you to use [declination=X][/declination] tags in all.tpl files of the template and makes a minor but convenient change to the operation of these tags.

Open index.php in the root of the site and find:
echo $tpl->result['main'];
Insert above:
$tpl->result['main'] = preg_replace_callback ( "#\\[declination=(\d+)\\](.+?)\\[/declination\\]#is", "declination", $tpl->result['main'] );
Open File engine/modules/functions.php and find:
return $matches[1]." ".$word;
Replace with:
return $word;
Done.

Now I will tell you about the change in the operation of these tags.
If you use such a construction:
You have [declination={new-pm}]reported|s|s/s[/declination]
Then the result on the page will look like this:
You have 10 messages
This hack removes the number and the space between the word, leaving only the declined word, creating the need to write a numeric tag additionally. Thus, it allows you to use more complex constructions of this type:
You have {new-pm} [declination={new-pm}]new|oe|s|s[/declination] [declination={new-pm}]reported[/declination]
The result on the page will look like this:
You have 10 new messages
Who did not understand, without revision - it would look like this:
You have 10 10 new 10 messages

I hope it will be useful in your projects ;)
Thank you for your attention!




Information

Visitors who are in the group Guests they can't download files.
Log in to the site under your login and password or if you are a new user go through the process registrations on the website.

Comments:

This publication has no comments yet. You can be the first!

Information the publication:

Related News

26 December 2022
DLE hacks
We change the annoying

Title: Changing the annoying xfsearch to a more logical word in the address Author: everyone who thought of it The

Read more
26 December 2022
DLE hacks
Expanding the

Expanding the functionality of the template engine

Read more
26 December 2022
DLE hacks
Additional fields by

Title: Additional fields by category [DLE ALL] Author: everyone who thought of it The author of this method:

Read more
26 December 2022
DLE hacks
The second button is

Adding a second "Discuss on the Forum" button to BulletEnergy 1.3

Read more
14 November 2022
OpenCart script»,OpenCart modules
SEO Tags PRO module for

The module for website promotion by keywords in search engines is SEO Tags PRO Opencart 3.0. It will help you

Read more

Information

Users of 🆅🅸🆂🅸🆃🅾🆁 are not allowed to comment this publication.

Site Search

Site Menu


☑ Websites Scripts

Calendar

«    December 2024    »
MonTueWedThuFriSatSun
 1
2345678
9101112131415
16171819202122
23242526272829
3031 

Advertisement

Survey on the website

Evaluate the work of the site
 

Statistics

  • +5 Total articles 6749
  • +17 Comments 4218
  • +26 Users : 6013