drupal-7

Push notifications Drupal module - Remove device (Web services)

谁都会走 提交于 2019-12-06 23:39:59
问题 I´ve started to work with this module and i´ve managed to register devices (following the instructions of his author posted here). Now i'm trying to unregister devices but when i send the http delete request (sending the token parameter with the value stored in DB) the message that i obtain is "HTTP/1.1 301 Moved Permanently" and i have no idea what´s happening here. I´ve been surfing the net but i didn´t find anything related to this... If you need any additional info let me know. Thanks in

How to allow multiple blocks in a module of Drupal

梦想的初衷 提交于 2019-12-06 16:23:22
问题 I am trying to make a module for Drupal 7 that provides a block and has certain configuration settings. Now what I want is that I want to provide 5 blocks to the user so that they can use different settings in each block. In other words, I want to provide each block a separate set of settings. How can I do that? Edit: Actually I have made a module that shows a single block. If you have used superfish menu module then you can see there that they allow us an option to choose how many block

How can I redirect a Drupal user after they create new content

*爱你&永不变心* 提交于 2019-12-06 16:00:02
问题 I want to redirect my users after they create a piece of new content, instead of directing them to the 'view' page for the content. I have seen mention of using hook_alter or something, but I'm really new to drupal and not even sure what that means? Thanks! 回答1: As you mention that you are new to Drupal, I'd suggest to take a look at the Rules module. You can add a trigger on for content has been saved/updated and add an action, to redirect the user to a specific page. You can however do the

PDOException: SQLSTATE[42S02]

百般思念 提交于 2019-12-06 15:19:14
I have just install Drupal 7 through microsoft web platform installer after successful installation when i run web matrix and run it. It show me this error I am new to drupal so have no clue what is this error and how to solve it It's a simple problem to solve, just visit install.php on your website and you should be able to install as normal. Sometimes the installer doesn't automatically redirect to install.php and instead visits the root of the site. The exception happens because Drupal looks for the database tables and they don't exist, install.php not having been run. There's a discussion

Drupal field_settings_form

守給你的承諾、 提交于 2019-12-06 14:50:19
I made my own Field in Drupal for an address. It displays things like street, number, zip,... So far so good. But for some reason, ALL field are required. Although there are set required in the UI or the Array. So I would like to edit it's field_settings_form. I found myself an example in the Drupal-core code, but it doesn't help me a lot. Goal of the field_settings is to make the fields visible or not and required or not. So I came up with this code (I got it from user_reference.module ) function mymodule_field_settings_form($field, $instance, $has_data) { $settings = array_keys($field[

dynamic view by date arguments in drupal 7

a 夏天 提交于 2019-12-06 13:27:28
I'm new to drupal, currently im stuck with this problem. I want to create a article view ("tip of the day") wherein the content of the will automatically changed accordingly. The default value would be the current date. For example: http://localhost/test this will get the current date as the default filter. If no items found it will give no results found. when i go to http://localhost/test/20111220 the view will automatically get the value of the date parameter in the url and output the content on that date. How can I achieved this? Any thoughts or ideas there? Thank you. If you are using

Valid access arguments

耗尽温柔 提交于 2019-12-06 13:18:56
How can I look up the valid access arguments? I looked in menu_router, but I believe that only gives some of them. $items['admin/page'] = array( 'access arguments' => array('access administration pages'), ); Invoke hook_permission() across all modules: $permissions = module_invoke_all('permission'); If I remember rightly array_keys($permissions) will then give you a list of valid permission machine names. The labels/descriptions/other settings for each permissions are in each individual array item. Actually, you are interested to the values of the access arguments where the access callback is

Drupal login form customize

你说的曾经没有我的故事 提交于 2019-12-06 12:19:04
问题 Hi i have used this code <?php $elements = drupal_get_form("user_login"); $form = drupal_render($elements); echo $form; ?> to get the default Drupal login form for my site but I need to customize the HTML, I have found some pages in module/users but did not understand how to customize the structure. 回答1: use this in template.php function themename_theme() { $items = array(); $items['user_login'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'corporateclean') . '

How do I add custom fields in a view?

女生的网名这么多〃 提交于 2019-12-06 10:47:46
I have created a view in Drupal 7, and used "Table" as format. How can I add my own fields to that table? One method is, in your view, click 'add' for fields, then filter by 'Global', and you will get 4 types of custom fields to add. Global: Contextual Links Global: Custom text Global: Math expression Global: View result counter Another method is to make use of Views Custom Field module. 来源: https://stackoverflow.com/questions/15162343/how-do-i-add-custom-fields-in-a-view

how to construct an https POST request with drupal_http_request?

自作多情 提交于 2019-12-06 08:28:41
问题 I want to send a POST request to an https server. $data = 'name=value&name1=value1'; $options = array( 'method' => 'POST', 'data' => $data, 'timeout' => 15, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'), ); $result = drupal_http_request('http://somewhere.com', $options); I can't figure out out to implement the https options in the POST example code above. Can anyone please explain me how to do this? I am quite new to PHP coding with Drupal, and I could definitely