Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:plugins:installation [2016/10/30 14:10] – created fasseen:plugins:installation [2026/01/24 12:13] (current) fasse
Line 1: Line 1:
 ====== Using  Plugins in your homepage ====== ====== Using  Plugins in your homepage ======
-===== The difference between Plugins and Modules=====+===== Which plugins can I install on other websites? =====
  
-Plugins are small PHP scripts doing defined works  (e.gshow the events of the next 2 daysshow actual birthdays...). Unlike modules, plugins must be called not necessarily as a separate page, but can be integrated into any html or php page. You can download the plugins in the body_top.php or body_bottom.php installed by Admidio so that certain information is displayed on all pages Admidio.+Would you like to display specific information from Admidio on your club website or elsewhere? You can use the plugins on the Admidio overview page to do thisThere is a plugin for almost every module here, which can also be customized individuallyHere you can display the next two events or current birthdaysfor example. Unlike modules, these overview plugins do not necessarily have to be called up as a separate page, but can be integrated into other websites as HTML snippets.
  
 +===== How do I integrate plugins? ===== 
 +The corresponding plugin should already be set up in the **adm_plugins** folder.
  
 +==== Add plugin to the Admidio overview ====
  
-===== How do I install plugins?===== +Check the installation instructions on the plugin page in the first stepSome Plugins supply their own installation script and integrate themselves thereby independently into our menu. In this case no further steps are necessary.
-Download the plugin from [[http://forum.admidio.org/viewforum.php?f=9 | Plugin Area]] and unpack the zip file. Copy the folder with the files in the folder ** adm_plugins ** in your Admidio folder.  If the folder adm_plugins  does not exist, it must first be created yetThis should be on the same level as adm_my_files.+
  
-Plugins are usually written in php and should integrate their content into an existing html or php page. +Other plugins can be integrated with small HTML script on the overview page. For this purpose the corresponding script must be included in the template file ''adm_themes/simple/templates/overview.tpl''.
-If you're looking to integrate the plugin in pure html page, you should have the file extension of the first page of html to php renamedNow you can use the module using PHP in your formerly pure html site integration. Add the plugin //(as an example, the plugin will login_form used)// using one of the following methods in your html code at the location where the output of the plugin should be displayed:+
  
-1. Do you use the plugin only within Admidio pages so, a simple call to:+Several DIV blocks are stored there and you have to add your new DIV block behind an existing DIV block. The DIV-blocks look like this 
 +<code html><div class="admidio-overview-plugin col-sm-6 col-lg-4 col-xl-3" id="admidio-plugin-name"> 
 +   <div class="card admidio-card"> 
 +      <div class="card-body"> 
 +         {load_admidio_plugin plugin="plugin-name" file="plugin-file-name"
 +      </div> 
 +   </div> 
 +</div></code>
  
-<code php><?php +<code html><div class="col-sm-6 col-lg-4 col-xl-3"> 
-  include(SERVER_PATH. "/adm_plugins/birthday/birthday.php"); +    <div class="card admidio-roles" id="role_details_panel_'.$rolId.'"
-?></code>+        <div class="card-body" id="admRoleDetails'.$rolId.'"> 
 +            {load_admidio_plugin plugin="plugin-name" file="plugin-file-name"
 +        </div> 
 +    </div> 
 +</div></code> 
 +In this DIV block replace **plugin-name** with the name of the folder of your plugin and replace **plugin-file-name** with the file name containing the html-script.
  
-2The plugin is used on pages that have nothing to do with Admidio, it must first have the // common.php // **at the very beginning** of the php file on the server location of these lines:+If you want to include for example the Plugin ''adm_plugins/calendar/calendar.php'', then the code block looks afterwards like this  
 +<code html><div class="admidio-overview-plugin col-sm-6 col-lg-4 col-xl-3" id="admidio-plugin-calendar"> 
 +   <div class="card admidio-card"> 
 +      <div class="card-body"> 
 +         {load_admidio_plugin plugin="calendar" file="index.php"
 +      </div> 
 +   </div> 
 +</div></code> 
 + 
 +Then you can reload the overview page and your plugin should be visible. 
 + 
 +==== Integrating plugins outside of Admidio pages ==== 
 + 
 +You can usually also use the plugins outside of Admidio pages and integrate them into your own HTML/PHP pages. However, this requires a few additional steps. 
 + 
 +=== Integrating the plugin as an iFrame === 
 + 
 +The simplest and recommended way to integrate plugins from the overview page into another website is to integrate them as an iFrame into the HTML code of the other website. To do this, you can place the following HTML code exactly where you want the plugin to appear: 
 +<code html><iframe src="#URL-to-Admidio#/adm_plugins/#Folder-of-the-specific-plugin#/#Start-file-of-the-plugin"#></iframe></code> 
 +The specific implementation for the login plugin would then look like this if Admidio is installed in the **admidio** subfolder in your web space: 
 +<code html><iframe src="admidio/adm_plugins/login_form/index.php"></iframe></code> 
 +You can then easily define the sizeborders, and spacing of the plugin for CSS, which could look like this: 
 +<code css>iframe { 
 +   width: 80%; 
 +   height: 600px; 
 +   border: 1px solid #ccc; 
 +}</code> 
 +Now you can reload your website and the corresponding plugin will be displayed :-) 
 +\\ \\  
 + 
 +=== Embed plugin as code block in website === 
 + 
 +You can also use the plugins outside of the Admidio pages and integrate them into your own HTML / PHP pages. However, a few additional steps are necessary. 
 + 
 +If you want to integrate the plugin into a pure html page, you should first rename the file extension of the page from html to php. Now you can integrate the plugin with help from PHP into your formerly pure HTML page. Now add the plugins (as an example here the plugin //login_form//) into your Html code at the point where the output of the plugin should be displayed by one of the following methods: 
 + 
 +1. First the file //common.php// must be added **at the very beginning** of your PHP file via the server path:
  
 <code php><?php <code php><?php
-  include_once($_SERVER['DOCUMENT_ROOT']. "/Path-to-Admidio-folder /adm_program/system/common.php");+  include_once($_SERVER['DOCUMENT_ROOT']. '/Path-to-Admidio-folder /system/common.php');
 ?></code> ?></code>
 +The //Path-to-Admidio-folder// must contain the folder structure, which you have to go from the file in which you want to install the plugin, to the Admidio folder.
 +
 +**Example 1**
 +  FTP file path in which the plugin should be installed:
 +  homepage/index.php
 +  
 +  FTP file path to Admidio folder
 +  homepage/admidio/index.php
 +  
 +  Include-Befehl:
 +  include_once($_SERVER['DOCUMENT_ROOT']. '/admidio/system/common.php');
 +
 +**Example 2**
 +  FTP file path in which the plugin should be installed:
 +  homepage/index.php
 +  
 +  FTP file path to Admidio folder
 +  admidio/index.php
 +  
 +  Include-Befehl:
 +  include_once($_SERVER['DOCUMENT_ROOT']. '/../admidio/system/common.php');
 +  
 +2. Afterwards the plugins are installed in the desired places:
  
-After that, as at point 1, the installation of the plugins at the desired locations: 
 <code php><?php <code php><?php
-  include($_SERVER['DOCUMENT_ROOT']. "/ Path-to-Admidio-folder /adm_plugins/login_form/login_form.php");+  include($_SERVER['DOCUMENT_ROOT']. '/Path-to-Admidio-folder /adm_plugins/login_form/index.php');
 ?></code> ?></code>
  
-3. While previous versions not have been successful, you can link the plugins directly via an URL. However, in this variant the common.php is executed repeatedly for each plugin, which is not very useful, regarding the performance of the Web server.+3. If the previous variants have not led to success, you can also integrate the plugins directly via URL. However, in this variantthe common.php for each plugin is repeatedly processed, which is not the best for the performance of the webserver.
  
 <code php><?php <code php><?php
-  include("http://www.example.org/ Path-to-Admidio /adm_plugins/login_form/login_form.php");+  include('http://www.example.org/Path-to-Admidio-folder /adm_plugins/login_form/index.php');
 ?></code> ?></code>
  
-4. The plugin has a CSS file it must also be integrated into the website. This must be the once within Admidio' **my_header.php**  of  the selected theme and in the header of your own pages if you also want to show the plugin there.+4. If the plugin has a CSS fileit must also integrate into the website. This must be done both within Admidio's ** my_header.php ** of the selected theme folder as well as in the header of your own pagesif you want to display the plugin there as well.
  
-<code html><link rel="stylesheet" type="text/css" href="http://www.example.org/ Path-to-Admidio /adm_plugins/login_form/login_form.css" /></code>+<code html><link rel="stylesheet" type="text/css" href="http://www.example.org/Path-to-Admidio-folder /adm_plugins/login_form/login_form.css" /></code>
  
 ===== Where can I configure the plugins?===== ===== Where can I configure the plugins?=====
-You can configure most plugins via **config.php** file that is located in the same folder as the plugin. Here are some variables with default values available. This you can customize according to your needs. +You can configure most plugins via **config.php** file. For this purpose, a **config_sample.php** file is usually delivered, which should be located in the folder of the plugin. You can simply rename this file to **config.php**. Here are some variables with default values available. You can change them according to your needs.  
-Does the plugin have a CSS file, it can be customized using the the layout of the plugin. + 
-Updating a plugin, these files should not been necessarily overwritten. In case new settings or CSS settings are added by the update, then the new variable or CSS settings should be copied from the downloaded files into the existing files //(config.php and pluginname.css)// of the plugin and the desired values can be customized .+If the plugin has its own CSS file, the layout of the plugin can be adjusted via this file.  
 + 
 +When updating the plugin, these two files need not and should not be overwritten. If new settings or CSS settings are added by the update, the new variables or CSS settings can be copied from the **config_sample.php** into the previous files //(config.php and pluginname.css)// of the plugin and the desired values can be inserted. 
 + 
 +You can see an example of integrating a plugin into a website using iFrame in the highlighted area of this screenshot:\\  
 +{{:en:plugins:plugin_integration_en.png?300|Integrating plugins via iFrame}}
  
-An example of integration of multiple plugins in a sidebar you can see on this screenshot in the highlighted area+You can see an example of plugin integration on the overview page in this screenshot:\\  
-{{:de:2.0:documentation:plugins:plugins_show.png?400|Install plugins}}+{{:en:plugins:plugin_overview_en.png?400|Integrate plugins into overview page}}
  
 ===== How do I update a plugin?===== ===== How do I update a plugin?=====
-If there is an update, because of a bug fix, a new feature, or due to an incompatibility with current Admidio version, usually only the PHP script of the plugin is to be replaced. Download the latest version from [[http://forum.admidio.org/viewforum.php?f=9|Plugin Area]]  and replace the existing PHP file with new ones. The plugin folder should //never// been replaced, because all settings are going to be lost then. Special features of the update are mentioned in the **readme.txt**  in the plugin folder.+If there is an update, because of a bug fix, a new feature, or due to an incompatibility with current Admidio version, you can replace the plugin folder. Download the latest version from [[en:plugins:index|Plugin Area]]  and replace the existing plugin folder with the new folder of the downloaded zip-file. Special features of the update are mentioned in the **readme.txt**  in the plugin folder.
  
  • en/plugins/installation.1477833027.txt.gz
  • Last modified: 2016/10/30 14:10
  • by fasse