Drupal

PHP Exec executes some commands, but not others

Drupal Module Development - Sun, 2010-06-13 11:36

I'm trying to get the difference between 2 files on my Debian system.

<?php
$output=`diff path/to/file1 path/to/file2`;
echo "<hr>".$output."<hr>";
?>

Gives a page with "<hr><hr>".

However, this:
<?php
$output=`ls -la path/to/files/`;
echo "<hr>".$output."<hr>";
?>

Gives me a listing of the directory as expected.

Do the executables need to be registered somewhere?

Categories: Drupal

Shadowbox in Drupal

Drupal Module Development - Sun, 2010-06-13 10:45

Hi all,
I am a novice in using Drupal and currently working hard to get my grips on the whole thing. I've been using the Shadowbox module to handle images within my Drupal site but would like to do the same for audio and video.
This is where I get into trouble: within 'shadowbox options' there seems to be no way to configure for video and mp3, whereas when I configure the 'display fields' for which I want to use mp3 I can't set it to Shadowbox. I can choose from various SB G fields, but they seem to apply to images only.
Does anyone know what to do in this case?

Categories: Drupal

Mark Sholtez - www.marksholtez.com

Drupal Showcase - Sun, 2010-06-13 07:11

www.marksholtez.com

Mark Sholtez is an Australian singer/song writer.

The development of the site was a collaborative effort between Level Four - development (http://www.levelfour.com.au/) and Babekuhl - Design (http://www.babekuhl.com/) on behalf of The Grindhouse (http://www.thegrindhouse.com/).

Comments welcome.

Cheers.

Categories: Drupal

display subtotal,Free shipping,discount,order total preview?

Drupal Module Development - Sun, 2010-06-13 02:17

HI
ubercart shipping cart page?

example:www.example.com/cart
How to:
display subtotal,Free shipping,discount,order total preview?

Thank you very much

Categories: Drupal

db_fetch_object stopped working?

Drupal Module Development - Sun, 2010-06-13 01:10

Okay, I'm very confused. I had this code in my hook_block under the view operation and it worked fine. I decide to put the query in its own function to pretty up the code and it stops working.

<?php
function _module_whatever($delta){
if ($delta == 3){
        $type1 = 'looking';   
        $field_name = 'field_lookingreference';
        $row[] = array('General', 'Specific', 'Description', 'Specific');
       
    }
    elseif ($delta == 4){
           $row[] = array('General', 'Specific', 'Description', 'Specific');
        $type1 = 'offering';   
        $field_name = 'field_offeringreference';
    }
   
    $sql = "SELECT n.nid, t.tid  FROM {node} n INNER JOIN {term_node} t ON n.nid = t.nid WHERE n.uid = %d AND n.type = '%s' ORDER BY n.nid";
    $result = db_query(db_rewrite_sql($sql), $user->uid, $type1);   
   
    while($data = db_fetch_object($result)) {
//Never reaches here. For whatever reason, the $data is remaining null and the db_fetch_object is not working.
..}
}
?>

The $data = db_fetch_object($result) is coming up null. I've run dsm($result) and it's given me objects, but the function is not working. dsm($data) is NULL.

So, so, so very confused.

Categories: Drupal

Lebanese PM Fuad Siniora Official Website

Drupal Showcase - Sat, 2010-06-12 21:07

PM Fuad Siniora Official Website is built to be a portal to provide information for the lebanese community worldwide and to allow communication with the public.

Why Drupal?

Drupal is a proven content management framework that provides a wide toolkit while providing the ability to customize every aspect of it. While its arabic support is below Joomla for example and other content management frameworks, its solid multilingual capabilities allow to fill in the gaps.

Modules

The website uses a set of proven track modules such as: CCK, Views, Imagecache, Lightbox
Other custom modules has been developed to provide site specific features and allows intuitive interaction with the site visitors

Performance

It is critical that the website stays online 100 per cent of the time, so careful planning and fine-tuning of the server settings has been made to make sure that the web server never crashes to an influx of visitors. Moreover a PHP opcode has been used to speed up performance and the cache module to use it as a preferred alternative to slow database caching.

Goals

In the recent days, the website has succeeded to achieve its goals by allowing a great deal of visitors to be able to send their messages.

Categories: Drupal

Explain custom fields in D7 vocabulary

Drupal Module Development - Sat, 2010-06-12 20:51

Give some example why would you add custom fields to a vocabulary.
Is it possible to add these fields as a fieldset in a content type.

Categories: Drupal

St Petersburg Music Conservatory / Санкт-Петербургская государственная консерватория музыки

Drupal Showcase - Sat, 2010-06-12 17:20

Now this is a real honor: the St. Petersburg State Conservatory of Music – the oldest academy of music in Russia -- uses Drupal for its web site:

http://www.conservatory.ru/

I spotted this while doing some research on Chopin.

Categories: Drupal

multipage form not working

Drupal Module Development - Sat, 2010-06-12 15:54

Hi,

I'm trying to build a multi-page form but nothing happens when submit is clicked after the first step.
This is (part of) my code for creating the form.

<?php
function lesplanning_add_form($form_state = NULL) {
//first check user role
global $user;
// Check to see if $user has the docent role.
if (in_array('docent', array_values($user->roles))) {

}else {
//do leerling stuff
if(!isset($form_state)){
$step = 1;
}else{
$step = $form_state['step'] +1;
}

$form['step'] = array(
'#type' => 'hidden',
'#value' => $step,
);

switch($step){
//start of by selecting subject
case 1:
//get subjects from db
$result = db_query("SELECT vak FROM {subjects}");
$options = array();
while($row = db_fetch_array($result)){
$options[] = $row['vak'];
}
$form['subject'] = array(
'#type' => 'checkboxes',
'#title' => 'Selecteer het vak waar je bijles voor wil',
'#options' => $options
);

$form['choice'] = array(
'#type' => 'radios',

read more

Categories: Drupal

Difference between [a/%b] and [a/%] in paths

Drupal Module Development - Sat, 2010-06-12 15:29

Hi,
what's difference between:
$items['a/%']

And this one:
$items['a/%b']

what's usage of writing b after percent?

Categories: Drupal

Book of nodes for customized Proposals.

Drupal Module Development - Sat, 2010-06-12 14:13

I am not sure if I should try doing this in D6 or D7, but thinking that this might be interesting to try both ways.
I want to create a customized proposal system for an Industrial Construction Project. Naturally, we don't want competitors to see what we are doing, but we are also looking for a way to setup formal proposals in a template solution.

We begin with a template, probably a template of a book.

In each book section the author can attach references to other nodes.

The finished Book would be en entire node that we could invite Prospects to see.

Just an outline:
Section Intro, would include an NDA that the client would have to agree with. Just not to show it to competitors.
section one would be a proposal outline with details
Section Two would include all details to qualify to compete on the project.
Section Three would include Nodes of past projects that we have done

I would also want the project to have limited access to just prospects, and probably time limited as well. So we can send an invitation to a prospect to view the project, but no one else except for internal people can view it. Then use time or limit viewing by IP address or something like that.

My thoughts on doing this would include:
- A Single domain, and assign Books to users. But need to get the right Modules for this.

read more

Categories: Drupal

Form in block (D7): Am I wrong or is it a bug?

Drupal Module Development - Sat, 2010-06-12 13:06

Hi,

I want to display a custom form in a block.

My block:
function my_module_block_view($delta = '') {
  switch ($delta) {
    case 'my_block':
      $block['content'] = drupal_get_form('my_module_test_form');
      break;
  }

  return $block;
}

My form:
function my_module_test_form() {
  $form = array();
  $form['any_value'] = array(
    '#type' => 'textfield',
    '#title' => t('Insert a value'),
    '#default_value' => '',
    '#required' => TRUE,
  );

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Do it'),
  );
  return $form;
}

Submission code:
function my_module_test_form_submit($form, &$form_state) {
  drupal_set_message("Form submitted");
}

When I try to submit the form, I get an error message because of the execution time is greater than 30 seconds, sometimes I also get a memory error, that the maximum memory (64MB) is too less. If I try to load the form on a single page and disable the block, everything works fine.

Any idea, what there is wrong?

Best regards,
Sebastian

Categories: Drupal

Video not found or access denied: drupal-6.16/sites/default/files/sites/default/files

Drupal Module Development - Sat, 2010-06-12 12:45

Module : SWF Tools 6.x-3-0-beta4.

I have install this module at the local machine (Ubuntu 9.10) with the Apache2 mod rewrite enable and clean URLs configuration. Why the same problem still occur again ? Maybe setting of Apache is wrong ? Windows system not yet tested. I like this module, a lot improvement.

Categories: Drupal

hook_schema / hook_insert versus hook_field_* / drupal_execute

Drupal Module Development - Sat, 2010-06-12 09:43

hi drupal community,
it's very hard to get information and answer about this kind of issue

I want to programmatically populate a new content of my own ( job status extracted from SAP).
But what is the better way to create and also access this new content ?

I think there are many ways

first by directly creating a table in the database using hook_schema and populate with hook_insert

second add field to existing content using hook_nodeapi and hook_insert

third by creating a custom content with cck ( hook_field_*) and populate with drupal_execute

I'm thinking to use the third way for reusability reason.

Hope somebody understand my problem and has an idea about it.

Thanks for any clue

Categories: Drupal

permission and role

Drupal Module Development - Sat, 2010-06-12 09:07

i have created role and assign permission to a newly created user.but when i login it through the newly created username and password the permission which i have not assign to it is also coming. i think it's not working .

Categories: Drupal

Create form using Form API

Drupal Module Development - Sat, 2010-06-12 08:27

Hi all,
I'm having this problem, and want everyone can help for me, the problem following:
I created form using Form API, and i want while calling form then assign value to text filed(because value of text file always change).
Thank all!

Categories: Drupal

Probably a Stupid Question...

Drupal Module Development - Sat, 2010-06-12 07:58

I know this is going to end up being a stupid question, but I have a problem that thus far I have been unable to find the answer to. I have Googled and even tried loading code up into XDEBUG and still can not find what I am looking for. My problem is this...I have a website that I am working on that started off using Drupal. The user database is all based in Drupal. What I am trying to do is tie Drupal's credential system into the pages that I am creating. Now what I do know is that when a user logs into Drupal is creates a PHP session and sets a cookie. This means that Drupal is setting a PHP $_SESSION variable and checking to find out if a user is logged in. What I need to know is what the name of that variable is for standard user and for admin users so I can verify if the user is logged in when they visit my page. At this point I am open to any ideas..

Thanks,

Whit3fir3

Categories: Drupal

Selecting name in taxonomy array

Drupal Module Development - Sat, 2010-06-12 04:10

So, basically, I'm creating a $tmpNode = node_load($nid). I'm then inputting dsm($tmpNode->array). My results are below:

#
... (Array, 1 element)

    *
      3 (Object) stdClass
          o
            tid (String, 1 characters ) 3
          o
            vid (String, 1 characters ) 1
          o
            name (String, 5 characters ) Books
          o
            description (String, 0 characters )
          o
            weight (String, 1 characters ) 0
My question is, I want to simply grab the name value from here.

$tmpNode->taxonomy->name doesn't work, since I'm one level too high for the name. It's in an array within the taxonomy array, titled by my term id ("3 (Object) stdClass"). But I can't figure out how to iterate down through that second array.

Help would be immensely appreciated.

Categories: Drupal

User registration confirmation

Drupal Module Development - Sat, 2010-06-12 03:17

I am trying to display a page after a user has filled in the registration form, where a confirmation message would appear. Are you sure you want to register? Yes / No. User should be created only if the answer is Yes.

I have some code here, that fails to override the core user register submit function.


<?php
function confirm_registration_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'user_register':
$key = array_search('user_register_submit', $form['#submit']);
if ($key !== FALSE) {
unset($form['#submit'][$key]);
}
array_unshift($form['#submit'],'confirm_registration_user_register_submit');
break;
}
}

function confirm_registration_user_register_submit(&$form, $form_state) {
if (isset($form_state['values']['mail'])) {
return _confirm_registration_confirm($form_state);
}
return user_register_form($form_state);
}

function _confirm_registration_confirm(&$form_state) {
$desc = 'Are you sure you want to register?';
// Tell the submit handler to process the form
$form['process'] = array('#type' => 'hidden', '#value' => 'true');
// Make sure the form redirects in the end
$form['destination'] = array('#type' => 'hidden', '#value' => 'example/todo');

return confirm_form($form,
'Are you sure?',

read more

Categories: Drupal

Need Help with installing / using Google Maps on my site...

Drupal Module Development - Fri, 2010-06-11 21:46

I am a newb Drupal user (3rd day)....wanted to ask for some help...

I am trying to install a Google Map onto my site....and cannot get it to work...here is where I stand:

I found the GMapEZ module, downloaded it, unzipped it, used my FTP to transfer it into my hosting center - drupal/modules...it is there now, I activated the module.

I then went to Google and got me a Google Maps API key....which I then input in the GMapEZ module section...

What do I do now?

What code do I actually use to put into the body of the page in order to get the Google Map to apprear?

I tried to copy various forms of code from other forum discussions, but none of them have worked...definitely need some help here.

(dont know php at all...btw)

Whatever you can do to help would be much appreciated.

Andrei

Categories: Drupal