chat index avatar core file edit...

User avatar
spaceace
Site Owner
Posts: 991
Joined: Wed Dec 16, 2009 8:30 pm
Location: Ontario, Canada
Flag: Canada

chat index avatar core file edit...

Post by spaceace »

the current version 0.1.0-BETA needs a core phpbb file patched for forums installed in a subfolder for the user set avatars to display when a message first gets submitted.
Open root/phpbb/avatar/driver/upload.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select all
	public function get_data($row, $ignore_config = false)
	{
		return array(
			'src' => $this->path_helper->get_web_root_path() . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
			'width' => $row['avatar_width'],
			'height' => $row['avatar_height'],
		);
	}
Replace with
Tip: Replace the preceding line(s) to find with the following line(s).
Code: Select all
	public function get_data($row, $ignore_config = false)
	{
		$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
		return array(
			'src' => $root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
			'width' => $row['avatar_width'],
			'height' => $row['avatar_height'],
		);
	}
save and upload the file
Last edited by spaceace on Mon Mar 23, 2015 8:14 pm, edited 1 time in total.

if you like my work and would like to contribute to my development of styles, please donate by using the donate button in the header.

Image

Need hosting? Click this text to check out ICDSOFT

User avatar
Reaper
Site Admin
Posts: 3
Joined: Sun Feb 15, 2015 10:12 am
Location: New-Brunswick, Canada
Flag: Canada

Re: chat index avatar core file edit...

Post by Reaper »

There is also the local.php file from the same driver folder, that has a bug in it, here is the fix
Open root/phpbb/avatar/driver/local.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select all
	public function get_data($row, $ignore_config = false)
	{
		return array(
			'src' => $this->path_helper->get_web_root_path() . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
			'width' => $row['avatar_width'],
			'height' => $row['avatar_height'],
		);
	}
Replace with
Tip: Replace the preceding line(s) to find with the following line(s).
Code: Select all
	public function get_data($row, $ignore_config = false)
	{
		$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
		return array(
			'src' => $root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
			'width' => $row['avatar_width'],
			'height' => $row['avatar_height'],
		);
	}
save and upload the file

User avatar
spaceace
Site Owner
Posts: 991
Joined: Wed Dec 16, 2009 8:30 pm
Location: Ontario, Canada
Flag: Canada

Re: chat index avatar core file edit...

Post by spaceace »

from phpBB 3.1.4 and up, these core edits are part of the phpBB software package and manual edits are no longer required :D
if you like my work and would like to contribute to my development of styles, please donate by using the donate button in the header.

Image

Need hosting? Click this text to check out ICDSOFT