Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

wareczek

Użytkownik
  • Postów

    1 893
  • Dołączył

  • Ostatnia wizyta

Odpowiedzi opublikowane przez wareczek

  1. 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;
    }

  2. 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']

  3. Wiadomo ftp będzie całkiem czyste na nowo poza folderem uploads, jak zauważył DawPi. Mnie natomiast ciekawi jak możemy "wyczyścić" bazę danych. Wiadomo, że wszystkie logi spiderów i inne to można w prosty sposób, ale co z tabelami/polami w bazie, które zostały dodane przez różne modyfikacje (a one nie mają skryptu deinstalacyjnego) ? Mam odpalić testowe forum i porównywać budowy i istnienie tabel w czystej kopii z moją kopią? Już od przejścia z 2.1.x na 2.3.x myślałem o takim czyszczeniu, ale chyba coś mi wtedy nie wyszło. Jakieś pomysły jak to sprawnie przeprowadzić?

×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.