PermaLinks :: Chaining

By jenolan - August 21, 2013

I am pondering re-starting my affiliate link system, already have the permalink system installed but there is going to be a problem is both the CALM (Affiliate) and PermaLink plugins are loaded as both are going to want to parse/despatch links to redirect them.

CALM could load the Permalink code if it doesn't have a match, but that could end up causing issues. Do you reckon that a hook point should be provided in the '404' code so that if PermaLink was about to '404' a link I could hook in see if I wanted to take over, if not return and allow PermaLink to continue with its '404' processing. Reasoning is that the PermaLink side is likely to be 'hit' more than CALM and it would be better to allow what would be the main process handle the 99% and only trigger the affiliate processing when it might be needed.

Of course, if the user doesn't have PermaLink then CALM will be directly despatching the links and handling the '404' condition. Still early days I have JLogica up and ssl'd with an under construction page still flat out like a lizard drinking with the other project that I have been helping out with, but hopefully I may get to do some of my coding again by the end of the year (well maybe).

---



Peace and Long Life

By jenolan - August 22, 2013

Not yet, the problem will be that I expect to be the code called from .htaccess as the default file, seems to me to be pretty simple to just allow for a hook point...

So far as the two being the same they seriously aint!   Your is meant to handle links and just flick them in affiliate processing involves keeping track of impressions split a/b testing and all sorts of other stuff, which is why I suggested a hook as you would be handling the normal internal style links the person wants to have a pretty links, CALM is meant to track affiliate links only.

---



Peace and Long Life

Hi Larry,

You could get users of both plugins to add a function to the permalinks_notFound404.php page that redirects or runs a function for the CALM plugin. The permalinks_notFound404.php file already calls the viewer_functions file. So any functions you added to the CALM plugin would be available on the permalinks_notFound404.php file. Then you'd just need to add instructions to the CALM plugins readme.txt for users who have both plugins.

We've done something similar in the permalinks plugin that explains to users who have both wordpress and CMS Builder on the same server how to get both to use the URL redirect system correctly. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com