Customising an Extension

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
spacebiscuit
Registered User
Posts: 38
Joined: Thu Nov 17, 2011 10:36 am

Customising an Extension

Post by spacebiscuit »

I currently have an Ads Management extension installed on my v3.3.1 forum. I have made some customisations to the extension but I cannot see these. For example there is a common.php:

$lang = array_merge($lang, array(
'Foo' => 'Bar''
));

I have added some entries to this array, they should appear as new options in a drop-down presented when adding a configuration in the extension. Instead of the value I see the key in the select element's title and label:

<select name="FOO">FOO</select>

I am guessing that I need to re-initialise something, I have cleared cache which does not work but probably I need to reinstall the extension? But how to do that? When I click on the Extension tab in the admin it simply defaults to another plugin installed.

Should I not see a list of extensions and be able to disable or choose which to install?

Thanks in advance.
User avatar
warmweer
Jr. Extension Validator
Posts: 6503
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Customising an Extension

Post by warmweer »

spacebiscuit wrote:
Wed Nov 04, 2020 8:11 pm
Should I not see a list of extensions and be able to disable or choose which to install?
The list of enabled and not yet enabled/disabled extensions can be seen in the Customise tab.
The Extensions tab is only visible if there 's an installed extension with a customisation page.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
spacebiscuit
Registered User
Posts: 38
Joined: Thu Nov 17, 2011 10:36 am

Re: Customising an Extension

Post by spacebiscuit »

Thanks - yes I see it now. Disabling and reinstalling fixed the issue.

The final thing I need to do, is it possible to use modulus operator in my template, something like:

Code: Select all

{% if loops.postrow|length > 1 and postrow.S_NUM_POSTS % 5 == 0 %}
Further, is it possible to output the value of postrow.S_NUM_POSTS to debug?
spacebiscuit
Registered User
Posts: 38
Joined: Thu Nov 17, 2011 10:36 am

Re: Customising an Extension

Post by spacebiscuit »

So this works (almost)

{% if loops.postrow|length > 1 and postrow.S_ROW_COUNT % 5 == 0 %}

However since POST_COUNT starts at 0 I am not targeting ever 5th post as I intended, and I don't seem to be able to increment the ROW_COUNT for the ex[ression:

{% if loops.postrow|length > 1 and postrow.S_ROW_COUNT+1 % 5 == 0 %}
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4741
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Customising an Extension

Post by kasimi »

The % operator has higher priority than +. This should work:

Code: Select all

{% if loops.postrow|length > 1 and (postrow.S_ROW_COUNT + 1) % 5 == 0 %}
Post Reply

Return to “Extension Writers Discussion”