home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / FAQ / discus_admin_1357211388 / source / adm-msgs.pl < prev    next >
Text File  |  2009-11-06  |  2KB  |  70 lines

  1. # FILE: adm-msgs.pl
  2. # DESCRIPTION: Administrator's Messages (announcement, about, title, main)
  3. #-------------------------------------------------------------------------------
  4. # DISCUS COPYRIGHT NOTICE
  5. #
  6. # Discus is copyright (c) 2002 by DiscusWare, LLC, all rights reserved.
  7. # The use of Discus is governed by the Discus License Agreement which is
  8. # available from the Discus WWW site at:
  9. #    http://www.discusware.com/discus/license
  10. #
  11. # Pursuant to the Discus License Agreement, this copyright notice may not be
  12. # removed or altered in any way.
  13. #-------------------------------------------------------------------------------
  14.  
  15. use strict;
  16. use vars qw($GLOBAL_OPTIONS $DCONF $PARAMS);
  17.  
  18. ###
  19. ### preview_admin_message
  20. ###
  21. ### Preview an administrative message (announcement / about)
  22. ###
  23.  
  24. sub preview_admin_message {
  25.     my ($input, $message, $location, $FORMref) = @_;
  26.     my $subst = {};
  27.     $subst->{'general'}->{'location'} = $location;
  28.     $subst->{'general'}->{'message_text'} = $message;
  29.     if ($FORMref->{HTTP_REFERER} =~ m|(\d+)/(\d+)|) {
  30.         $subst->{'general'}->{topic} = $1;
  31.         $subst->{'general'}->{page} = $2;
  32.     }
  33.     $subst->{'FORMref'} = $FORMref;
  34.     $input =~ s/&/&/g;
  35.     $input =~ s/</</g;
  36.     $input =~ s/>/>/g;
  37.     $input =~ s/"/"/g;
  38.     $subst->{'general'}->{'source'} = $input;
  39.     $subst->{'general'}->{'cancel'} = "$PARAMS->{cgiurl}?action=pm-page_editor&HTTP_REFERER=$FORMref->{HTTP_REFERER}&username=$FORMref->{username}&menu=1" if $location == 0;
  40.     screen_out("adminmsg", $subst);
  41. }
  42.  
  43. ###
  44. ### set_announce_message
  45. ###
  46. ### Save an announcement message
  47. ###
  48.  
  49. sub set_announce_message {
  50.     my ($input_arg) = @_;
  51.     my $hashref = GetPage($input_arg->{topic}, $input_arg->{page}, { lock => 1} );
  52.     $hashref->{'pginfo'}->{'announcement'} = $input_arg->{message};
  53.     return SetPage($hashref, { unlock => 1 });
  54. }
  55.  
  56. ###
  57. ### set_about_message
  58. ###
  59. ### Save an about message
  60. ###
  61.  
  62. sub set_about_message {
  63.     my ($input_arg) = @_;
  64.     my $hashref = GetPage($input_arg->{topic}, $input_arg->{page}, { lock => 1} );
  65.     $hashref->{'pginfo'}->{'about'} = $input_arg->{message};
  66.     return SetPage($hashref, { unlock => 1 });
  67. }
  68.  
  69. 1;
  70.