drupal

Best way to gather, then import data into drupal?

余生长醉 提交于 2019-12-21 21:25:29
问题 I am building my first database driven website with Drupal and I have a few questions. I am currently populating a google docs excel spreadsheet with all of the data I want to eventually be able to query from the website (after it's imported). Is this the best way to start? If this is not the best way to start what would you recommend? My plan is to populate the spreadsheet then import it as a csv into the mysql db via the CCK Node. I've seen two ways to do this. http://drupal.org/node/133705

Theme a custom menu with theme_menu_tree()

∥☆過路亽.° 提交于 2019-12-21 21:21:26
问题 I'm trying to override a custom menu output in a block so that instead of <ul class="menu">...</ul> I can get <select name="menu title">...</select> In Drupal 6, I could use function theme_menu_tree($tree,$menu_name="") {...} but this doesn't work in Drupal 7 with function theme_menu_tree($variables) {...} . I've tried theme_menu_tree__mymenu($variables) {...} with no success. How do I specify a unique menu in Drupal 7? Thanks. 回答1: I had the same problem with overriding and correct naming of

Drupal Session User id for independent script

旧时模样 提交于 2019-12-21 21:12:29
问题 I am creating a simple script say a.php. I know that drupal 6 creates a session etc. So in my a.php I am trying to print_r($_SESSION); but that doesnt seem to work. What is the best way to get the logged in users userid in my program? Sorry I am new to drupal. Thank you for your time. 回答1: Drupal's cron.php is a perfect example of a "simple" php script that uses the libraries in Drupal's /includes directory. The key lines in that file are: include_once './includes/bootstrap.inc'; drupal

How to use Highcharts Drupal 7 module

若如初见. 提交于 2019-12-21 20:19:33
问题 How to use Highcharts Drupal 7 module. I tried using views integration but not settings are available. But i saw an image http://drupal.org/files/views_settings.png like this. In my drupal instalation when i click on settings for Highchart these options are not there. Can anybody help me please. 回答1: This two tutorials may help you.. just follow the exact instructions http://webwash.net/tutorials/intro-visualization-api-part-1-views-and-gva http://webwash.net/tutorials/intro-visualization-api

Drupal Android App Login Persistence

我们两清 提交于 2019-12-21 20:06:47
问题 I have successfully setup an Android App which logs-in to my drupal website. My problem is the logged-in user session does not last very long. The site clearly shows my user as logged-in to the site, but within an hour or so the user is no longer shown as active on the site. (I am guessing because I don't really exactly know it.) Can anyone offer an insight into why this is happening? The code is as follows: protected HttpResponse doInBackground(Void... params) { // TODO Auto-generated method

PHP arrays… What is/are the meaning(s) of an empty bracket?

喜你入骨 提交于 2019-12-21 19:24:43
问题 I ran across some example code that looks like this: $form['#submit'][] = 'annotate_admin_settings_submit'; Why is there a bracket after ['#submit'] that is empty with nothing inside? What does this imply? Can anyone give me an example? Normally (from my understanding which is probably wrong) is that arrays have keys and in this case the the $form array key '#submit' is equal to 'annotate_admin_settings_submit' but what is the deal with the second set of brackets. I've seen examples where an

Datetime type in Drupal 7 schema

老子叫甜甜 提交于 2019-12-21 17:02:23
问题 I'm writing a new Drupal 7 module (Drupal 7.10, Date 7.x-2.0-rc1 installed, Schema 7.x-1.0-beta3 installed) i defined a table in mymodule.install: $schema['museums_tickets']= array( 'fields' => array( 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'day' => array( 'type' => 'datetime', 'mysql_type' => 'DATETIME', 'not null' => TRUE, ), 'tickets' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'ticket_code' => array( 'type' => 'varchar',

How do I decide between theme('node', $node) and drupal_render($node->content) for programmatic $node output

别来无恙 提交于 2019-12-21 16:22:39
问题 Given a $node , I'm trying to decide between the following two ways of outputting that $node. either $output = theme('node', $node); or node_build_content($node); $output = drupal_render($node->content); They both seem to give similar results, but is there something I should consider before I choose one way over the other? 回答1: Your output is similar if there are no other modules and themes altering the output via the theme layer. But! If you bypass the theme layer, you'll probably start

Fundamental understanding of how Views and Pathauto work together

好久不见. 提交于 2019-12-21 09:17:08
问题 I am having fundamental problems understanding when to use a pathauto rule, and when to use a views page path. I have several custom content types, and I am using blocks to display certain parts of nodes on certain paths. Then I use a views page to display the main node on a path. When I do this, I can't use pathauto, as it overrides the paths I set in views. Eg.. If I set up a views page path of "location/%", and set a pathauto rule for Location content types of "location/[title-raw]", when

How do you migrate CCK fields between environments in Drupal?

拟墨画扇 提交于 2019-12-21 05:44:09
问题 The Content Construction Kit (CCK) is one of the most useful Drupal modules. It allows you to easily add custom fields to a content type. However, these new fields are created through Drupal itself and stored in the database. This means that if you change a CCK field in your development environment you need to manually make the same change in your test and production environments. Worse, there's no simple way to determine if your environments have gotten out of sync. So if you ever