Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -17,6 +17,7 @@ namespace IPS\convert\Software\Forums;
use DomainException;
use Exception;
use IPS\Content;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Core\Smf as SmfCore;
use IPS\Db;
@@ -228,14 +229,15 @@ class Smf extends Software
/**
* Pre-process content for the Invision Community text parser
*
* @param string $post The post
* @param string|null $className Content Classname passed by post-conversion rebuild
* @param int|null $contentId Content ID passed by post-conversion rebuild
* @param string The post
* @param string|null Content Classname passed by post-conversion rebuild
* @param int|null Content ID passed by post-conversion rebuild
* @param App|null App object if available
* @return string The converted post
*/
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null ): string
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null, ?App $app=null ): string
{
return SmfCore::fixPostData( $post, $className, $contentId );
return SmfCore::fixPostData( $post, $className, $contentId, $app );
}
/**
@@ -267,39 +269,18 @@ class Smf extends Software
public function convertForumsBoards(): void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'id_board' );
foreach( $this->fetch( 'boards', 'id_board' ) AS $row )
{
$last_post_time = 0;
$last_poster = 0;
$last_title = NULL;
$last_poster_name = NULL;
try
{
$last_post = $this->db->select( '*', 'messages', array( "id_msg=?", $row['id_last_msg'] ) )->first();
$last_post_time = $last_post['poster_time'];
$last_poster = $last_post['id_member'];
$last_poster_name = $last_post['poster_name'];
$last_title = $last_post['subject']; # Yes, I know this is technically wrong, but it's better than just not showing anything
}
catch( UnderflowException $e ) {}
$info = array(
'id' => $row['id_board'],
'name' => $row['name'],
'description' => $row['description'],
'topics' => $row['num_topics'],
'posts' => $row['num_posts'],
'last_post' => $last_post_time,
'last_poster_id' => $last_poster,
'last_poster_name' => $last_poster_name,
'parent_id' => ( $row['id_parent'] <> 0 ) ? $row['id_parent'] : 'c' . $row['id_cat'],
'position' => $row['board_order'],
'last_title' => $last_title,
'redirect_url' => $row['redirect'],
'queued_topics' => $row['unapproved_topics'],
'queued_posts' => $row['unapproved_posts'],