Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

-1
View File
@@ -14,7 +14,6 @@ class convert_hook_Db extends _HOOK_CLASS_
* @param array|string|NULL $having HAVING clause (same format as WHERE clause)
* @param int $flags Bitwise flags
* @li \IPS\Db::SELECT_DISTINCT Will use SELECT DISTINCT
* @li \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS Will add SQL_CALC_FOUND_ROWS
* @li \IPS\Db::SELECT_MULTIDIMENSIONAL_JOINS Will return the result as a multidimensional array, with each joined table separately
* @return \IPS\Db\Select
*
@@ -1,7 +1,7 @@
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
@@ -8,6 +8,36 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
class convert_hook_LegacyParser extends _HOOK_CLASS_
{
/**
* Parse
*
* @param string $value Text to parse
* @return string
*/
public function parse( $value )
{
$result = parent::parse( $value );
/* Parse [mention=id]name[/URL] bbcode */
preg_match_all( '#\[mention=(\d+)\](.+?)\[\/mention\]#is', $result, $matches );
foreach( $matches[0] as $idx => $m )
{
$member = \IPS\Member::load( $matches[1][ $idx ] );
if ( $member->member_id )
{
$result = str_ireplace( $m, "<a contenteditable=\"false\" rel=\"\" href=\"{$member->url()}\" data-mentionid=\"{$matches[1][ $idx ]}\" data-ipshover-target=\"{$member->url()->setQueryString( 'do', 'hovercard' )}\" data-ipshover=\"\">@{$matches[2][ $idx ]}</a>", $result );
}
else
{
$result = str_ireplace( $m, "@{$matches[2][ $idx ]}", $result );
}
}
return $result;
}
/**
* Parse statically
*
+1 -1
View File
@@ -1,7 +1,7 @@
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}