[CDB] Ajax Chat

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

here's where i'm at...

i can get the DB, the UCP options, and even the bbcode that is needed for the extension. but i'm stuck on the hard part of porting the root files. i've read the [HowTo] Convert 3.0 MOD into 3.1 Extension i don't know how mant times and it is just not sinking in. is there someone that can help get me started on these files? i'm the type of person that if you show me and explain, i can usually finish things myself. i've pm and e-mailed several people asking for help and have gotten no reply. not even to tell me no, or they don't have time. discouraging but i'm not giving up ;)
User avatar
RMcGirr83
Former Team Member
Posts: 22099
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [DEV] Ajax Chat

Post by RMcGirr83 »

You probably want to use a route.yml file...like the way paul999 does in his chat extension.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

i have been looking his shoutbox extension over to try to use it as a guide and many other extensions and that is how i've put together several parts but the chat mod i'm porting has 2 root php files. paul's is using all the functions in one controller file and building from the bottom up, not porting that i can see. am i to assume that i can use 2 controller files? or do i need to try to merge both php files into 1 controller. i'm sure everything is plainly in front of me of what to do, but i'm just not seeing it for the life of me :roll:
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

i'm having problems getting the migration files to work. can someone look these over and let me know what is wrong please

first is create_tables

Code: Select all

namespace spaceace\ajaxchat\migrations;

class create_table extends \phpbb\db\migration\migration
{
	static public function depends_on()
	{
		return array();
	}

	public function update_schema()
	{
		return array(
			'add_tables'	=> array(
				$this->table_prefix . 'ajax_chat'	=> array(
					'COLUMNS'	=> array(
						'message_id'					=> array('UINT:11', NOT NULL, 'auto_increment'),
						'chat_id'						=> array('UINT:11', NOT NULL, 0),
						'user_id'						=> array('UINT:11', NOT NULL, 0),
						'username'						=> array('VCHAR:255', NOT NULL, ''),
						'user_colour'					=> array('VCHAR:6', NOT NULL, ''),
						'message'						=> array('MTEXT_UNI', NOT NULL, ''),
						'bbcode_uid'					=> array('VCHAR:8', NOT NULL, ''),
						'bbcode_bitfield'				=> array('VCHAR:255', NOT NULL, ''),
						'bbcode_options'				=> array('UINT:11', NOT NULL, 7),
						'time'							=> array('UINT:11', NOT NULL, 0),
					),
					'PRIMARY_KEY'	=> 'message_id',
				),
				$this->table_prefix . 'ajax_caht_sessions'	=> array(
					'COLUMNS'	=> array(
						'user_id'					=> array('MEDIUMINT:8', NOT NULL, 0),
						'username'					=> array('VCHAR:255', NOT NULL, ''),
						'user_colour'				=> array('VCHAR:6', NOT NULL, ''),
						'user_login'				=> array('UINT:11', NOT NULL, 0),
						'user_firstpost'			=> array('UINT:11', NOT NULL, 0),
						'user_lastpost'				=> array('UINT:11', NOT NULL, 0),
						'user_lastupdate'			=> array('UINT:11', NOT NULL, 0),
					),
					'PRIMARY_KEY'	=> 'user_id',
				),
			),
		);
	}

	public function revert_schema()
	{
		return array(
			'drop_tables' => array(
				$this->table_prefix . 'ajax_caht',
				$this->table_prefix . 'ajax_caht_sessions',
			),
		);
	}
}
next is update_table

Code: Select all

namespace spaceace\ajaxchat\migrations;

class update_table extends \phpbb\db\migration\migration
{
	static public function depends_on()
	{
		return array();
	}

	public function update_schema()
	{
		return array(
			'add_columns'        => array(
				$this->table_prefix . 'users' => array(
					'ajax_chat_view'		=> array('TINYINT(1)', NOT NULL, 1),
					'ajax_chat_position'	=> array('TINYINT(1)', NOT NULL, 1),
					'ajax_chat_avatars'		=> array('TINYINT(1)', NOT NULL, 1),
					'ajax_chat_sound'		=> array('TINYINT(1)', NOT NULL, 1),
				),
			)
		);
	}

	public function revert_schema()
	{
		return array(
			'drop_columns' => array(
				$this->table_prefix . 'users' => array(
					'ajax_ajax_chat_view',
					'ajax_chat_position',
					'ajax_chat_avatars',
					'ajax_chat_sound',
				)
			),
		);
	}
}
finally is update_chat_bbcodes

Code: Select all

namespace spaceace\ajaxchat\migrations;

class update_bbcodes extends \phpbb\db\migration\migration
{
	public function update_data()
	{
		return array(
			array('custom', array(array($this, 'update_chat_bbcodes'))),

			// Stop tracking the version number in the db
			array('config.remove', array('modx_version')),
		);
	}

	public function update_chat_bbcodes()
	{
		$bbcode_data = array(
			'color2=' => array(
				'bbcode_helpline'	=> '',
				'bbcode_match'		=> '[color2={COLOR}]{TEXT}[/color2]',
				'bbcode_tpl'		=> '<span style="color: {COLOR}">{TEXT}</span>',
			),
		);

		global $request, $user;
		$acp_manager = new \spaceace\ajaxchat\core\acp_manager($this->db, $request, $user, $this->phpbb_root_path, $this->php_ext);
		$acp_manager->install_bbcodes($bbcode_data);
	}
}
the problem i get is an error page with this
Parse error: syntax error, unexpected T_STRING, expecting ')' in /ext/spaceace/ajaxchat/migrations/update_table.php on line 15
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

after hours of trying different combinations out, i narrowed the issue down to the NOT NULL argument. i removed it and made some other adjustments and all the migration files are now working as they should :D
ONEMDX
Registered User
Posts: 15
Joined: Tue Jan 06, 2015 10:10 am

Re: [DEV] Ajax Chat

Post by ONEMDX »

awsome , a download link will be greate :)
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

ONEMDX wrote:awsome , a download link will be greate :)
can't provide a download link yet. i still need to get the root .php files ported and the core file additions done. as it stands, this is only working as half MOD and half EXT. as soon as i get it completely ported, i will provide a download of it ;)

i'm new to the extension system and am learning as i go and having to do most of it myself
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

i'm at a point in this that i need help.

here's what i need help with:
getting code into the root/index.php and includes/functions.php via the listener.php file

need help getting the root chat.php and shout.php files into a controller

if there is anyone that is able to help out, please pm me or contact me through my site
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Ajax Chat

Post by mr.ruf »

quiet, we believe in you
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

mr.ruf wrote:quiet, we believe in you
thanks. but i still need help :lol:

also, i've made some template changes. a tester mentioned that there was too much blue in the chat header. i changed that and would like some input about how it looks now. you can also see what it looks like from an Admin or Mod view with the delete function ;)

Image

something i also would like an opinion on. currently, when you hover over someone's avatar, it shows it full size. would anyone like to see this changed or left as is?
User avatar
Sshadow
Registered User
Posts: 302
Joined: Thu Aug 20, 2009 3:54 pm
Name: Chris C.

Re: [DEV] Ajax Chat

Post by Sshadow »

This was one of the first chat mods I ever used with phpBB :)

Have you thought to actually post your question for help here viewforum.php?f=461 in the "mod writers discussion" forum? I think you could get more help from there.

When posting in this particular forum your more dealing with admins who "want" the extensions now or will help you to test and debug once you have atleast a dev or alpha available. The above linked I think may gain your plea for help a bit more attention.
Chris/Admin
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

a switch has been added to the UCP to turn the avatar hover on or off
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Ajax Chat

Post by mr.ruf »

great !!!

im waiting spaceace :D
JacquelineHyde
Registered User
Posts: 12
Joined: Sun Jan 04, 2015 10:45 pm

Re: [DEV] Ajax Chat

Post by JacquelineHyde »

spaceace wrote:
mr.ruf wrote:quiet, we believe in you
thanks. but i still need help :lol:

also, i've made some template changes. a tester mentioned that there was too much blue in the chat header. i changed that and would like some input about how it looks now. you can also see what it looks like from an Admin or Mod view with the delete function ;)

Image

something i also would like an opinion on. currently, when you hover over someone's avatar, it shows it full size. would anyone like to see this changed or left as is?
I like the idea of being able to see a full sized avatar with a hover :)
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [DEV] Ajax Chat

Post by spaceace »

JacquelineHyde wrote:I like the idea of being able to see a full sized avatar with a hover :)
it is an option in the UCP now ;)

Return to “Extensions in Development”