Tagged Questions

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
7 views

D6/Ubercart2 PHP5.3 CA custom PHP broken [on hold]

We've just updated a D6 Ubercart site to PHP5.3 in preparation for a major site upgrade. We're using node-checkout with a conditional action to write the Order ID and Checkout Status into the node ...
0
votes
1answer
7 views

Passing PHP filtered arguments to Panel and View Pane

I have been able to pass URL parameters to a Panel and from there to a View Pane inside the Panel. However, I must pre-proccess the URL data with PHP. I have only been able to use Visibility rules ...
0
votes
1answer
12 views

user-profile-edit.tpl.php not working for user#1

I am going crazy on this one :-/ I have overridden my user edit page with a user-profile-edit.tpl.php In my template I have: function mytheme_theme() { $items = array(); ...
0
votes
0answers
7 views

Can different region combinations being used in specific pages of drupal [on hold]

Can we use separate region combinations for different pages in drupal. For example apart from the normal regions avaialble throughout the site,I want the user pages to display only 2 regions.And ...
0
votes
1answer
18 views

Your web server does not appear to support any common PDO database extensions

I'm trying to install Drupal7 or Drupal8 and keep getting this error: Database support Disabled Your web server does not appear to support any common PDO database extensions. Check with your ...
-1
votes
1answer
11 views

A code editor for module developer

Is there a code editor which can edit code in module php file ? like editor under plugin menu in Wordpress. Thanks in advance.
0
votes
0answers
9 views

How can I remove the dependency on PHP of rules in a feature?

I am attempting to disable the PHP filter on my site, so I am moving all PHP input in the UI into code. I finished cleaning up my views and panels, and now only some rules remain. Right now, all my ...
0
votes
0answers
21 views

Which is the better way to way to theme fields in Drupal 7 [closed]

Which is effecient way ot theme fields in drupal. Using theme_field or field.tpl.php? Which is easier and effecient to use
0
votes
1answer
15 views

Dealing with compressed JSON string from external API

I'm trying to call the Stack Exchange API but it sends compressed JSON strings and I can't uncompress it. $request = ...
1
vote
1answer
17 views

“global” keyword does not work from within drush script

I have the following script: <?php $GLOBALS['foo1'] = "foobar1"; function g1() { echo "g1 " . $GLOBALS['foo1'] . "\n"; } $foo2 = "foobar2"; function g2() { global $foo2; echo "g2 " ...
0
votes
1answer
22 views

How to get term name using PHP code in views? Drupal 6!

how can i get term name of current term using PHP code? I am using it in views. Thank you. I dont know why, but the below code doesant work: $term = taxonomy_get_term($tid); $name = $term->name; ...
0
votes
1answer
16 views

Source: empty object - in hook_feeds_after_parse()

Working on a module that modifies some csv files before it's processed by feeds_import. I use the hook_feeds_after_parse($source, $result). The processing and $result is ok. But the object $source of ...
0
votes
1answer
36 views

Drupal 7 | Checked box to display image (PHP IF) [closed]

I am slowly getting the hang of PHP. What I am trying to figure out is how to display an image (icon) if the checkbox is ticked. I understand its something like this but its returning errors. ...
-1
votes
0answers
12 views

Name of the webform's variable?

I want to add some php code for my webform, but I don't know how to find the right variable's name of the differents fields that I have in ma form. Any idear ? Thanks to everyone.
1
vote
2answers
52 views

PHP Output in module

I am creating a module that is outputting a static php page into my Drupal install. Here is my module file: <?php function mymodule_menu() { $items = array(); ...
-1
votes
1answer
21 views

PHP code in welcome email

I need PHP (for some logic) inside the welcome email, the welcome email structure is defined in admin/config/people/accounts (in the text box) The question is how can I place PHP code there, I tried ...
4
votes
2answers
73 views

Blocking IP Address In Drupal 7 Via Code

I want to know is there any function in DRUPAL 7 that I can send it an IP address as a parameter and it adds this ip to blacked_ips table ?? Indeed I have a rule that contains a Execution PHP action ...
0
votes
1answer
18 views

How to customize drupal node using 'PANELS'

I am trying to implement the "PANELS" module in drupal 7.31 to customize a page display. Panels Module : 7.x-3.4 Drupal version : 7.31 I have created courses(as a product) using "COMMERCE" module. ...
0
votes
0answers
10 views

Node - Refererence Syntax for 'All Users'

I am building a SEO Function in Drupal 7 which is located in the template.php file. Currently, I require the syntax to reference all users in the conditional statement I have coded. Please provide ...
2
votes
3answers
90 views

Can't log in to Drupal websites after upgrading to OSX Yosemite

I have just upgraded my local machine to OSX Yosemite which has changed my Apache version from 2.2 to 2.4 and my PHP version from 5.4 to 5.5. When I visit both example.dev/user and ...
0
votes
1answer
25 views

Are Drupal .php files associated with a module cached?

I am wondering if they are, as that would explain why a simple change to one of my variables in my config.php file is not showing up in the DOM. Here is what is making me suspect this. In my ...
0
votes
0answers
10 views

PHP mail logging — more detail possible from Drupal in phpmail.log?

I've got PHP configured to log sending of mail to /var/log/phpmail.log. BUT...for Drupal, it only shows "system.mail.inc", which is not terribly helpful in diagnosing which form/node/etc is actually ...
-2
votes
1answer
22 views

How to add content into topic item [duplicate]

I want to add content into a topic item on a website. I am using drupal and have admin access. I want to edit code that will return the below objective. How do I access the files that would have the ...
0
votes
1answer
16 views

Accessing text of a field with type “Text”

I fear that my question could be covered in detail already somewhere, but I did not find something useful. So appologies if this is the case. I added a field of type "Text" to content type "Article". ...
0
votes
2answers
33 views

Drupal, menu links multilanguage

I'm translating the site with my custom theme to another language. The problem is in menu links. On the original language they are fine, but with another one they are looks like "node/id". I've tried ...
0
votes
0answers
49 views

Calculate the difference between two unix timestamp date fields

I need to calculate the difference between two date fields in a table view in Views so that each row in the table shows the time difference in days, hours and minutes . The date fields are set to the ...
0
votes
1answer
39 views

how to specify which region of panelpage can be displayed with php

I am using a page--front.tpl for my frontpage. It overrides a panelpage whice i use for my frontpage. I can display the content of my panelpage with <?php print $content; ?> Is it possible to ...
-1
votes
1answer
35 views

PHP Fatal error /allowed memory size exhausted (but 100% NOT the “problem”) [closed]

I have several blank pages coming up and the server log contains the following error: PHP fatal error […] allowed memory size exhausted […] in ...
0
votes
2answers
41 views

How to build web app with Drupal

I would like to build a php based webapp. I am newbie with Drupal, but after some research I am convinced that Drupal may be the best solution for my web app. However I have some questions, here is ...
0
votes
0answers
19 views

Shared hosting - force mail return envelope

I hope I'm on the right site, because it's a crossover between drupal and server configuration... I am currently using shared hosting for a website and am encountering mail problems while sending ...
0
votes
0answers
16 views

Drupal 7 views show nodes filtered by user profile field

Drupal 7 views show nodes filtered by user profile field In Drupal 7, create taxonomy vocabulary "Interests". It has terms sports, arts, computer... admin/structure/profiles create main profile. It ...
0
votes
0answers
20 views

translate php date?

Im my view I use last-access field for users. I use custom date format (only d) The resulot is for example 1 day 14 hours. Question: how to translate it to different language? I am not using any ...
0
votes
1answer
18 views

Alter keywords searched in solr

I want to search phrase entered by user as q="phrase"^21.0 OR phrase On localhost:8983/solr/admin/form.jsp it parses "phrase"^21.0 OR phrase perfectly! and return correct results How can i do it ...
0
votes
0answers
9 views

PDM: Remember dismissed messages until user logs out

I am using the Persistent Dismissible Messages module with Drupal 7, which works perfectly, however I could do with the adding a certain bit of functionality. When the user logs out, I need PDM to ...
0
votes
0answers
36 views

Call to undefined function views_embed_view() in php/php.module error

I have a Drupal 7 based website that is multi-site. There is one sub domain ,say sub.example.com which is a Drupal installation with out any module or content type and the example.com it self and they ...
-1
votes
0answers
17 views

On click of checkbox send email to selected recipients [duplicate]

<?php if( isset($_POST['Submitter']) && !empty($_POST['Submitter']) ) { $to = "syz@gmail.com"; $subject = "Test Subject"; $body = "Test Body"; $headers = "From: ...
0
votes
0answers
17 views

ckeditor interface language for multilingual site

I am trying to implement various languages in ckeditor interface for my multilingual site if i set config.language = 'en-gb'; config.wsc_lang = 'en_GB'; config.scayt_sLang = 'en_GB'; in admin panel ...
0
votes
0answers
7 views

How to hide a node in panels when user is member of some groupnode

In panels i like to hide a node. Users who are a member of any type of groupnode should not see the node. My problem is that i can only find a visibility rule that can hide the node when the user is ...
0
votes
1answer
29 views

Sub Menu's are not coming under main menu

I am using this code to fetch menu's in drupal. I have given Home as parent menu and other are sub menu's like submenu1, submenu2 etc. But in front end they are not coming under Home menu. Only Home ...
0
votes
1answer
41 views

What are some php cache related modules for drupal 7?

i just updated my server to php 5.5 and been reading about apc and opcache, and I'm not to sure which one to use or what modules support this feature. What are some modules or modifications to drupal ...
0
votes
0answers
18 views

AND/OR multiple subqueries in SOLR and Drupal 6

What i need is to search in forum & topic of forum is tid: 123. I want to limit the results to a particular topic author name and having keyword in it. e.g All topics by 'xyz' having the ...
0
votes
1answer
15 views

Drupal 6 theme add / edit content form

Drupal 6 theme add / edit content form In Drupal 6, we can add new content type "content-type". We want to theme /node/add/content-type by template file. We want to theme the edit form ...
0
votes
1answer
46 views

How to refer input values in php by giving $_POST[name] or $_GET[name]?

I have created content type and I want to refer two textboxes. How can I do that? using normal php the below will do that $Fname = $_POST[uname]; $Lname = $_POST[Lname]; How to do that using ...
0
votes
1answer
68 views

Updating to PHP 5.4 breaks Drupal 7.25 with Strict warning: Declaration on bootstrap.inc

I tried updating to PHP 5.4, but got a few errors. These aren't critical errors right? seems like its only warnings. I'm using Drupal 7.20 What do the following errors mean exactly? And how can they ...
0
votes
0answers
16 views

How to substr_replace a “$” in front of price tags using VBO

I'm using Views Bulk Operations to update details on a bunch of products (more than 1300 of them.) I am trying to insert a "$" in front of the #### price tag, and I receive an error of: Parsing ...
1
vote
2answers
42 views

How to add button to user profile page in drupal

I start using drupal(7) 3 days ago and I have small task : I'm using Profile2 Module to create 2 type of users (candite/employer) and I Want to create a button in the wiew page of the profile of ...
1
vote
1answer
97 views

what is starting point of any drupal module.?

Only beginner can ask this type of question. as i am learning drupal recently. what is the first function that executes in .module file..how can i understand which function or hook executed.I just ...
0
votes
0answers
19 views

How to add social sharing buttons to a CCK slideshow

I have a simple d7 field slideshow with a carousel and I need to add the ability to "share" the image that is visible in the slideshow. I have included my custom buttons in the ...
1
vote
1answer
20 views

Nesting Navigation Tabs

In my custom module, I'm defining a menu_item with the type MENU_NORMAL_ITEM. In the default bartik theme, this adds a new navigation tab (next to the Home tab). This is great; however, I need nested ...
0
votes
1answer
41 views

Add and customize login block on page.tpl

I'm trying to add the user login block in my page.tpl file. I've tried inserting the following code but the only thing I see is the username, password and submit fields. The "Register" and "Forgot ...