Default image not created

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
Fri Apr 06, 2012 4:01 am
Hi,

I'm using News Show Pro GK4 (v3.3) with Joomla 1.5 and I'd like to take advantage of the functionality that creates a default image when one is not presented in the article, however this image isn't created.

This is what I have tried so far:
1. I created an image in the /modules/mod_news_pro_gk4/cache/default/ folder and named it default.newspro1.png (where newspro1 is also my module id).
2. I turned on "create thumbnails"
3. I also tried "automatic module id" on and off but that didn't make a difference

Is there anything I'm missing? I notice that in the file layout.parts there is a section dedicated to creating a default image (lines 70-83 ) but this isn't happening for me.

Code: Select all
if($config['create_thumbs'] == 1 && $IMG_SOURCE != ''){
         // try to override standard image
         if(strpos($IMG_SOURCE,'http://') == FALSE) {
            if(NSP_GK4_Thumbs::createThumbnail($IMG_SOURCE, $config, false, false, $IMG_REL) !== FALSE) {
               $uri = &JURI::getInstance();
               $IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/'.NSP_GK4_Thumbs::translateName($IMG_SOURCE,$config['module_id']);
            } elseif($config['create_thumbs'] == 1) {
               jimport('joomla.filesystem.file');
               if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
                  $IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';         
               }
            } else
               $IMG_SOURCE = '';
         }   
      } elseif($config['create_thumbs'] == 1) {
         jimport('joomla.filesystem.file');
         
         if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
            $IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';         
         }
      }


Please help!

Thanks!
User avatar
Junior Boarder

teitbite
Fri Apr 06, 2012 5:19 pm
Hi

Can You please show me Your site ?
User avatar
Moderator

GK User
Fri Apr 06, 2012 11:53 pm
teitbite wrote:Hi

Can You please show me Your site ?


My site is not live yet, I'm still putting on the finishing touches so for now I'm just running it on localhost using xampp. I can send you screenshots for snippets of code or any files that you need.
User avatar
Junior Boarder

teitbite
Sat Apr 07, 2012 4:49 pm
Hi

Unfortunatel screens will not help much. I need to check how site behave with couple of configuraton changes and what file exacly is tried to being pulled. Please let me know when site will be live.
User avatar
Moderator

GK User
Sat Apr 07, 2012 7:35 pm
Hi teitbite,

I am hesitant to go live with my site because of this issue. If there is no image in the article, the text in the article goes under the title and it becomes unreadable (I'm using the World News II template, which uses this module on the main page). I'm attaching a screenshot of what the article looks like without a default image.

Image

Since you can't help until the site is live, can you provide some troubleshooting tips that I can try on on my own? For example, how would you attempt to troubleshoot this issue if you had access to the site?

Thanks!
User avatar
Junior Boarder

GK User
Sat Apr 07, 2012 8:14 pm
Ok, I did some more troubleshooting, and put an echo to print out the name of the file. I put the echo between line 77-83 of the layout.parts.php file to try to figure out what file the module is looking for. Here is what it looks like with the echos:

Code: Select all
elseif($config['create_thumbs'] == 1) {
         jimport('joomla.filesystem.file');
         echo "<br/>path=".JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png';
         if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
            $IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';         
         }
      }


This was the result of the output:
path=C:\xampp\htdocs\football\modules\mod_news_pro_gk4\cache\default\defaultnewspro1.png

As you can see the name of the file doesn't contain the dot between default and newspro1.
The documentation indicates that there should be a dot between default and newspro1:
All thumbnails are stored in a module cache/ catalog. Additionally, if a given article does not have images, default images default.MOD_ID.png from default/ catalog can be loaded, where MOD_ID is an ID of our module, e.g. newsprol.


In short to make the default image show up, you need to take the following steps.
1. Automatic module id = off
2. Enable create thumbnails
3. Create a default image named defaultMOD_ID.png (i.e MOD_ID is newspro1 here)

Also and probably most important, the documentation should be updated.
User avatar
Junior Boarder

teitbite
Sun Apr 08, 2012 2:30 am
Hi

I believe documentation and module is being done by 2 different developers in this case, because on source requests I can see that this dot should supposed to be there. Thank You for noticing that. I'll let developers know that.
User avatar
Moderator


cron