Skip to content
Snippets Groups Projects
Select Git revision
  • d41c4f23f16e12c05616761486f55481a9b38edf
  • 11.x default protected
  • 11.2.x protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

poll.module

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    blog.module 12.14 KiB
    <?php
    // $Id$
    
    function blog_conf_options() {
     $output .= form_textarea("Explanation or submission guidelines", "blog_help", variable_get("blog_help", ""), 55, 4, "This text will be displayed at the top of the blog submission form.  Useful for helping or instructing your users.");
     $output .= form_select(t("Minimum number of words in a node"), "minimum_blog_size", variable_get("minimum_blog_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words",  50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words",  150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a personal blog entry should consist of.  This can be useful to rule out submissions that do not meet the site's standards, such as short test post."));
    
     return $output;
    
    }
    
    
    function blog_node($field) {
      global $user;
    
      $info["name"] = t("personal blog");
      $info["description"] = t("A blog is your personal diary or journal.  It is made up of individual entries that are time stamped and are typically arranged by the day, as normal a diary. Blogs often contain links to things you've seen, or on which you agree/disagree.  Since a Blog is personal, you and only you have full control on what you publish.  The most interesting blogs, or those blogs that fit the site's topic might get promoted to the front page.");
    
      return $info[$field];
    }
    
    function blog_access($op, $node) {
      global $user;
    
      if ($op == "view") {
        return $node->status;
      }
    
      if ($op == "create") {
        return $user->uid;
      }
    
      if ($op == "update") {
        return ($user->uid == $node->uid);
      }
    
      if ($op == "delete") {
        return ($user->uid == $node->uid);
      }
    
    }
    
    function blog_save($op, $node) {
      global $REQUEST_URI;
    
      if ($op == "approve") {
        return array("promote" => 1);
      }
    
      if ($op == "create") {
        if (user_access("adminster nodes")) {
          return array();
        }
        else {
          return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
        }
      }
    
      if ($op == "decline") {
        return array("promote" => 0);
      }
    
      if ($op == "update") {
        if (strstr($REQUEST_URI, "module.php?mod=node&op=edit")) {
          /*
          ** Updating your own blog entry will demote it (if promoted),
          ** and will queue it in the moderation queue for promotion.
          ** If a node administrator updates his own blog entry through
          ** the blog update mechanism that regular users use, then he
          ** will be treated as a regular user and his blog entry will