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
1answer
20 views

Trying to find variable names from $user array

I need to manually pull through user images and and users first name for a comment section, but i cant find what these array items are named, if anybody knows please tell me and or tell me how to find ...
4
votes
2answers
83 views

How to find all inputs that make use of the php input filter to fully disable the php filter module?

I want to disable the PHP Filter module on a large website, but going through all nodes, blocks and other fields where you could make possible use of the php filter would take eons. Is there a simple ...
0
votes
0answers
11 views

Changing the term url switch statment for the field

I want change the path of the term by the field name. But the problem is all the term field changes to the 1st switch statement. y i.e return array('path' => 'news/path/' . $term->tid); ...
0
votes
0answers
18 views

Is there an alternative to APC? [on hold]

I'm using xampp v3.2.1 on win 7 with php v5.5.11 for a development server for drupal 7. I understand from research that APC will not be updated past 5.4. Is there an alternative accelerator I can ...
1
vote
1answer
26 views

How to make disqus load avatar picture instead of user picture?

In user profiles I crated a field called Avatar and has a machine name of field_avatar I was wondering if I could make Disqus load the Avatar picture instead of the default Drupal user picture. ...
1
vote
1answer
18 views

Follow up Drupal path to PHP function

How do I figure out which PHP function is called from a Drupal path/URL (e.g. "/mysite/?q=flag/flag/like/&destination=node/1&token=xyz")? Thx in advance!
0
votes
1answer
30 views

Module has conditional Checkboxes, need to remove value

I am building a module that will have a bunch of checkboxes to enable the addition of metatags like HandheldFriendly, MobileOptimized, etc. I want to have the first checkbox only displayed. Upon ...
0
votes
1answer
19 views

Module Rules-> PHP Code, trying to use a Form Handler from Pardot, but Pardot is not receiving the info

I am trying to use the Rules Module to send a form-handler to Pardot using a php Script when a User logs in. I tested my variables to make sure they were valid by seeing them in a message and they ...
0
votes
1answer
31 views

How to write a custom action that provides a new integer variable?

My articles have a field collection field and one of the fields is an integer. Users can add as many fields as they want. I'd like to reward them some userpoints, equal to the total value in their ...
0
votes
1answer
24 views

User relationship module - error strict warning: Only variables should be passed by reference

module name: User Relationships. module version is: 7.x-1.0-alpha5 whenever i try to add relationship type or edit it give me this error: Strict warning: Only variables should be passed by ...
0
votes
0answers
13 views

Understanding field slideshows available variables

I am actually trying to write a patch for the field slideshow module. At the moment i am a little bit stuck with some kind of understandment how the following works: In the field_slideshow.tpl.php is ...
1
vote
1answer
16 views

Views: how to display different buttons before/after associated date?

I've got a node that has a deadline date field. I am configuring a view that shows a list of all the nodes. If we are past the deadline for a given node, I want to show "closed" text. If not, I ...
-4
votes
1answer
28 views

function “L” cannot work

I am trying to highlight nids of pages when I am using $nid = $node->nid they stop working of function l in drupal 7 but our nids is highlighted here is my code $ch1=db_query("SELECT th.tid FROM ...
0
votes
3answers
86 views

Responsive not working after converting html theme to Drupal theme

While trying to convert a HTML responsive theme to Drupal 7 theme, it's responsive is not working!!! Can anyone help me with this to sort the issue? We have copied Bartik theme and removed the CSS ...
-6
votes
1answer
87 views

How to see the source code of our project [closed]

I am new to Drupal. How do I see the source code of our development project. Is there any way to see the code? And where exact will our code be stored. Please, can anybody tell me the process.
0
votes
1answer
37 views

How to check programatically whether a comment is new?

I'd like to make some changes to a new comment programatically. I'm using the following code: function MYMODULE_comment_presave($comment) { $user = user_load($comment->uid); $uid = ...
0
votes
1answer
45 views

user_presave doesn't work correctly when new account is created

My users have 2 fields: 'A' and 'B'. The value of the second one depends on the value of the first one and is set by the following custom module: function MYMODULE_user_presave (&$edit, $account) ...
1
vote
1answer
19 views

Print current logged in user without link

I'd like to print out the name of the user that is currently logged in, but not have it be a link. Currently I have: <?php print l($user_name, 'user/' . $user->uid);?> But this prints ...
0
votes
1answer
12 views

how to set a taxonomy term active?

In my block i have different taxonomy term: term A -term B --term c ---term D when i am on term b it is set to active or bold if i am on term d then it is set to active and bold. this is already been ...
0
votes
1answer
29 views

taxonomy term is not working

when i am added any query code is added in blocks our taxonomy term is not working they give two kind of errors: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'term' in 'where ...
1
vote
1answer
24 views

Transforming a Webform upload field into a single Attach button

I want to transform the entire "Browse No file selected Upload" to a button like "Submit" nellens.com/home/content/contact, using CSS, I don´t know if this is possible. It is made with Webforms!
0
votes
1answer
64 views

Where does Drupal 7 clear my custom set cookies and how do I stop this?

I have parts of my website that are not controlled by drupal that set cookies. When I access a drupal-run page, my cookies get cleared. I tried to investigate which script does this by placing ...
-2
votes
1answer
40 views

how to highlighted clicked taxonomy term

I am using below code : echo "<h1>".Volume."</h1>"; $tid=db_query("SELECT th.tid FROM taxonomy_term_hierarchy th INNER JOIN taxonomy_term_data td ON th.tid=td.tid INNER JOIN ...
0
votes
1answer
45 views

Trying to create a widget that submits a form and takes you to another search page

The original example http://www.trellon.com/content/blog/apachesolr-and-facetapi uses an auto submitter, which I don't want. I'm trying to modify it to use checkboxes and submit with a submit button, ...
0
votes
1answer
30 views

How to link taxonomy term with its content?

This is the code below that i am used $ch=db_query("SELECT th.tid FROM taxonomy_term_hierarchy th INNER JOIN taxonomy_term_data td ON th.tid=td.tid INNER JOIN field_data_field_books book ON ...
0
votes
2answers
41 views

How to link taxonomy term with current loaded NID?

I want to link taxonomy term with current loaded node I am using $nid = arg(1); $term=taxonomy_term_load($tid) print $term; but noting happened. Please tell what is the correct way
0
votes
0answers
79 views

How to add item to cart programmatically, with attributes in Ubercart

So I know how to go about adding an item to the cart with PHP like this; $product_nid = 2; $some_data = NULL; uc_cart_empty(uc_cart_get_id()); $data = serialize($some_data); ...
1
vote
2answers
40 views

How to hide a field in a comment in hook_comment_view programatically?

My comments have a field called 'Extra'. I'm trying to hide it when the user who's viewing the comment wrote it. This is my custom module: function mymodule_comment_view($comment) { global $user; ...
1
vote
1answer
29 views

How to get uid from a node on which is commented?

I'm using hook_comment_view($comment) and I'd like to confer the uid from the comment ($comment->uid) with the uid from the node on which is commented. I thought of $node->uid, but I don't know ...
0
votes
1answer
20 views

Fatal memory Error at the bottom of the page but not WSD. What this means?

I occasionally get the following error showing at the bottom of some pages when I'm logged in as Admin. I have seen this error before when the server didn't have enough php memory. But then always the ...
0
votes
0answers
46 views

Getting Drush to play with MAMP and Acquia

I have a Mac workstation which is shared between two users, User°1 who first installed the machine, and User°2 who came along after, both administrators. User°2 has installed Drush using brew and ...
0
votes
1answer
15 views

Using array_unshift with a multiple image field

I have a custom content type "gallery" which has a field containing (unlimited) images. The sample contents of the relevant part of the node look like this: [field_picture] => Array ( ...
0
votes
1answer
17 views

How would I add a class with the same name as the header?

I'd like to add a class with the same name as the header, in order to keep similar header columns the same size. Basically, the code is generating multiple tables, some of which have the same header ...
0
votes
2answers
86 views

Increasing the search query limit (Apache Solr)

We want to create a search page with Apache Solr with an increased query limit. I was reading that using hook_search_execute was not a recommended way to do this. Is this statement correct? What ...
0
votes
1answer
29 views

Can I render a region of my drupal site on a non-drupal site?

Here is my situation. I'm in the process of implementing Drupal as the primary CMS for a large site with hundreds of pages. But until the data input into Drupal can be done (which will be an ongoing ...
0
votes
1answer
33 views

Edit php code on a webform

I need to set an auto response message on a Webform 7.x-3.19. I understand that I need to add a script which is going to do the job. My question is which php file should I edit to do so?
0
votes
1answer
25 views

Trying to print results of Apache Solr Search

I'm trying to print to Drupal message, the indexed items as an object in Drupal. Here's what I have so far: function resource_library_search_apachesolr_process_results(&$results, ...
1
vote
1answer
132 views

How does Drupal 7 page/block cache work?

I have a few questions about drupal 7 page/block cache. If I enable the cache and set the expiration time for 15min., and the content in page A is updated within next 10min., will the cached version ...
0
votes
0answers
81 views

Dynamically Generating Multiple choice question From search result

I am trying to create a multiple choice question dynamically(radio button) from a page which has the question . Fore testing I have declared the array of question in page(content) as : 0 => ...
2
votes
2answers
116 views

How to edit a node programatically after it has been created?

My articles have a field 'Ranking' and I'd like to give a value to this field after a node has been created. The value depends on the node's ranking in a view called 'Top 3'. I tried the following in ...
0
votes
1answer
48 views

Get filename in webform with Rules

I need to get just the file name from a file submitted in a Webform. In actions, I try to execute the following code at a "Show a message on the site" action: $path = "[data:component-value]";/*a ...
1
vote
1answer
68 views

Is it necessary to learn php in order to use drupal to manage my site? [closed]

I am planning on using Drupal to manage a website. Should I learn PHP because I understand Drupal is built on PHP language? I don't know PHP and I am not planning to learn it, but I have decided to ...
0
votes
0answers
128 views

Drupal 8.x-dev: require_once() error when trying to install

I'm trying to install Drupal 8.x-dev (the current one - just downloaded) - I know it's still beta and unstable, but I need it for some reason. Anyway, after uploading files and running the ...
0
votes
1answer
82 views

How can I change an image field programatically?

I'm trying to change the image field 'Badge' when an article is situated at the top of a view 'Top 3' after it has been updated. This is my custom module: function top_node_update($node) { $top = ...
1
vote
1answer
52 views

pass php page to page callback with hook_menu

I'm developing a module where I use hook_menu. I know that I can pass to 'page callback' a function that return string with HTML/PHP code. function mymodule_menu(){ $items = array(); ...
0
votes
1answer
35 views

Commenting option for each paragraph of a node body

I want to provide this option that users be able to put comment on each paragraph of an article that a user has posted in Drupal. I have applied some changes to node.tpl.php file, like $paragraphs ...
1
vote
1answer
39 views

Getting field label with entity_metadata_wrapper

Say I am iterating through a list of field names, and I have loaded a particular node using entity_metadata_wrapper(). $wrapper = entity_metadata_wrapper('node', $node); Shouldn't I be able to just ...
1
vote
0answers
33 views

Why am I getting the error, 'Unknown data property' when the field exists

I am trying to grab all of the fields of a node (which I am doing by using array_keys). At this point, I want to feed them all to entity_metadata_wrapper(), and grab their values. I will then, if ...
0
votes
1answer
12 views

How do I grab a list of all fields in a content type?

How would I grab a list of all the fields in a content type? Currently, I'm using entity_metadata_wrapper() to grab each field individually, but I feel that there's probably a more efficient way to ...
2
votes
1answer
90 views

How to call site name in PHP block?

I have a block in my footer that I currently use to display a copyright message using PHP, like so: Copyright © <?php echo date("Y"); ?> I'd like to add the site name to that code snippet, ...