Thursday, 20 June 2019

Content Management System (CMS) and the Application of Regular Expressions

The text, pictures and auxiliary items in a web page placed in the body tag of the HTML document that present readable opinion that are relevant to the needs of site visitors are called content. They usually require modifications and amendments from grow old-fashioned to epoch and the frequency depends on the subject of the type and level of ruckus going re in the doling out of the site's owner. The task of effecting these changes upon content is known as content admin which can pretend to have an skirmish allocation or the quantity up of a web page at the instance of removal, add together, and editing of the existing content. Being a fine and anyhow inevitable practice of forever updating web sites, there is the dependence to make a structure for content doling out of a site. This structure is known as Content Management System (CMS). Content Management System can taking office two forms- the structure that uses HTML templates and the structure that uses database-driven site model.

Content Management System that relies upon HTML templates is structured to operate changes to a page off-heritage followed by uploading to the take control of book of the site. The content and the HTML codes are interspersed. For Content Management System that uses database-driven site model, the content is divided from the HMTL file. When a site is database-driven, the content printed upon the browser is from the database and not from the static HTML codes take to the lead the page prior to uploading. Thus, once dealing in the back appendage content in a database-driven site model, two relevant issues habit to be considered- content flexibility and content printing.

For more info agen bola 188

1. Content concur - You take on new content via forms. Because of the isolation of HTML document from content in database-driven site, you may have to pay for for content formatting to the fore agreement especially if it is a long text. Some Content Management System use form behind ready-made tools for take taking place formatting of the text such as boldface, underline, italics etc. It is realizable for you to make custom tags and put them in the take possession of places in your text if you are using unidentified form lacking formatting facilities. Such tags enable you make paragraphs, boldface, underline etc. This is where the use of regular expressions come into operate for the direct of interpreting those custom tags for formatting upon the browser.

Regular expressions (Regexes) are in set sights on of fact a declarative language for (string) pattern matching. Using regular expressions, we can:

See if a string matches a specified pattern as a amassed.
Search within a string for a substring matching a specified pattern.
Extract substrings matching a specified pattern from a string.
SQL SELECT avowal will song for where the pattern in its WHERE clause matches the string in the specified table column(s) e.g. SELECT * FROM news WHERE content following '%passion%'. Its functionality is limited to matching pattern once an entire string. Regular expressions go auxiliary than that by matching patterns when substrings in a string and that is why it is a totally fascinating and powerful tool for searching long text.

There are various types of regular expressions each considering its set of functions. PHP, for example, supports POSIX regular expressions and Perl Compatible Regular Expressions. POSIX is the acronym for Portable Operating System Interface. Examples of POSIX regular expressions functions are ereg(), eregi(), ereg_replace(), and eregi_replace(). Some PERL functions are preg_match(), preg_match_all, and preg_replace().

2. Content printing - Submitted content to a database table will contain custom tags taking into account [PA] for paragraph and [UND] for underline, positioned in the take possession of places in the text. They are greater than before created the mannerism you will be of the same mind. The script that will right to use and print upon the browser the formatted content will contain the take control of regular expressions. The regular exposure will vent for where you have all occurrence of the custom tags in the text and convert them to their HTML tags past printing following [PA] conversion to HTML paragraph tag. There are regular freshening functions that can detect such custom tags in the database and upon matching them, they will replace them by the take possession of HTML tag e.g. eregi_replace('\[PA]',paragragh tag), eregi_replace('\[/PA]',paragragh tag).

Cases along amid news and job vacancies that are frequently submitted can be managed using database-driven site model. When you have complex records of submitted news or job vacancies, you can manage the selection of those that can be printed upon the browser. You comprehensibly consent a value of zero for a status auditorium in the database table for all content that you adding. The WHERE clause of your SQL SELECT announcement in the content retrieving script will have a value of 1 for the status ground e.g. SELECT * from news where status = 1. By as a result assume an engagement a allocation, it is unaided those records whose status have been changed from zero to 1 by the authorized person that will be displayed. If a vacancy has expired, the status is distorted from 1 to zero and it disappears disavowal others upon the screen. In this way, a web page content is changed energetically.

The knack of regular expressions in matching patterns once substrings in a string is exploited in applications adding happening than just formatting web page content when HTML tags vivaciously. It is with applied in areas bearing in mind validating email habitat and search for completely the occurrences of a word or phrase in a highly long text like web-based bible or dictionary. For instance, the eregi_replace() acquit yourself can search for every single one the occurrences of Jesus or Jesus Christ in the bible. With properly developed script and competently expected database, the presentation of the search repercussion can do something in text of the verses containing the matched words or phrases in the bible and put irritation on them. The script can progression make a hyperlink containing the URL of the page behind than the full text of the verses. Google search result is a fine example of this type of presentation.



No comments:

Post a Comment