@@ -76,11 +76,13 @@ public function onAfterRender()
7676
7777 public function onContentPrepare ($ context , &$ article , &$ params , $ page = 0 )
7878 {
79- if (JFactory::getApplication ()->isAdmin ( ))
79+ if (JFactory::getApplication ()->isClient ( ' administrator ' ))
8080 {
8181 return true ;
8282 }
8383
84+ $ input = JFactory::getApplication ()->input ;
85+
8486 $ allowContext = array (
8587 'com_content.article ' ,
8688 'easyblog.blog ' ,
@@ -107,7 +109,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
107109 $ autoAdd = $ this ->params ->get ('autoAdd ' ,0 );
108110 $ sharePos = (int )$ this ->params ->get ('shares_position ' , 1 );
109111 $ enableOpenGraph = $ this ->params ->get ('enable_opengraph ' ,1 );
110- $ option = JRequest:: getCmd ('option ' );
112+ $ option = $ input -> get ('option ' );
111113 $ helper = PlgJLLikeHelper::getInstance ($ this ->params );
112114
113115 if (strpos ($ article ->text , '{jllike} ' ) === false && !$ autoAdd )
@@ -120,7 +122,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
120122 $ article ->catid = '' ;
121123 }
122124
123- $ print = JRequest:: getInt ('print ' , 0 );
125+ $ print = ( int ) $ input -> get ('print ' , 0 );
124126
125127 $ root = JURI ::getInstance ()->toString (array ('host ' ));
126128 $ url = $ this ->protokol . $ this ->params ->get ('pathbase ' , '' ) . str_replace ('www. ' , '' , $ root );
@@ -170,7 +172,9 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
170172 }
171173
172174
173- include_once JPATH_ROOT .'/components/com_content/helpers/route.php ' ;
175+ if (version_compare (JVERSION , '3.12.0 ' , '< ' )) {
176+ include_once JPATH_ROOT .'/components/com_content/helpers/route.php ' ;
177+ }
174178 $ link = $ url . JRoute::_ (ContentHelperRoute::getArticleRoute ($ article ->slug , $ article ->catid ));
175179
176180 $ image = '' ;
@@ -207,7 +211,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
207211
208212 if ($ context == 'com_content.article ' )
209213 {
210- $ view = JRequest:: getCmd ('view ' );
214+ $ view = $ input -> get ('view ' );
211215 if ($ view == 'article ' )
212216 {
213217 if ($ autoAdd == 1 || strpos ($ article ->text , '{jllike} ' ) == true )
@@ -266,7 +270,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
266270 if (($ context == 'easyblog.blog ' ) && ($ this ->params ->get ('easyblogshow ' , 0 ) == 1 ))
267271 {
268272 $ allow_in_category = $ this ->params ->get ('allow_in_category ' , 0 );
269- $ isCategory = (JRequest:: getCmd ('view ' , '' ) == 'entry ' ) ? false : true ;
273+ $ isCategory = ($ input -> get ('view ' , '' ) == 'entry ' ) ? false : true ;
270274
271275 if (!$ allow_in_category && $ isCategory )
272276 {
@@ -310,4 +314,4 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
310314 break ;
311315 }
312316 }
313- }
317+ }
0 commit comments