Questions about PHP not related to Drupal should be asked on Stack Overflow. Don't use this tag to generally mean "the question is about PHP code."

learn more… | top users | synonyms

0
votes
0answers
5 views

Programatically insert product/order to cart from php file external to Drupal

I have an external php file on the same server, how can I create an item in the checkout? I have tried this, but I dont know which or how to include the proper files for the functions. Could I just ...
0
votes
1answer
9 views

How to access the order total amount in Drupal commerce?

I'm trying to make a block with an image that would change when there is something in his or hger basket (empty basket image when basket is empty, full basket when it's full) My understanding of PHP ...
0
votes
0answers
13 views

Is this snippet modification correct? (php snippet in a drupal commerce rule)

I´ve read about the possibility to use this snippet to hide a specific checkout pane (in Drupalcommerce), according to the cart contents. Could I use this somewhat modified to hide a pane when the ...
0
votes
2answers
51 views

Views: Apply a wrapper to every 3 and 6 group of rows

My Views Output is as follows <div class="views-row-1">Content</div> <div class="views-row-2">Content</div> <div class="views-row-3">Content</div> <div ...
2
votes
1answer
24 views

Drupal on PHP 5.5

With the feature freeze for PHP 5.5 long past, I figured it was time I post an update to the popular PHP 5.4 and Drupal 7 question. So, can Drupal run on PHP 5.5?
0
votes
1answer
16 views

Print something in a tlp file if a field isnt empty

I need to print some html in a node tpl file if a certain field is not empty. The follwing is giving me a white screen: <?php if (!empty($content['field_hotel_sat_nav'])) { ...
1
vote
2answers
19 views

Remove link to user profile on content

How do I remove the link to a user's profile on article content? The element is part of the article header and its classname is ".username". I am new to Drupal but not to webdesign; I am just ...
2
votes
2answers
55 views

Trying to make a custom region disappear upon user login, then reappear when user logs out

I've looked everywhere for an answer to my problem, but can't find one. My goal is to collapse/force a custom region on my website to disappear when a user logs in, and then have it reappear when the ...
0
votes
0answers
46 views

PHP to create text field with default content from PHP command?

We have a block containing the code: <?php print token_replace('[current-page:url]'); ?> which does most of what is needed, which is just to mirror the URL of a unique views page containing ...
0
votes
1answer
29 views

Custom node.tpl.php for specific page

I have a custom page template (Drupal 7) created from a basic page and I call it page--node-84.tpl.php. I'd like to manually print/render the 'body' field from this page and so I tried that doing ...
0
votes
2answers
45 views

drupal webform sliding radio button

I m trying to build a form that has questions with radio button answers when someone clicks on a radio button the next question comes up and it should have a next and prev button is there any php code ...
1
vote
1answer
19 views

How to find out allowed memory for a specific Drupal page

I want to find out how much allowed memory a page uses after it is loaded on my drupal 6 site. I know that you can do this when a page is not loading correctly, by enabling errors in php.ini. How do ...
1
vote
1answer
24 views

Reference (include) php file in content summary

In my content summary section I will have the same information for each node. I would like to reference an external php file so that down the road if I ever need to change the summary content I don't ...
0
votes
2answers
20 views

How to transfer data from views-view-fields.tpl to views-view-unformatted.tpl in D7?

I need to collect some data within views-view-fields.tpl, and then transfer it to views-view-unformatted.tpl to do some magic to the whole data-object. How could I do that? Thnx!
0
votes
1answer
25 views

Drupal 6: integer field, how to output the value + a 3% up for a field, programmatically

I have a production website with a content type that has 3 integer fields. Now the website owner wants to raise those values in a 3%. Since there are hundreds of nodes for that content type, is there ...
1
vote
2answers
28 views

Drupal Website showing only some images

I was told to migrate a Drupal website, but I've never worked with it before so I'm having some difficulties here. I'm trying to run the site in localhost/myfolder. The URL generated for images is: ...
0
votes
0answers
26 views

Reorder view results by field view value

Is it possible to reorder a view's results by the value of a field view (an embedded view as a field)? I'm talking about those field views, I'm tagging hooks in case there is an option of doing this ...
0
votes
1answer
22 views

drupal nodes list control

I am using Drupal 7. For example, I do not want to show node uid=28 in the list ($page==0). The list page is a "view" without filtering there. So it shows up all the nodes of a specific content type ...
1
vote
1answer
18 views

Change values of user input in hook_field_validate?

I have setup a custom field and have a validater setup for it. I would like to be able to adjust and actually change the user input from within my validator. so say this is a multi value field, each ...
0
votes
0answers
18 views

Drupal 6 theme individual mini pagers

I was able to theme the mini pager by taking pieces of the code from views module file and adding in some useful php to manipulate it. problem is that i need to individualize the setting so i dont ...
0
votes
1answer
11 views

Date Calender Starting Date of Field B should be equals to or advanced from the Ending Date of Field A

I have created a form using webfrom module. The form contains Arrival Date and Leaving Date. I want Leaving date should either be same as Arrival date or higher than that.
0
votes
1answer
24 views

D6 - Clean URL not resolving correct menu item [closed]

I have developed a D6 module that generates images based on URL passed values. Values are passed in the following pattern: http://site.com/create_image/param1/param2/param3?random_number Where: ...
0
votes
1answer
40 views

PHP - If a field has a certain text value then print something

The following PHP in a node tpl file: check_plain($node->field_room[$node->language][0]['value']) Will print this in the page: Value1 What I want however is if the field has a value of ...
0
votes
0answers
37 views

PHP syntax error because of Drush?

Today and the last few days I had lots of problems with drush. On last Thursday I downloaded Devel via drush and when i tried to install it but then i got the error PHP : Parse error: syntax error, ...
0
votes
3answers
39 views

Listing all entries of a specific content type within a panel

I've been tasked with adding a page to an existing Drupal (version 7.15) site. I know next to nothing about Drupal or PHP so I've been struggling a bit. I've created a page with 2 panels and am ...
0
votes
1answer
40 views

Is it possible customize user login page on Adaptive Theme?

I tried many solutions for change my mysite.com/user page. I want, only login-register-forgotten form is visible, other block hidden. But what i try a solution, don't working. Is it possible? How can ...
0
votes
3answers
30 views

Allow public to edit content type

I have a content type that users can vote on so I need that content type to keep tally of the votes. I'm assuming I need to allow the public to edit that content type but, unsure how to go about ...
2
votes
2answers
34 views

How to get user by uid in views_php?

i am using the views_php module and i need to get the user by his uid to read out some properties to build a filter. (It is not the currently logged-in user!). Is there some drupal function like this ...
-1
votes
2answers
57 views

Is this possible to use an IDE in the worklow of a Drupal project? [closed]

I am interested to integrate an IDE with a Drupal site,that when writing some code,it is integrated with the Drupal project,so as not need to export it,and then add it to the modules folder.Is this ...
0
votes
0answers
63 views

Multi Node Add - Set default value to date field depeding from first date field

I'm using Multi Node Add -module in my site. And I have content type called Event. In that content type I have date field which is for scheduling node publish. I've made Rule which uses that date ...
0
votes
3answers
87 views

Code showing on every content page

I'm pretty new to Drupal but have take my company's half-baked site from the server and gotten a working instance of it in my local wamp stack working. The only problem is that it seems on every page ...
0
votes
0answers
13 views

Email encode in text input using

I want to encode an email id in a text box of drupal admin backend in user edit form. I want to display user email in text input and when i see the email id in page source then the email id should be ...
0
votes
2answers
64 views

Adding classes to block title

I have a block which template I'm overriding with my own. The title in it is displayed by the following code: <h2<?php print $title_attributes;?>><?php print $title; ...
0
votes
0answers
202 views

AJAX and Dynamic/Dependent Dropdown

I have been working on getting dependent dropdowns to work on my site and not having any luck. I think the problem I am having is that my ($form_state['values']['city']) is not pulling from the first ...
0
votes
1answer
43 views

PHP Custom Form Render warning

I'm receiveing the warning Strict warning: Only variables should be passed by reference in eval() (line 2 of D:\wwwroot\tixers\modules\php\php.module(80) : eval()'d code). Everywhere I've looked ...
2
votes
1answer
126 views

Fieldsets 'IF ELSE' based on checkboxes?

So i have a custom form with 3 fieldsets built from FORM API. each fieldset holds its own "mini" form for users to fill out. what i want is the second 2 fieldsets should not display unless either ...
0
votes
1answer
41 views

user details as block with auto refresh

I am new to drupal. I want to show a module that refresh every 3 seconds and displays the other existing user details with their photo graph .
0
votes
1answer
49 views

Node edit page not showing up using page.tpl.php?

I'm working on a new drupal 7 site right now (I'm new to drupal) and currently have given the ability to users to create nodes. The node creation page (url.com/node/add/) works just fine and uses the ...
1
vote
1answer
108 views

Would disabling these following functions in PHP.INI affect Drupal 7?

If i disabled the following php functions: disable_functions = ...
0
votes
0answers
39 views

Drupal Commerce: this hook_form_alter snippet won´t work to hide the postal code of the addressfield. Why?

I want to programatically hide the postal code field, of the address module. I´ve unsuccessfully tried this: function mymodulename_form_alter(&$form, &$form_state, $form_id) { if($form_id == ...
0
votes
1answer
92 views

Using computed field to calculate total hours for a datetime field but to exclude all weekend hours

Please please if can anyone help I would really appreciate it! I have managed to get total hours between value 1 and value 2 of my datetime field however I really want to exclude any hours which are ...
0
votes
3answers
101 views

How to send form submitted data to paypal in Drupal?

I have setup a form where user fill some fields and choose a user type & on submission I have to send him to paypal with the values which he filled up, so that on IPN callback I receive the data ...
0
votes
1answer
125 views

How to Display Token by PHP in Block

What is the way to use tokens in PHP code. I have tried but didn't works. Suppose: I need to show the user profile picture url. So, this code do not working: <?php echo ...
1
vote
1answer
32 views

User View List in Drupal filter by taxonomy

In a social website powered by Drupal, Users are allowed to add interest tags into a taxonomy terms by autotagging. My problem is how to create a view page to list all users based on a certain ...
2
votes
0answers
49 views

Any way to filter by Week Number in Views 3?

Drupal 7, Views 3 I've got several views configured which display data over many years. The data is filtered by Year using a date field as filter criteria. For each year I have attachment views that ...
1
vote
1answer
69 views

Hide Profile2 fields depending on it's value when viewing user profile

I am relatively new to drupal and for days I'm stuck. I need to hide fields from the user profile page when they have a specific value. Adding a CSS class would also do it. But I prefer deleting the ...
-5
votes
1answer
31 views

I am trying to build drupal view to get list of users by certain role [closed]

I am trying to build drupal view to get list of users by certain role. i am newbie on drupal please get me details steps
5
votes
1answer
121 views

How can I insert PHP code in Views?

I tried the views_php but I have no luck. Any link to its documentation? I want to add some custom field with PHP code inside it but the one I did return nothing. Please see the attached picture.
4
votes
2answers
139 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 ...
0
votes
0answers
30 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> ...

1 2 3 4