Skip to main content
Recent Posts
91
Addons / Re: [ADDON] SimplePortal
Last post by Spuds -
Looks like you are trying to use a custom block from 1.x, those will not work with this new version of SimplePortal.

I did a 2.0 version for RecentEx that you can try, its attached.  Overwrite the one you added to Addons/SimplePortal/subs/spblocks, and if you added any others there they need to be removed so they can be updated.
95
Addons / Re: [ADDON] SimplePortal
Last post by ScottJB -
@Spuds
Another bug detected.
When try to create new block, do not even get to select type, but get:

Code: [Copy]
Type of error: General
 Exception: Class "SP_Abstract_Block" not found
 /index.php?action=admin;area=portalblocks;sa=add;col=5
 File: /Addons/SimplePortal/subs/spblocks/RecentEx.block.php—Line:29

Code: [Copy]
Exception: Class "SP_Abstract_Block" not found
#0: {closure:ElkArte\Errors\ErrorHandler::__construct():54}()
Called from: unknown line: -1
98
Addons / Re: What file did you edit?
Last post by Hj Ahmad Rasyid Hj Ismail -
Since we have this topic, and it is in the addon board, I am going to share what I did which I think the only things needed to be done in converting hook version of the 1.1. addon to 2.0. We may split it later, only if needed, but for now, I do not think so.

Basically you need to update your package-info.xml first, where just below the 1.1 uninstall bracket, you need to add something like this:
Code: [Copy]
	<install for="2.0.0 Beta 1 - 2.0.99">
<readme type="file" parsebbc="true">Masa.readme.txt</readme>
<require-file name="English.php" destination="LANGUAGEDIR/Masa" />
<require-file name="Masa.subs.php" destination="ADDONSDIR/Masa" />
<require-file name="Masa.template.php" destination="THEMEDIR/Masa" />
<require-file name="Masa.styles.css" destination="THEMEDIR/css/Masa" />
<require-file name="Masa_light.css" destination="THEMEDIR/css/_light/Masa" />
<require-file name="Masa_guest_light.css" destination="THEMEDIR/css/_light/Masa" />
<code>Masa.hooks.php</code>
<redirect url="?action=admin;area=addonsettings;sa=general" timeout="499">Redirecting to Addons Settings...</redirect>
</install>
<uninstall for="2.0.0 Beta 1 - 2.0.99">
<readme parsebbc="true">Masa.readme.txt</readme>
<remove-dir name="LANGUAGEDIR/Masa" />
<remove-dir name="ADDONSDIR/Masa" />
<remove-dir name="THEMEDIR/Masa" />
<remove-dir name="THEMEDIR/css/Masa" />
<remove-dir name="THEMEDIR/css/_light/Masa" />
<code>Masa.hooks.php</code>
<redirect url="?action=admin;area=packages" timeout="499">Redirecting to Package Manager...</redirect>
</uninstall>

Others seems the same but note the changes in the LANGUAGEDIR and ADDONSDIR, as in 1.1 we use LANGUAGEDIR/english/Masa, and SOURCEDIR/addons/Masa, something like that, but 2.0 seems to cut it short, and this also affects when you call for them later.

The second one will be the hooks file that call the function from your addon, something like this will make it 2.0 compliance, I think:
Code: [Copy]
if (ELK == 'SSI')
db_extend('packages');

// Define the directory and hooks for 2.0 compatibility
$addon_dir = file_exists(ADDONSDIR . '/Masa/Masa.subs.php') ? ADDONSDIR : SOURCEDIR . '/addons';

$hook_functions = array(
'integrate_menu_buttons' => 'Masa_Main|' . $addon_dir . '/Masa/Masa.subs.php',
'integrate_general_mod_settings' => 'Masa_Settings|' . $addon_dir . '/Masa/Masa.subs.php',
);

// Adding or removing them?
if (!empty($context['uninstalling']))
$call = 'remove_integration_function';

else
$call = 'add_integration_function';

This is simply because there is no need to create a different file to make it 2.0 compliance, just because the path has changed, we just accommodate it to work for both 1.1 and 2.0.

Thirdly, so far everything was called exactly the same in 2.0 except for languages, which as I noted above earlier, that you must use English.php, and put it at the above LANGUAGEDIR, and load it like this:
Code: [Copy]
	// Load language(s)
if (is_dir(SOURCEDIR . '/ElkArte/Languages'))
loadLanguage('Masa');      // ElkArte 2.x
else
loadLanguage('Masa/Masa'); // ElkArte 1.1

Also please note that above all, you addon(s) must be php8 compliance, otherwise, you may get error(s), since 2.0 is for php8 and above.

I think that is about all that was needed to be edited in making your 1.1 addon(s) 2.0 compatible, so good luck.
99
Custom Themes / Re: [Theme] FaceIt
Last post by Hj Ahmad Rasyid Hj Ismail -
Face11 was finished but never updated in here or shared, so I added it up, but not sure whether it is installable directly, as I merely zipped and cleaned it from my site. Now we are at 2.0 beta 1, I am not sure sure anyone would still need it for their 1.1 forum, but it is here now. In any event, development for 2.0 version is in progress as we speak.