[Tutorial] How to install a MODX modification

Discussion forum for MOD Writers regarding MOD Development.
User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: [Tutorial] How to install a MODX modification

Post by Martin Truckenbrodt »

Hallo Haravik,
if the MODs are supporting UMIL then you can use the config values <name of MOD>_version to get automatically compatibility with other MODs.
E.g. I'm doing it this way on AMLS:

Code: Select all

	// phpBB Gallery MOD - https://www.phpbb.com/customise/db/mod/phpbb_gallery
	if (array_key_exists('phpbb_gallery_version', $config) && $config['phpbb_gallery_version'])
{
... 
}
Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!
Haravikk
Registered User
Posts: 261
Joined: Sat Nov 02, 2002 4:42 pm

Re: [Tutorial] How to install a MODX modification

Post by Haravikk »

Martin Truckenbrodt wrote:if the MODs are supporting UMIL then you can use the config values <name of MOD>_version to get automatically compatibility with other MODs.
Thanks for the reply, but I'm not sure how I would apply this to the changes I've added to my MODX file? Specifically I'd like to do something like:

Code: Select all

<open src="foo.php" type="if-exists">
    <!-- Edits etc. -->
</open>
So that the edits can be skipped if a particular file (that may not be installed) does not exist, rather than throwing up an error in AutoMOD like it does now. I suppose it's more of an AutoMOD feature since for the MODX file itself I can just add a comment telling the user to skip the step if they don't have the file, but AutoMOD doesn't seem to have the ability to do this.

I'd like to be able to do the same thing with <edit> commands, so that I can look for edits made by other mods to resolve incompatibilities, or to ensure my code appears at the correct position.

For example, if my mod, and someone else's mod both added code after the same <find> command, then depending upon the order in which our mods are installed incompatibilities could arise. But if I could detect the other mod then I could change my edit to a before-add instead, to ensure my code executes first.

The edit might look something like:

Code: Select all

<edit type="if-found">
    <find><![CDATA[$foo = 'bar';]]></find>
    <!-- An action, inline find, whatever -->
</edit>
Basically the edit would only continue if its <find> statements are matched, otherwise it's okay to just skip it.
User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: [Tutorial] How to install a MODX modification

Post by Martin Truckenbrodt »

Hello,
I told a way to do implement compatibilty directly in your PHP code.

Do an extra XML file an place it in the contrib Folder, add a link to your main XML file.

Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!
User avatar
BiGDiL
Registered User
Posts: 2
Joined: Thu Jul 12, 2012 5:18 am
Name: Uriah Sanuani
Contact:

Re: [Tutorial] How to install a MODX modification

Post by BiGDiL »

thanks for the info.
Uriah Sanuani!
phpBB.co.il - The Official Hebrew Version of phpBB!
johnmatthew84
Registered User
Posts: 1
Joined: Fri May 10, 2013 9:47 am

Re: [Tutorial] How to install a MODX modification

Post by johnmatthew84 »

I don’t know about the MODX modification but can you solve my problem which is I just setup my first board and tried to install my first MOD. I wanted the "update attachment" mod for my site and read all the guides and help on installing modes.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26455
Joined: Fri Aug 29, 2008 9:49 am

Re: [Tutorial] How to install a MODX modification

Post by Mick »

johnmatthew84 wrote:I wanted the "update attachment" mod for my site and read all the guides and help on installing modes.
Are you experiencing problems installing MODs in general, in other words, you don't know how to do it or are you're having problems installing that particular MOD?
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
TheRaj
Registered User
Posts: 6
Joined: Mon Nov 11, 2013 4:38 pm
Name: Raju Patel

Re: [Tutorial] How to install a MODX modification

Post by TheRaj »

Thanks for the tutorial, it saved my precious time :D
User avatar
Francoisjunior
Registered User
Posts: 11
Joined: Fri May 02, 2014 5:19 am

Re: [Tutorial] How to install a MODX modification

Post by Francoisjunior »

I learn a lot on this page. I like how you do the step by step with pictures in it. It's more clear and I followed it easily. Thanks for additional knowledge :)
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: [Tutorial] How to install a MODX modification

Post by Korkel »

Great Tutorial, but the images are broken?
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image
User avatar
tbackoff
Former Team Member
Posts: 7068
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: [Tutorial] How to install a MODX modification

Post by tbackoff »

They don't seem to be broken for me
Flying is the second best thrill to cheerleaders; being caught is the first.
User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [Tutorial] How to install a MODX modification

Post by all4phone »

Thanks for the tutorial.
I can confirm the images are fine.
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11048
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [Tutorial] How to install a MODX modification

Post by battye »

Korkel wrote:Great Tutorial, but the images are broken?
If you're having trouble viewing the images it might just be that the SSL certificate hasn't been accepted.
If you view an image directly, like by clicking this link - https://camo.phpbb.com/4f2ef1e5d5e40e62 ... 782e4a5047 - you will be prompted to accept the certificate. Then the images should load fine :)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
rwmtiger
Registered User
Posts: 21
Joined: Mon Jul 07, 2014 6:45 am

Re: [Tutorial] How to install a MODX modification

Post by rwmtiger »

i got error 400
Image
5hocK
Registered User
Posts: 3139
Joined: Wed Nov 23, 2011 7:00 pm
Location: UK

Re: [Tutorial] How to install a MODX modification

Post by 5hocK »

rwmtiger wrote:i got error 400
I get this quite often too (once a week or so) - Deleting all board cookies and clearing your browser cache does the trick for me.
User avatar
rwmtiger
Registered User
Posts: 21
Joined: Mon Jul 07, 2014 6:45 am

Re: [Tutorial] How to install a MODX modification

Post by rwmtiger »

thank for info
Image
Locked

Return to “[3.0.x] MOD Writers Discussion”