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:40]
lokothodida [Data & Settings]
plugins:creation [2017/01/19 22:08]
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 214: Line 216:
 // Set up the folder name and its permissions // Set up the folder name and its permissions
 // Note the constant GSDATAOTHERPATH,​ which points to /​path/​to/​getsimple/​data/​other/​ // Note the constant GSDATAOTHERPATH,​ which points to /​path/​to/​getsimple/​data/​other/​
-$folder ​      ​= GSDATAOTHERPATH . '/'​ . $plugin_id . '/';​ +$folder ​       = GSDATAOTHERPATH . '/'​ . $plugin_id . '/';​ 
-$filename ​    ​= $folder . '​ua-data.txt';​ +$filename ​     = $folder . '​ua-data.txt';​ 
-$chmodMode ​   = 0755; +$chmod_mode ​   = 0755; 
-$folderExists ​= file_exists($folder) || mkdir($folder,​ $chmodMode);+$folder_exists ​= file_exists($folder) || mkdir($folder,​ $chmod_mode);
  
 // Save the file (assuming that the folder indeed exists) // Save the file (assuming that the folder indeed exists)
-if ($folderExists) {+if ($folder_exists) {
   file_put_contents($filename,​ $data);   file_put_contents($filename,​ $data);
 } }
plugins/creation.txt · Last modified: 2017/01/19 22:08 by lokothodida