Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-12-23 15:27:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,495
Website

Re: Cannot use $this as parameter

Yeah you can’t use $this as it’s reserved by PHP. So just swap it out:

function tcm_is_this($atts, $thing)
{
        global $pretext, $thisarticle, $pretext;
        if($pretext['s']==$thisarticle['section']
         &&$pretext['id']==$thisarticle['thisid'])
        {
           return $thing;
        }
}

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2018-12-23 16:28:28

Anton2
New Member
Registered: 2018-12-22
Posts: 9

Re: Cannot use $this as parameter

Thanks jakob and Bloke.

I figured it out. The description says: “A Simple tag to find out if the listed article is requested”, so digging through my TXP forms I saw that I used this tag to assign a custom class to currently selected menu items (to highlight them, basically).

“Oh that was many moons ago” :)

Offline

Board footer

Powered by FluxBB