drupal-6

Drupal Views: Display recent nodes created by user on profile page

China☆狼群 提交于 2019-11-28 18:54:29
I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user. ok, the answer involves creating a drupal view, so you will need the views module and although simple, the answer is lengthy. please bear with me through this... :) (i am actually doing this on a test site as i write the instructions, to make sure i dont miss anything...) i assume that you know how to download and install the views module. make sure you also enable the views-ui

Drupal behaviors

时光毁灭记忆、已成空白 提交于 2019-11-28 15:28:11
What are Drupal behaviors at all? What type of service layer it offers to module developers? What type of relation it maps to jQuery.ready ? Long version : Drupal.behaviors is not simply a replacement for jQuery.ready since the latter only runs once (when DOM is ready for manipulation): behaviors can be fired multiple times during page execution and can be run whenever new DOM elements are inserted into the document. Also, modules could override or extend an existing behavior (e.g. if one module has a behavior of adding a bounce effect on all links, a second module could replace the behavior

print_r to get object methods in PHP?

放肆的年华 提交于 2019-11-28 13:39:23
I'm working with Views 2 in Drupal 6, and I am having difficulty finding documentation on the methods of the View object. Is there any PHP function like print_r that outputs methods as well as fields? I believe you're looking for get_class_methods . If this is the case, get_class_vars may also interest you. The Reflection API might be of interest to you (if it's not overkill). Specifically:- <?php Reflection::export(new ReflectionClass('View')); ?> Check out the manual for more in-depth examples. Besides the functions mentioned by Mathachew you can also take a look at Reflection , especially

How to redirect user to a specific page after they login if they belong to a certain role?

假装没事ソ 提交于 2019-11-28 12:16:38
We have certain users in our member list that have a role "vendor" attached to them. All such members are to be redirected to a certain page upon login. How can this be accomplished? You can define actions and triggers in Drupal: Action( admin/settings/actions ) - Redirect to a specific page Trigger ( admin/build/trigger/user ) - After user has logged in Try this. EDIT (see comments): Create a small module to check on a user's login process what role he has and then redirect if neccesary. drupal_goto => redirect-function in drupal hook_user =>triggers on user operations And for the user's

Drupal: How to Render Results of Form on Same Page as Form

℡╲_俬逩灬. 提交于 2019-11-28 10:16:14
How would I print the results of a form submission on the same page as the form itself? Relevant hook_menu: $items['admin/content/ncbi_subsites/paths'] = array( 'title' => 'Paths', 'description' => 'Paths for a particular subsite', 'page callback' => 'ncbi_subsites_show_path_page', 'access arguments' => array( 'administer site configuration' ), 'type' => MENU_LOCAL_TASK, ); page callback: function ncbi_subsites_show_path_page() { $f = drupal_get_form('_ncbi_subsites_show_paths_form'); return $f; } Form building function: function _ncbi_subsites_show_paths_form() { // bunch of code here $form[

Drupal 6: best way to upgrade jQuery?

Deadly 提交于 2019-11-28 09:23:04
I want to upgrade jQuery inside my drupal installation. At the moment I have jQuery 1.2.6 and I would like to upgrade it to jQuery 1.4 I guess some Drupal modules still depends on the old jQuery version. I've tried jquery_update module to upgrade jQuery, but it didn't work. It asked to replace the original Drupal files in the "misc" folder with the new ones, but it didn't work. Anyway, I was wondering if there is a better method instead of using another module thanks 30equals the jquery update module doesn't install jquery 1.4. you need to manually update the jquery.js. jQuery 1.4 breaks quite

Increase PHP Memory limit (Apache, Drupal6)

烈酒焚心 提交于 2019-11-28 04:52:03
问题 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

How to solve the use of deprecated function ereg() of PHP 5.3.0 in Drupal 6.13

岁酱吖の 提交于 2019-11-28 01:16:54
Anyone knows how to solve the error below? Deprecated: Function ereg() is deprecated in C:\wamp\www\includes\file.inc on line 895 It is happening after installing Drupal 6.13 on wamp server 2.0i with PHP 5.3.0 Alan Storm Drop your error reporting level below E_DEPRECATED . PHP 5.3 introduced two new error reporting levels, E_DEPRECATED and E_USER_DEPRECATED and - for the first time in PHP's history - they've started to walk away from older parts of their API. The ereg_* function will still work, but this warning is intended to let you know that "hey, these function will be going away soon,

Simulate a click in a Google Map

余生颓废 提交于 2019-11-27 22:12:57
问题 I'm trying to simulate a user click on a Google Map, using API v3, after I geolocate their position when they write down their address. I used to do: google.maps.event.trigger(map, 'click', { latLng: new google.maps.LatLng(lat, lng) }); But now I got an error: Uncaught TypeError: Cannot read property 'wa' of undefined main.js:727 I need to simulate the click because I'm using Drupal with a CCK field, and it's doing this on clicks under the hood that are not triggered if I add the location

Drupal Views: Display recent nodes created by user on profile page

梦想与她 提交于 2019-11-27 20:29:09
问题 I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user. 回答1: ok, the answer involves creating a drupal view, so you will need the views module and although simple, the answer is lengthy. please bear with me through this... :) (i am actually doing this on a test site as i write the instructions, to make sure i dont miss anything...) i