Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <script language="cache" method="OnPreHTTP" arguments="" returntype="%Boolean">
  2.        
  3.         ; Initialize:
  4.         set return = 1
  5.        
  6.         //set return = ##super() // Invoke the overridden superclass method - ONLY IF A DIFFERENT SUPER CLASS THAN %CSP.Page is specified.
  7.         set check("cmsStoryObj") = ##class(dt.cms.schema.CMSStory).%OpenId($get(%request.Data("cid", 1)))
  8.         set check("redirect") = "http://special.registerguard.com" _ ..EscapeURL($get(%request.Data("uri", 1)))
  9.         set check("status") = "301 Moved Permanently"
  10.        
  11.         ; Is the CMSStory an object?
  12.         if ($isobject(check("cmsStoryObj")) <= 0) {
  13.                
  14.                 ; No object found, so redirect to archive:
  15.                 set %response.Redirect = check("redirect")
  16.                 set %response.Status = check("status")
  17.                
  18.         } else {
  19.                
  20.                 ; Is the CMSStory's DBO story an object?
  21.                 if (($isobject(check("cmsStoryObj").getStory()) <= 0)||(check("cmsStoryObj").getStory().storyId = 3268)) {
  22.                        
  23.                         ; No object found, so redirect to archive:
  24.                         set %response.Redirect = check("redirect")
  25.                         set %response.Status = check("status")
  26.                        
  27.                 }
  28.                
  29.         }
  30.        
  31.         quit return // Exit.
  32.        
  33. </script>