This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Ajax edit form load into a DIV

Using Ajax, I need to load an edit form into a DIV, so a user can edit part of his profile, but the request brings the whole system. I can't get only the form. For example, in Cake using $this->layout = 'ajax', you can get only the content of index(). Anyone knows a solution for this problem ?, here is my code:

/* editprofile.js */

$jq(document).ready(function(){
//var base_url = $jq("#base_url").val(); //traigo la url absoluta del site.

limiting a certain post type on the front page

Hi guys,

I have a content type called 'image' which gets promoted to the top of the front page automatically. What I also need it to do is only allow the most recent two 'image' posts to be displayed. At the moment drupal treats all posts as one and not by type, I simply need to be able to tell drupal to display only two of the 'image' posts on the front page. Ive tried so many ways to get this working, can anyone help?

Thanks in advance,

Luke.

Using a customer error handler is not working

Hi, I have a script that connects to a remote database. Sometimes the remote connection to the database fails, but the nature of the database is critical, so any connection failures need to be handled correctly. I do not want to modify core code, so I am trying to implement my custom error handler and then restore Drupal's error handler afterwards. The problem is that the script does not resume execution.

I've made two test scripts. One is in Drupal and does not work and one is plain PHP and does work.

Any ideas how to handle database connection failures in Drupal?

Image download and header : how do you force cache ?

What sort of header do I need to send for the download of an image (in the file_download hook implementation) if I want the image to be always cachable in the browser...?

I have tried many things, and always the image is reloaded.

I use a HTTP request spy and see this :

http://11heavens.com/system/files/inspire/thumbnail/node1174879712_image...

GET /system/files/..... image83.jpg HTTP/1.1
Host: 11heavens.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: image/png,*/*;q=0.5
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://11heavens.com/
Cookie: PHPSESSID=....
If-Modified-Since: Mon, 26 Mar 2007 04:32:52 GMT

HTTP/1.x 200 OK
Date: Mon, 26 Mar 2007 04:33:08 GMT
Server: Apache...
X-Powered-By: PHP/...
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: post-check=0, pre-check=0, public
Pragma: no-cache
Last-Modified: Mon, 26 Mar 2007 04:33:08 GMT
Content-Length: 38122
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Content-Type: image/jpeg; name=....image83.jpg

My code is :

<?php

...

return array(
'Content-Type: '. $type .'; name='. $name,
'Content-Length: '. $size,
'Cache-Control: public',
);

Flash card

I'm trying to figure out how to make this PHP script work, but every time I run it, it assigns a random number for the solution as well as the individual numbers. Any suggestions? (Here's the script:)

Count view query results with footer PHP snippet

I have a view setup with external filters that query a list of nodes. I've tried to cobble together some PHP to place a count of the number of results returned in the footer of the Views page—to no avail.

It seems simple enough; does anybody have an idea about how to do this, or know of the necessary code?

Thanks!!!

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions