links posted within my chat extension...

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
User avatar
spaceace
Registered User
Posts: 12
Joined: Thu Dec 04, 2014 4:33 pm
Location: Ontario Canada
Contact:

links posted within my chat extension...

Post by spaceace »

i just tried my chat extension on phpBB 3.2.0-a1 and everything seems to work fine except where forum posts get put into chat. they show up like this
when i view the source, it is showing the link in 2 sets of <a href> tags. and also outputting the link as this
instead of this
while my extension outputs everything as it should in phpBB 3.1.x, it won't in 3.2 and i don't know how to go about fixing it.

here's the part of the listener that does it... maybe it's all wrong and should be fixed. i just don't know as the person that was helping me with chat has stopped :roll:

Code: Select all

		$url			 = append_sid(generate_board_url() . '/viewtopic.' . $this->php_ext, 'f=' . $event['data']['forum_id'] . '&t=' . $event['data']['topic_id'] . '&p=' . $event['data']['post_id'] . '#p' . $event['data']['post_id']);
		$username		 = get_username_string('full', $this->user->data['user_id'], $this->user->data['username'], $this->user->data['user_colour']);
		$message		 = sprintf($lang, $url, $event['post_data']['post_subject']);
		$uid			 = $bitfield		 = $options		 = '';
		$allow_bbcode	 = $allow_urls		 = $allow_smilies	 = true;
		generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
		$sql_ary = array(
			'chat_id'			 => 0,
			'user_id'			 => $this->user->data['user_id'],
			'username'			 => $this->user->data['username'],
			'user_colour'		 => $this->user->data['user_colour'],
			'message'			 => $message,
			'bbcode_bitfield'	 => $bitfield,
			'bbcode_uid'		 => $uid,
			'bbcode_options'	 => $options,
			'time'				 => time(),
			'forum_id'			 => $event['forum_id'],
			'post_id'			 => $event['data']['post_id'],
		);
		$sql	 = 'INSERT INTO ' . CHAT_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
		$this->db->sql_query($sql);
also, in my language file

Code: Select all

'CHAT_NEW_TOPIC'				=> 'has started a new topic: <a href="%1$s">%2$s</a>',

User avatar
spaceace
Registered User
Posts: 12
Joined: Thu Dec 04, 2014 4:33 pm
Location: Ontario Canada
Contact:

Re: links posted within my chat extension...

Post by spaceace »

i got help with this on phpbb.com in this topic https://www.phpbb.com/community/viewtop ... &t=2347386

i posted this here because i did not think that posting a phpBB 3.2 question was relevant being posted in a phpBB 3.1 discussion forum as this one is for 3.x which would make sense as it would cover 3.1 as well as 3.2

never the less, it's resolved :D

Post Reply