The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
33 views

global variable for path

In my project I want to provide path of some files from root directory. Path has repeated 4 to 5 time in one module so I am thinking that put one global variable and access that variable in same ...
2
votes
1answer
31 views

using $GLOBALS['base_path']

A quick one - is it ok to use this? I can't seem to get access to $base_url in my node which is set in my settings.php file.
0
votes
0answers
10 views

views rules and views global filter: how to configure parameter in rules action?

I'm using Views Rules and Global Filter and I would like to use "Collect views result rows" within an action in Rules, which makes it necessary to configure the parameter of the global view. Is there ...
0
votes
1answer
39 views

When is hook_user_presave triggered?

I'm trying to create a little module that operates on similar principals as a shopping cart, but has nothing to do with e-commerce. I want to add paired values to $user->data['cart'] on a very ...
0
votes
2answers
52 views

How to get MEDIAN of value in a view field

I have 5 integer fields and I want to show the MEDIAN result for those fields in my content view. How to get the result?
1
vote
1answer
146 views

global static variable to be accessed in comment.tpl.php, node.tpl.php and in page.tpl.php

I wanted to show some ads inside the content (node, comments) and body. I decided to add them using the template by adding some lines to comment.tpl.php, node.tpl.php and page.tpl.php for example in ...
0
votes
1answer
63 views

The link generated by a View's header (Global: Text area) is only visible for the admin role and I need it to show for other roles

I have the following code in the View's header (Global: Text area). <?php global $user; if (user_access('create page content', $user)) { $output = l(t('Publica un artículo nuevo'), ...
0
votes
1answer
61 views

function defined in module not global?

I created a module in order to define a few functions that I would like to use from a workflow rule. The workflow rule is triggered by an event and runs a php code snippet. The php snippet that it ...
0
votes
2answers
66 views

Is the use of the $GLOBALS array in Drupal in anyway 'less secure' or 'bad practice'?

Is the use of the $GLOBALS array in Drupal in anyway 'less secure' or 'bad practice'. Like using: $GLOBALS['user']->uid instead of $account->uid if it were avialable? Thanks.
0
votes
2answers
37 views

Can't find developer/globals.php

I want to store some global variables that can be accessed anywhere in the drupal 7 platform (eg. theme files, modules etc...). Others have said that I should be putting my globals variables in ...
2
votes
4answers
351 views

$GLOBALS['user']->uid returns same uid for different logged in users?

I'm implementing hook_menu in my custom module. Implementation works fine except, it turns out that $GLOBALS['user']->uid returns always same value no matter which user is currently logged in. Sounds ...
1
vote
1answer
117 views

Global Variable with a dynamic value set by variable_get() in multisite

My question is, if I have a multisite environment what is the expected behaviour of global variables set like: define('GLOBAL_VARIABLE' , variable_get('myvar')); 'myvar' is set in a module ...
0
votes
1answer
2k views

How to get the base url?

(Drupal 7.22) We need to create a menu link to an external site, "https://example.com/some/path" /some/path is static, whereas "https://example.com" depends on site instance, such as ...
1
vote
2answers
629 views

How can I get a field value of a node using PHP?

I have created a field in a Basic Page with the label of User Name and the field name of field_user_name. How can I get it's value using PHP?
0
votes
2answers
115 views

Proper way of making global text strings for field body? Use tokens?

I'm currently creating a bunch of nodes, but they all have the same or similar body text. I was thinking of using the token module to set a global text string and then reference it via a token in the ...
1
vote
1answer
173 views

how to include globals.php in template.php file

I need the variables from the globals.php and I can't seem to call/register them in theme's template.php file. These variables are needed for my custom hook function for the template. Am i missing ...
0
votes
2answers
190 views

D7 - Custom PHP processing page

I have a PHP page already written specifically for users to be directed to (sort of like a referrer link, and carries querystring values) from external sites. This page is not intended to have any ...
0
votes
2answers
96 views

Can I use the $user global variable for security purposes?

I am developping a module which allows users to modify information about themselves using a form. I want to make sure no user is able to modify the informations about another user. To do this, I ...
1
vote
2answers
3k views

How Do i Create Combined Search Filters In Views?

lets say I am currently working on a view that allows me to search "title" of a content type along with 3 other exposed filters. but now i want users to not only be able to search "title" but also ...
4
votes
2answers
2k views

Global variable, visible only inside the module

I have several modules, that implement very close functionality. And the SQL requests are almost the same, except for the table name. So I wanted to create a global variable, inside each module: ...
0
votes
2answers
43 views

How do you access custom user information added from: Configuration » People » Account settings

I'm looking to create a script that pulls some of this information, but I need to know how to call it. For example one of the 'machine names' for one field is field_first_name how could I call this? ...
1
vote
2answers
355 views

Global $user object isn't always “Fully Loaded”

I have a Drupal 6 module that implements hook_user() to add a custom property on op='load'; mymodule_user($op, &$edit, &$account, $category = NULL) { $account->external_id = ...
4
votes
2answers
1k views

D7: Dealing with absolute paths while on localhost

I have a long-term path problem while developping modules for drupal. For instance I have the following project path while locally: http://localhost:8888/mylocalproject while on the production ...