ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Net Web >

Add UserAgent for typecho plug

Tuesday on March 24th, 2020Net Web

Many students of the blog are UserAgent, show reviewer operating system and browser, but also to distinguish between bloggers according to critics of the mailbox, this function well.

Baidu a moment, just a classmate to typecho produced a related plug-ins, download, add commen.php the prompts:

? Php UserAgent_Plugin :: render ($ this-agent) ;?

But suggest the following errors:

Fatal error: Using $ this when not in object context in ...

I code is blind, Baidu relevant errors, saying that does not support this like, I do not know what to say, did not say specifically how to modify, helpless.

Carefully looked at the context of the relevant code, we do not create, but also according to cat painted tiger, put this into comments, actually succeeded.

? Php UserAgent_Plugin :: render ($ comments-agent) ;?

Specific comments section to see the effect, the mouse on the comment date there will be surprises Oh!

Really blind cat caught in a dead rat, ha ha ~

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/netweb/Add-UserAgent-for-typecho-plug.htm