drupal-6

Drupal 7 programming advancements, differences from Drupal 6 upgrade or wait

会有一股神秘感。 提交于 2019-11-30 23:17:54
问题 I was just wondering if there were any changes in the Drupal 7 code that effect server load and speed for large sites. Also, with 7 nearing beta release, should I wait to build the sites with Drupal 7? I'm a future kinda guy. I would like to be able to develop Drupal sites for a freelance business I am owner of, and would like to start soon. Is Drupal 7 accepted enough to be developing live, customer sites for? Security Issues? Thanks 回答1: You should wait to pass to Drupal 7 until Drupal 7

How can I associate many existing files with drupal filefield?

这一生的挚爱 提交于 2019-11-30 19:35:55
问题 I have many mp3 files stored on my server already from a static website, and we're now moving to drupal. I'm going to create a node for each audio file, but I don't want to have to upload each file again. I'd rather copy the files into the drupal files directory where I want them, and then associate the nodes with the appropriate file. Any ideas on how to accomplish that? Thanks! 回答1: I am not sure if I am going to propose a different approach or if I am about to tell with different words

Drupal 7 Browser specific css

瘦欲@ 提交于 2019-11-30 16:11:44
How can i have a browser specific css in Drupal 7 . I would like to load chrome.css if browser is chrome . Please help You can do this in your template.php file with a preprocess_html theme hook and drupal_add_css function. You will find example in drupal 7 theme, for example in bartik : // Add conditional stylesheets for IE drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE)); drupal_add_css(path_to_theme() . '/css/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '

Calling Drupal functions in external PHP file

半城伤御伤魂 提交于 2019-11-30 12:53:50
How can I call a Drupal function or get the global variable in a PHP file which is located under the drupal installation folder. I doing it for the first time. Are there any files I need to include in my code in order to access the Drupal function or variables? Taken from the linked question in the comment above You need to Bootstrap Drupal in the external PHP file: /** bootstrap Drupal **/ chdir("/path/to/drupal/site/htdocs"); require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); Be sure to change the path to your Drupal installation, then add your code below the

How to change the label of the default value (-Any-) of an exposed filter in Drupal Views?

穿精又带淫゛_ 提交于 2019-11-30 08:26:12
I created a view which has three exposed filters. Everything works fine except the fact that I can neither translate or change the default string (-Any-) for the dropdowns. Is there a way to change this string to something more meaningful like "Please Select" and make it translatable so the German version displays "Bitte wählen"? I have two screen captures that may be helpful: and A further improvement would be the ability to change the text "any" to something like "please select a (field name here)" but I am losing hope for that =) UPDATE IMPORTANT: On further testing, I found that if you

Throwing exceptions in a PHP Try Catch block

别等时光非礼了梦想. 提交于 2019-11-29 23:08:48
I have a PHP function in a Drupal 6 .module file. I am attempting to run initial variable validations prior to executing more intensive tasks (such as database queries). In C#, I used to implement IF statements at the beginning of my Try block that threw new exceptions if a validation failed. The thrown exception would be caught in the Catch block. The following is my PHP code: function _modulename_getData($field, $table) { try { if (empty($field)) { throw new Exception("The field is undefined."); } // rest of code here... } catch (Exception $e) { throw $e->getMessage(); } } However, when I

Calling Drupal functions in external PHP file

痴心易碎 提交于 2019-11-29 18:06:19
问题 How can I call a Drupal function or get the global variable in a PHP file which is located under the drupal installation folder. I doing it for the first time. Are there any files I need to include in my code in order to access the Drupal function or variables? 回答1: Taken from the linked question in the comment above You need to Bootstrap Drupal in the external PHP file: /** bootstrap Drupal **/ chdir("/path/to/drupal/site/htdocs"); require_once './includes/bootstrap.inc'; drupal_bootstrap

Increase PHP Memory limit (Apache, Drupal6)

China☆狼群 提交于 2019-11-29 11:12:53
I'm trying to run a Drupal installation on a shared hosting server. (I'm just subscribing to a provider - I don't own the box.) I need to increase the PHP memory limit for my Apache server. I have tried ini_set('memory_limit', '64M'); in settings.php (a file that is included in every request), but this causes Internal Server Error 500. If I take it out, I get this error: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 19456 bytes)... Side question: 19456 is less than 33554432. Why is it saying that allowed size is exhausted? I also tried putting this in on

Can someone explain “access arguments” in Drupal?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 23:28:19
Can someone explain "access arguments" in Drupal? Trust me I have tried Googling it but I am just not getting a clear grasp. in /admin/user/permissions you will see lots of access options. they come from drupal modules, and lets the site administrator distribute specific permissions to user roles (drupal provides 'anonymous' and 'registered' roles by default). modules declare them through hook_perm and they are as easy to use as: function mymodulename_perm { return array('use custom feature', 'use the other custom feature'); } and they will show up there, ready to be used. now, in any function

Throwing exceptions in a PHP Try Catch block

依然范特西╮ 提交于 2019-11-28 19:25:08
问题 I have a PHP function in a Drupal 6 .module file. I am attempting to run initial variable validations prior to executing more intensive tasks (such as database queries). In C#, I used to implement IF statements at the beginning of my Try block that threw new exceptions if a validation failed. The thrown exception would be caught in the Catch block. The following is my PHP code: function _modulename_getData($field, $table) { try { if (empty($field)) { throw new Exception("The field is