Find and Replace Procedure for Html Module
Last Post 07/26/2011 1:50 AM by nirma shah. 7 Replies.
Author Messages
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
05/24/2007 2:45 AM  
This is a tip from bi4ce. It allows you to correct URL errors in the text / HTML module. - For instance when you are moving a localhost installation to a live site more often than not the URLs are not correct, so using this procedure from bi4ce allows you to search for incorrect URLs and replace them with the correct URLs.

It also works for any text you wish to search and replace within the text HTML module:
http://www.bi4ce.com/tabid/106/foru...fault.aspx
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
Fred
Nuker
Nuker
Posts:13


--
12/15/2009 9:03 PM  
Has anyone had luck using this on 5.1... It looks like they changed the field name, so I modified the script to use the field name 'content' instead. when i run the query, it generates several messages like these. I also tried the latest version of the F3 module from engage software, but that bombs out, too, because of old field names.

Msg 512, Level 16, State 1, Procedure Replace_DesktopHtml, Line 71
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/17/2009 2:40 AM  
Hello,

I just tried it. The problem appears because the text / html module now has content versioning.

It will work on modules that just have one version of the text, but when it reaches the point where there is 2 or more entries for module id, ie. several versions of text in one text / html module, it causes an error.

I don't have enough SQL knowledge to know how to change the procedure, but hopefully Kevin will create a new procedure in the future.

Thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
pwil
Nuker
Nuker
Posts:16


--
01/21/2010 2:48 PM  
The bi4ce site is down. Can someone paste the text of that stored procedure here? I'll take a look at it and see what needs to be done to handle versioning.
Joseph Craig
DNN MVP
Posts:11667


--
01/21/2010 3:03 PM  
Bi4ce became R2Integrated a few years ago.

I have a modified version of the script, but I recommend that you use Engage Software's F3 module instead.  It is free, and it was just updated so it should be compatible with DotNetNuke 5 (though I haven't personally tested it).  It has nice search and replace features and a nice UI.  You install it as a module, place it on a page that is accessible to administrators, and that's it.

Joe Craig, Patapsco Research Group
Complete DNN Support
pwil
Nuker
Nuker
Posts:16


--
01/21/2010 5:37 PM  
Joe, thanks much, F3 works well on my DNN 05.02.00 (275) site.

For those who need more info, the need I had was to update all the image URLs in my HTML/text modules to a new path.  This is because my production environment has a slightly different path than my local dev environment.

Production image path: /Portals/0/...
Dev image page: /powerdnncom/portals/0/...

So, using F3, this is how I updated all the image links on my site that were in HTML/text modules:

  • Download F3 from engagesoftware.com (registration required, but free)
  • Install just like any other extension (login as host, click Extensions, run the Install Extension Wizard).
  • Create a new blank page called Admin Tools, set privileges to Admin Only, and add the Engage: F3 module to the page.
  • In the F3 Search String box, put in "src="/Portals/0" (without the quotes).  Note that the HTML/text module stores its information encoded, which is why you see the " in the string instead of an actual quote symbol.  Your search will not work if you look for src="https://www.dnncreative.com/Portals/0.
  • It will list out all the instances where it found that string.  For me this was 210 instances on a fairly small website - I was surprised.
  • In my dev environment, the new path needs to have /powerdnncom in front of it (gee, I wonder if that gives away who my excellent hoster is?), so my replace string was this: "src="/powerdnncom/Portals/0"
Voila!  Done in the blink of an eye!  Be VERY careful with this, and until you get comfortable that a certain search and replace does what you want, be sure to double-check everything that meets the search criteria to make sure that your criteria are tight enough.

That's all I got, over and out.  Thanks for the pointer to F3 Joe.

TrevorC
Nuke Newbie
Nuke Newbie
Posts:2


--
10/13/2010 4:06 PM  

I have sucessfully used the sql FIND & REPLACE procedure from bi4ce on our website www.ormerodrutter.co.uk This site was originally set up on temporary hosting with our provider.

The dnn site pages have editable html sections which respond to SQL find and replace but I do not appear to have access to the full source to remove the unwanted section from URL's.

The URL from the live host includes numerous references to the temporary host. e.g
http://ormerodrutter.aries. an...rnet.co.uk I just need to be able to remove all references to '.aries. aninternet' from all pages.


Any one know how i can achieve this.


Source from home page attached. A bit messy and I know i need to strip out the font code and use css.






<!--**********************************************************************************-->
<!-- DotNetNuke? - http://www.dotnetnuke.com -->
<!-- Copyright (c) 2002-2007 -->
<!-- by DotNetNuke Corporation -->
<!--**********************************************************************************-->
< le>
Ormerod Rutter Chartered Accountants - Accountants in Droitwich, Worcestershire



<form> name="Form" method="post" action="/Default.aspx" id="Form" enctype="multipart/form-data" style="?height: 100%;">






[script removed]
nirma shah
Nuke Newbie
Nuke Newbie
Posts:1


--
07/26/2011 1:50 AM  
thank you brother to share such a great and help full information, i really like it and i find it very help full for my web site http://www.webdevelopmentseo.com hope that you will keep it up and will share more information with us

regard
nirma shah


---