GK News Show Pro Problem

Best WordPress theme for game news websites, game portals or whatever your preferred subject.
GK User
Wed Oct 10, 2012 9:36 am
When I use GK News Show Pro everything goes down. I checked cache_nsp file permission folder has 777 permission , I changed the cache directory from code nothing changed.Is there anyone who changed categories and made new posts and use GK News Show Pro and don't have any problem?
User avatar
Junior Boarder

GK User
Wed Oct 10, 2012 10:30 am
What type of source you use in News Show Pro ? Please enable display_errors option in PHP configuration this will provide more details about problem.
User avatar
Platinum Boarder

GK User
Wed Oct 10, 2012 11:27 am
Warning: stripos() expects parameter 1 to be string, object given in /home/public_html/oktaysaral/wp-content/themes/GameNews/gavern/widgets.nsp.php on line 868

Catchable fatal error: Object of class WP_Error could not be converted to string in /home/public_html/oktaysaral/wp-content/themes/GameNews/gavern/widgets.nsp.php on line 869"
User avatar
Junior Boarder

GK User
Wed Oct 10, 2012 9:24 pm
@kacal - do you have the GD library installed on your server?
User avatar
Administrator

GK User
Thu Oct 11, 2012 8:15 am
I am using hostgator servers I asked their techinical stuff there is no problem with directory permissions and gd library.
User avatar
Junior Boarder

GK User
Thu Oct 11, 2012 8:21 am
Hostgator technical stuff says your theme has a coding problem.They checked all the possible solutions and give this answer.
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 6:52 am
The problem is fact, that the image_resize function built-in with WordPress returns the WP_Error object instead of the file name, so the image cannot be created due the permissions or due problems with GD library - please replace the generate_art_image method in the widgets.nsp.php file with:

Code: Select all
function generate_art_image($i) {
       $art_ID = '';

       if($this->wdgt_config['data_source_type'] == 'post') {
          $art_ID = $this->wdgt_results[$i][0]->ID;
       } else {
          $art_ID = $this->wdgt_results[$i]->ID;
       }

       $art_url = get_permalink($art_ID);

       $image = wp_get_attachment_image_src( get_post_thumbnail_id( $art_ID ), 'single-post-thumbnail' );
       $image_path = $image[0];
       $real_image_path = stripos($image_path, 'wp-content/uploads/');
       $image_path = substr($image_path, $real_image_path);
       $image_path = str_replace('wp-content/uploads/', '/uploads/', $image_path);

       if($image_path != '') {
          $new_path = image_resize(WP_CONTENT_DIR . $image_path, $this->wdgt_config['article_image_w'], $this->wdgt_config['article_image_h'], true, $this->id, dirname(__FILE__) . '/cache_nsp' );

          if(is_string($new_path)) {
             $new_path_pos = stripos($new_path, '/gavern/cache_nsp');
             $new_path = substr($new_path, $new_path_pos);
             $new_path = get_template_directory_uri() . $new_path;

             $style = '';

             if($this->wdgt_config['image_block_padding'] != '' && $this->wdgt_config['image_block_padding'] != '0') {
                $style = ' style="margin: '.$this->wdgt_config['image_block_padding'].';"';
             }

             if($this->wdgt_config['article_image_pos'] == 'left' && $this->wdgt_config['article_image_order'] == 1) {
                return '<div class="gk-nsp-image-wrap"><a href="'.$art_url.'" class="gk-image-link"><img src="'.$new_path.'" alt="" class="gk-nsp-image" '.$style.' /></a></div>';
             } else {
                return '<a href="'.$art_url.'" class="gk-responsive gk-image-link"><img src="'.$new_path.'" alt="" class="gk-nsp-image gk-responsive" '.$style.' /></a>';
             }
          } else {
             return '<strong>Warning!</strong> Permissions for the gavern/cache_nsp directory are wrong or the PHP GD library is not installed and the thumbnails cannot be created.';
          }
       } else {
          return '';
       }
    }
User avatar
Administrator

GK User
Fri Oct 12, 2012 9:29 am
I am bored I changed the codes
Warning! Permissions for the gavern/cache_nsp directory are wrong or the PHP GD library is not installed and the thumbnails cannot be created.
I get this error
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 9:36 am
http://akilliofis.com/osaral/
if you look at the website 2nd nsp part row it ganerates images why ?
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 9:51 am
when I change category in nsp module there is problem too. without nsp module everything is fine if you don't use nsp everything is ok and it ganerates images and thumbnails.As you can see second nsp module at homepage generates thumbs.
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 10:29 am
I asked hostgator technical stuff to check everything agian. Their answer is gd libray is up to date, permissions ara ok 775. MySQL 5.5.23 - phpMyAdmin 3.4.10.1 - PHP: 5.2.17 if you have any questions they will answer.
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 10:58 am
Please change fragment:
Code: Select all
            return '<strong>Warning!</strong> Permissions for the gavern/cache_nsp directory are wrong or the PHP GD library is not installed and the thumbnails cannot be created.';


To:
Code: Select all
return print_r($new_path->get_error_messages(), true);


And write me what was displayed after this change.
User avatar
Administrator

GK User
Fri Oct 12, 2012 11:12 am
Array ( [0] => Could not calculate resized image dimensions )
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 11:42 am
http://akilliofis.com/osaral/ look the site when you give the exact value 640 - 300 it works but when the image value is diffrent from value you give it gives error look the second news
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 3:49 pm
Could you specify how big is memory limit on your hosting? Maybe you have set the small limit what cause the problem?
User avatar
Administrator

GK User
Fri Oct 12, 2012 8:14 pm
Hostgators technical stuff said there is no problem with the memory limit. I think there is a problem with the widgets nsp image size limits. If you set it higher then 640 - 300 the problem starts if you set the image size to 640 - 300 there is no problem, it works.The padding is 0px 20px 0px 20px margin is 0px 2px 12px the problem lies under image size , padding or margin.
User avatar
Junior Boarder

GK User
Fri Oct 12, 2012 10:46 pm
@kacal - I will need an FTP and administrator access to your website - there is an only way to check what is a real reason of your problem - could you send it to dziudek[at]gavick[dot]com?
User avatar
Administrator


cron