GetSimple Support Forum
Find out if the backend is active - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8)
+--- Thread: Find out if the backend is active (/showthread.php?tid=4204)



Find out if the backend is active - ale - 2013-01-24

i18n_specialpages uses

PHP Code:
if (basename($_SERVER['PHP_SELF']) && basename($_SERVER['PHP_SELF']) != 'index.php') { 

to find out if GS is in the backend... it works, but this looks more like a bad hack than like the best solution.

May i suggest that the backend entry points define a GSBACKEND=true and the front end defines GSBACKEND=false?

ciao
a.l.e


RE: Find out if the backend is active - shawn_a - 2013-01-25

In 3.1+ you can use is_frontend()

This was broken in previous versions.


RE: Find out if the backend is active - ale - 2013-01-25

yep, "is_frontend()" is what i was looking for!