Problem With CCK Computed Field's Computed Code - Integer Range Comparison

Hello,

I am trying to make the computed field in my CCK settings fill in a hidden field's value, using the following code:

$price=trim($node->field_prop_price[0]['value']);

if ($price <= 250000) {
   $node_field[0]['value'] = 'from 100,000 to 250,000';
   }
if ($price > '250000' && $node->field_prop_price[0]['value'] <= 500000) {
   $node_field[0]['value'] = 'from 250,000 to 500,000';
   }
if ($price > '500000' && $node->field_prop_price[0]['value'] <= 750000) {
   $node_field[0]['value'] = 'from 500,000 to 750,000';
   }
if ($price > '750000' && $node->field_prop_price[0]['value'] <= 1000000) {
   $node_field[0]['value'] = 'from 750,000 to 1,000,000';
   }
if ($price > '1000000' && $node->field_prop_price[0]['value'] <= 1500000) {
   $node_field[0]['value'] = 'from 1,000,000 to 1,500,000';
   }
if ($price > '1500000' && $node->field_prop_price[0]['value'] <= 2000000) {
   $node_field[0]['value'] = 'from 1,500,000 to 2,000,000';
   }
if ($price > '2000000' && $node->field_prop_price[0]['value'] <= 2500000) {
   $node_field[0]['value'] = 'from 2,000,000 to 2,500,000';
   }
if ($price > '2500000' && $node->field_prop_price[0]['value'] <= 5000000) {
   $node_field[0]['value'] = 'from 2,500,000 to 5,000,000';
   }
else {$node_field[0]['value'] = 'from 5,000,000';}

Can't stay logged in after upgrade to PHP5

I have a couple installations of Drupal 4.7 on a server that just upgraded PHP to 5.2.4 from PHP 4. After some memory issues were resolved so the sites would even appear, now I cannot stay logged in. If I login as admin and try to edit something I get Access denied. I assume there must be some session setting either in Drupal or in the php.ini file.

How to create a forum "homepage"

I'm trying to create a online discussion forum in my website. So far, I've enabled the forum, comment, and taxonomy modules. I've successfully created a sample threaded discussion, where online readers are responding anonymously or are logging in to post their replies.

default url path for editors

the drupal editors automatically convert a full site url, e.g., http://www.mysite.com/???, to /???. this becomes a problem when i send out newsletters, e.g., using simplenews, because the hyperlinks in the newsletter become invalid links. except just manually correct each links in the html editor mode, is there a way to let drupal use the full url to begin with?
thanks,
eric

Help Troubleshooting => Reset Password Module => FX.php + FileMaker

I was wondering if someone can help me out on this one ...

i have a function that looks up the record id of a record in filemaker and makes changes to that record based on the returned record id ... i am using fx.php along with FileMaker Pro 8... the edit function basically changes the password stored on the database .. however, whenever this function is executed .. the password doesn't really change and the module then takes me to a page that is intended to be shown after the password is successfully reset .. any pointers on where i am erring ?

code:

<?php

function reset_password_submit($form_id, $form_values) {

$arrErrors = array();
$newPass = $form_values['password_new'];
$currentPass = $form_values['password_current'];

$memberrecid = reset_password_connect_to_fm("web");
$memberrecid->AddDBParam('people::userid', $user->name,'eq');
$memberrecid->AddDBParam('people::drupal_uid', $user->uid,'eq');
$memberrecidresult = $memberrecid->FMFind();
$recid = array_shift(explode('.',array_shift(array_keys($memberrecidresult['data'])))); // retreieving record id

$resetPassword = reset_password_connect_to_fm("web");
$resetPassword->AddDBParam('-recid',$recid);
$resetPassword->AddDBParam('people::password',$newPass);
$resetPassword->AddDBParam('ipeople::webxstatus','pending');

Is it possible to paginate a themed table?

Is it possible to paginate a themed table? for example :

say I have my php as:


//$trow has over 100 rows but I want say 30 to a page with header intact
print theme('table', $header, $trow, $ta);

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x