Version 2.3.6

This commit is contained in:
Neo committed 2025-12-19 00:26:08 -08:00
1 parent a3bb603c96
commit 19b38c7c74
764 files changed
+143731 -118164

No files matched your search

+52 -28
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.2.2
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:54 PM
| Release: e3790216629e5a2aaf37070b32237f06
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-09-22 05:28:54 -0500 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
| > $Date: 2008-04-23 15:02:02 -0400 (Wed, 23 Apr 2008) $
| > $Revision: 1254 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > PORTAL PLUG IN MODULE: Recent topics
@@ -62,7 +52,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
@@ -71,7 +61,7 @@ class ppi_recent_topics
/**
* IPS Global object
*
* @var string
* @var object
*/
var $ipsclass;
@@ -83,6 +73,15 @@ class ppi_recent_topics
*/
var $portal_object = array();
/**
* Maximum number of days to check:
* limits resource usage. Set to 0
* for no days restriction.
*
* @var int
*/
var $max_days = 20;
/*-------------------------------------------------------------------------*/
// INIT
/*-------------------------------------------------------------------------*/
@@ -116,10 +115,12 @@ class ppi_recent_topics
{
return;
}
$time_restrict = $this->max_days ? " AND start_date > " . ( time() - 60 * 60 * 24 * $this->max_days ) : '';
$this->ipsclass->DB->simple_construct( array( 'select' => 'tid, title, posts, starter_id as member_id, starter_name as member_name, start_date as post_date, views',
'from' => 'topics',
'where' => "$qe approved=1 and state != 'closed' and (moved_to is null or moved_to = '')",
'where' => "$qe approved=1 and state != 'closed' and (moved_to is null or moved_to = '')" . $time_restrict,
'order' => 'start_date DESC',
'limit' => array( 0, $limit ) ) );
$this->ipsclass->DB->simple_exec();
@@ -172,6 +173,13 @@ class ppi_recent_topics
$this->ipsclass->vars['recent_topics_article_forum'] = ','.$this->ipsclass->vars['recent_topics_article_forum'];
}
$time_restrict = $this->max_days ? " AND t.start_date > " . ( time() - 60 * 60 * 24 * $this->max_days * 2 ) : '';
if( $time_restrict )
{
$qe .= $time_restrict;
}
$this->ipsclass->DB->cache_add_query( 'portal_get_monster_bitch', array( 'csite_article_forum' => $this->ipsclass->vars['recent_topics_article_forum'], 'qe' => $qe, 'limit' => $limit ) );
$outer = $this->ipsclass->DB->cache_exec_query();
@@ -199,6 +207,12 @@ class ppi_recent_topics
$entry['posts'] = $this->ipsclass->do_number_format(intval($entry['posts']));
$entry['views'] = $this->ipsclass->do_number_format($entry['views']);
if( !$entry['author_id'] )
{
$entry['member_name'] = $this->ipsclass->vars['guest_name_pre'] . $entry['author_name'] . $this->ipsclass->vars['guest_name_suf'];
$entry['member_id'] = 0;
}
//-----------------------------------------
// LINKS
//-----------------------------------------
@@ -241,28 +255,38 @@ class ppi_recent_topics
//-----------------------------------------
$attach_pids[ $entry['pid'] ] = $entry['pid'];
//-----------------------------------------
// Format posts
//-----------------------------------------
$this->portal_object['parser']->parse_html = ( $this->ipsclass->cache['forum_cache'][ $entry['forum_id'] ]['use_html'] and $entry['post_htmlstate'] ) ? 1 : 0;
$this->portal_object['parser']->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
$this->portal_object['parser']->parse_nl2br = $entry['post_htmlstate'] == 2 ? 1 : 0;
$entry['post'] = $this->portal_object['parser']->pre_display_parse( $entry['post'] );
//-----------------------------------------
// Avatar
//-----------------------------------------
$entry['avatar'] = $this->ipsclass->get_avatar( $entry['avatar_location'], 1, $entry['avatar_size'], $entry['avatar_type'] );
$entry['avatar'] = $this->ipsclass->get_avatar( $entry['avatar_location'], $this->ipsclass->member['view_avs'], $entry['avatar_size'], $entry['avatar_type'] );
if ( $entry['avatar'] )
{
$entry['avatar'] = $this->ipsclass->compiled_templates['skin_portal']->tmpl_wrap_avatar( $entry['avatar'] );
}
if ( $this->ipsclass->check_perms($this->ipsclass->forums->forum_by_id[ $entry['forum_id'] ]['download_perms']) === FALSE )
{
$this->ipsclass->vars['show_img_upload'] = 0;
}
//-----------------------------------------
// View image...
//-----------------------------------------
if ( ! $this->ipsclass->member['view_img'] )
{
//-----------------------------------------
// unconvert smilies first, or it looks a bit crap.
//-----------------------------------------
$entry['post'] = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $entry['post'] );
$entry['post'] = preg_replace( "/<img src=[\"'](.+?)[\"'].+?".">/", "(IMG:<a href='\\1' target='_blank'>\\1</a>) ", $entry['post'] );
}
$html .= $this->ipsclass->compiled_templates['skin_portal']->tmpl_articles_row($entry, $bottom_string, $top_string);
}