Skip to main content
added 615 characters in body; edited tags
Source Link
dorien
  • 141
  • 8

I have a (non drupal bound) table, that I need to display within my site.

It has information about "runs":

userID (drupal) - runID - name - distance - ... etc

I want to go to site/run/runID and display the data of that particular run.

I don't know if there is an easy way of doing it without having to create a custom module for it? I basically just need to $get the variables and display them from the database. My first concern is calling my php code when the file is loaded.

And if I need to create a module for it. How would I go about it?

Or perhaps I can use panels to put my custom code on a page and get the url variables? Or some other module I am not thinking about...

--Update

To get started I created this little module. Now just reading the url parameter runID that is behind it...

function epicrun_menu(){
 $items['epicrun'] = array(
 'page callback' => 'epicrun_my_page',
 'title' => 'Callback',
   'type' => MENU_CALLBACK,
 'access arguments' => array('access content'),
 );
 return $items;
}

* this code (noted in the callback above) creates the
 * contents of the "epicrun" page */
 
function epicrun_my_page(){
 return "<p>This is my epicrun demo page.</p>";
}

I have a (non drupal bound) table, that I need to display within my site.

It has information about "runs":

userID (drupal) - runID - name - distance - ... etc

I want to go to site/run/runID and display the data of that particular run.

I don't know if there is an easy way of doing it without having to create a custom module for it? I basically just need to $get the variables and display them from the database. My first concern is calling my php code when the file is loaded.

And if I need to create a module for it. How would I go about it?

Or perhaps I can use panels to put my custom code on a page and get the url variables? Or some other module I am not thinking about...

I have a (non drupal bound) table, that I need to display within my site.

It has information about "runs":

userID (drupal) - runID - name - distance - ... etc

I want to go to site/run/runID and display the data of that particular run.

I don't know if there is an easy way of doing it without having to create a custom module for it? I basically just need to $get the variables and display them from the database. My first concern is calling my php code when the file is loaded.

And if I need to create a module for it. How would I go about it?

Or perhaps I can use panels to put my custom code on a page and get the url variables? Or some other module I am not thinking about...

--Update

To get started I created this little module. Now just reading the url parameter runID that is behind it...

function epicrun_menu(){
 $items['epicrun'] = array(
 'page callback' => 'epicrun_my_page',
 'title' => 'Callback',
   'type' => MENU_CALLBACK,
 'access arguments' => array('access content'),
 );
 return $items;
}

* this code (noted in the callback above) creates the
 * contents of the "epicrun" page */
 
function epicrun_my_page(){
 return "<p>This is my epicrun demo page.</p>";
}
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
dorien
  • 141
  • 8

Taking over a url and getting variables from url

I have a (non drupal bound) table, that I need to display within my site.

It has information about "runs":

userID (drupal) - runID - name - distance - ... etc

I want to go to site/run/runID and display the data of that particular run.

I don't know if there is an easy way of doing it without having to create a custom module for it? I basically just need to $get the variables and display them from the database. My first concern is calling my php code when the file is loaded.

And if I need to create a module for it. How would I go about it?

Or perhaps I can use panels to put my custom code on a page and get the url variables? Or some other module I am not thinking about...