This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Userpoints->PayPal->Privelige

The following text will be divided into two sections; the first one stats, and the second one is the problem.
Stats:
I am using Drupal 4.6.5.
I have PHP5.
I am trying to use the userpoints module
Problem:
I want to convert userpoints (once there are enough) to money that can be used in my Drupal store (with the ecommerce module) to buy certain things. How can I do that without actually giving the person money?

Single sign-on module

Drupal version used: 4.65.
Web server: apache2.

I'm using the single sign-on module with a master site built by me, and having a problem to log in through the same slave more then once. The problem does'nt appear while deleting the slave's site cookie and using a different session id each time.
I know that the problem is that the same slave cannot get into the first if statement of the nested if:
" if (empty($_SESSION['singlesignon_prior_sid']) || $_SESSION['singlesignon_prior_sid'] != session_id()) { ".

Inserting content from one Drupal site into another

I'm working on a project where the client wants to incorporate content from one Drupal site into another. This client has multiple weblogs (each serving a different industry) and one main company site. Each are Drupal sites. On the main site, they have a section for all of their Webinars. They want to be able to categorize each of these webinars by industry. Then on each industry weblog, they want to be able show the webinars from the main site.

Example:

-Main site
-- Webinars
--- Widget industry webinars
--- Sprocket industry webinars

Filemanager Demo Site?

Anybody knows of a drupal web site that has filemanager module working properly? I have installed it together with the attachment module and enabled them but can't see the functionality of it. I was able to successfully upload (attach) a file to my post but how can I specify the permissions/sections, like public and private?

Adding an image upload field to a custom module

This is a 4.7 friendly version of the image upload method here: http://drupal.org/node/30944. 4.7 enables much simpler code, making image.module do most of the work.

My task was to add an image upload field to a custom 'news' node - a variation on the standard story node. The function names here use those from my module (news), but these will of course need to be changed to your module references (i.e. mymodule_insert() or whatever).

STEP 1: Add the file upload field to the node's form
Insert the following line into hook_form()

$form['image'] = array('#type' => 'file', '#title' => t('Image'), '#description' => t('Click "Browse..." to select an image to upload.'));

STEP 2: Handle the submitted form's new image field using the image.module.
Create or edit hook_update() and hook_insert(). These use functions from image.module to upload the image and create the 'preview' and 'thumbnail' versions, then associate the image files with this node.

function news_update(&$node) {
  if(function_exists('image_prepare') && function_exists('image_update')){
    image_prepare($node, 'image');
    image_update($node);
  }
}
function news_insert(&$node) {
  if(function_exists('image_prepare') && function_exists('image_insert')){
    image_prepare($node, 'image');
    image_insert($node);
  }
}

STEP 3: Load the node's associated image data into $node

Passing more than one variable using link

How do I pass more than one variable in a link. Here is what I have:

    $rows[] = array(t($points->name),
              t($points->tot_points),
              t($points->tot_games),
              t($points->avg_points),
              l(t(details), "poker/details_page/".$points->player_id)
);

The l line works and passes the variable $points->player_id to the function, but I can't figure out how to pass a second variable. Can someone tell me how?

Thanks in advance.

Norm

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions