drupal-6

Drupal Installation PDOException

社会主义新天地 提交于 2019-12-05 02:15:13
问题 http://localhost got problem: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_test.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 165 of /var/www/drupal/includes/lock.inc). This is my database configuration: $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'drupal_test', 'username' => 'root', 'password' => 'XXX', 'host' =>

How to get rid of Drupal CSS stylesheets?

回眸只為那壹抹淺笑 提交于 2019-12-05 02:09:14
I am trying to accomplish the following. I need to use Drupal 6 as a project requirement, but I want to use it with my own HTML and CSS stylesheets for each node/view/panel etc. The problem is, whatever the theme, I always found that Drupal applies to my HTML content both my CSS stylesheets and the CSS related to the theme chosen. I have also tried, without success, using the stylestripper module (installed in sites/all/modules). No matter what I do, additional CSS stylesheets are applied to my pages, completely destroying my layout. What is the proper way to achieve this? Why stylestripper

Adding HTML to Drupal closure?

让人想犯罪 __ 提交于 2019-12-05 02:01:37
问题 To add javascript, you can use: drupal_add_js And similar for css: drupal_add_css But what if I just want to add html at the end of my page. I.e. Add a div with some text in it at the end of the page? 回答1: A lot of suggestions here work if you want your alteration to be theme-based, but if you want this to come from a module, using a block region, page template or page prepocess won't cut it, because you're tying the alteration to the theme. From a modular standpoint, the following options

Drupal Custom CCK field with multiple child fields

跟風遠走 提交于 2019-12-05 01:18:15
问题 Is there a way of creating a composite field that can have multiple values, with each value having another group of composite values? E.g. we want to have this structure at the end: Group 1 (unlimited number of groups) Child field (unlimited children for each group) Child field ... Group 2 Child field Child field ... ... Is this possible at all for a custom module that defines a CCK field? If so, can someone push me in the right direction? 回答1: this is a very know and debated issue in the

How to add a custom word to my domain URL for every request?

心不动则不痛 提交于 2019-12-04 19:33:49
Consider my domain name is www.mydomain.com Consider a page request www.mydomain.com/user/register I want to add a custom word after base URL for every request inside mydomain.com.example www.mydomain.com/customword/ www.mydomain.com/customword/user/register Can we do this using URL rewriting in htaccess file ? Actually it should execute 'www.mydomain.com/user/register' internally...but externally the URL should look like www.mydomain.com/customword/user/register. You could create the directory "register", and put an index file inside it that performs the action. That's probably the simplest

Drupal Views display newest content per taxonomy limit to one node

扶醉桌前 提交于 2019-12-04 17:57:05
I want to create a view where all 5 of my taxonomy terms are displayed and it then displays the latest node published but this is limited by 1. For Example: Tax Term 1 Latest node published Tax Term 2 Latest node published etc etc Currently I'm grouping by taxonomy term so it's displaying all nodes published then sorted by published date desc. I can't quite figure out how to limit the nodes to only show one item per taxonomy term. Any help would be greatly appreciated. This is possible with Views 3. I've tested this on D7, but should work on D6 also. Add a new view of type - Taxonomy terms Add

Disabling /node view and other hidden views in Drupal?

末鹿安然 提交于 2019-12-04 15:55:58
Many long nights spent on my site, and now I've started doing all sorts of security checks and stumbled upon the following: www.mysite.com/node That shows the latest x nodes that a user has access to. I DON't want this view visible to users. And I certainly don't want any other views similar to this available. So, my questions are: How do I disable this view? Are there other hidden views that I'm not aware of that an anonymous user can use to access several nodes at once? You want to use hook_menu_alter() in a custom module to reroute what happens when someone tries to load the page at /node .

Caching a Drupal site with session-specific data on every page

随声附和 提交于 2019-12-04 15:05:30
We have a site written in Drupal 6. We want to use Drupal's caching mechanism to improve performance, but when we turned it on, we found problems because our site has session data displayed on every page. Drupal's caching system only works for static content page, and our session data effectively means that none of our pages are static. We've come up with two solutions to this: Rewrite the block that shows the session data such that it loads the non-static data using Ajax, so that the main HTML content is then static. The down-sides of this are that it will mean quite a lot of work, and also

Where to declare variables common to different include files in a module - Drupal

匆匆过客 提交于 2019-12-04 11:15:11
I have a Drupal Module 'example'. I have split the admin and client side functionality of the module into two include files example.admin.inc and example.pages.inc. I declared constants (define()) in the example.module file, which are accessible in both the pages.inc file and admin.inc file. But how can I declare normal $variables in a centralized location so that they can be accessible in both the admin.inc file and pages.inc file. I tried to declare $variable in example.module, but couldn't access it in the example.admin.inc and example.pages.inc. There are multiple possibilities, depending

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

南笙酒味 提交于 2019-12-04 07:09:37
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? 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 experiencing unexpected behaviour when you install modules or themes and change config settings that use the