Menu
Is free
check in
home  /  Firmware / PHP irretrievable Weblinks. Joomla components (execution)

Irretrievable Weblinks PHP. Joomla components (execution)

There is an offer in the file /includes/joomla.php. in function cleantext. Replace line

$ text \u003d strip_tags ($ text); $ Text \u003d Strip_Tags ($ Text, " " ) ;

This hack is designed only For pictures that are inserted as normal images. For images inserted by Mambot (Mosimage), this hack will not work.

As in the COM_Weblinks component, to make a direct link

AT weblinks.html.php. It is necessary to replace the string:

$ Link \u003d SEFRELTOABS ( "index.php? option \u003d com_weblinks & task \u003d view & catid \u003d". $ Catid. "& id \u003d". $ row -\u003e id); $ link \u003d $ row -\u003e url;

How to make Joomla worked on two hosts (domains) at the same time. Those. For example, on the local network at 10.0.0.15 and from the Internet site-Firma. While both addresses are headed for one car.

First, the whole salt of the problem is that Joomla gives all pictures and CSS files (their paths in the template) relative to its $ mosconfig_live_site variable - the base address of the site introduced during installation. And if someone tries to contact it in another address, then nothing in the logic of its work does not change - the base address is taken from the Figure File. For example, if the configuration is written that Joomla is located on Localhost, then the appeal from local network, even if the address of the address 192.168.0.1 does not change the address of the address 192.168.0.1 - the SRC will still begin with the "localhost" for other cars, which will already be your localhost "Ohm. Focus solutions for such cases is a substitution The $ mosconfig_live_site variable for the requested host so that all functions can issue the correct links and already drive the user either one by one or a different virtual site (issue the right basic paths to pictures and the basic paths to addresses). There is a Mambot Auto Live Site that can This is automated. If he does not suit you something, in principle it can be repeated, for this configuration.php. At the site of the definition of $ mosconfig_live_site, you need to write your code. Something like:

if ($ _Server ["http_host"] \u003d\u003d "Host1.ru") $ mosconfig_live_site \u003d "host1.ru"; Else $ mosconfig_live_site \u003d "Host2.ru";

It is necessary to note that in the case of the use of the cache, it is also necessary to have two different caching directory for two hosts, because the cache can cross links to different hosts, and then the user does not fall from that network at all anywhere. For the cache corresponds to the variable $ mosconfig_cachepath.

How to make two components simultaneously displayed on one page.

I'll say right away - not everything is so simple. Component he is not a module. Therefore, first of all, it is worth looking for an alternative, i.e. Surely the popular component are modules that can repeat its functionality. If there is nothing like this then this option. You can do as a module, but you can insert in the idea and in the template. The idea is such - call a component through index2.php (which and why - read Favor Full). Those. You can make iframe with src \u003d "index2.php? Option \u003d COM_component & no_html \u003d 1" in the order of inserting the second component you need. And he will be displayed there. Another thing is that it is unlikely to fully ensure the futsal. But nevertheless this is a way out.

Or use the design: mosloadcomponent ("com_mycomp");

But if the component is completed in this way, then it is necessary to understand what he knows does not know about your manipulations and will work according to its $ option and $ task.

How to increase the header length in the article

You need to execute the following two commands in phpMyAdmin (there is a special page to run SQL queries), just need to replace ### _ to your real table prefix. The maximum possible number is 255. In the example used 200.

Alter table `### _ content`` title_alias`` Title_alias` Varchar (200) Not NULL; Alter table `### _ CONTENT` CHANGE `Title`` Title` Varchar (200) Not NULL;

How to include in RSS feed full texts of news, and not just their headlines

To do this, in the /Components/com_rss/rss.php file, you need to replace

$ item_description \u003d $ row -\u003e introText; $ item_description \u003d $ ROW -\u003e FullText;

How can you make two sites on Joomla using the same database or using the same files

As for the use of one database - it is necessary to register in configuration.php for two engines one base, but you need to understand what you are doing. For the maintenance of sessions for users in this case will be very problematic because Domains are different. Those. The entry records in the #__sessions table will be intersecting (can intersect).

If you want to use the same files, without copying a large distribution, it is in principle using the LN -S command in Linux to create symbolic links to already existing files and not copy them for a new site.

How to create a virtual page available at a specific address in the General Design Joomla (http: / / list.ru/super_page)

  • The first way is to use any SEF component in which the desired virtual path to register for the static page. There is a minus - this component will begin to redo all other links (and in general, these components are very voracious and require many resources to work).
  • Create alias such a page with mod_rewrite and .htaccess.. To do this, it is necessary:
    • Create a static page with the text you need, find out its ID and address (not necessarily create a page, it can already exist and in general it is just any component, not necessarily com_content)
    • Come up with an alias, let it be " super_puper"
    • Open.htaccess and in front of the line "RewriteCond% (Request_fileName)! -F" Write:
Rewriterule ^ (super_puper) index.php? Option \u003d com_content & task \u003d view & id \u003d 12 rewritecond% (Request_FileName)! -F
    • And now, provided that Joomla stands at the site.ru, when opening the HTTP: / / list.ru/super_Puper link will open the desired static page with your information. Link "index.php? Option \u003d com_content & task \u003d view & id \u003d 12" can be any that you need, most importantly, to link was not absolute (i.e. with http: / / ...) and relative ( should Start with index.php? ...)

How to prohibit caching for a specific article

This may be needed if you are inserting any scripts using the RD_ADDDPHP mambote that each time you must generate random numbers or random text, regardless of the Joomla caching system. To disable caching a certain thing, you need to know its ID (in the admin, when editing, take a look at the address bar, there will be something "... & id \u003d 123 ..."). So, 123 - and there will be our ID of the article. Needed in /components/com_content/content.php approximately on line 1600 replace

$ cache -\u003e call ("HTML_CONTENT :: Show", $ row, $ params, $ access, $ page); if ($ row -\u003e id! \u003d "123") $ cache -\u003e call ("HTML_CONTENT :: Show", $ row, $ params, $ access, $ Page); ELSE HTML_CONTENT :: Show ($ Row, $ Params, $ Access, $ Page);

Where 123 is the article ID you need.

I put a lot of components, and in the list of components in the admin menu it shows a trimmed quantity, and then it is written "More Components ...". How to output all components.

It is necessary in the file /administrator/modules/mod_fullmenu.php string

$ TopLevellimit \u003d 19;

replaced by

$ TopLevellimit \u003d 199;

How to install a copy of the component

I must say that the task of rarity is complex. If you do not understand how the component is arranged, then you should not even try. For those who will all want to mention the highlights:

  • In the XML file, rename the name of the component in the Name tag
  • Next, you need to rename the tables used (first in the XML file, and secondly in all component files, where the database object is used everywhere. $ Database. and method setQuery.)
  • All paths in the components also rename. Paths can be used in links to yourself or in the names of the included files. Most often it boils down to the search for the substring COM_MAKOMPONENT and replacing it to a new one.

But this method Nothing guarantees. With simple, this is possible and will pass, but with difficult - no one will handle it.

How to make so that one of the modules assigned to it randomly

  • Option 1 - Hack Fucnium Moslaadmodules. In the template place where it is necessary to output one of the N modules we write (pay attention to the third argument):
mosloadmodules ("Position", configuration of display, true);

And I corrected the above mentioned fucement somewhat:

Function MosloadModules ($ Position \u003d "Left", $ style \u003d 0, $ show_random \u003d false) (... $ allmodules \u003d & initmodules (); if (ISSET ($ Globals ["_mos_modules"] [$ position])) ( $ modules \u003d $ globals ["_mos_modules"] [$ position];) else ($ modules \u003d array ();) // add iF ($ show_random && sizeof ($ modules)\u003e 0) ($ TMP \u003d $ Modules [ Rand (0, Sizeof ($ Modules) -1)]; $ Modules \u003d Array ($ TMP);) // End of the addition IF (Count ($ Modules)< 1 ) { $style = 0 ; }

We completed the third argument into it (which is used in the template, where we wrote true) and modified the code.

  • Option two is more painless, we only modify the template. But more work - we need to create several positions. First create a few new positions of modules, such as New1 ... NEW10. We save. In the desired place of the template, before calling the MosloadModules function add the desired code:
$ rand_num \u003d Rand (1, 10); // from 1 to 10 - as in the name of the position MosloadModules ("New". $ rand_num, display_

I believe that renamed folder / Adminisrator / I will make my site safer

Standardly such an opportunity is not provided. But in fact, it is possible by organizing the search for the Jumla files to make the replacement of any entry of such a word to yours - secret. Sometimes then it may be possible to pop up the errors about not the possibility of access to files, but knowing the file and the row number can be fixed. Therefore, the problem is in principle solvable.

Yrc WebLink browser is created and distributed by the Indian software company Yrc Group Inc. And therefore as homepage The default is Indian Google :))

Indian programmers are considered one of the coolest in the world (after Russian and Chinese :), but with this browser they did not hold something, because it is just a holiday of some kind, and not a browser. The ideas that they tried to embody in this browser are beautiful, but the realization itself is bad. The browser works "through the stump deck", that is, strange and bad. Tried it on two different computers - under Windows 7 and under Windows 8 - and there and there are glitches and freezes.

However, let's go in order.

After installation, the browser offers to choose some settings (as, for example, it is seen in the screenshot above), and in addition - to create an account for cloud synchronization and storage of settings, bookmarks, notes and files.

Great idea! Link Sign Up, which means "Register", a site with cheerful pictures opens, but for some reason he does not open in Yrc Weblink, but in the browser that stands on the default computer and this is the first weird. Another oddity is that it is necessary to introduce quite a lot of their data - why? For example, in the Maxthon browser to register in the cloud, you only need to enter email and password, which is much easier, more pleasant and does not matter any questions.

Okay, I enter all this data. A letter comes to confirm the account, click on the link, but the site informs me "Oops! - I do not find your data in the database." But then another letter comes with a new link, I will click on the link in it and again - Oops! However, in the course of these UPS, the third letter comes and it is written there - congratulations, your account is confirmed! Such is the peculiar Indian account verification.

I open the browser, settings, try to import bookmarks. The browser does not see the format's bookmark file.html, which all the browsers known to me see, understand and take without problems. I enter the name of the file manually, click to import and get a report - bookmarks are successfully imported!

But where did they successfully imported ??? Neither in the browser nor in the cloud they are not. I repeat the operation again and the same result. Nevermind. Moving on.

In the cloud and settings there is a point of notes. Remembering the notes in the Maxthon browser, which can be created using the built-in notepad and which are autmatically saved in the cloud, trying to find something similar in Yrc Weblink, alas, to no avail. View notes is there, and there is no tool for creating them. Strange? And how!

Well, OK. We look at what we still have. When installing the browser independently (without demand), you installed two labels on the desktop - the browser label (this is normal) and Twitter label.

When you click on this shortcut, a separate browser window with twitter opens. What the hell do it still by default? Maybe I do not use twitter at all? Okay, the twitter label from the desktop deleted, but it was not here! Now, when you click on the browser label (not twitter), in the taskbar, the browser is highlighted by twitter! There was no such festive glitch in my life!

By the way, about these three windows that you see in the screenshot above. The Summary settings window hangs over times. And so that it is possible to cut it out only by disconnecting the process in the Task Manager, differently - in any way. And you can close the synchronization window only by aligning the system.

If you click on "no", the window will constantly hang outdoor. The fact that the browser itself is, on the contrary, it turns off from time to time. And what is funny: the browser turns off, and the summary window hanging and opened window Synchronization - no, so they hang themselves overlooking, abandoned by a browser until you caress them in the Task Manager. Enchanting glitches!

However, it would not be correct to list and positive sides of browser.

First, it is an anonymous surfing mode. Include in the settings this mode and the browser does not use cache, cookies, does not record the history of visits. There are browsers that work only in this mode, for example, Browzar, which is sometimes necessary, but generally extremely inconvenient. And the ability to quickly connect-turn off this mode is a large plus browser.

Secondly, Yrc WebLink has the ability to choose search engine default. Choose, however, comes from a sufficiently specific list:

However, the address of the search engine can be set and manually by pressing the define new button (it is not visible in the screenshot, it is under the list).

Well, the last, but very weighty plus - YRC Weblink almost never loads the system! For comparison, it opened 10 tabs in it and 10 tabs with the same addresses opened in the Yandex browser (leader among the browsers on the system loading) and that's what the picture turned out.

Yandex browser:

It is not difficult to guess that Yrc Weblink in this sense of practicing out competition in good sense.


SUMMARY. If all the ideas that the creators tried to introduce in this browser were made as necessary, the prices would not have been, Yrc Weblink could claim the title of the best or at least one of best browsers. But with those flaws, which in it are observed, he does not even pull on "Troychka". I appreciate him 3- .

After testing, the browser is uninstaling - to have such a buggy program at all. Well, wait for further steps from Yrc Group Inc. Indian programmers will be able to eliminate all flaws and release a truly working version of the browser, the honor of them and praise. We will not be able - another stillborn browser in the world will be more.

Layered cake

It will be about the COM_Weblinks component and the Joomla page HTML markup. How easy and easy to create a reference catalog on the Joomla website.

This CMS was created for interactive working with a registered user, without direct coding. Although the trend is developed by Joomla leads to the com_weblinks component at all, as from useless on the site, and simply adding overweight (more than 100 kb - 90 files) and without that "heavy" system. But while this component is still present in the distribution and is used by some programmers.

The Joomla site page visible on the screen is a layered pie, in the construction of which many blocks are at the same time (respectively, many templates). Here the Joomla philosophy is affected - large-born site construction. For each block, there is a template (layout) of HTML markup.

Main blocks:

Template main page (Site / index.php template), which its HTML markup determines the positions for modules and components and displays these modules and components.
- Page template
- Module templates
- Templates of components

Each of these large blocks is available for editing (changes). That is, you can edit separately for example a template of any module or component, and it will look like new on the page. The same with the page template.

The novice programmer is difficult to understand that the first line in the content part of the page is displayed as a page title and is edited on the menu item editing page, which indicates this page. That the second line is displayed from the COM_CONTENT or COM_Weblinks component template. And rows in templates as a rule are string variables and their initialization and localization are made in language files, such as Language \\ RU-RU \\ RU-RU.Mod_weblinks.ini and their like.

Sometimes the beginner puts in a dead end: which pattern brought one or another line that looks like a logical continuation of the same narrative on the screen page. It turns out one line is in one template, the other in the second template, the third in the third. And the tab with the tabs below is a conclusion from the mod_tabform module template.

Sometimes module patterns are called layouts. But this is a matter of terminology. The essence is one - this is "clothes" for content. It is more correct to say - markup. So, the markup of one on-screen page is in different files of the Joomla directories.

Menu

Many novice Joomla programmers often do not understand that menu items may have different types. In other words - menu items can refer to Joomla objects. different types. These can be different objects, such as: components (voting, search, reference catalog, etc.).

Select the menu item type:

Contacts (COM_CONTACT)
List of contact categories (Categories)
Contact list of specified category (Category)
Contact ( contact.)
Favorite Contacts (Featured)

Materials (COM_CONTENT)
Archive materials (Archive)
Material (article)
List of all categories ( categories.)
Blog Category (Blog Category)
List of materials category (category)
Favorite materials (Featured)
Create Material

Smart search (COM_SEARCH)
Search ( search.)

Hello WORLD! ( cOM_HELLOWORLD)
Message ( helloWorld)

News Tapes (com_newsfeeds)
List of news tape categories ( categories.)
List of news feeds in category (Category)
Newsfeed news

Search ( cOM_SEARCH)
Search form and search results list (search)

Users Manager (COM_USERS)
Authorization form (Login)
User Profile (Profile)
Change user profile
Registration form (Registration)
Restoring username (Remind)
Change password (reset)

Wrapper (COM_WRAPPER)
Wrapper

As you can see, here all the types of menu are components. By its name, the Type of the menu item actually indicates the name of the template of its component type. And component templates are located in the Views catalogs (View):

joomla \\ Components \\ COM_Weblinks \\ Views \\ Categories
joomla \\ Components \\ COM_WEBLINKS \\ Views \\ Category
joomla \\ Components \\ COM_Weblinks \\ Views \\ Weblink
joomla \\ Components \\ COM_USERS \\ Views \\ Login

As we see the names of the types of links in the menu and template names in the Vews directories coincide.

The developer has the ability to create new non-standard patterns (Layouts) for components. These new layouts will also be reflected as new menu types in the menu type selection window. This is a separate topic.

Democontient Distribution Joomla

Let's see how the hierarchy of the menu items "ABOUT JOOMLA" is built to display the COM_Weblinks component on the default Demo content (Beez2 template - default) Joomla template.

Let's go to the admin on the COM_WEBLINKS component editing page: Components-\u003e Links. We see that five categories for the COM_Weblinks component have been created in the Democontaite, which comes with the distribution. So references will be distributed in five categories. All created categories will be saved in the database table #_categories. In the same table, categories and other components are saved.

Sample Data-Weblinks
| -Park Links.
| -Joomla! Specific Links.
| - | -Other Resources
Uncategorised

In the About Joomla menu, the Hierarchy of the menu items is created, respectively.

Hierarchy of menu items:

Using Joomla! (Type: Material)
| - extensions (Type: List of all categories) :: List of categories in materials
| - | -components (Type: Blog Categories) :: Category in Materials
| - | - | -Weblinks Component (Type: Material)
| - | - | - | -Submit a WebLink (Type: Create a link) :: In the link component
| - | - | - | -Weblinks Single Category (Type: List of links in category) :: in the link component
| - | - | - | -Weblinks Categories (Type: List of link categories) :: in the link component

We see that some menu items have types: list of categories, list of links in the category and create a link.
The "List of Link Categories" indicates the upper category from which hierarchy will be shown.
The "List of links in the category" indicates the category of which will be displayed.
In the "Create link" item will be displayed the form that the registered user will be fill in.
Here by the way looks like a link to this form in the editor (in address line It will change it):

index.php? Option \u003d com_weblinks & view \u003d form & layout \u003d edit

Some items in the menu can be shown only to the registered user! For example, the menu item with the "Create link" type will be visible only for registered users. This feature is designed specifically so that registered users can create links that will be posted on the page.

Thus, the COM_Weblinks component gives good way Interactive filling of the page with interesting links. At the same time, all references that will be placed on such a page have a redirect, that is, they will not be indexed as external. Perhaps such links you could observe on the forums. When you hover the mouse to such a link, you will see the address of your site, and only after clicking it will be redirected to the address you specified.

The ability to add links to external sites to the user itself is the main plus and the meaning of the COM_Weblinks component, as well as the ability to add new content - articles, images, video files, and so on.

It is possible to registered with the user who endowed with the right to fill the site with a direct coding content - the main philosophy of CMS Joomla.

Uncategorised
SAMPLE DATA-ARTICLES
| - Joomla!
| - | - Extensions
| - | - | - Components
| - | - | - Modules
| - | - | - | - Content Modules
| - | - | - | - User Modules
| - | - | - | - Display Modules
| - | - | - | - Utility Modules
| - | - | - | - Navigation Modules
| - | - | - Templates
| - | - | - | - Atomic
| - | - | - | - Beez 20
| - | - | - | - Beez 5
| - | - | - Languages
| - | - | - Plugins
| - Park Site
| - | - Park Blog
| - | - Photo Gallery
| - | - | - Animals
| - | - | - Scenery
| - Fruit Shop Site
| - | - Growers
| - | - Recipes

It seems not too many categories for materials!
Category hierarchy in materials can also be as well as the request to the table of categories in the database:

SELECT * from `# _categories` Where` extension` \u003d "com_content"

The Links Component (Web Links) provides an easy way to organize content, including links to other sites. Each element consists of URL-address (links) and optional text. Separate links are combined in the category. Like materials, links can be created by people who add materials to the site, edit them or publish, and not just administrators having access to the control panel.

Like materials, links can be edited in the client part of the website. Users to edit links will see the change icon (edit) by viewing the site page. By default, the same rules are disseminated to edit links as on editing materials, except that the rights "edit their own" (EDIT OWN) does not exist. The key difference of references from the materials is that access control functions are applied not at the level of individual links, but at the level of the component as a whole and categories to which specific links are attributed (in later releases of Joomla! 3 this scheme may change).

As for creating materials and other key components in order to create new link In the administrative part of the site, you need to click on the Create (New) icon on the toolbar. In the form that opens, enter the title, link itself and Description (this is not necessary to fill in the field). You can also choose what will happen after clicking on the link: For example, the page will open in the same tab or browser window, in a new tab or window, in a pop-up modal or emitting window in which the browser navigation elements will not be present. . These settings are on the tab or in the Basic Options drop-down list (Basic Options). Experiment with different options. As you gain experience, you can find application to each of the options, although the transition is most often used in the same browser window.

If your computer broke or you are unhappy with his work and want to repair a computer - our computer service specialists will help you.

The menu manager supports the creation of the menu items for the three types of link representation layouts:

  • List of links in category (List Web Links in A Category). This layout is designed to display the list of all references in the selected category; The corresponding description is displayed for each link. Click on the link allows you to go to the resource to which the link indicates.
  • List of link categories (List All Web Links Categories). This layout displays a list of all categories that exist in the Link Component (Web Links), the right to watch the user. Each title is a link to the "Category List) type list layout, which lists all subcategories in the selected category.
  • Create a link (Submit a Web Link). This layout contains the form of creating a new link.

There is no way there is a directly withdraw one link to the page with the corresponding description. However, the same effect can be achieved by creating a category with a single link and using the "List of Category List" layout. If you need in the menu Link leading directly to another site, you should select the Outer URL menu item type (External Link). For links, as well as for components, default parameters and general parameters are configured on the screen, which opens by clicking on the Settings button (Options) in the administrative part of the site. You will see several tabs containing standard settings For all links on your website. These settings, however, can be redefined for each specific link.

The Link Component (Web Links) is a good solution for managing some specific content types and display it. For example, it is often used to determine references to external sources information on a specific topic. In addition, it is convenient to display directories, such as product manufacturers or other people or companies that can even pay for the ability to get into this list. You can also create a page with links to the websites of the participants of your project or recommended blogs. Another option: Use links to selected articles about your organization or the topic of interest to you on other sites. This component can be applied even to managing references to documents and other sections of your website.

Let's start considering the components from how the basic WebLinks component operates in the administrative part of the website. This component is typical for this part of the website, it is very similar to other components, designed to manage articles, users, modules, etc.

Listed below software files This component. All these files are in the folder administator / Components / COM_Weblinks. In the rest of this chapter, the names of all files of the WebLinks component are referred to regarding this initial folder, unless otherwise indicated. Most files are organized by the MVC template. In particular, all view files are in the subfolder subference, and all major models and controller files are in subfolders of models and controllers, respectively. They are also complemented by installation, configuration and auxiliary files.

Component Administrative FilesWeblinks, except index.html files

  • controllers / Weblink.php - Main Controller for Editing Single Web Link Controller
  • controllers / Weblinks.php - Main Controller for drawing up the controller and displaying a web link list on the Weblinks Manager screen (Web Link Manager)
  • helpers / WebLinks.php - provides various methods used in controllers and representations
  • models / Fields / Ordering.php - Model JFormfield Displays a web link ordering column on the Weblinks Manager screen
  • models / Forms / WebLink.xml - XML \u200b\u200bfile used in the JForm-Model Field class, for layout of form with input fields and edit web links on the screen
  • models / Weblink.php - model for on-screen shape Single model web link
  • models / Weblinks.php - Model for Dispatcher Dispatcher Model Web Links
  • sql / install.mysql.utf8.sql - SQL file to compile a web link table during installation
  • sql / uninstall.mysql.ut8.sql - SQL file to delete the table of the weblock during installation
  • tables / WebLink.php - Provides class model
  • views / Weblink / TMPL / edit_metadata.php - File source layout for editing metadata web links

Administrative part of the Weblinks component

  • views / Weblink / TMPL / edit_params.php - File of the original layout for editing single web link options
  • views / Weblink / TMPL / edit.php - File source layout for web link editing
  • views / view.html.php - Basic view class to output single web links in HTML format File of the original layout for web link dispatcher
  • views / Weblinks / view.html.php - Basic view class To display web links in HTML format directly on the Weblinks Manager screen
  • access.xml - XML \u200b\u200bfile providing a list of actions for access control lists system (ACL)
  • config.xml - XML \u200b\u200bfile providing a list of component configuration options
  • controller.php - Class of the main controller
  • webLinks.php - entry point for request
  • weblinks.xml - XML \u200b\u200bfile used to control the installation process