Creating an internal link to edit a user's profile in Drupal 6

This is how it's done:

<?php
global $user;
if ($user->uid) {
print "<a href=\"user/$user->uid/edit\">Fill in my directory profile</a>";
}
?>

Just choose PHP Filter from input filters. This can be placed anywhere

Getting where you want to go in Drupal

The following information applies to Drupal 5.x

If you are working with a protected site, using http://drupal.org/project/login_destination module is a good way to create a logic system for routing users.

In my case, I needed people to get to where they were trying to go in the first place when logging in.

For instance, if a user visits example.com/blog, and is prompted to login first, then I want them to arrive at *exactly* example.com/blog after they successfully login.

So, http://drupal.org/project/login_destination provides this functionality.

Taxonomy Section Custom Drupal Code

  1. $taxo_section_string = $taxo_section;
  2. echo "[" . $taxo_section_string . "]";
  3. $taxo_section_tids = taxonomy_get_term_by_name($taxo_section_string);
  4. if (!$taxo_section_tids) {
  5. // add section into this issue
  6. // this will only occur with new section names
  7. $form_values = array('vid' => $taxo_volume_vid, 'name' => $taxo_section_string, 'parent' => array($taxo_issue_tid));
  8. $status = taxonomy_save_term($form_values);
  9. echo "[added" . $taxo_section_string .
Original location: 

none

Install Ruby Gems on Ubuntu Intrepid 8.10

Do this:

$ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
 
$ tar rubygems-1.3.1.tgz
 
$ cd rubygems-1.3.1
 
$ sudo ruby setup.rb  #you can do ruby setup.rb --help to see options
 
$ sudo  sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
 
$ sudo gem -v
1.3.1

Done!

Donation Networks

After some months working privately with agent based Altruism and Cooperation models, I am working towards initiating an experiment with with a small number regional and continental participants in creating a balanced donation and distribution system.

The system is fairly simple:

This method adds nodes to the graph dynamically. BirdEye Code Example

  1. =======================
  2.  
  3. /*
  4. * This method adds nodes to the graph dynamically.
  5. */
  6. private function addNodesToGraph(newNodes:XML):void {
  7. vgraph.newNodesDefaultVisible = true;
  8.  
  9. var nodes:XMLList = newNodes.child("Node");
  10. var edges:XMLList = newNodes.child("Edge");
  11.  
  12. //Keep track of root node.
  13. var root:IVisualNode=vgraph.currentRootVNode;
  14.  
  15. for (var i:Number = 0; i < nodes.l

How to create a site redirect on a sub-directory using .htaccess and PHP

I needed to make the old http://socialsynergyweb.org/oardc domain point to the new home at http://localfoodsystems.org (and include all sub-directory listings under /oardc). Plus, it was desired to place a message letting people know about a timed redirect, and to "update your book marks".

So, here is what I did:

The .htaccess file:

RedirectMatch 301 ^/oardc/.*$ http://socialsynergyweb.org/lfs/index.php

This simply finds everything that is under http://socialsynergyweb.org/oardc and redirects to http://socialsynergyweb.org/lfs/index.php

A discussion with Richard Schulte about creating an open distributed agriculture research network

A Jabber discussion today with Richard Schulte about how to go about creating an open distributed agriculture research network see attached file

Building a capistrano recipe into a rails2 application, to deploy Drupal clone sites (or other cloned web applications)

I needed to build a way to deploy Drupal sites to support a limited hosting application for http://socialmediaclassroom.com project.

I decided to build an application using http://www.capify.org/ (Capistrano). I thought about developing this in http://drupal.org/project/drush. However, time constraints dictated otherwise.

I ended up working on this with partner Paul B. Hartzog. Here is what we did:

A test

Some Python:

# Function defined outside the class
def f1(self, x, y):
    return min(x, x+y)
 
class C:
    f = f1
    def g(self):
        return 'hello world'
    h = g

Some ruby:

# Ruby knows what you
# mean, even if you
# want to do math on
# an entire Array
cities  = %w[ London
              Oslo
              Paris
              Amsterdam
              Berlin ]
visited = %w[Berlin Oslo]
 
puts "I still need " +
     "to visit the " +
     "following cities:",
     cities - visited

Some php:

<?php

Syndicate content (C01 _th3me_)