You need to Register for free and Login to post a message in the forum.

Forum

Find and Replace Procedure for Html Module
Last Post 2011-07-26 07:50 AM by nirma shah. 7 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Lee SykesUser is Offline
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945
Avatar

--
2007-05-24 08: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
Rick MontanaUser is Offline
Nuker
Nuker
Posts:12

--
2009-12-16 03:03 AM  
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 SykesUser is Offline
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945
Avatar

--
2009-12-17 08: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
pwilUser is Offline
Nuker
Nuker
Posts:16

--
2010-01-21 08: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 CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9008
Avatar

--
2010-01-21 09: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, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
pwilUser is Offline
Nuker
Nuker
Posts:16

--
2010-01-21 11: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="http://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.

TrevorCUser is Offline
Nuke Newbie
Nuke Newbie
Posts:2

--
2010-10-13 10: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 shahUser is Offline
Nuke Newbie
Nuke Newbie
Posts:1

--
2011-07-26 07: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
You are not authorized to post a reply.

Active Forums 4.3

Latest Forum Posts

RE: iPhone website logo in DNN root directory by JohnnieD
I'm supposed to add this link to make my custom logo show up on iPhones. Where in DNN would I a
iPhone website logo in DNN root directory by JohnnieD
I'm trying to put an iPhone logo that I made into my site so when someone saves the website on their
RE: Fixed size container by Joseph Craig
Use an HTML module and style the container to have a fixed height and width. Set the overflow attr
Fixed size container by Aggiedan97
I am looking for advice or an actual container that has a fixed height (and width). An HTML module w
RE: DNN 6.1 app_offline.htm by Joseph Craig
If the site "works" in Chrome, Firefox and Safari, but not in IE8 look to IE8 as the problem. It is
RE: DNN site automatically redirects to a different domain name. by Joseph Craig
Make a copy what is in the portalalias table and then remove all but the localhost entry. Verify th
DNN 6.1 app_offline.htm by Dave Hassall
Hi As recommended I have successfully been using the app_offline.htm whilst performing upgrades t
RE: DNN site automatically redirects to a different domain name. by imran shaikh
Hi i have done same as mention in this post my dnn folder name is Trademaxomanupg with
Enforce Terms Tutorial Update by Vistalogix Corporation
I tried configuring my DNN 6.1.2 install to have a required "accept terms" checkbox as described in
RE: Best Practices for Modifying a Custom Module by Joseph Craig
Start up the development website, then install the module using the package that you have. Then, yo
Best Practices for Modifying a Custom Module by schilders
Good Morning, I'm needing to modify a custom built module created by another developer targeted f
RE: Admin menu problem by alireza arabiyan
hi in localhost i have http://localhost/senf/خانه.aspx and http://localhost/senf/Admi
RE: Admin menu problem by Joseph Craig
Yes, that is what you should have done. What is the URL for your home page? What is the URL for
RE: Admin menu problem by alireza arabiyan
hi first in localhost i add my domain.com as portal alias. then copy all files to host , restore my
RE: Admin menu problem by Joseph Craig
How did you move it? Have you added an entry in the portalalias table for the site's domain name?
RE: Re: SQL SERVER 2008 R2 Remote connection by Joseph Craig
Set up a user with dbo privileges and set the connection string for that user, rather than using Win
Re: SQL SERVER 2008 R2 Remote connection by Prakasam Srinivasan
I have successfully configured MSSQL Server 2008 r2 remote connection. I am using windows 7 and it h
Admin menu problem by alireza arabiyan
hi i installed dnn 6 on localhost and move it in my host, all link's , pages and modules are ok,
RE: dnn 4.4 upgrade issue by imran shaikh
Thanks you all it is done by renaming release.config to web.config procedure
RE: dnn 4.4 upgrade issue by imran shaikh
Thanks you all it is done by renaming release.config to web.config
You are not logged in.
You must log in to access all 
650+ videos, tutorials, podcasts, and more.
RSS Feeds