Get address of previous page to include in sitenote
| Project: | Site notes |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
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><!--Break--></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 + '<a href=\"' + clean_link + '\">' + clean_link + '</a>';
}</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
I'm open to discussion, but I'm not sure how many people would want this.
#2
#3
#4
closing for lack of activity