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
14 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
24 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
10 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
10 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 ...
-3
votes
0answers
26 views

read data from RS232 bacode scanner using php [closed]

In my application , i need to scan barcode using RS232 com port barcode scanner and place the output to textbox
0
votes
1answer
25 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
3answers
31 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
21 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 ...
0
votes
0answers
12 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
30 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
87 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
14 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
15 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
22 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
25 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
13 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 ...
-1
votes
0answers
10 views

Drupal 7 and Adobe Edge Animate

I have an ecommerce store im in the process of building using drupal commerce. One product type needs to be customizable. It will be a shirt that can be customized with what i think is the best ...
0
votes
1answer
10 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
25 views

call views block with php

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
15 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 ...
-1
votes
0answers
16 views

Get Post By Tags

How we can get the post by tags. I have used below snippet by not getting post $node = node_load(arg(1)); if ($node != NULL) { $field = $node->field_my_vocabulary; $terms_en = $field['en']; ...
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
19 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
18 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
18 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
24 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
19 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 ...
0
votes
1answer
16 views

HOOK_node_submit funtion not working in custom module

I recently upgraded a drupal installation from 7.15 to 7.31. All seemed to be working well but as I went through testing features I noticed one of the template forms for content submission wasnt ...
0
votes
0answers
24 views

hook_js_alter not being called

I find this strange. My module seems to be named correctly but the module will not be called. The var_dumps are not on the page nor are watchdogs when I put them in. The module shorthand is ...
0
votes
1answer
45 views

Hiding Field(s) if Date is Expired

I'm using Drupal 7 date field. Using views, when the date has expired, the page goes to a section labeled 'past events.' In the template page, the date and time are both separated for instance. ...
0
votes
1answer
23 views

clean URL and slash after index.php in drupal 8

Drupal 8 does not send any form. Stores only if you write through /index.php/ example: site.com/index.php/config That would be needed to site.com/config There is the idea that it's something with the ...
0
votes
1answer
29 views

How to add custom RewriteRule in .htaccess

I have a website which some one else has built using Drupal Database API (nothing else from Drupal has been used). With the RewriteRule added to the .htaccess file which is in the root folder, the ...
0
votes
2answers
24 views

Form Alter Foreach Loop changes not sticking

I'm trying to modify my exposed filter block to put each of the controls inside fieldsets, and make other modifications to them. However, when I try to utilize a foreach loop to do this, none of my ...
0
votes
0answers
12 views

Jquery Ajax to Drupal to External site, reading response

I have a drupal site. There is a page (page 1) with a form that gathers user info and submits it via AJAX to a Drupal Module page. The AJAX format is jquery var responseTarget = ...
0
votes
1answer
24 views

How can I restart the PHP environment installed with Drush for Windows?

I have installed Drush for Windows, works great, but it installs its own version of PHP in a subdir of the install directory. I've increased the memory limit and execution times in that ini but how ...
0
votes
1answer
14 views

Drush version component error

I am trying to enable drush aliases in linux so that I can use Acquia, but I am getting the following error when I run: drush @dev status Drush command terminated abnormally due to an unrecoverable ...
0
votes
1answer
22 views

Saving a value from Javascript on Drupal form submit

I have a jQuery map that I've built that allows users to select states and counties. This is all done in Javascript. I would like to, on form submit, take this data and submit it to the user's ...
0
votes
2answers
72 views

How do I prevent Drupal raising a segmentation fault when using a Node.js theming workflow?

Symptoms: Some drush commands fail; Some Drupal pages are blank. The failing drush commands report "Segmentation fault: 11" The Apache log (e.g. php-error.log in MAMP) also shows the same error. ...
0
votes
1answer
16 views

drush -v @live status can't find remote php

I can't seem to get drush to execute fully using ssh. If I try: drush -v @live status The resulting error message is: /usr/bin/env: php: No such file or directory I can explicitly execute php ...
1
vote
1answer
31 views

Write form value to database

I need to save this to database, but could not find a way to make it work. Now this paypal_email is only saved to current user. Apparently it is saved somehow to the database under user table, but it ...
0
votes
0answers
23 views

Add class to view block if view has count result using template.php

I need to add class to view block if view has certain count result. For example if count result is 4 or less. I have working code for view format HTML list, but I need to use Unformatted list. ...
0
votes
0answers
45 views

How to add class to view block programmatically

I need to add class to view block programmatically, but could not find working way to do it. My view format is Unformatted list. I have this in my template.php: function ...
4
votes
1answer
142 views

How do the seasoned OO PHP people go about setting up a professional development environment and how can we apply this to Drupal 8

A few years ago I was in to Drupal 7 development. Back then, in the company I worked for, we just kept everything in the database, had a few modules we kept on disk somewhere, didn't really use ...
0
votes
1answer
46 views

Issue implementing Ajax in form

I created a basic page which has a basic form and implements ajax, or attempts to do so. My issue is that it doesn't seem to be functioning as it should. What might be Ajax, only works after I press ...
0
votes
1answer
26 views

Is drupal the right solution for me? [closed]

Hopefully this question is suited for this forum, please advise if not. I'm looking to develop a Web front end that is used by end users to input utility transfers for home owners, electricity, gas ...
0
votes
2answers
26 views

Get IP of the Author only

I use this solution for now which works great: It's with Computed fields, and I use this line: $entity_field[0]['value'] = ip_address(); So basically what it does, it's when a user submits a new ...
0
votes
1answer
24 views

If Profile2 fields are empty, problem in accessing data

I just found out that if ALL fields of certain Profile2 profile ie. main are empty, I am not able to access data inside main profile. For example I want to do a check if a field is empty but can not ...
0
votes
1answer
70 views

profile2_load_by_user Trying to get property of non-object

I use simple code to hide field from profile2 main profile based on another field inside the profile2 main profile. If field_testcheckbox is not checked, hide field_info. function ...