Warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache' query: UPDATE cache SET data = 'a:402:{s:13:\"theme_default\";s:4:\"kewl\";s:13:\"filter_html_1\";s:1:\"1\";s:18:\"node_options_forum\";a:1:{i:0;s:6:\"status\";}s:18:\"drupal_private_key\";s:64:\"a5de3144cabd3a5a76889cdc7d52a5656ec758dd9c66b720824755fe28d5dc59\";s:10:\"menu_masks\";a:24:{i:0;i:127;i:1;i:63;i:2;i:62;i:3;i:61;i:4;i:59;i:5;i:58;i:6;i:57;i:7;i:56;i:8;i:31;i:9;i:30;i:10;i:29;i:11;i:28;i:12;i:24;i:13;i:21;i:14;i:15;i:15;i:14;i:16;i:12;i:17;i:11;i:18;i:7;i:19;i:6;i:20;i:5;i:21;i:3;i:22;i:2;i:23;i:1;}s:12:\"install_task\";s:4:\"done\";s:13:\"menu_expanded\";a:2:{i:0;s:15:\"menu-categories\";i:1;s:10:\"navigation\";}s:9:\"site_name\";s:7:\"jide.fr\";s:9:\"site_mail\";s:17:\"jide.fr@gmail.com\";s:21:\"date_defa in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1860:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>Edit: As Pol said in comments, you can use the openlayers_taxonomy module to do this. But it turns out I had to use content types as layers too, so this technique still was useful to me. Thank you Pol :)</p>\\n<p> I wanted to create layers depending on some taxonomy terms with Openlayers. But the only way to create layers with views is to add one display per layer. Wha in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1927:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>To show the profile2 form directly on the user account edit form :</p>\\n<p>The following assumes that the profile2 type is called \\"profile\\".</p>\\n<p>First, we have to hide the tab on the user account page :</p>\\n<p><code>/**<br />\\n * Implements hook_menu_alter in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:2491:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>Drupal uses a default jQuery UI theme. Here is how to use your own theme created using the <a href=\\"http://jqueryui.com/themeroller\\">jQuery ThemeRoller</a>.</p>\\n<p>Put the generated jQuery UI theme in your theme directory, in a subfolder called \\"jquery-ui\\". It should have an \\"images\\& in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:660:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>For a recent project, I had to migrate from Drupal 5 to Drupal 7. Here is how I did it without too much pain. The key steps are :</p>\\n<ul>\\n<li>Export data to CSV from the original instance using Views module and a CSV output plugin.</li>\\n<li>Import them in the 7.x instance using Feeds.</li>\\n</ul& in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1183:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>A friend of mine just pointed out that my name is written in big characters in a slide of the latest Keynote of Dries Buytaert showing Drupal contributors :) It is in slide #10, and also in the video, around 1:00. Yay ! I\\'m famous !</p>\\n<p><a href=\\"http://buytaert.net/state-of-drupal-presentation-march-2011\\"><img in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:4585:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p><code>/**<br />\\n * Implements hook_cron_queue_info().<br />\\n */<br />\\nfunction MYMODULE_cron_queue_info() {<br />\\n $queues = array();<br />\\n $queues[\\'MYMODULE_queue_notify\\'] = array(<br />\\n \\'worker callback\\' => \\'MYMODU in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1347:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>When using a view with exposed filters, if the exposed filter is empty, by default views renders the view with all results displayed. To make an empty view instead :</p>\\n<ul>\\n<li>Add an argument \\"Global: Null\\"</li>\\n<li>Action to take if argument is not present: Provide default argument</li& in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1041:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>To create GIT patches using branches (which is required for drush make):<br />\\n<code>git clone --branch 7.x-1.x <a href=\\"http://git.drupal.org/project/session_api\\" title=\\"http://git.drupal.org/project/session_api\\">http://git.drupal.org/project/session_api</a><br />\\ncd session_api& in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1137:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>Here is a simple database API example :</p>\\n<p><code>$results = db_select(\\'authmap\\', \\'am\\') // \\'authmap\\' is the table name, \\'am\\' the alias<br />\\n ->fields(\\'am\\', array(\\'uid\\')) // The alias and the in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:3054:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>There are many examples on how to use AJAX using form API, but I could not find a good example on how to use AJAX with markup. Here is a simple method.</p>\\n<p>To create an AJAX link in Drupal, outside of form API, we first need to add a menu item :</p>\\n<p><code>function MYMODULE_menu() {<br />\\n $items = arr in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:6490:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data'\nquery: UPDATE cache_views_data SET data = 'a:3:{s:6:\\"result\\";a:74:{i:0;O:8:\\"stdClass\\":1:{s:3:\\"nid\\";s:1:\\"4\\";}i:1;O:8:\\"stdClass\\":1:{s:3:\\"nid\\";s:1:\\"2\\";}i:2;O:8:\\"stdClass\\":1:{s:3:\\"nid\\";s:2:\\"47\\";}i:3;O:8:\\"stdClass\\" in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:6310:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data'\nquery: UPDATE cache_views_data SET data = 'a:4:{s:4:\\"head\\";s:0:\\"\\";s:3:\\"css\\";a:0:{}s:2:\\"js\\";a:0:{}s:6:\\"output\\";s:3583:\\"<div class=\\"view view-tagadelic view-id-tagadelic view-display-id-block_1 view-dom-id-1\\">\\n \\n \\n \\n <div class=\\"view-content\\"&gt in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:6255:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_block'\nquery: UPDATE cache_block SET data = 'a:2:{s:7:\\"content\\";s:3583:\\"<div class=\\"view view-tagadelic view-id-tagadelic view-display-id-block_1 view-dom-id-1\\">\\n \\n \\n \\n <div class=\\"view-content\\">\\n <div class=\\"tagadelic_views\\"><a href=\\"/english/android-0\\" class=\\& in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:409:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>Follow me : <a href=\\"http://twitter.com/jidefr\\">jidefr</a></p>\\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:fb82f31c75d9dcc2908dc560fa3f9280'\";s:5:\"%file\";s:37:\"/home/jideretu/www/includes/cache.inc\";s:5:\"%li in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1006:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data'\nquery: UPDATE cache_views_data SET data = 'a:3:{s:6:\\"result\\";a:1:{i:0;O:8:\\"stdClass\\":3:{s:10:\\"twitter_id\\";s:18:\\"937070315510861824\\";s:12:\\"twitter_text\\";s:143:\\"RT @PhilippeCorbe: Si vous avez du mal à comprendre l\\'affaire russe, et l\\'importance de l\\'information du jour, le plaider coupable de l\\ in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:2339:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data'\nquery: UPDATE cache_views_data SET data = 'a:4:{s:4:\\"head\\";s:0:\\"\\";s:3:\\"css\\";a:0:{}s:2:\\"js\\";a:3:{i:0;a:5:{i:0;s:38:\\"sites/default/modules/views/js/base.js\\";i:1;s:6:\\"module\\";i:2;s:6:\\"header\\";i:3;b:0;i:4;b:1;}i:1;a:5:{i:0;s:43:\\"sites/default/modules/views/js/ajax_view.js\\";i:1;s in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:676:\"UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_block'\nquery: UPDATE cache_block SET data = 'a:2:{s:7:\\"subject\\";s:15:\\"Recent Comments\\";s:7:\\"content\\";s:187:\\"<div id=\\"dsq-recentcomments\\" class=\\"dsq-widget\\"><script type=\\"text/javascript\\" src=\\"http://disqus.com/forums/jide/recent_comments_widget.js?num_items=1&hide_avatars=1\\& in /home/jideretu/www/includes/database.mysql.inc on line 135
Drupal | jide.fr

Drupal

  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>Edit: As Pol said in comments, you can use the openlayers_taxonomy module to do this. But it turns out I had to use content types as layers too, so this technique still was useful to me. Thank you Pol :)</p>\n<p> I wanted to create layers depending on some taxonomy terms with Openlayers. But the only way to create layers with views is to add one display per layer. What if you want as many layers as terms ? Some Views trickery to the rescue !</p>\n<ol>\n<li>Create your Openlayers view.</li>\n<li>Add a layer display for the first term.</li>\n<li>Create a filter for the term.</li>\n<li>Export the view through code.</li>\n</ol>\n<p>Then, edit the view code to create one layer per term :<br />\n<code>/**<br />\n * Implements hook_views_default_views().<br />\n */<br />\nfunction MYMODULE_views_default_views() {<br />\n $vocabulary = taxonomy_vocabulary_machine_name_load(\'VOCABULARY_NAME\');<br />\n $terms = taxonomy_get_tree($vocabulary-&gt;vid);<br />\n // Your view code for the master display...<br />\n foreach($terms as $term) {<br />\n $handler = $view-&gt;new_display(\'openlayers\', $term-&gt;name, \'layer_\' . $term-&gt;tid);<br />\n // The display code...<br />\n $handler-&gt;display-&gt;display_options[\'filters\'][\'tid\'][\'value\'] = array(</code></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:96b2e1305e4ea53571532d0df223da34' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>To show the profile2 form directly on the user account edit form :</p>\n<p>The following assumes that the profile2 type is called \"profile\".</p>\n<p>First, we have to hide the tab on the user account page :</p>\n<p><code>/**<br />\n * Implements hook_menu_alter().<br />\n */<br />\nfunction MY_MODULE_menu_alter(&amp;$items) {<br />\n $items[\'user/%user_category/edit/profile\'][\'access callback\'] = FALSE;<br />\n}</code></p>\n<p>Then, merge the profile2 form with the user account form itself :</p>\n<p><code>/**<br />\n * Implements hook_form_FORM_ID_alter() for the user edit form.<br />\n */<br />\nfunction MY_MODULE_form_user_profile_form_alter(&amp;$form, &amp;$form_state) {<br />\n if (($type = profile2_get_types(\'profile\')) &amp;&amp; $type-&gt;userCategory) {<br />\n if (empty($form_state[\'profiles\'])) {<br />\n $profile = profile2_load_by_user($form[\'#user\'], \'profile\');<br />\n if (empty($profile)) {<br />\n $profile = profile_create(array(\'type\' =&gt; \'profile\', \'uid\' =&gt; $form[\'#user\']-&gt;uid));<br />\n }<br />\n $form_state[\'profiles\'][$profile-&gt;type] = $profile;<br />\n }<br />\n profile2_attach_form($form, $form_state);<br />\n }<br />\n}</code></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:be9a2aa2db52554f9291ab05d56dd498' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>Drupal uses a default jQuery UI theme. Here is how to use your own theme created using the <a href=\"http://jqueryui.com/themeroller\">jQuery ThemeRoller</a>.</p>\n<p>Put the generated jQuery UI theme in your theme directory, in a subfolder called \"jquery-ui\". It should have an \"images\" folder and a \"jquery-ui.css\" file.</p>\n<p>Then, in your theme\'s template.php :</p>\n<p><code>/**<br />\n * Implements hook_library_alter().<br />\n */<br />\nfunction YOUR_THEME_library_alter(&amp;$libraries, $module) {<br />\n $libraries[\'ui\'][\'css\'] = array();<br />\n $libraries[\'ui.accordion\'][\'css\'] = array();<br />\n $libraries[\'ui.autocomplete\'][\'css\'] = array();<br />\n $libraries[\'ui.button\'][\'css\'] = array();<br />\n $libraries[\'ui.datepicker\'][\'css\'] = array();<br />\n $libraries[\'ui.dialog\'][\'css\'] = array();<br />\n $libraries[\'ui.draggable\'][\'css\'] = array();<br />\n $libraries[\'ui.droppable\'][\'css\'] = array();<br />\n $libraries[\'ui.mouse\'][\'css\'] = array();<br />\n $libraries[\'ui.position\'][\'css\'] = array();<br />\n $libraries[\'ui.progressbar\'][\'css\'] = array();<br />\n $libraries[\'ui.resizable\'][\'css\'] = array();<br />\n $libraries[\'ui.selectable\'][\'css\'] = array();<br />\n $libraries[\'ui.slider\'][\'css\'] = array();<br />\n $libraries[\'ui.sortable\'][\'css\'] = array();<br />\n $libraries[\'ui.tabs\'][\'css\'] = array();<br />\n $libraries[\'ui\'][\'css\'][drupal_get_path(\'theme\', \'YOUR_THEME\') . \'/jquery-ui/jquery-ui.css\'] = array();<br />\n}</code></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:ef8b9243b7f29ec9dac449c4bbf71976' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>For a recent project, I had to migrate from Drupal 5 to Drupal 7. Here is how I did it without too much pain. The key steps are :</p>\n<ul>\n<li>Export data to CSV from the original instance using Views module and a CSV output plugin.</li>\n<li>Import them in the 7.x instance using Feeds.</li>\n</ul>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:f5e139959eda0938c9a6dbc5aa355ce5' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>A friend of mine just pointed out that my name is written in big characters in a slide of the latest Keynote of Dries Buytaert showing Drupal contributors :) It is in slide #10, and also in the video, around 1:00. Yay ! I\'m famous !</p>\n<p><a href=\"http://buytaert.net/state-of-drupal-presentation-march-2011\"><img src=\"http://www.jide.fr/sites/default/files/Drupal-contributors-1.gif\" /></a></p>\n<p>Random magic hehe, I\'m not such a big contributor ;) Try to find my name in this picture where contributors size is proportionate, that\'s a little harder :) :</p>\n<p><a href=\"http://files.marcvangend.nl/d7-contributor-cloud-large.png\"><img src=\"http://www.jide.fr/sites/default/files/Drupal-contributors.gif\" /></a></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '2:842a05d2a6e06993f96e95bd488f079e' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p><code>/**<br />\n * Implements hook_cron_queue_info().<br />\n */<br />\nfunction MYMODULE_cron_queue_info() {<br />\n $queues = array();<br />\n $queues[\'MYMODULE_queue_notify\'] = array(<br />\n \'worker callback\' =&gt; \'MYMODULE_queue_notify_worker\',<br />\n \'time\' =&gt; 15,<br />\n );<br />\n return $queues;<br />\n}<br />\n&nbsp;<br />\n/**<br />\n * Queue worker for sending notification mails.<br />\n */<br />\nfunction MYMODULE_queue_notify_worker($params) {<br />\n drupal_mail(\'MYMODULE\', \'notify\', $params[\'to\'], language_default(), $params, $params[\'from\']);<br />\n}<br />\n&nbsp;<br />\n/**<br />\n * Implements hook_mail().<br />\n */<br />\nfunction MYMODULE_mail($key, &amp;$message, $params) {<br />\n $language = $message[\'language\'];<br />\n $message[\'subject\'] = $params[\'subject\'];<br />\n $message[\'body\'][] = $params[\'message\'];<br />\n}<br />\n&nbsp;<br />\n/**<br />\n * Implements hook_rules_action_info().<br />\n */<br />\nfunction MYMODULE_rules_action_info() {<br />\n return array(<br />\n \'MYMODULE_rules_action_mail\' =&gt; array(<br />\n \'label\' =&gt; t(\'Send mail\'),<br />\n \'group\' =&gt; \'MYMODULE\',<br />\n \'parameter\' =&gt; array(<br />\n \'to\' =&gt; array(<br />\n \'type\' =&gt; \'text\',<br />\n \'label\' =&gt; t(\'To\'),<br />\n \'description\' =&gt; t(\'The e-mail address or addresses where the message will be sent to. The formatting of this string must comply with RFC 2822.\'),<br />\n ),<br />\n \'subject\' =&gt; array(<br />\n \'type\' =&gt; \'text\',<br />\n \'label\' =&gt; t(\'Subject\'),<br />\n \'description\' =&gt; t(\"The mail\'s subject.\"),<br />\n ),<br />\n \'message\' =&gt; array(<br />\n \'type\' =&gt; \'text\',<br />\n \'label\' =&gt; t(\'Message\'),<br />\n \'description\' =&gt; t(\"The mail\'s message body.\"),<br />\n ),<br />\n \'from\' =&gt; array(<br />\n \'type\' =&gt; \'text\',<br />\n \'label\' =&gt; t(\'From\'),<br />\n \'description\' =&gt; t(\"The mail\'s from address. Leave it empty to use the site-wide configured address.\"),<br />\n \'optional\' =&gt; TRUE,<br />\n ),<br />\n ),<br />\n ),<br />\n );<br />\n}<br />\n&nbsp;<br />\n/**<br />\n * Action: Add notification mails to the queue.<br />\n */<br />\nfunction MYMODULE_rules_action_mail($to, $subject, $message, $from = NULL, $settings, RulesState $state, RulesPlugin $element) {<br />\n // Gather params.<br />\n $params = array(<br />\n \'to\' =&gt; str_replace(array(\"\\r\", \"\\n\"), \'\', $to),<br />\n \'from\' =&gt; !empty($from) ? str_replace(array(\"\\r\", \"\\n\"), \'\', $from) : NULL,<br />\n \'subject\' =&gt; $subject,<br />\n \'message\' =&gt; $message,<br />\n );<br />\n // Add to the queue.<br />\n $queue = DrupalQueue::get(\'MYMODULE_queue_notify\');<br />\n $queue-&gt;createItem($params);<br />\n}</code></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:e4c819bad8580ffa46f55815744408a6' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>When using a view with exposed filters, if the exposed filter is empty, by default views renders the view with all results displayed. To make an empty view instead :</p>\n<ul>\n<li>Add an argument \"Global: Null\"</li>\n<li>Action to take if argument is not present: Provide default argument</li>\n<li>Default argument type: Fixed entry</li>\n<li>Default argument: let it blank</li>\n<li>Validator: PHP code</li>\n<li>PHP validate code:<br />\n<code>if (!empty($view-&gt;exposed_input) &amp;&amp; count($view-&gt;exposed_input) == 1 &amp;&amp; isset($view-&gt;exposed_input[\'destination\'])) {<br />\n return FALSE;<br />\n}<br />\nreturn (!empty($view-&gt;exposed_input));</code></li>\n<li>Action to take if argument does not validate: Display empty text (if you want the view to be rendered)</li>\n</ul>\n<p>And voilà !</p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:423aa8e2c04e2b5e90d23b0cf223d125' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>To create GIT patches using branches (which is required for drush make):<br />\n<code>git clone --branch 7.x-1.x <a href=\"http://git.drupal.org/project/session_api\" title=\"http://git.drupal.org/project/session_api\">http://git.drupal.org/project/session_api</a><br />\ncd session_api<br />\ngit checkout -b cron<br />\n[edit code...]<br />\ngit commit -a -m \"Use an expiration logic when clearing sessions on cron\"<br />\ngit checkout 7.x-1.x<br />\ngit diff --no-prefix 7.x-1.x cron &gt; session_api_cron.patch</code><br />\nYou may use the \"master\" branch instead of \"7.x-1.x\".</p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:57c7007c34e648b7f5faa9a98fc4cf61' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>Here is a simple database API example :</p>\n<p><code>$results = db_select(\'authmap\', \'am\') // \'authmap\' is the table name, \'am\' the alias<br />\n -&gt;fields(\'am\', array(\'uid\')) // The alias and the field we want to fetch<br />\n -&gt;distinct() // Add distinct<br />\n -&gt;condition(\'module\', \'MYMODULE\') // A condition on the \'module\' field, \'MYMODULE\' value<br />\n -&gt;condition(\'authname\', $ids, \'IN\') // A condition on the \'authname\' field, value is in $ids array<br />\n -&gt;execute() // Execute the query<br />\n -&gt;fetchCol(); // Fetch column</code></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:7feecd4cdb197502c59a5b4f1268ccf8' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>There are many examples on how to use AJAX using form API, but I could not find a good example on how to use AJAX with markup. Here is a simple method.</p>\n<p>To create an AJAX link in Drupal, outside of form API, we first need to add a menu item :</p>\n<p><code>function MYMODULE_menu() {<br />\n $items = array();<br />\n $items[\'MYMODULE/ajax\'] = array(<br />\n \'page callback\' =&gt; \'MYMODULE_ajax_callback\',<br />\n \'access callback\' =&gt; TRUE,<br />\n \'type\' =&gt; MENU_CALLBACK,<br />\n );<br />\n $items[\'MYMODULE/ajax/%/%\'] = array(<br />\n \'page callback\' =&gt; \'MYMODULE_ajax_callback\',<br />\n \'page arguments\' =&gt; array(2, 3),<br />\n \'access callback\' =&gt; TRUE,<br />\n \'type\' =&gt; MENU_CALLBACK,<br />\n );<br />\n return $items;<br />\n}</code></p>\n<p>Then, wherever you want to create a link, include the library :</p>\n<p><code>// Add libraries<br />\ndrupal_add_library(\'system\', \'drupal.ajax\');<br />\ndrupal_add_library(\'system\', \'jquery.form\');</code></p>\n<p>Create a link with the \"use-ajax\" class and a wrapper for the AJAX response. This is a dummy example, you must do this in an appropriate way of course :</p>\n<p><code>// Output a link<br />\nl(t(\'AJAX\'), \'MYMODULE/ajax/nojs/\' . $some_argument, array(\'attributes\' =&gt; array(\'class\' =&gt; array(\'use-ajax\'))));<br />\n// Output a wrapper<br />\n\'&lt;div id=\"MYMODULE-wrapper\"&gt;&lt;/div&gt;\'</code></p>\n<p>Finally, create your callback function :</p>\n<p><code>function MYMODULE_ajax_callback($type = \'ajax\', $some_argument) {<br />\n if ($type == \'ajax\') {<br />\n $commands[] = ajax_command_replace(\'#MYMODULE-wrapper\', \'Hey ! Some AJAX content !\');<br />\n $page = array(\'#type\' =&gt; \'ajax\', \'#commands\' =&gt; $commands);<br />\n ajax_deliver($page);<br />\n }<br />\n else {<br />\n $output = t(\"This is some content delivered via a page load.\");<br />\n return $output;<br />\n }<br />\n}</code></p>\n<p>That\'s it !</p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:ced483412c1701fc505f39a38e0ca088' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data' query: UPDATE cache_views_data SET data = 'a:3:{s:6:\"result\";a:74:{i:0;O:8:\"stdClass\":1:{s:3:\"nid\";s:1:\"4\";}i:1;O:8:\"stdClass\":1:{s:3:\"nid\";s:1:\"2\";}i:2;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"47\";}i:3;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"48\";}i:4;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"54\";}i:5;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"60\";}i:6;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"62\";}i:7;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"63\";}i:8;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"65\";}i:9;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"67\";}i:10;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"69\";}i:11;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"72\";}i:12;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"74\";}i:13;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"76\";}i:14;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"78\";}i:15;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"80\";}i:16;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"83\";}i:17;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"84\";}i:18;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"87\";}i:19;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"90\";}i:20;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"92\";}i:21;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"94\";}i:22;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"95\";}i:23;O:8:\"stdClass\":1:{s:3:\"nid\";s:2:\"98\";}i:24;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"100\";}i:25;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"101\";}i:26;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"104\";}i:27;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"106\";}i:28;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"108\";}i:29;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"110\";}i:30;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"111\";}i:31;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"113\";}i:32;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"118\";}i:33;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"119\";}i:34;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"121\";}i:35;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"124\";}i:36;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"126\";}i:37;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"128\";}i:38;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"130\";}i:39;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"132\";}i:40;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"134\";}i:41;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"135\";}i:42;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"138\";}i:43;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"142\";}i:44;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"144\";}i:45;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"145\";}i:46;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"147\";}i:47;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"149\";}i:48;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"151\";}i:49;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"153\";}i:50;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"155\";}i:51;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"158\";}i:52;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"159\";}i:53;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"161\";}i:54;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"163\";}i:55;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"165\";}i:56;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"167\";}i:57;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"169\";}i:58;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"171\";}i:59;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"173\";}i:60;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"187\";}i:61;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"188\";}i:62;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"190\";}i:63;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"192\";}i:64;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"194\";}i:65;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"200\";}i:66;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"203\";}i:67;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"205\";}i:68;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"208\";}i:69;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"209\";}i:70;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"211\";}i:71;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"213\";}i:72;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"215\";}i:73;O:8:\"stdClass\":1:{s:3:\"nid\";s:3:\"217\";}}s:10:\"total_rows\";i:74;s:5:\"pager\";a:5:{s:9:\"use_pager\";b:0;s:14:\"items_per_page\";i:0;s:7:\"element\";i:0;s:6:\"offset\";i:0;s:12:\"current_page\";i:0;}}', created = 1513123564, expire = 1513127164, headers = '', serialized = 1 WHERE cid = 'tagadelic:block_1:results:e95417a84dd0b10d3ce7de97e90f7660' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data' query: UPDATE cache_views_data SET data = 'a:4:{s:4:\"head\";s:0:\"\";s:3:\"css\";a:0:{}s:2:\"js\";a:0:{}s:6:\"output\";s:3583:\"<div class=\"view view-tagadelic view-id-tagadelic view-display-id-block_1 view-dom-id-1\">\n \n \n \n <div class=\"view-content\">\n <div class=\"tagadelic_views\"><a href=\"/english/android-0\" class=\"tagadelic level1\" rel=\"tag\">android</a> \n<a href=\"/english/apache-0\" class=\"tagadelic level1\" rel=\"tag\">Apache</a> \n<a href=\"/english/automator-0\" class=\"tagadelic level1\" rel=\"tag\">Automator</a> \n<a href=\"/english/bootstrap-0\" class=\"tagadelic level3\" rel=\"tag\">bootstrap</a> \n<a href=\"/english/canal-0\" class=\"tagadelic level1\" rel=\"tag\">canal +</a> \n<a href=\"/english/command-line-0\" class=\"tagadelic level1\" rel=\"tag\">Command line</a> \n<a href=\"/english/css\" class=\"tagadelic level1\" rel=\"tag\">CSS</a> \n<a href=\"/english/css-0\" class=\"tagadelic level1\" rel=\"tag\">CSS</a> \n<a href=\"/english/customize-0\" class=\"tagadelic level1\" rel=\"tag\">customize</a> \n<a href=\"/english/drupal-0\" class=\"tagadelic level5 active\" rel=\"tag\">Drupal</a> \n<a href=\"/english/drupal\" class=\"tagadelic level2\" rel=\"tag\">Drupal</a> \n<a href=\"/english/dwmapi-0\" class=\"tagadelic level1\" rel=\"tag\">Dwmapi</a> \n<a href=\"/english/facebook-0\" class=\"tagadelic level1\" rel=\"tag\">Facebook</a> \n<a href=\"/english/finder-0\" class=\"tagadelic level1\" rel=\"tag\">Finder</a> \n<a href=\"/english/freshy-0\" class=\"tagadelic level1\" rel=\"tag\">freshy</a> \n<a href=\"/english/game-0\" class=\"tagadelic level1\" rel=\"tag\">game</a> \n<a href=\"/english/git-0\" class=\"tagadelic level1\" rel=\"tag\">GIT</a> \n<a href=\"/english/github-0\" class=\"tagadelic level1\" rel=\"tag\">github</a> \n<a href=\"/english/grunt-0\" class=\"tagadelic level1\" rel=\"tag\">grunt</a> \n<a href=\"/english/html\" class=\"tagadelic level1\" rel=\"tag\">HTML</a> \n<a href=\"/english/javascript-0\" class=\"tagadelic level2\" rel=\"tag\">javascript</a> \n<a href=\"/english/jidefr-0\" class=\"tagadelic level1\" rel=\"tag\">jide.fr</a> \n<a href=\"/english/jquery\" class=\"tagadelic level1\" rel=\"tag\">jQuery</a> \n<a href=\"/english/jquery-ui\" class=\"tagadelic level2\" rel=\"tag\">jQuery UI</a> \n<a href=\"/english/lamp\" class=\"tagadelic level1\" rel=\"tag\">LAMP</a> \n<a href=\"/english/le-moteur-de-recherche-0\" class=\"tagadelic level1\" rel=\"tag\">le moteur de recherche</a> \n<a href=\"/english/less-0\" class=\"tagadelic level2\" rel=\"tag\">less</a> \n<a href=\"/english/mac-os-x-0\" class=\"tagadelic level1\" rel=\"tag\">Mac OS X</a> \n<a href=\"/english/made-in-france-0\" class=\"tagadelic level1\" rel=\"tag\">made in france</a> \n<a href=\"/english/mobile-0\" class=\"tagadelic level1\" rel=\"tag\">mobile</a> \n<a href=\"/english/mongo-db-0\" class=\"tagadelic level1\" rel=\"tag\">mongo db</a> \n<a href=\"/english/mysql-0\" class=\"tagadelic level1\" rel=\"tag\">MySQL</a> \n<a href=\"/english/nodejs-0\" class=\"tagadelic level1\" rel=\"tag\">nodejs</a> \n<a href=\"/english/openlayers\" class=\"tagadelic level1\" rel=\"tag\">Openlayers</a> \n<a href=\"/english/php-0\" class=\"tagadelic level2\" rel=\"tag\">PHP</a> \n<a href=\"/english/qt-0\" class=\"tagadelic level1\" rel=\"tag\">Qt</a> \n<a href=\"/english/queue-api-0\" class=\"tagadelic level1\" rel=\"tag\">Queue API</a> \n<a href=\"/english/ruby-0\" class=\"tagadelic level1\" rel=\"tag\">Ruby</a> \n<a href=\"/english/rules-0\" class=\"tagadelic level1\" rel=\"tag\">Rules</a> \n<a href=\"/english/vagrant\" class=\"tagadelic level1\" rel=\"tag\">Vagrant</a> \n<a href=\"/english/views\" class=\"tagadelic level1\" rel=\"tag\">Views</a> \n<a href=\"/english/windows-api-0\" class=\"tagadelic level1\" rel=\"tag\">Windows API</a> \n<a href=\"/english/wordpress\" class=\"tagadelic level3\" rel=\"tag\">wordpress</a> \n<a href=\"/english/wordpress-0\" class=\"tagadelic level6\" rel=\"tag\">wordpress</a> \n</div> </div>\n \n \n \n \n \n \n</div> \";}', created = 1513123564, expire = 1513127164, headers = '', serialized = 1 WHERE cid = 'tagadelic:block_1:output:f9d44744f2ad14e08a7fcb35fd44c428' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_block' query: UPDATE cache_block SET data = 'a:2:{s:7:\"content\";s:3583:\"<div class=\"view view-tagadelic view-id-tagadelic view-display-id-block_1 view-dom-id-1\">\n \n \n \n <div class=\"view-content\">\n <div class=\"tagadelic_views\"><a href=\"/english/android-0\" class=\"tagadelic level1\" rel=\"tag\">android</a> \n<a href=\"/english/apache-0\" class=\"tagadelic level1\" rel=\"tag\">Apache</a> \n<a href=\"/english/automator-0\" class=\"tagadelic level1\" rel=\"tag\">Automator</a> \n<a href=\"/english/bootstrap-0\" class=\"tagadelic level3\" rel=\"tag\">bootstrap</a> \n<a href=\"/english/canal-0\" class=\"tagadelic level1\" rel=\"tag\">canal +</a> \n<a href=\"/english/command-line-0\" class=\"tagadelic level1\" rel=\"tag\">Command line</a> \n<a href=\"/english/css\" class=\"tagadelic level1\" rel=\"tag\">CSS</a> \n<a href=\"/english/css-0\" class=\"tagadelic level1\" rel=\"tag\">CSS</a> \n<a href=\"/english/customize-0\" class=\"tagadelic level1\" rel=\"tag\">customize</a> \n<a href=\"/english/drupal-0\" class=\"tagadelic level5 active\" rel=\"tag\">Drupal</a> \n<a href=\"/english/drupal\" class=\"tagadelic level2\" rel=\"tag\">Drupal</a> \n<a href=\"/english/dwmapi-0\" class=\"tagadelic level1\" rel=\"tag\">Dwmapi</a> \n<a href=\"/english/facebook-0\" class=\"tagadelic level1\" rel=\"tag\">Facebook</a> \n<a href=\"/english/finder-0\" class=\"tagadelic level1\" rel=\"tag\">Finder</a> \n<a href=\"/english/freshy-0\" class=\"tagadelic level1\" rel=\"tag\">freshy</a> \n<a href=\"/english/game-0\" class=\"tagadelic level1\" rel=\"tag\">game</a> \n<a href=\"/english/git-0\" class=\"tagadelic level1\" rel=\"tag\">GIT</a> \n<a href=\"/english/github-0\" class=\"tagadelic level1\" rel=\"tag\">github</a> \n<a href=\"/english/grunt-0\" class=\"tagadelic level1\" rel=\"tag\">grunt</a> \n<a href=\"/english/html\" class=\"tagadelic level1\" rel=\"tag\">HTML</a> \n<a href=\"/english/javascript-0\" class=\"tagadelic level2\" rel=\"tag\">javascript</a> \n<a href=\"/english/jidefr-0\" class=\"tagadelic level1\" rel=\"tag\">jide.fr</a> \n<a href=\"/english/jquery\" class=\"tagadelic level1\" rel=\"tag\">jQuery</a> \n<a href=\"/english/jquery-ui\" class=\"tagadelic level2\" rel=\"tag\">jQuery UI</a> \n<a href=\"/english/lamp\" class=\"tagadelic level1\" rel=\"tag\">LAMP</a> \n<a href=\"/english/le-moteur-de-recherche-0\" class=\"tagadelic level1\" rel=\"tag\">le moteur de recherche</a> \n<a href=\"/english/less-0\" class=\"tagadelic level2\" rel=\"tag\">less</a> \n<a href=\"/english/mac-os-x-0\" class=\"tagadelic level1\" rel=\"tag\">Mac OS X</a> \n<a href=\"/english/made-in-france-0\" class=\"tagadelic level1\" rel=\"tag\">made in france</a> \n<a href=\"/english/mobile-0\" class=\"tagadelic level1\" rel=\"tag\">mobile</a> \n<a href=\"/english/mongo-db-0\" class=\"tagadelic level1\" rel=\"tag\">mongo db</a> \n<a href=\"/english/mysql-0\" class=\"tagadelic level1\" rel=\"tag\">MySQL</a> \n<a href=\"/english/nodejs-0\" class=\"tagadelic level1\" rel=\"tag\">nodejs</a> \n<a href=\"/english/openlayers\" class=\"tagadelic level1\" rel=\"tag\">Openlayers</a> \n<a href=\"/english/php-0\" class=\"tagadelic level2\" rel=\"tag\">PHP</a> \n<a href=\"/english/qt-0\" class=\"tagadelic level1\" rel=\"tag\">Qt</a> \n<a href=\"/english/queue-api-0\" class=\"tagadelic level1\" rel=\"tag\">Queue API</a> \n<a href=\"/english/ruby-0\" class=\"tagadelic level1\" rel=\"tag\">Ruby</a> \n<a href=\"/english/rules-0\" class=\"tagadelic level1\" rel=\"tag\">Rules</a> \n<a href=\"/english/vagrant\" class=\"tagadelic level1\" rel=\"tag\">Vagrant</a> \n<a href=\"/english/views\" class=\"tagadelic level1\" rel=\"tag\">Views</a> \n<a href=\"/english/windows-api-0\" class=\"tagadelic level1\" rel=\"tag\">Windows API</a> \n<a href=\"/english/wordpress\" class=\"tagadelic level3\" rel=\"tag\">wordpress</a> \n<a href=\"/english/wordpress-0\" class=\"tagadelic level6\" rel=\"tag\">wordpress</a> \n</div> </div>\n \n \n \n \n \n \n</div> \";s:7:\"subject\";s:4:\"Tags\";}', created = 1513123564, expire = -1, headers = '', serialized = 1 WHERE cid = 'views:tagadelic-block_1:kewl:en:http://www.jide.fr/english/drupal-0' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>Follow me : <a href=\"http://twitter.com/jidefr\">jidefr</a></p>\n', created = 1513123564, expire = 1513209964, headers = '', serialized = 0 WHERE cid = '1:fb82f31c75d9dcc2908dc560fa3f9280' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data' query: UPDATE cache_views_data SET data = 'a:3:{s:6:\"result\";a:1:{i:0;O:8:\"stdClass\":3:{s:10:\"twitter_id\";s:18:\"937070315510861824\";s:12:\"twitter_text\";s:143:\"RT @PhilippeCorbe: Si vous avez du mal à comprendre l\'affaire russe, et l\'importance de l\'information du jour, le plaider coupable de l\'anc…\";s:20:\"twitter_created_time\";s:10:\"1512249947\";}}s:10:\"total_rows\";N;s:5:\"pager\";a:5:{s:9:\"use_pager\";s:1:\"0\";s:14:\"items_per_page\";i:1;s:7:\"element\";i:0;s:6:\"offset\";i:0;s:12:\"current_page\";i:0;}}', created = 1513123564, expire = 1513127164, headers = '', serialized = 1 WHERE cid = 'tweets:block:results:72324ccbb847e44714310307270aae76' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_views_data' query: UPDATE cache_views_data SET data = 'a:4:{s:4:\"head\";s:0:\"\";s:3:\"css\";a:0:{}s:2:\"js\";a:3:{i:0;a:5:{i:0;s:38:\"sites/default/modules/views/js/base.js\";i:1;s:6:\"module\";i:2;s:6:\"header\";i:3;b:0;i:4;b:1;}i:1;a:5:{i:0;s:43:\"sites/default/modules/views/js/ajax_view.js\";i:1;s:6:\"module\";i:2;s:6:\"header\";i:3;b:0;i:4;b:1;}i:2;a:3:{i:0;a:1:{s:5:\"views\";a:2:{s:9:\"ajax_path\";s:19:\"/english/views/ajax\";s:9:\"ajaxViews\";a:1:{i:0;a:7:{s:9:\"view_name\";s:6:\"tweets\";s:15:\"view_display_id\";s:5:\"block\";s:9:\"view_args\";s:0:\"\";s:9:\"view_path\";s:16:\"taxonomy/term/80\";s:14:\"view_base_path\";N;s:11:\"view_dom_id\";i:2;s:13:\"pager_element\";i:0;}}}}i:1;s:7:\"setting\";i:2;s:6:\"header\";}}s:6:\"output\";s:732:\"<div class=\"view view-tweets view-id-tweets view-display-id-block view-dom-id-2\">\n \n \n \n <div class=\"view-content\">\n <div class=\"views-row views-row-1 views-row-odd views-row-first views-row-last\">\n \n <span class=\"views-field-text\">\n <span class=\"field-content\">RT <a target=\"_blank\" rel=\"nofollow\" href=\"http://twitter.com/PhilippeCorbe\">@PhilippeCorbe</a>: Si vous avez du mal à comprendre l\'affaire russe, et l\'importance de l\'information du jour, le plaider coupable de l\'anc…</span>\n </span>\n &#8212; \n <span class=\"views-field-created-time\">\n <span class=\"field-content\"><em>1 week 3 days</em> ago</span>\n </span>\n </div>\n </div>\n \n \n \n \n \n \n</div> \";}', created = 1513123564, expire = 1513127164, headers = '', serialized = 1 WHERE cid = 'tweets:block:output:7475b0b3516412a48129b88a1bae2ce5' in /home/jideretu/www/includes/cache.inc on line 112.
  • user warning: UPDATE command denied to user 'jideretumysql'@'10.0.66.38' for table 'cache_block' query: UPDATE cache_block SET data = 'a:2:{s:7:\"subject\";s:15:\"Recent Comments\";s:7:\"content\";s:187:\"<div id=\"dsq-recentcomments\" class=\"dsq-widget\"><script type=\"text/javascript\" src=\"http://disqus.com/forums/jide/recent_comments_widget.js?num_items=1&amp;hide_avatars=1\"></script></div>\";}', created = 1513123564, expire = -1, headers = '', serialized = 1 WHERE cid = 'disqus:disqus_recent_comments:kewl:en' in /home/jideretu/www/includes/cache.inc on line 112.

Edit: As Pol said in comments, you can use the openlayers_taxonomy module to do this. But it turns out I had to use content types as layers too, so this technique still was useful to me. Thank you Pol :)

I wanted to create layers depending on some taxonomy terms with Openlayers. But the only way to create layers with views is to add one display per layer. What if you want as many layers as terms ? Some Views trickery to the rescue !

  1. Create your Openlayers view.
  2. Add a layer display for the first term.
  3. Create a filter for the term.
  4. Export the view through code.

Then, edit the view code to create one layer per term :
/**
* Implements hook_views_default_views().
*/
function MYMODULE_views_default_views() {
$vocabulary = taxonomy_vocabulary_machine_name_load('VOCABULARY_NAME');
$terms = taxonomy_get_tree($vocabulary->vid);
// Your view code for the master display...
foreach($terms as $term) {
$handler = $view->new_display('openlayers', $term->name, 'layer_' . $term->tid);
// The display code...
$handler->display->display_options['filters']['tid']['value'] = array(

To show the profile2 form directly on the user account edit form :

The following assumes that the profile2 type is called "profile".

First, we have to hide the tab on the user account page :

/**
* Implements hook_menu_alter().
*/
function MY_MODULE_menu_alter(&$items) {
$items['user/%user_category/edit/profile']['access callback'] = FALSE;
}

Then, merge the profile2 form with the user account form itself :

/**
* Implements hook_form_FORM_ID_alter() for the user edit form.
*/
function MY_MODULE_form_user_profile_form_alter(&$form, &$form_state) {
if (($type = profile2_get_types('profile')) && $type->userCategory) {
if (empty($form_state['profiles'])) {
$profile = profile2_load_by_user($form['#user'], 'profile');
if (empty($profile)) {
$profile = profile_create(array('type' => 'profile', 'uid' => $form['#user']->uid));
}
$form_state['profiles'][$profile->type] = $profile;
}
profile2_attach_form($form, $form_state);
}
}

Drupal uses a default jQuery UI theme. Here is how to use your own theme created using the jQuery ThemeRoller.

Put the generated jQuery UI theme in your theme directory, in a subfolder called "jquery-ui". It should have an "images" folder and a "jquery-ui.css" file.

Then, in your theme's template.php :

/**
* Implements hook_library_alter().
*/
function YOUR_THEME_library_alter(&$libraries, $module) {
$libraries['ui']['css'] = array();
$libraries['ui.accordion']['css'] = array();
$libraries['ui.autocomplete']['css'] = array();
$libraries['ui.button']['css'] = array();
$libraries['ui.datepicker']['css'] = array();
$libraries['ui.dialog']['css'] = array();
$libraries['ui.draggable']['css'] = array();
$libraries['ui.droppable']['css'] = array();
$libraries['ui.mouse']['css'] = array();
$libraries['ui.position']['css'] = array();
$libraries['ui.progressbar']['css'] = array();
$libraries['ui.resizable']['css'] = array();
$libraries['ui.selectable']['css'] = array();
$libraries['ui.slider']['css'] = array();
$libraries['ui.sortable']['css'] = array();
$libraries['ui.tabs']['css'] = array();
$libraries['ui']['css'][drupal_get_path('theme', 'YOUR_THEME') . '/jquery-ui/jquery-ui.css'] = array();
}

For a recent project, I had to migrate from Drupal 5 to Drupal 7. Here is how I did it without too much pain. The key steps are :

  • Export data to CSV from the original instance using Views module and a CSV output plugin.
  • Import them in the 7.x instance using Feeds.

A friend of mine just pointed out that my name is written in big characters in a slide of the latest Keynote of Dries Buytaert showing Drupal contributors :) It is in slide #10, and also in the video, around 1:00. Yay ! I'm famous !

Random magic hehe, I'm not such a big contributor ;) Try to find my name in this picture where contributors size is proportionate, that's a little harder :) :

/**
* Implements hook_cron_queue_info().
*/
function MYMODULE_cron_queue_info() {
$queues = array();
$queues['MYMODULE_queue_notify'] = array(
'worker callback' => 'MYMODULE_queue_notify_worker',
'time' => 15,
);
return $queues;
}
 
/**
* Queue worker for sending notification mails.
*/
function MYMODULE_queue_notify_worker($params) {
drupal_mail('MYMODULE', 'notify', $params['to'], language_default(), $params, $params['from']);
}
 
/**
* Implements hook_mail().
*/
function MYMODULE_mail($key, &$message, $params) {
$language = $message['language'];
$message['subject'] = $params['subject'];
$message['body'][] = $params['message'];
}
 
/**
* Implements hook_rules_action_info().
*/
function MYMODULE_rules_action_info() {
return array(
'MYMODULE_rules_action_mail' => array(
'label' => t('Send mail'),
'group' => 'MYMODULE',
'parameter' => array(
'to' => array(
'type' => 'text',
'label' => t('To'),
'description' => t('The e-mail address or addresses where the message will be sent to. The formatting of this string must comply with RFC 2822.'),
),
'subject' => array(
'type' => 'text',
'label' => t('Subject'),
'description' => t("The mail's subject."),
),
'message' => array(
'type' => 'text',
'label' => t('Message'),
'description' => t("The mail's message body."),
),
'from' => array(
'type' => 'text',
'label' => t('From'),
'description' => t("The mail's from address. Leave it empty to use the site-wide configured address."),
'optional' => TRUE,
),
),
),
);
}
 
/**
* Action: Add notification mails to the queue.
*/
function MYMODULE_rules_action_mail($to, $subject, $message, $from = NULL, $settings, RulesState $state, RulesPlugin $element) {
// Gather params.
$params = array(
'to' => str_replace(array("\r", "\n"), '', $to),
'from' => !empty($from) ? str_replace(array("\r", "\n"), '', $from) : NULL,
'subject' => $subject,
'message' => $message,
);
// Add to the queue.
$queue = DrupalQueue::get('MYMODULE_queue_notify');
$queue->createItem($params);
}

When using a view with exposed filters, if the exposed filter is empty, by default views renders the view with all results displayed. To make an empty view instead :

  • Add an argument "Global: Null"
  • Action to take if argument is not present: Provide default argument
  • Default argument type: Fixed entry
  • Default argument: let it blank
  • Validator: PHP code
  • PHP validate code:
    if (!empty($view->exposed_input) && count($view->exposed_input) == 1 && isset($view->exposed_input['destination'])) {
    return FALSE;
    }
    return (!empty($view->exposed_input));
  • Action to take if argument does not validate: Display empty text (if you want the view to be rendered)

And voilà !

To create GIT patches using branches (which is required for drush make):
git clone --branch 7.x-1.x http://git.drupal.org/project/session_api
cd session_api
git checkout -b cron
[edit code...]
git commit -a -m "Use an expiration logic when clearing sessions on cron"
git checkout 7.x-1.x
git diff --no-prefix 7.x-1.x cron > session_api_cron.patch

You may use the "master" branch instead of "7.x-1.x".

Here is a simple database API example :

$results = db_select('authmap', 'am') // 'authmap' is the table name, 'am' the alias
->fields('am', array('uid')) // The alias and the field we want to fetch
->distinct() // Add distinct
->condition('module', 'MYMODULE') // A condition on the 'module' field, 'MYMODULE' value
->condition('authname', $ids, 'IN') // A condition on the 'authname' field, value is in $ids array
->execute() // Execute the query
->fetchCol(); // Fetch column

There are many examples on how to use AJAX using form API, but I could not find a good example on how to use AJAX with markup. Here is a simple method.

To create an AJAX link in Drupal, outside of form API, we first need to add a menu item :

function MYMODULE_menu() {
$items = array();
$items['MYMODULE/ajax'] = array(
'page callback' => 'MYMODULE_ajax_callback',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
$items['MYMODULE/ajax/%/%'] = array(
'page callback' => 'MYMODULE_ajax_callback',
'page arguments' => array(2, 3),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}

Then, wherever you want to create a link, include the library :

// Add libraries
drupal_add_library('system', 'drupal.ajax');
drupal_add_library('system', 'jquery.form');

Create a link with the "use-ajax" class and a wrapper for the AJAX response. This is a dummy example, you must do this in an appropriate way of course :

// Output a link
l(t('AJAX'), 'MYMODULE/ajax/nojs/' . $some_argument, array('attributes' => array('class' => array('use-ajax'))));
// Output a wrapper
'<div id="MYMODULE-wrapper"></div>'

Finally, create your callback function :

function MYMODULE_ajax_callback($type = 'ajax', $some_argument) {
if ($type == 'ajax') {
$commands[] = ajax_command_replace('#MYMODULE-wrapper', 'Hey ! Some AJAX content !');
$page = array('#type' => 'ajax', '#commands' => $commands);
ajax_deliver($page);
}
else {
$output = t("This is some content delivered via a page load.");
return $output;
}
}

That's it !

Syndicate content

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:0:\"\";s:5:\"%file\";s:37:\"/home/jideretu/www/includes/cache.inc\";s:5:\"%line\";i:112;}', 3, '', 'http://www.jide.fr/english/drupal-0', '', '54.163.61.66', 1513123564) in /home/jideretu/www/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'jideretumysql'@'10.0.66.38' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:428:\"UPDATE command denied to user &#039;jideretumysql&#039;@&#039;10.0.66.38&#039; for table &#039;sessions&#039;\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &#039;54.163.61.66&#039;, session = &#039;messages|a:1:{s:5:\\&quot;error\\&quot;;a:1:{i:0;s:68:\\&quot;user warning: in /home/jideretu/www/includes/cache.inc on line 112.\\&quot;;}}&#039;, timestamp = 1513123564 WHERE sid = &#039;3vcmcmtfcfc2j1gg2fidp2jp81&#039;\";s:5:\"%file\";s:39:\"/home/jideretu/www/includes/session.inc\";s:5:\"%line in /home/jideretu/www/includes/database.mysql.inc on line 135