function search_class($site)
 {
     $this->site = $site;
     $this->engine = $this->site->engine;
     if (!empty($site->get[3])) {
         $site->content = engine::error();
         return;
     }
     $urls = array();
     $site->title = urldecode($site->get[1]) . ' - ' . $site->title;
     $site->content .= $GLOBALS["Lang"]["Search results by request"] . '<br/><br/><h1> "' . urldecode($site->get[1]) . '"</h1><br/><br/>';
     $query = 'SELECT * FROM `nodes_content` WHERE `text` LIKE "%' . urldecode($site->get[1]) . '%"';
     $res = engine::mysql($query);
     while ($data = mysql_fetch_array($res)) {
         require_once "engine/functions/print_preview.php";
         $site->content .= print_preview($data);
         array_push($urls, "/" . $data["url"]);
     }
 }
示例#2
0
if ($pool->description) {
    ?>
    <div style="margin-bottom: 2em;"><?php 
    echo h($pool->description);
    ?>
</div>
  <?php 
}
?>
  <div style="margin-top: 1em;">
  <ul id="post-list-posts">
    <?php 
foreach ($posts as &$post) {
    ?>
      <?php 
    echo print_preview($post, array('onclick' => "return remove_post_confirm(" . $post->id . ", " . $pool->id . ")", 'user' => User::$current, 'display' => $browse_mode ? 'large' : 'block', 'hide_directlink' => $browse_mode));
    ?>
    <?php 
}
?>
  </ul>
  </div>
</div>
<script type="text/javascript">
  function remove_post_confirm(post_id, pool_id) {
    if (!$("del-mode") || !$("del-mode").checked) {
      return true
    }

    Pool.remove_post(post_id, pool_id)
    return false
示例#3
0
<div class="deleting-post">
<?php 
if (!$post->is_deleted()) {
    ?>
  <br />
  <?php 
    if ($post_parent) {
        ?>
    Votes will be transferred to the following parent post.
    If this is incorrect, reparent this post before deleting it.<br />
  <?php 
        if (CONFIG::can_see_post(User::$current, $post_parent)) {
            ?>
    <ul id="post-list-posts"> <?php 
            echo print_preview($post_parent, array('hide_directlink' => true));
            ?>
 </ul>
  <?php 
        } else {
            ?>
    (parent post hidden due to access restrictions)
  <?php 
        }
        ?>

  <?php 
    } else {
        ?>
    This post has no parent.  If this post has been replaced, reparent this post before deleting, and votes will be transferred.<br />
  <?php 
示例#4
0
<?php

if (Request::$post) {
    ?>
  <?php 
    if (!$errors) {
        ?>
    <?php 
        echo print_preview($post, array('display' => 'large', 'disable_jpeg_direct_links' => true, 'hide_directlink' => true));
        ?>
  <?php 
    } else {
        ?>
    <li style="width:160px;text-align:center">
      There was an error with<br />
      "<em><?php 
        echo substr(Request::$params->post['filename'], 0, 50);
        strlen(Request::$params->post['filename']) > 50 && (print '...');
        ?>
</em>":
      <h6><?php 
        echo $errors;
        ?>
</h6>
      <a class="directlink largeimg" href="#">
        <span class="directlink-info"><img class="directlink-icon directlink-icon-large" src="/images/ddl_large.gif" alt=""></span>
        <span class="directlink-res">Error</span>
      </a>
    </li>
  <?php 
    }
示例#5
0
      <div>
<?php 
if (!$posts) {
    ?>
        <p>Nobody here but us chickens!</p>
<?php 
} else {
    ?>
        <ul id="post-list-posts">
<?php 
    foreach ($posts as $post) {
        ?>
      <?php 
        echo print_preview($post, array('blacklisting' => true));
    }
    ?>
        </ul>

<?php 
    # Make sure this is done early, as lots of other scripts depend on this registration.
    do_content_for("post_cookie_javascripts");
    ?>

        <script type="text/javascript">
        
          Post.register_tags(<?php 
    echo to_json(Tag::batch_get_tag_types_for_posts($posts));
    ?>
)

<?php 
 function content_class($site)
 {
     $this->site = $site;
     $this->engine = $this->site->engine;
     $query = 'SELECT * FROM `nodes_catalog` WHERE `visible` = 1';
     $res = $site->engine->mysql($query);
     if ($site->get[0] != "content") {
         $site->menu .= '<a href="/content">' . $GLOBALS["Lang"]["Content"] . '</a>
         ';
     } else {
         $site->menu .= '<a href="/content"><b>' . $GLOBALS["Lang"]["Content"] . '</b></a>
         ';
     }
     if ($site->get[0] != "content") {
         $link = $site->get[0];
         if (!empty($site->get[1])) {
             $site->content = engine::error();
             return;
         }
     } else {
         if (!empty($site->get[2])) {
             $site->content = engine::error();
             return;
         }
         $link = $site->get[1];
     }
     $flag = 0;
     while ($data = mysql_fetch_array($res)) {
         $flag = 1;
         if ($link == $data["url"]) {
             $site->menu .= '<a href="/' . $data["url"] . '"><b>' . $data["caption"] . '</b></a>
         ';
         } else {
             $site->menu .= '<a href="/' . $data["url"] . '">' . $data["caption"] . '</a>
         ';
         }
     }
     if (!$flag) {
         $site->menu = '';
     }
     if ($site->get[0] != "content" || !empty($site->get[1]) && $site->get[0] == "content") {
         // print catalog
         $query = 'SELECT * FROM `nodes_catalog` WHERE `url` = "' . $link . '"';
         $res = $site->engine->mysql($query);
         $data = mysql_fetch_array($res);
         if (!empty($data)) {
             $site->title = $data["caption"] . ' - ' . $site->title;
             $site->description = strip_tags($data["text"]);
             if (!empty($data["img"])) {
                 $site->img = "/img/data/big/" . $data["img"];
             }
             $query = 'SELECT * FROM `nodes_content` WHERE `cat_id` = "' . $data["id"] . '"';
             $res = $site->engine->mysql($query);
             if (!$data["visible"]) {
                 $site->menu = '';
             }
             $site->content .= '<h1>' . $data["caption"] . '</h1><br/>' . '<br/>';
             $flag = 0;
             //  print articles
             while ($d = mysql_fetch_array($res)) {
                 $flag = 1;
                 require_once "engine/functions/print_preview.php";
                 $site->content .= print_preview($d);
             }
             if ($flag) {
                 $site->content .= '<div style="clear:both;"></div>';
             } else {
                 //  print catalog
                 if (!empty($data["img"])) {
                     $site->content .= '<div id="article">
                         <div style="float:left; margin-right: 10px; margin-left: 10px;">
                             <img src="/img/data/big/' . $data["img"] . '" class="img" />
                         </div>
                         <div class="text">
                             ' . $data["text"] . '
                         </div>
                     </div>';
                 } else {
                     $site->content .= '<div id="article">
                         <div class="text">
                             ' . $data["text"] . '
                         </div>
                     </div>';
                 }
                 $site->content .= '<div style="clear:both;"></div>';
             }
         } else {
             $query = 'SELECT * FROM `nodes_content` WHERE `url` = "' . $link . '"';
             $res = $site->engine->mysql($query);
             $data = mysql_fetch_array($res);
             if (empty($data)) {
                 $query = 'UPDATE `nodes_catch` SET `interval` = "-2" WHERE `url` = "' . $_SERVER["SCRIPT_URI"] . '"';
                 $site->engine->mysql($query);
                 $site->engine->error();
                 exit;
             } else {
                 require_once "engine/functions/print_content.php";
                 $site->title = $data["caption"] . ' - ' . $site->title;
                 $site->description = strip_tags($data["text"]);
                 if (!empty($data["img"])) {
                     $site->img = "/img/data/big/" . $data["img"];
                 }
                 $query = 'SELECT * FROM `nodes_catalog` WHERE `id` = "' . $data["cat_id"] . '"';
                 $r = engine::mysql($query);
                 $d = mysql_fetch_array($r);
                 $site->content .= '<h1>' . $data["caption"] . '</h1><br/>';
                 $site->content .= print_content($data);
                 $site->content .= '
                     <div style="clear:both;"></div>
                     <br/>
                     ';
                 require_once "engine/functions/print_preview.php";
                 $query = 'SELECT * FROM `nodes_content` WHERE `cat_id` = "' . $data["cat_id"] . '" AND `id` <> "' . $data["id"] . '" ORDER BY `date` DESC LIMIT 0, 3';
                 $res = $site->engine->mysql($query);
                 $count = 0;
                 while ($d = mysql_fetch_array($res)) {
                     $count++;
                     $site->content .= print_preview($d);
                 }
                 if ($count < 3) {
                     $query = 'SELECT * FROM `nodes_content` WHERE `cat_id` <> "' . $data["cat_id"] . '" ORDER BY `date` DESC LIMIT 0, 3';
                     $res = $site->engine->mysql($query);
                     while ($d = mysql_fetch_array($res)) {
                         if ($count++ > 3) {
                             break;
                         }
                         $site->content .= print_preview($d);
                     }
                 }
                 $site->content .= '
                     <div style="clear:both;"></div>
                     ';
             }
         }
     } else {
         require_once "engine/functions/print_preview.php";
         $site->title = $GLOBALS["Lang"]["Content"] . ' - ' . $site->title;
         $site->content .= '<h1>' . $GLOBALS["Lang"]["Content"] . '</h1><br/><br/>';
         $query = 'SELECT * FROM `nodes_content` ORDER BY `date` DESC';
         $res = engine::mysql($query);
         $flag = 0;
         while ($data = mysql_fetch_array($res)) {
             $flag = 1;
             $site->content .= print_preview($data);
         }
         if ($flag) {
             $site->content .= '<div style="clear:both;"></div>';
         } else {
             $site->content = '<div style="padding-top: 70px; padding-bottom: 70px;">' . $GLOBALS["Lang"]["No articles found"] . '<div>';
         }
     }
 }