User Tools

Site Tools


develop:plugins

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
develop:plugins [2023/10/27 21:11]
duncanc
develop:plugins [2023/10/27 21:17] (current)
duncanc
Line 219: Line 219:
 If you must query the database directly, you need to sanitise your queries to avoid Sql Injection.  Use //sprintf// for this. Numbers are sanitised with %d and strings with //Sql_Escape//  If you must query the database directly, you need to sanitise your queries to avoid Sql Injection.  Use //sprintf// for this. Numbers are sanitised with %d and strings with //Sql_Escape// 
  
-Also, it is best practice to avoid doing a **select *** on tables, just to be sure.+Also, it is best practice to avoid doing a **select \*** on tables, just to be sure.
  
 So the result would look something like So the result would look something like
Line 373: Line 373:
 <code>print($myTable->display())</code> <code>print($myTable->display())</code>
 This would create a nicely formatted table inside the same kind of box that the "UIPanel" class produces. The worm in the apple here is that this table will be given the same title that appears in the first column. There seems to be no facility for creating a table title separate from the heading of the first column in the table. But you can easily change the table title with the PHP function //str_replace()// This would create a nicely formatted table inside the same kind of box that the "UIPanel" class produces. The worm in the apple here is that this table will be given the same title that appears in the first column. There seems to be no facility for creating a table title separate from the heading of the first column in the table. But you can easily change the table title with the PHP function //str_replace()//
-<code>$html = $myTable->display();+ 
 +<code> 
 +$html = $myTable->display();
 $oldTitle = 'ID'; $oldTitle = 'ID';
 $newTitle = 'The Heights of Various Buildings'; $newTitle = 'The Heights of Various Buildings';
Line 547: Line 549:
 </code> </code>
  
-Make sure to use a proper unique value for //unique_value//, for example, based on the name of your plugin, to avoid it clashing with other plugins. A way to create a good unique value for the index is to simply append the name of your page (without ".php") to the name of your plugin. For example if your plugin is //MyCoolPlugin// and you are writing code for //myCoolPage.php//, you might take "MyCoolPlugin_myCoolPage" as your index for the //$pagefooter// array.+Make sure to use a proper unique value for //unique\_value//, for example, based on the name of your plugin, to avoid it clashing with other plugins. A way to create a good unique value for the index is to simply append the name of your page (without ".php") to the name of your plugin. For example if your plugin is //MyCoolPlugin// and you are writing code for //myCoolPage.php//, you might take "MyCoolPlugin_myCoolPage" as your index for the //$pagefooter// array.
  
 ====== Javascript modal dialogs ====== ====== Javascript modal dialogs ======
Line 671: Line 673:
 You should have no space between the letter representing the argument, for example **-p**, and the value of the argument. You should have no space between the letter representing the argument, for example **-p**, and the value of the argument.
  
-Suppose that the path to the **phplist** directory is ///myhome/public_html/phplist///. Then you could process the Phplist queue with the following invocation of //processqueue.php//+Suppose that the path to the **phplist** directory is ///myhome/public\_html/phplist///. Then you could process the Phplist queue with the following invocation of //processqueue.php//
 <code> <code>
 php /myhome/public_html/phplist/admin/index.php -c/myhome/public_html/phplist/config.config.php -pprocessque php /myhome/public_html/phplist/admin/index.php -c/myhome/public_html/phplist/config.config.php -pprocessque
Line 855: Line 857:
 </code>  </code> 
  
-In this case add a definition for PLUGIN_ROOTDIRS that identifies the "plugins" directory in each repository:+In this case add a definition for PLUGIN\_ROOTDIRS that identifies the "plugins" directory in each repository:
 <code> <code>
 define("PLUGIN_ROOTDIRS","/home/me/git/phplist-plugin-myplugin1/plugins;/home/me/git/phplist-plugin-myplugin2/plugins"); define("PLUGIN_ROOTDIRS","/home/me/git/phplist-plugin-myplugin1/plugins;/home/me/git/phplist-plugin-myplugin2/plugins");
develop/plugins.txt · Last modified: 2023/10/27 21:17 by duncanc

Resources
Contact Us

e: info@phplist.com

Boring Bit

phpList is a registered limited company

UK Company No. 07582966

VAT Registration 122 0788 37

© phpList 2016