Questions about PHP not related to Drupal should be asked on Stack Overflow. Don't use this tag to mean "the question is about PHP code."
1
vote
1answer
29 views
Redirect to mobile page (not theme switching)
I'm looking for a way to redirect mobile users to a mobile landing page (and I'm not looking for a theme switcher). I have a specific page that I'd like to redirect mobile users to: www.mysite.com/m/
...
-1
votes
0answers
24 views
Send email with csv file as attachment in Drupal 7
I have implemented custom function to send email with csv file as attachment. CSV file content is created on the fly. When I setup email header but text "Content-Type: text/html; charset="utf-8", this ...
4
votes
2answers
32 views
drupal_http_request and stream_socket_client
The D7 core function drupal_http_request uses the stream_socket_client() php function. For many serious web hosters, sockets and stream_sockets functions are a security bad practice and most of them ...
-1
votes
0answers
16 views
PDOException Error
When i created a image content type and add a content, get this error:
DOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.12' in 'where clause': SELECT base.tid AS tid, ...
0
votes
0answers
16 views
Import content in my front tpl
I have HTML structure. With the following:
My menu:
<ul id="nav">
<li><a href="#">NEWS</a></li>
<li><a href="#">NEWS</a></li>
...
0
votes
1answer
25 views
Is there an interactive PHP testing tool for Drupal?
I'm in the middle of trying to create some contextphp code and drupal_set_message debugging is getting old fast. Is there any tool that would allow me to specify a url "context" (e.g. /node/6) and ...
0
votes
0answers
11 views
Drupal Calendar Block variable that holds which month is being viewed
I am using Drupal Calendar module to handle a calendar system for a website. I am using the block view as the main calendar for styling reasons. I need to write some custom php code that handles some ...
0
votes
0answers
13 views
I need help to calculate the price with Computed Field
I have a content type with 2 fields: price and currency.
I need a Computed Field that calculates the price in euros approximately. I would change it by hand, no need to do it automatically.
Example: ...
0
votes
0answers
25 views
Warning: htmlspecialchars Error in View When Adding [body] to Title
Hello this has been bugging me for years (yes years) on my site and its got to the point where i really need some help as usually i just soldier on myself using google.
You can view the page with the ...
0
votes
1answer
104 views
Drupal 7 views: Get NID in views using contextual filters
Does anybody know how to get the nid from a node using contextual filters or filter criteria in views
WITHOUT using "Get id from url"? I was thinking about using PHP or getting it from a node-field.
...
0
votes
1answer
36 views
Create taxonomy 'add terms' form into block
I have two vocabularies named 'vocab_one' and 'vocab_two'. I create custom multiple blocks module named 'add library', in order to display the taxonomy 'add terms' form to each blocks.
Each block ...
1
vote
1answer
37 views
how to print 'add term' taxonomy form into block
I have a taxonomy vocabulary named "jenis dokumen". I want to let anonymous users add terms within this vocabulary. I'm trying to add a block and render that form to add new term using PHP filter, but ...
0
votes
0answers
26 views
json_decode does not work with field safe values
Using a field's safe_value with php's json_decode results in json_decode complaining about a syntax error. Whereas using the regular value does not.
I can't see any obvious difference in the two ...
2
votes
3answers
87 views
What's wrong with the way I use variables in my function?
I have a function that looks like this:
function mymodule_privatemsg_message_validate($message) {
$uid = $vars['message']->author->uid;
//if root or help user, message should always go ...
2
votes
0answers
50 views
total sum of textfield values of field collection(with unlimited values) in another field out of field collection in same form
I am creating a form. it has a field collection. it has a field age in field collection that can be filled unlimited times in single form. I want to add the total of those field values(age) in another ...