/[drupal]/contributions/modules/embedfilter/embedfilter.install
ViewVC logotype

Contents of /contributions/modules/embedfilter/embedfilter.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Sun Sep 27 10:54:07 2009 UTC (2 months ago) by karens
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +26 -0 lines
File MIME type: text/x-php
Port code to D6, #218518 by greg.harvey ignore sub domains, #177853 by ragaskar check object data tags too.
1 <?php
2 function embedfilter_install() {
3
4 variable_set('embedfilter_filtertip', t('You can use &lt;object>, &lt;embed> and &lt;script> tags from the following sites to add media to your posts:'));
5
6 $whitelist = array(
7 $_SERVER['HTTP_HOST'],
8 'youtube.com',
9 'flicker.com',
10 'twitter.com',
11 'facebook.com',
12 'google.com',
13 'yahoo.com',
14 );
15 variable_set('embedfilter_host_whitelist', implode("\n", $whitelist));
16 }
17
18 function embedfilter_update_6000() {
19 $ret = array();
20 // Create a new format with only this filter.
21 db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('%s', '', %d)", 'feature_embed', 1);
22 $format_id = db_last_insert_id('filter_formats', 'format');
23
24 db_query("INSERT INTO {filters} (`format`, `module`, `delta`, `weight`) VALUES (%d, '%s', %d, %d)", $format_id, 'feature_embed', 0, 0);
25 variable_set('embedfilter_format', $format_id);
26 return $ret;
27 }
28
29 function embedfilter_uninstall() {
30 db_query("DELETE FROM {variable} WHERE NAME LIKE 'embedfilter%'");
31 }

  ViewVC Help
Powered by ViewVC 1.1.2