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
1answer
17 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
8 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
51 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
18 views

PHP not executing in non-Drupal HTML files in web root [on hold]

Our site has a bunch of small HTML files that correspond to URLs used in print ads. For example, we put "oursite.com/thing1" in one ad, and "oursite.com/thing2" in another. These HTML files contain a ...
0
votes
1answer
21 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 ...
-2
votes
0answers
16 views

Automatic Nodetitles [on hold]

I am trying to create automatic titles using the Automatic Nodetitle module and the Token module on my Drupal 7 website. The title should look like this: [Token1]: [Token2] ([Token3], [Token4]) - ...
0
votes
0answers
5 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
20 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
15 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
29 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
11 views

Facebook PHP SDK upgrade from 3.2.3 to 4.0.0 on Drupal 6 site [on hold]

It seems that the necessary php version for the facebook php 4.0.0 sdk is php5.4 yet drupal 6 sites supports only php 5.3 for now. Is there a solution for this issue that can use the 4.0.0 sdk without ...
0
votes
0answers
29 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
26 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
35 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
14 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
12 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
19 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
16 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
8 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
25 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
9 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
27 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
33 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
12 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
14 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
39 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 ...
1
vote
3answers
60 views

How do you disable strict errors for PHP 5.4 & 5.5 in Drupal 7 via the settings.php file?

Currently I disabled the error messages via UI under Administration > Developement > Logging & Errors: But I want to be able to do this via the settings.php file. How can that be done?
0
votes
1answer
43 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
14 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
37 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
94 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
16 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
19 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
39 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 ...
0
votes
0answers
20 views

Print out multiple upload fields on a page

I'm trying to output 4 upload fields on a page. But the problem is that it only outputs the first one and not the rest. All works fine when uploading the files with Drupal's form api, but I just can't ...
0
votes
1answer
48 views

hook_views_pre_render -> how to access variables

I have a view of teasers, and would like to check the status of each node. Using hook_views_pre_render (in the template.php file of the theme), I can access: $view->style_plugin->row_plugin ...
0
votes
0answers
15 views

Fill a field with a specific number when clicking on a link

I have changed my node.tpl.php file a little bit, <div class="content clearfix"<?php print $content_attributes; ?>> <?php // We hide the comments and links now so that we can ...
0
votes
1answer
11 views

How to install certain modules only for specific site using Acquia Desktop

I am using Acquia Desktop for creating multisites. Problem is whenever I am installing a module it gets replicated in everyother site. What i need to know is that if i want to have a module only for ...
-1
votes
2answers
28 views

call views block with php [duplicate]

I make a page and enable php filter core module too. Now I want to call a views block with php. How can I do this? How can I call a views block with php?
0
votes
0answers
14 views

hook_init executing instructions multiple times..Does it happen only for drupal_set_message or also for other statements? [duplicate]

I have added a Drupal_set_message in my hook_init implementation of my module. I havent placed any if condition as i want the set of instruction to occur in every page . But often in many pages i can ...
1
vote
0answers
24 views

How to use drupal tokens using token_replace

Recently i developed a module which will prompt a message to user when he logs in Hi xyz .thanks for vising the site. using drupal_set_message.Now in order for this to work i had to use ...
0
votes
0answers
13 views

Drupal alter country list generated by location module [duplicate]

I want to remove some countries from the drop down field provided by location module, is there any admin way to remove the fields or hook_form_alter is the only way to limit them, thanks in advance
0
votes
0answers
25 views

How to get the value of a content type field in Drupal and pass it to a JS file

In my Drupal theme I have a field for soundCloud URL which its machine name is (field_soundcloud_url_) I have a javascript file that will work based of the value of this variable. But it does not ...
0
votes
1answer
27 views

Views Php how to select actual term name not term ID

How to select term reference field with variables in views global PHP field? I need to not Term ID, but actual term name. My views is fields of a content type that contains term reference field. And ...
0
votes
1answer
26 views

Send email with URL of same page as the email link?

We have a page that displays a logged-in user's selections from a Flag Lists process. The page includes code to generate the specific URL of that page, so it can be copied and pasted elsewhere. ...
1
vote
2answers
29 views

select nodes whose created date in hours is equal or larger than 48 hours

I make a PHP routine in which all node is selected and check created date and delete those nodes which is created in last 48 hours or greater. $result = db_query('SELECT n.nid, n.title, ...
0
votes
1answer
23 views

Two variables in function

I know this is my fault and lack of knowledge of php . Sorry about this . I have a function in my template.php . /** * Implements THEME_preprocess_node(). */ function ...