Beispiel #1
0
     // Micro sneaker
     echo '<div class="mini-sneaker">';
     // AdSense
     do_banner_story();
     print_story_tabs($tab_option);
     echo '<fieldset>';
     include mnmpath . '/libs/link_sneak.php';
     echo '</fieldset>';
     echo '</div>';
     echo '<script type="text/javascript">$(function(){start_link_sneak()});</script>' . "\n";
     break;
 case 7:
     // Show trackback
     echo '<div class="voters" id="voters">';
     // AdSense
     do_banner_story();
     print_story_tabs($tab_option);
     echo '<a href="' . $link->get_trackback() . '" title="' . _('URI para trackbacks') . '" class="tab-trackback-url"><img src="' . $globals['base_url'] . 'img/common/permalink.gif" alt="' . _('enlace trackback') . '" width="16" height="9"/> ' . _('dirección de trackback') . '</a>' . "\n";
     echo '<fieldset><legend>' . _('lugares que enlazan esta noticia') . '</legend>';
     echo '<ul class="tab-trackback">';
     $trackbacks = $db->get_col("SELECT trackback_id FROM trackbacks WHERE trackback_link_id={$link->id} AND trackback_type='in' and trackback_status = 'ok' ORDER BY trackback_date DESC limit 50");
     if ($trackbacks) {
         require_once mnminclude . 'trackback.php';
         $trackback = new Trackback();
         foreach ($trackbacks as $trackback_id) {
             $trackback->id = $trackback_id;
             $trackback->read();
             echo '<li class="tab-trackback-entry"><a href="' . $trackback->url . '" rel="nofollow">' . $trackback->title . '</a> [' . preg_replace('/https*:\\/\\/([^\\/]+).*/', "\$1", $trackback->url) . ']</li>' . "\n";
         }
     }
     echo '<li class="tab-trackback-technorati"><a href="http://technorati.com/search/' . urlencode($globals['link_permalink']) . '">' . _('Technorati') . '</a></li>' . "\n";
Beispiel #2
0
	function print_summary($type='full', $karma_best_comment = 0, $show_tags = true) {
		global $current_user, $current_user, $globals, $db;

		if(!$this->read) return;
		if($this->is_votable()) {
			$this->voted = $this->vote_exists($current_user->user_id);
			if (!$this->voted) $this->md5 = md5($current_user->user_id.$this->id.$this->randkey.$globals['user_ip']);
		}

		$url = htmlspecialchars($this->url);

		$this->permalink = $this->get_permalink();

		echo '<div class="news-summary">';
		echo '<div class="news-body">';
		if ($type != 'preview' && $this->title && $this->content 
				&& ($this->votes > 0 || $current_user->user_id == $this->author) ) {
			$this->print_shake_box();
		}

		$this->print_warn();

		if ($this->status != 'published') $nofollow = ' rel="nofollow"';
		else $nofollow = '';

		if($globals['ads']) echo "<!-- google_ad_section_start -->\n";

		echo '<h1>';
		echo '<a href="'.$url.'"'.$nofollow.'>'. $this->title. '</a>';

		// Content type (for video and images)
		if ($this->content_type == 'image') {
			echo '&nbsp;<img src="'.$globals['base_static'].'img/common/is-photo01.png" class="media-icon" width="18" height="15" alt="'._('imagen').'" title="'._('imagen').'" />';
		} elseif ($this->content_type == 'video') {
			echo '&nbsp;<img src="'.$globals['base_static'].'img/common/is-video01.png" class="media-icon" width="18" height="15" alt="'._('vídeo').'" title="'._('vídeo').'" />';
		}
		echo '</h1> ';

		echo '<div class="news-submitted">';
		if ($type != 'short') {
			echo '<a href="'.get_user_uri($this->username).'"><img src="'.get_avatar_url($this->author, $this->avatar, 25).'" width="25" height="25" alt="" onmouseover="return tooltip.ajax_delayed(event, \'get_user_info.php\', '.$this->author.');" onmouseout="tooltip.clear(event);" /></a>';
		}
		echo '<strong>'.htmlentities(preg_replace('/^https*:\/\//', '', txt_shorter($this->url))).'</strong>'."&nbsp;<br />\n";

		// Allow to invert user in japanese translations
		printf (_('por %s'), ' <a href="'.get_user_uri($this->username, 'history').'">'.$this->username.'</a> ');

		// Print dates
		if ($globals['now'] - $this->date > 604800 || empty($_SERVER['HTTP_USER_AGENT'])) { // 7 days or user agent is empty
			echo _('el').get_date_time($this->sent_date);
			if($this->status == 'published')
				echo ', '  ._('publicado el').get_date_time($this->date);
		} else {
			echo _('hace').txt_time_diff($this->sent_date);
			if($this->status == 'published')
				echo ', '  ._('publicado hace').txt_time_diff($this->date);
		}
		echo "</div>\n";

		if($type=='full' || $type=='preview') {
			if (($src = $this->has_thumb())) {
				echo "<img src='$src' width='$this->thumb_x' height='$this->thumb_y' alt='' class='thumbnail'/>";
			}

			echo '<p>';
			echo text_to_html($this->content, 'links');
			if ($globals['link'] && $type != 'preview' ) {
				if ($this->is_editable()) {
					echo '&nbsp;&nbsp;<a href="'.$globals['base_url'].'editlink.php?id='.$this->id.'&amp;user='******'" title="'._('editar noticia').' #'.$this->id.'"><img class="mini-icon-text" src="'.$globals['base_static'].'img/common/edit-misc01.png" alt="edit" width="18" height="12"/></a>';
				}
				if ($this->geo && $this->is_map_editable()) {
					echo '&nbsp;&nbsp;<a href="#" onclick="$(\'#geoedit\').load(\''.$globals['base_url']."geo/get_form.php?id=$this->id&amp;type=link&amp;icon=$this->status".'\'); return false;"><img class="mini-icon-text" src="'.$globals['base_static'].'img/common/edit-geo01.png" alt="edit" title="'._('editar geolocalización').'"/></a>';
				}
			}
			echo '</p>';
		}


    if ($this->start_date && (!$this->end_date || ($this->start_date==$this->end_date))) {
      echo '<div>';
      echo _('Data:').' <strong>'.Link::format_date($this->start_date).'</strong>';
      echo '</div>';
    } elseif ($this->start_date && $this->end_date) {
      echo '<div>';
      echo _('Do').' <strong>'.Link::format_date($this->start_date).'</strong> '._('ata o').' <strong>'.Link::format_date($this->end_date).'</strong>';
      echo '</div>';
    }


		// Print a summary of the best comment
		// with a least one vote and younger than a day
		if ($karma_best_comment > 0 && $this->comments > 0 && $this->comments < 50 && $globals['now'] - $this->date < 86400 &&
			($best_comment = $db->get_row("select SQL_CACHE comment_id, comment_order, substr(comment_content, 1, 225) as content from comments where comment_link_id = $this->id and comment_karma > $karma_best_comment and comment_votes > 0 order by comment_karma desc limit 1"))) {
			echo '<div class="box" style="font-size: 80%; border: 1px solid; border-color: #dadada; background: #fafafa; margin: 7px 50px 7px 25px; padding: 4px; overflow:hidden">';
			$link = $this->permalink.'/000'.$best_comment->comment_order;
			echo '<a onmouseout="tooltip.clear(event);"  onclick="tooltip.clear(this);" onmouseover="return tooltip.ajax_delayed(event, \'get_comment_tooltip.php\', \''.$best_comment->comment_id.'\', 10000);" href="'.$link.'"><strong>'.$best_comment->comment_order.'</strong></a>';
			echo ':&nbsp;'.text_to_summary($best_comment->content, 200).'</div>';
		}

		if ($this->do_inline_friend_votes) $this->inline_friend_votes();

		echo '<div class="news-details main">';
		if($this->comments > 0) {
			$comments_mess = $this->comments . ' ' . _('comentarios');
		} else  {
			$comments_mess = _('sin comentarios');
		}
		echo '<span class="comments-counter">&nbsp;<a href="'.$this->get_relative_permalink().'">'.$comments_mess. '</a></span>';

		// If the user is authenticated, show favorite box
		if ($current_user->user_id > 0)  {
			echo '<span class="tool"><a id="fav-'.$this->id.'" href="javascript:get_votes(\'get_favorite.php\',\''.$current_user->user_id.'\',\'fav-'.$this->id.'\',0,\''.$this->id.'\')">'.favorite_teaser($current_user->user_id, $this).'</a></span>';
		}

		// Print meta and category
		echo ' <span class="tool">'._('en').': ';
		echo '<a href="'.$globals['base_url'].'?meta='.$this->meta_uri.'" title="'._('meta').'">'.$this->meta_name.'</a>, ';
		echo '<a href="'.$globals['base_url'].'?meta='.$this->meta_uri.'&amp;category='.$this->category.'" title="'._('categoría').'">'.$this->category_name.'</a>';
		echo '</span>';
		echo ' <span class="tool">karma: <span id="a-karma-'.$this->id.'">'.intval($this->karma).'</span></span>';

		if(!$this->voted &&
				$this->votes_enabled &&
				$this->negatives_allowed($globals['link_id'] > 0) && 
				$type != 'preview' /*&& $this->author != $current_user->user_id*/) {
				$this->print_problem_form();
		}

		echo '</div>'."\n";
		// End news details
		if($globals['ads']) echo "<!-- google_ad_section_end -->\n";

		// Displayed only in a story page
		// and tags in sent/voted listing
		if ($globals['link'] || $type == 'short') {
			if ($show_tags && !empty($this->tags)) {
				echo '<div class="news-details">';
				echo '<strong>'._('etiquetas').'</strong>:';
				$tags_array = explode(",", $this->tags);
				$tags_counter = 0;
				foreach ($tags_array as $tag_item) {
					$tag_item=trim($tag_item);
					$tag_url = urlencode($tag_item);
					if ($tags_counter > 0) echo ',';
					if ($globals['base_search_url']) {
						echo ' <a href="'.$globals['base_url'].$globals['base_search_url'].'tag:';
					} else {
						echo ' <a href="'.$globals['base_url'].'search.php?p=tag&amp;q=';
					}
					echo $tag_url.'">'.$tag_item.'</a>';
					$tags_counter++;
				}

				echo '</div>'."\n";
			}
			if ($type != 'short') {
				echo '<div class="news-details">';
				echo '<strong>'._('negativos').'</strong>: <span id="a-neg-'.$this->id.'">'.$this->negatives.'</span>&nbsp;&nbsp;';
				echo '<strong>'._('usuarios').'</strong>: <span id="a-usu-'.$this->id.'">'.$this->votes.'</span>&nbsp;&nbsp;';
				echo '<strong>'._('anónimos').'</strong>: <span id="a-ano-'.$this->id.'">'.$this->anonymous.'</span>&nbsp;&nbsp;';

				echo '<span class="tool">';
        echo '<strong>'.('orde').'</strong>: <select id="selectCommentOrder" >'
            .'<option value="kdate" '.(!$current_user->comment_options['korder']?'selected="selected"':'').'>'._('data').'</option>'
            .'<option value="korder" '.($current_user->comment_options['korder']?'selected="selected"':'').'>'._('karma').'</option>'
          .'</select>&nbsp;&nbsp;';
				echo '</span>';

				echo '<span class="tool">';
				// Share icons
				$short_permalink = $this->get_short_permalink();
				echo '<strong>';
				echo '<a href="'.$short_permalink.'" title="'._('enlace corto').'">'._('compartir').'</a>';
				echo '</strong>:';
				print_share_icons($this->permalink, $short_permalink, $this->title);
				echo '</span>';
				echo '</div>' . "\n";
			}
		}

		// Include post text ads
		do_banner_story();

		echo '</div>'."\n";
		echo '</div>'."\n";

		// Geo edit form div
		if ($this->geo && $this->is_map_editable())  {
			echo '<div id="geoedit" class="geoform" style="margin-left:20px">';
			if ($current_user->user_id == $this->author && $this->sent_date > $globals['now'] - 600 && !$this->latlng)  {
				geo_coder_print_form('link', $this->id, $globals['latlng'], _('ubica al origen de la noticia o evento (ciudad, país)'));
			}
			echo '</div>'."\n";
		}

	}