Get address of previous page to include in sitenote

mblazke - July 20, 2007 - 14:16
Project:Site notes
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,
fiddling with excelent module SiteNotes I've found solution for my needs - and I'd like to offer such idea to others...

As a site-admin with two co-admins (acting as voluntary censors too :-D ) we need simple tool to write down notes when browsing our Drupal 5.1 site. That is what SiteNotes was developed for, isn't it? ;-)
We even developed workflow & views based on SN content for us... Thanks for the module again!

One thing was clumsy when creating content inspired SiteNotes (e.g. "Let the author know that his page XY has some outdated info" or "Let co-admin search drupal.org to get help with feature used on XX node ") - I had to notice the content (page/story/view etc.) URL before I clicked to Add_new_sn.

In sitenotes.module (just after line 65)

case 'node/add/sitenotes':
      $output = t('<h3>Remember: you should insert <b>&lt;!--Break--&gt;</b> after the text you want to show in the teaser.</h3>');

I add simple extension:
$mb_hreferer = $_SERVER['HTTP_REFERER'];
$mb_hhost = $_SERVER['HTTP_HOST']."/";
$mb_cleanurl = eregi_replace("^.*".$mb_hhost,"",$mb_hreferer);
$output.="REFERER : <button onclick='javascript:add_mb_cleanurl(\"".$mb_cleanurl."\");'>".$mb_cleanurl."</button>\n";
      $output.="<pre>".$mb_cleanurl."</pre>\n";
      $mb_javascript = "<script language='javascript'>function add_mb_cleanurl(clean_link)
{ objEditBody = document.getElementById('edit-body');
objEditBody.innerHTML = objEditBody.innerHTML + '&lt;a href=\"' + clean_link + '\"&gt;' + clean_link + '&lt;/a&gt;';
}</script>";
$output.=$mb_javascript;

just before genuine return $output; line.
Wow! Now I have clickable button to add clean url link of previous visited page in the SN body text, if needed.

Bad news - this simple idea is not compatible with FCKeditor now, that's why there is the text of url printed to manually copy&paste...
As this is for me sufficient, I do not plan to tune up this idea to finish & possible patch SN - maybe SN author gets inspired and will think about similar SN feature in future.

Have a nice day,
Michal

#1

NancyDru - July 21, 2007 - 01:42

I'm open to discussion, but I'm not sure how many people would want this.

#2

NancyDru - July 23, 2007 - 03:28
Title:SiteNotes usage idea from a lazy admin» Get address of previous page to include in sitenote
Status:needs review» active

#3

NancyDru - July 30, 2007 - 00:24
Status:active» postponed (maintainer needs more info)

#4

NancyDru - September 4, 2007 - 22:09
Status:postponed (maintainer needs more info)» closed

closing for lack of activity

 
 

Drupal is a registered trademark of Dries Buytaert.