User Tools

Site Tools


plugins:creation

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
plugins:creation [2017/01/18 17:25]
lokothodida
plugins:creation [2017/01/19 22:08] (current)
lokothodida [Internationalization (I18N)]
Line 178: Line 178:
 </​code>​ </​code>​
  
-To register your i18n array, call ''​i18n_merge''​ with the ID of your plugin (**before ​the plugin is registered**):+To register your i18n array, call ''​i18n_merge''​ with the ID of your plugin (**before** ​''​register_plugin''​ is called):
  
 <code php> <code php>
Line 203: Line 203:
 i18n($plugin_id . '/​PLUGIN_TITLE'​);​ i18n($plugin_id . '/​PLUGIN_TITLE'​);​
 </​code>​ </​code>​
 +
 +For more information,​ go to [[plugins:​i18n|Plugins & Languages (I18N)]].
  
 ==== Data & Settings ==== ==== Data & Settings ====
Line 208: Line 210:
 If you need to save your data to a file on the server, we recommend saving it to a new folder within the ''​GSDATAOTHERPATH''​ path. For example: If your plugin needs to save the Google Analytics'​s UA-XXXXX id for the site, it would be best if you saved it within the folder ''/​path/​to/​getsimple/​data/​other/​my_plugin_folder/​ua-data.txt'',​ where ''/​my_plugin_folder/''​ is the folder you create and ''​ua-data.txt''​ is the file that holds your data. If you need to save your data to a file on the server, we recommend saving it to a new folder within the ''​GSDATAOTHERPATH''​ path. For example: If your plugin needs to save the Google Analytics'​s UA-XXXXX id for the site, it would be best if you saved it within the folder ''/​path/​to/​getsimple/​data/​other/​my_plugin_folder/​ua-data.txt'',​ where ''/​my_plugin_folder/''​ is the folder you create and ''​ua-data.txt''​ is the file that holds your data.
  
-When saving or accessing files and folders within a GetSimple installation,​ it is always best to use the defined constants set by the system. You can get the list of contents from the ''/​admin/​inc/​common.php''​ file, or by looking at our [[http://​code.google.com/​p/​get-simple-cms/​source/​browse/​trunk/​admin/​inc/​common.php|svn copy of it]].+<code php> 
 +// Set up the data 
 +$data = '<​Your Data Here>';​ 
 + 
 +// Set up the folder name and its permissions 
 +// Note the constant GSDATAOTHERPATH,​ which points to /​path/​to/​getsimple/​data/​other/​ 
 +$folder ​       = GSDATAOTHERPATH . '/'​ . $plugin_id . '/';​ 
 +$filename ​     = $folder . '​ua-data.txt';​ 
 +$chmod_mode ​   = 0755; 
 +$folder_exists = file_exists($folder) || mkdir($folder,​ $chmod_mode);​ 
 + 
 +// Save the file (assuming that the folder indeed exists) 
 +if ($folder_exists) { 
 +  file_put_contents($filename,​ $data); 
 +
 +</​code>​ 
 + 
 +When saving or accessing files and folders within a GetSimple installation,​ it is always best to use the defined constants set by the system ​(as illustrated above). You can get the list of contents from the ''/​admin/​inc/​common.php''​ file, or by looking at our [[http://​code.google.com/​p/​get-simple-cms/​source/​browse/​trunk/​admin/​inc/​common.php|svn copy of it]].
  
 ===== Scripts & Styles ===== ===== Scripts & Styles =====
plugins/creation.1484760321.txt.gz · Last modified: 2017/01/18 17:25 by lokothodida