0

Background:
I have a Drupal site with around 150 users. Each of those users has a spreadsheet that they send to me weekly.
I've uploaded all of the spreadsheets to an Editgrid account and I've created a custom drupal block to display there Live spreadsheet and edit it so removing the need to e-mail the sheet each week.

At the moment i am using the following link embedded into the block, the section that is highlighted (name of the spreadsheet) i would like to be dynamic depending on the user viewing it (so i dont have to make a different block for each user)

<iframe title="An EditGrid spreadsheet created by gdhub/admin" longdesc="http://www.editgrid.com/gdhub/admin/NE01" name="gridContainer" frameborder="0" src="http://www.editgrid.com/publish/grid/gdhub/admin/NE01?show=&version=2&frame_style=border%3A9px%20solid%20%23666%3Bheight%3A700px%3Bwidth%3A100%25" style="border:1px solid #666;height:700px;width:100%">&nbsp;</iframe>

Please bear with me as i have very little knowledge of PHP, but determined to learn

Questions:
Could i replace NE01 with a print $variable and use the users Drupal $user->uid to select the correct $variable based on an array?

hopefully i've made sense, i may be heading in the wrong direction but would apreciate any pointers..

many thanks

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by ecdmonkey
0

I've just found a soloution, might be a workaround but it works

I added a new colomn into the database table user called reports and entered the spreadsheet name for each user into it.

changed my block code to

<?php
global $user;
?>

<iframe title="An EditGrid spreadsheet created by gdhub/admin" longdesc="http://www.editgrid.com/gdhub/admin/[B]<?php print $user->reports ?>[/B]" name="gridContainer" frameborder="0" src="http://www.editgrid.com/publish/grid/gdhub/admin/[B]<?php print $user->reports ?>[/B]?show=&version=2&frame_style=border%3A9px%20solid%20%23666%3Bheight%3A700px%3Bwidth%3A100%25" style="border:1px solid #666;height:700px;width:100%">&nbsp;</iframe>

and hey presto each user can now see their own sheet

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.