Hi Haijak

I hope I'm not too late in replying.

Unfortunately, your code doesn't have any surrounding context nor is
it in the plugin itself, so I can't see what you are doing or trying
to achieve, but the error you are seeing is technically correct.

The __get() function in theme.php is not a static function, so
shouldn't be called as such.

What you may find will work is to pass the $theme variable to your
function and then try calling __get() non-statically using the ->
operator.  For example:

function theme_my_custom_class($theme) {
     if($yr_mth->year == $theme->__get('year') and $yr_mth->month ==
$theme->__get('month')): $crnt = ' class="current"';
     return $crnt;
}

You would then use this function within your theme using something like:

$theme->my_custom_class();

This is a very crude and over simplified function, but it illustrates
the point and should hopefully steer you in the right direction.

HTH
Colin


On Thu, Dec 24, 2009 at 9:53 PM, haijak <[email protected]> wrote:
> I'm trying to hack the "RN Monthly Archives" plugin to add a small
> function for the theme I'm building.
>
> This line:
> if($yr_mth->year == Theme::__get('year') and $yr_mth->month ==
> Theme::__get('month')): $crnt = ' class="current"';
>
> Gives this result:
> Fatal error: Non-static method Theme::__get() cannot be called
> statically, assuming $this from incompatible context
>
> The research I have done leads me to believe that code should work.
> But there seams to be something else needed to "initialize" the use of
> the Theme class.
>
> I could also be completely wrong. If somebody could help, I would Love
> you.
> Thanks
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/habari-users



-- 
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://www.lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/habari-users

Reply via email to