Contacts

Synclit weblinks php. Layer Cake and com_weblinks Joomla. Address bar spoofing in Microsoft Internet Explorer

I continue to share with you small but very useful site scripts that help improve the attitude of search engines towards your site. This time we will talk about proper page linking.

First, let's create a database of page addresses and possible anchors for each of them. We will use a *.txt file as a base. The file structure will be like this:

Page_address_1; anchor_1, anchor_2, anchor_3,..., anchor_n page_address_2; ​​anchor_1, anchor_2, anchor_3,..., anchor_n page_address_3; anchor_1, anchor_2, anchor_3,..., anchor_n ... page_address_n; anchor_1, anchor_2, anchor_3, ..., anchor_n

As you can see, further use of the script is possible with any number of page addresses and anchors for them. The page address is written without http://www.site.ru/, i.e. immediately from the root without the first slash. The address is separated from the anchors by a semicolon, and the anchors are separated by just a comma. You can also write the full address, it’s just more convenient for me personally, but you can change the filling and output of the result yourself, I think you will intuitively figure it out yourself.

And so, a database of links and anchors for them has been created, below I will give an example of PHP code for directly displaying links for linking on the site:

We paste this code anywhere on the site, which displays 5 random links from the database and a random anchor. It is better to dilute anchors, rather than write only 1 to the link. With proper linking on your website, you will immediately see an increase in traffic and an improvement in other website indicators.

I look forward to your questions in the comments to this post.

Date of publication: March 03, 2014
    Reviews and comments:

    Dmitriy :
    Thanks for the script, I will implement it. It is impossible to copy the source code from the site; it is copied only in small fragments; it would be more convenient in its entirety.

    Kirill :
    Thanks for the note about copying, I just saw it now, I’ll try to fix it soon.

    Alexey Pavlov:
    Error in the line $tex = explode(":",$sendlist[$count] You need a semicolon, not a colon. I changed the code a little to make it clearer:

    Again, this is a very simple class with one display method. Most of the logic here is specific to the link component, but if you look closely you can find functionality used in most component view classes. At the end of the display method, this class calls the parent (JView) display method, passing the name of the template to display. If the name of the display template is not passed, the "default" template is used.
    And lastly, we open the template class.

    Template Class

    Let's agree that a specific template name was not passed, so the default template will be used. In this case, the following file will be considered: .../components/com_weblinks/views/categories/tmpl/default.php
    -> escape ($this -> params -> get ("page_title" ) ) ; ?>

    • ( )

    Much of the logic here is specific to the component being executed. It is also clear from the code that this file contains all HTML mixed with PHP - these are its features and purpose.

    Other files used in components

    Several of the other file types you might find in components:

    • Helpers - components often use a helper.php file or a helpers directory with many files. These files typically contain only the general functionality for the component.
    • Assets appears to be a catch-all folder for other files included in the component.
    • router.php - this file is used, when the SEF URL setting is enabled, to translate the URL in both directions (into a human-readable one with aliases and into the Joomla system view with parameters).
    • xml files - they usually define parameters and other information about the component, and its overview. They are used, for example, when creating component menu items.
    • index.html - It's a good practice to have an empty index.html file in all your directories. This is such a passive security measure.
    • css/images/js - Folders that contain various files to implement the design and functionality on the client side (in the browser).


Did you like the article? Share it