drupal-7

Track user's action

喜欢而已 提交于 2019-12-25 03:22:44
问题 In our company I have to extend the functionality of existing Drupal 7 website. Here are the requirements: The business needs to inform all staff members, on different topics using uploaded to the Drupal site documents. (I already implemented this requirement.) The business needs to know, which staff members have read a document and which still have not. They need a report like this: Document 1 25/50 (25 from 50 staff members still didn't read the file) Document 2 50/50 (all staff members did

custom 301 redirects from old joomla (mambo) website to new drupal 7 website using .htaccess

做~自己de王妃 提交于 2019-12-25 02:55:30
问题 The past couple of hours I am trying to create custom redirects from an old mambo website to new drupal 7 website with the .htaccess file that exists in my drupal's root. What I want to do is... 301 Redirect http://mysite.com/index.php?option=com_content&task=blogsection&id=11&Itemid=54 to http://mysite.com/this-is-the-new-page This is my .htaccess file... RewriteEngine on RewriteRule ^index.php?option=com_content&task=blogsection&id=11&Itemid=54$ http://mysite.com/this-is-the-new-page [R=301

Connecting PHP code on Compute Engine to Cloud SQL securely

早过忘川 提交于 2019-12-25 02:24:31
问题 I'm trying to connect drupal cms running on a Compute Instance to Cloud SQL database but every combination I try fails. I can connect to Cloud SQl from another server but I'm not sure what path the MySQL connection takes from my instance to Cloud SQL but also want to configure as secure as possible connection to and from the db server Here is the configuration I have Servers Cloud SQL with external IP address assigned. Also authorized external IP address of compute instance & Independent

drupal 7 cusomized user profile template can not save changes

泄露秘密 提交于 2019-12-25 02:13:08
问题 I want to custom my user profile edit page. The edit path is: xxx/user/2/edit 1. In my templage file: function MYTHEME_theme() { 'user_profile_form' => array( 'arguments' => array('form' => NULL), 'render element' => 'form', 'template' => 'user-profile-form', 'path' => drupal_get_path('theme', 'bootstrap_subtheme').'/templates', ), } function MYTHEME_preprocess_user_profile_form(&$vars) { drupal_set_title('Account settings'); unset($vars['form']['account']['mail']['#description']); $vars[

How to create table having text fiels with drupal 7 web form module

不问归期 提交于 2019-12-25 01:30:00
问题 I am using drupal 7 web form module.I want to create a form with a table having text fields.Can any one help me to do this.Is there any particular module available in drupal7 to customize a form to create a table 回答1: Use the Fieldset type to create a webform table component 来源: https://stackoverflow.com/questions/11241587/how-to-create-table-having-text-fiels-with-drupal-7-web-form-module

Javascript function not getting called in Drupal 7 which used to run proper in Drupal 6

岁酱吖の 提交于 2019-12-25 00:51:21
问题 I am in the process of migrating my Drupal 6 site to Drupal 7. As a result i am facing some issues with the code. The calling of javascript laced with jquery etc is different in Drupal 7 is what i have read. This is the image of the page i had in Drupal 6. On change of the dropdown box, the table above it gets populated with projects belonging to that status. This works fine in Drupal 6. But in Drupal 7 i see this javascript error. This is the form element for the Dropdown in my php file. <?

hook_permission and control access [how to redirect to the login page if user not logged in]

感情迁移 提交于 2019-12-25 00:36:16
问题 How does one limit "what" can access a page. I have little understanding on how to use hook_permission() to set user permission based on a role to control access to hook_menu() items. However, what if I have a hook_menu() item that is to be used solely by the system itself? For example, say I have a registration page in a custom module: module/register - Anyone can access that page. Then, say I have an another page which is only for admin. So, I register another item in hook_menu(), call it

Why does calling drush command by system() fail?

冷暖自知 提交于 2019-12-24 20:47:25
问题 I have Drupal 7 site on IIS 7.5 server. Inside IIS Services Manager I choose user with administrator rights in anonymous authentication settings. I'm sure that drush command is in evn path. When I logged as this user (Win7) I can call this command everywhere. However when I try to launch this command inside Drupal module: $output = array(); $res = exec('drush --version', $output, $retval); $retval is always 1 (error), $output and $res are empty. Different command (sqlcmd) works ok. Both

Drupal view shows only one row

左心房为你撑大大i 提交于 2019-12-24 19:23:55
问题 I've got a view defined with 3 nodes, in views-view-unformatted--my-view--default.tpl.php I loop throws $rows but get only first result, if I try this: $view = views_get_current_view(); error_log(count($view->result)); //<- This returns only 1 row error_log($view->total_rows); //<- This shows nothing, as if property didn't exist foreach ($rows as $id => $row): print $row; //<- Only print first node endforeach; What is the problem? Why can't I find the 3 of them? EDIT I found out that it's

Error enabling MongoDB module

余生颓废 提交于 2019-12-24 19:22:20
问题 I am trying to use MongoDB with drupal 7 site. The database is hosted remotely on mongolab.com. I have installed the MongoDB Driver on my dedicated server and it added extension = "mongo.so" to my php.ini automatically. Now, when I try to enable MongoDB module, it gives me this error: Mongodb requires the PHP MongoDB extension to be installed. (Currently using Mongodb Not found) Any ideas why? 回答1: 1) In your phpinfo() screen, make sure the Configuration file Path and Loaded Configuration