×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: JOSC_post.php checks wrong template folder for nophoto image

JOSC_post.php checks wrong template folder for nophoto image 13 years 4 months ago #11057

  • Hari Karam Singh
  • Hari Karam Singh's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
getUserGravatar() in JOSC_post.php will only check built in templates for nophoto.png. The slight tweak below will allow PNG and JPG nophoto's in any template folder...

~line 442...
$gravatar_email = $this->_item['email'];
		$uripng = new JURI("$this->_template_path/$this->_template_name/images/nophoto.png");
		$urijpg = new JURI("$this->_template_path/$this->_template_name/images/nophoto.jpg");
		$checkpathpng = JPATH_BASE.str_replace( '/', DS, $uripng->getPath());
		$checkpathjpg = JPATH_BASE.str_replace( '/', DS, $urijpg->getPath());
		if ( file_exists($checkpathpng) ) {
			$default = "$this->_template_path/$this->_template_name/images/nophoto.png";
		} elseif ( file_exists( $checkpathjpg ) ){
			$default = "$this->_template_path/$this->_template_name/images/nophoto.jpg";
		} else {
			$default = JURI::base().'components/com_comment/assets/images/nophoto.jpg';
		}

Hope this helps...

JOSC_post.php checks wrong template folder for nophoto image 13 years 4 months ago #11062

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
That is cool! I'll add this code to the next version :)

Thank you for sharing!

JOSC_post.php checks wrong template folder for nophoto image 13 years 4 months ago #11064

  • Hari Karam Singh
  • Hari Karam Singh's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Hooray! :)
  • Page:
  • 1
Time to create page: 0.102 seconds