Skocz do zawartości
Hosting webh.pl - 20%

[ITech] [AJAX] Inferno Top X Stats v1.0.1

Rekomendowane odpowiedzi

Opublikowano
  • Autor

Zmieniona funkcja fetch_latest_replies($read_perms) w pliku sources/lib/inferno_topxstats.php

function fetch_latest_replies($read_perms)
{
	$latest_replies = '';

	$this->ipsclass->DB->simple_construct(
		array(
			'select'	=> 't.title, t.tid, t.last_poster_name, t.last_poster_id, t.views, t.posts as replies, m.mgroup, t.last_post as date, t.forum_id',
			'from'		=> 'topics t left join ' . SQL_PREFIX . 'members m on (m.id = t.last_poster_id)',
			'where'		=> 't.forum_id in (' . $read_perms . ')',
			'order'		=> 't.last_post desc',
			'limit'		=> array(0, $this->ipsclass->vars['_inferno_topxstats_show'])
		)
	);
	$this->ipsclass->DB->simple_exec();

	$last_time = 0;

	while ($thread = $this->ipsclass->DB->fetch_row())
	{
		$thread['replies']			= $this->ipsclass->do_number_format($thread['replies']);
		$thread['views']			= $this->ipsclass->do_number_format($thread['views']);
		$thread['title']			= $this->ipsclass->txt_truncate($thread['title'], $this->ipsclass->vars['_inferno_topxstats_titles']);
		$thread['last_poster_name']	= $this->ipsclass->make_name_formatted($thread['last_poster_name'], $thread['mgroup']);
		$thread['last_post']		= $thread['date'];
		$thread['date']				= $this->ipsclass->get_date($thread['date'], 'SHORT');

		if ( $thread['last_post'] )
		{
			if ( isset($thread['db_read']) AND $thread['db_read'] )
			{
				$last_time = $thread['db_read'];
			}
			else if ( $this->db_row['marker_last_cleared'] )
			{
				$last_time = $this->db_row['marker_last_cleared'];
			}
			else
			{
				$last_time = 1;
			}
		}

		if($last_time && ($thread['last_post'] > $last_time))
		{
			$thread['title'] = "<b>".$thread['title']."</b>";
		}

		$latest_replies .= $this->ipsclass->compiled_templates[$this->skingroup]->inferno_topxstats_latestreply($thread);
	}

	return $latest_replies;
}

Zmienna $thread['db_read'] nie jest zdefiniowana, a jak chce to zdefiniować jakoś podobnie jak jest w sources/action_public/forums.php to się wykrzacza, podobnie z $this->db_row['marker_last_cleared']

Opublikowano
  • Autor

Kod funkcji od autora:

function fetch_latest_replies($read_perms)
{
$latest_replies = '';

$this->ipsclass->DB->simple_construct(
	array(
		'select'	=> 't.title, t.tid, t.last_poster_name, t.last_poster_id, t.views, t.posts as replies, m.mgroup, t.last_post as date',
		'from'		=> 'topics t left join ' . SQL_PREFIX . 'members m on (m.id = t.last_poster_id)',
		'where'		=> 't.forum_id in (' . $read_perms . ')',
		'order'		=> 't.last_post desc',
		'limit'		=> array(0, $this->ipsclass->vars['_inferno_topxstats_show'])
	)
);
$this->ipsclass->DB->simple_exec();

while ($thread = $this->ipsclass->DB->fetch_row())
{
	$thread['replies']			= $this->ipsclass->do_number_format($thread['replies']);
	$thread['views']			= $this->ipsclass->do_number_format($thread['views']);
	$thread['title']			= $this->ipsclass->txt_truncate($thread['title'], $this->ipsclass->vars['_inferno_topxstats_titles']);
	$thread['last_poster_name']	= $this->ipsclass->make_name_formatted($thread['last_poster_name'], $thread['mgroup']);
	$thread['date']				= $this->ipsclass->get_date($thread['date'], 'SHORT');

	$latest_replies .= $this->ipsclass->compiled_templates[$this->skingroup]->inferno_topxstats_latestreply($thread);
}

return $latest_replies;
}

Opublikowano
  • Manager

Jak najprościej powiedzieć, streścić co napisałem Wareczkowi na GG -> nie warto tego kodzić. Efekt nie jest współmierny do poniesionego na to czasu gdyby doszło do kodowania, a i serwera szkoda by mielił niemiłosiernie te posty.

intermedia - profesjonalne rozwiązania Invision Power Board, IC5

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Szukaj

Szukaj

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.