php error on php 5.3.9

Free responsive Joomla 2.5 and 3.x module to present your content with easy and intuitive way.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Wed Mar 07, 2012 1:37 am
Hi, installed the world news 2 joomla 2.5 template using quickstart and i get this error on frontpage

Notice: Trying to get property of non-object in C:\wamp\www\twn2\modules\mod_news_pro_gk4\tmpl\layout.parts.php on line 65
User avatar
Expert Boarder

GK User
Wed Mar 07, 2012 1:56 am
Hi, sorry, wrong setting in php.ini.

Best regards!
User avatar
Expert Boarder

GK User
Wed Mar 07, 2012 2:07 am
Hi, i think that disabling the notices doesn't fixed the error. In some way, the module refuses to show article's image.

Please see the attachments. When reading the article, the image displays OK, but in module view, the image does not show at all.

This was the nottice that PHP showed me.
Notice: Trying to get property of non-object in C:\wamp\www\twn2\modules\mod_news_pro_gk4\tmpl\layout.parts.php on line 65
User avatar
Expert Boarder

GK User
Wed Mar 07, 2012 2:15 am
Sorry, forgot to add screenshots, please remember that I installed The World News2 Template on joomla 2.5.3 using quickstart

ok.jpg


bad.jpg
User avatar
Expert Boarder

GK User
Mon Mar 12, 2012 8:34 am
razor7 wrote:Sorry, forgot to add screenshots, please remember that I installed The World News2 Template on joomla 2.5.3 using quickstart

ok.jpg


bad.jpg


Hi mate!
Have you sort out that "layout.parts.php on line 65" error?
I 've got the same error and front page front page looks completely messed up.
User avatar
Fresh Boarder

GK User
Mon Mar 12, 2012 11:39 am
In your screenshots you have 2 different pages compared. If you mean your modules does not show images then please read below.

You can try following :
In News Show Pro GK4 module settings set as below
Thumbnails > Thumbnail image type = Use first article image
or
If you have a lot of modules try editing following file:
Backup : \modules\mod_news_pro_gk4\tmpl\layout.parts.php
Find Lines : 48 to 79 which sample lines are below
Code: Select all
48 -    // article image generator
49 -    function image($config, $uri, $news_id, $news_iid, $news_cid, $news_text, $news_title, $images){
.
.
.
78 -      }
79 -      //

Replace 48 to 79 with below
Code: Select all
   // article image generator
   function image($config, $uri, $news_id, $news_iid, $news_cid, $news_text, $news_title, $images){      
      $news_title = str_replace('"', """, $news_title);
        $IMG_SOURCE = '';
      $IMG_LINK = ($news_id !== 0) ? JRoute::_(ContentHelperRoute::getArticleRoute($news_id, $news_cid)) : JRoute::_('index.php?option=com_user&view=login');   
      
      if($config['k2_thumbs'] == 'first') {
         if(preg_match('/\<img.*src=.*?\>/',$news_text)){
            $imgStartPos = JString::strpos($news_text, 'src="');
            if($imgStartPos)  $imgEndPos = JString::strpos($news_text, '"', $imgStartPos + 5);   
            if($imgStartPos > 0) $IMG_SOURCE = JString::substr($news_text, ($imgStartPos + 5), ($imgEndPos - ($imgStartPos + 5)));
         }
      } else {
         // set image to first in article content
         if(preg_match('/\<img.*src=.*?\>/',$news_text)){
         $imgStartPos = JString::strpos($news_text, 'src="');
         if($imgStartPos)  $imgEndPos = JString::strpos($news_text, '"', $imgStartPos + 5);   
         if($imgStartPos > 0) $IMG_SOURCE = JString::substr($news_text, ($imgStartPos + 5), ($imgEndPos - ($imgStartPos + 5)));
         }
      }
      //


See you around...
User avatar
Platinum Boarder

GK User
Mon Mar 12, 2012 11:50 am
Notice messages were cleaned in latest module version, update should resolve the problem.
User avatar
Platinum Boarder

GK User
Sun Mar 25, 2012 10:56 am
Good idea,
I have solved same problem...
thanx
User avatar
Junior Boarder


cron