Slashblog
[ class tree: Slashblog ] [ index: Slashblog ] [ all elements ]

Source for file publish.php

Documentation is available at publish.php

  1. <?php
  2.     //header('location: ../index.php?show=admin-write&mode=published');
  3.     require '../config.php';
  4.     
  5.     $blog new Blog();
  6.     $post new Post();
  7.     
  8.     $post->SetAuthor("admin");
  9.     $post->SetDate();
  10.  
  11.  
  12.     if(isset($_POST['title']))
  13.         $post->SetTitle($_POST['title']);
  14.     else
  15.         $post->SetTitle("Untitled");
  16.  
  17.     if(isset($_POST['content']))
  18.     {
  19.         if(strcmp($blog->GetSetting("HTML IN CONTENT")'YES'== 0// HTML in content is activated. 
  20.             $post->SetContent($_POST['content']);
  21.         else    
  22.         {
  23.             // The following two lines manipulate any HTML tags in the content, so that it doesn't mess with our XML. May change to use regular expressions.
  24.             $content str_replace('<''['$_POST['content']);
  25.             $content str_replace('>'']'$content);
  26.             $post->SetContent(str_replace(PHP_EOL"<br />"$content))// If HTML in content is not activated, we replace all endlines with <br /> tags
  27.         }
  28.     }
  29.     else
  30.     {
  31.         $post->SetContent("");
  32.     }
  33.  
  34.     if(isset($_POST['tags']))
  35.         $post->SetTags($_POST['tags']);
  36.     else
  37.         $post->SetTags("");
  38.  
  39.     $blog->PublishPost($post);
  40.  
  41.     exit();
  42. ?>

Documentation generated on Mon, 26 May 2008 19:59:43 +0100 by phpDocumentor 1.4.0