drupal

Drupal - display blocks according to node's taxonomy term ID

∥☆過路亽.° 提交于 2019-12-24 07:29:15
问题 I'm just trying to restrict block visibility to nodes that have a certain taxonomy ID. I'm using this snippet...: <?php $term_id_to_trigger_show_block = 109; if ((arg(0) == 'node') && is_numeric(arg(1))) { $terms = taxonomy_node_get_terms(arg(1)); foreach($terms as $term) { if ($term->tid == $term_id_to_trigger_show_block) { return TRUE; } } } ?> ...but I get no joy, the block remains hidden on the relevant nodes. Any ideas? Cheers 回答1: It looks like in drupal6 taxonomy_node_get_tree() takes

Fix Size of Login Box in Drupal Theme

前提是你 提交于 2019-12-24 07:14:32
问题 I've asked this question previously here, and thought it was fixed, however, it is only fixed in firefox. In Safari the login box is now very wide, jutting out over the page contents. Here is what it looks like in Safari, and here is what it looks like in Firefox. I originally went about fixing it by creating a drupal module which changed the input "size" from 15 or to 43. I put my widerlogin.module code up on paste bin here, where a kind person helped me to where I am now. 43 was chosen by

On INSERT to a table INSERT data in connected tables

五迷三道 提交于 2019-12-24 07:14:27
问题 I have two tables that have a column named id_user in common. These two tables are created in my Drupal webpage at some point (that I don't know because I didn't created the Netbeans project). I checked on the internet and found that probably by adding REFERENCES 1sttable (id_user) to the second table, it should copy the value of the 1sttable (that is always created when a new user arrives) to the id_user value of the 2ndtable (that I don't know at which point is created). Is it correct? If

On INSERT to a table INSERT data in connected tables

ⅰ亾dé卋堺 提交于 2019-12-24 07:14:17
问题 I have two tables that have a column named id_user in common. These two tables are created in my Drupal webpage at some point (that I don't know because I didn't created the Netbeans project). I checked on the internet and found that probably by adding REFERENCES 1sttable (id_user) to the second table, it should copy the value of the 1sttable (that is always created when a new user arrives) to the id_user value of the 2ndtable (that I don't know at which point is created). Is it correct? If

Fix Size of Login Box in Drupal Theme

跟風遠走 提交于 2019-12-24 07:14:03
问题 I've asked this question previously here, and thought it was fixed, however, it is only fixed in firefox. In Safari the login box is now very wide, jutting out over the page contents. Here is what it looks like in Safari, and here is what it looks like in Firefox. I originally went about fixing it by creating a drupal module which changed the input "size" from 15 or to 43. I put my widerlogin.module code up on paste bin here, where a kind person helped me to where I am now. 43 was chosen by

Is it possible to upgrade Drupal from very old version(4) to the newest one(7)?

折月煮酒 提交于 2019-12-24 06:59:22
问题 I have to upgrade website running very old version of Drupal (cannot even find out which version is that, but I guess it is even before 5) to the newest one? Is that possible? If yes, how to approach this? 回答1: The Drupal web site makes it clear that you cannot skip major versions when doing version upgrades. See this page: http://drupal.org/upgrade/ (it talks about not being able to skip from v5 to v7; it doesn't even mention v4!) So if you do manage to upgrade your site all the way from v4

Drupal db_select PDO Statement: ORDER BY CASE

拜拜、爱过 提交于 2019-12-24 06:58:08
问题 Hi I have written a MySQL statement that has a conditional order by clause which you can see in the example below. MySQL Example: SELECT title, description FROM books WHERE title LIKE "%keyword%" OR description LIKE "%keyword%" ORDER BY CASE WHEN title LIKE "%keyword%" THEN 1 ELSE 2 END I am now trying to recreate this statement in Drupal using its PDO style db_select() function. But I have got stuck when writing the ORDER BY clause. Drupal Example: $node_select = db_select('node', 'n');

Using the jQuery validate plugin to check if one or more checkboxes (with different names) are selected

笑着哭i 提交于 2019-12-24 06:50:25
问题 Ok, so I am implementing the jQuery validate plugin for a Drupal 7 site. The problem I am running into is that one part of the form generates multiple checkboxes with slightly different names. Because of this there does not seem to be a direct way to check, using the validator plugin, if at least one of these checkboxes is selected. http://docs.jquery.com/Plugins/Validation#API_Documentation To be more specific, the user has to select one or more theme categories. These checkboxes have names

PHP / Drupal, Session Storage and encryption

徘徊边缘 提交于 2019-12-24 06:49:12
问题 We're using Drupal on a number of sites. On all but one server, the data in the sessions table appears as a serialised string. This is normal behaviour AFAIK. On the exception server, the session data is stored looking like, _C0c5x_xpVKkya5nD68ChpaKaHYNzWTlEN52gOCkH1fIAvj3ziCydGnNbLXTO75q_pYLhumOYHzxD1D _ue5tRgeeQR4YUIDWtAZ2hxlJ7QUHS-KvUnYb5tHMFUCpFuGMY4brDUfOwlUScSgC1cVvuT51cm62bD jmU1XBvVAtZAfNrHpwgcy_-YE9a9ViXd4Jdzy7yzYo8ZGXoh0_p-xs3vfuQnsiCe3KkH89q_YiZwux8 (all one line, and very much

checkbox for Drupal CCK

北战南征 提交于 2019-12-24 05:14:06
问题 I'm new at Drupal. love it so far :) I'm creating a CCK custom content type. I need to make a amenities list in checkbox format. so I made; File Type: Text Widget Type: checkboxes/radiobuttons and Allowed values list: onsite_dining|Onsite Dining meeting_space|Meeting Space business_center|Business Center and it creates Radio Buttons which only 1 selection :( How can I make it Check Box to give ability to select more than 1? Appreciate helps! 回答1: There as an option: Number of values You have