Will inline image attachments display on the portal?


Topic author
magnusm
Active Member
Posts: 4
Joined: 22. May 2008 14:17

Will inline image attachments display on the portal?

Post by magnusm »

Hi,
I've been looking around for portals for a while now, and there seems to be a problem with inline attachment images displaying on the front pages of the portal when posts from a news forum are displayed on the portal. I was wondering if that is a problem in Board3portal?

tl;dr Will inline image attachments display on the portal news posts?

thanks.
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Will inline image attachments display on the portal?

Post by Kevin »

Not yet.
Maybe we'll implement this feature before the final release, but we'll see.
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Topic author
magnusm
Active Member
Posts: 4
Joined: 22. May 2008 14:17

Re: Will inline image attachments display on the portal?

Post by magnusm »

Hi,
thanks for the reply. I guess this must be pretty tricky, since no portal can get it working. :|
I'll keep looking, maybe I'll be back again :)

hewitt
Active Member
Posts: 8
Joined: 4. May 2008 10:27

Re: Will inline image attachments display on the portal?

Post by hewitt »

magnusm wrote:Hi,
thanks for the reply. I guess this must be pretty tricky, since no portal can get it working. :|
I'll keep looking, maybe I'll be back again :)
I was asking for this before and couldn't find any. But hey, now you can do it. Check out this this topic from phpbb. Attached images can be displayed with the news. Or as a gallery too.

Cheers,
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Will inline image attachments display on the portal?

Post by Kevin »

Awesome hewitt!
Many thanks for sharing this! :)

As i had a quick look: it's limited to images?


(Moved topic to: Blocks - In Development)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

hewitt
Active Member
Posts: 8
Joined: 4. May 2008 10:27

Re: Will inline image attachments display on the portal?

Post by hewitt »

Yes, it only displays images. Such as jpg, jpeg, gif, png, bmp. Other types of images can be added on

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

Any progress?

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

I've finally managed to bring up inline attachment functionality, so happy :D

Now I'm going to post this mod here.....

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

Hope this code will bring inline attachments to your portal, guys. ;)

1. OPEN
/portal/includes/functions.php

2. FIND

Code: Select all

$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$len_check = $row['post_text'];
3. BEFORE ADD

Code: Select all

// Pull attachment data
$sql2 = 'SELECT *
	FROM ' . ATTACHMENTS_TABLE . '
	WHERE `post_msg_id` = '. $row['post_id'] .'
	AND in_message = 0';
				
$result2 = $db->sql_query($sql2);

while ($row2 = $db->sql_fetchrow($result2))
{
	$attachments[] = $row2;
}
$db->sql_freeresult($result2);
4. FIND

Code: Select all

$message = smiley_text($message); // Always process smilies after parsing bbcodes
5. BEFORE ADD

Code: Select all

if (!empty($attachments))
{
	parse_attachments($row['forum_id'], $message, $attachments, $update_count);
}
Well...that's it. Please correct me if it still wont working. :geek:
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Will inline image attachments display on the portal?

Post by Kevin »

Wow - that's cool, thank you very much for sharing this! :)
I'll test it soon.
Do you have already a demo of the working code?
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

Sorry, but I prefer not to share my portal address. It would not show much anyway. But this code is working for me.

This code is taken from viewtopic.php and adapted for portal view. In other words it just makes portal to treat attachments the forum natural way. The main difference is that viewtopic.php operates with an array of posts instead of one at a time.

You could search through viewtopic.php for "// Pull attachment data"
and "parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count);"
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Will inline image attachments display on the portal?

Post by Ice »

It works, but for some odd reason the attachments are in a reverse order on the portal. :/
Board3 Portal Dev & English Tech Support

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

Try to play around with mysql query from Step 3.

Adding "DESC" directive may fix that problem.

P.S. I have an incremental in ACP attachment order settings.
Last edited by connect on 11. August 2008 07:23, edited 1 time in total.
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Will inline image attachments display on the portal?

Post by Kevin »

Yes, correct. He already added it. ;)
http://board3deportal.svn.sourceforge.n ... athrev=286

Thanks again, connect, to point out this solution! :)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

connect
Translator
Posts: 18
Joined: 14. July 2008 14:47

Re: Will inline image attachments display on the portal?

Post by connect »

Maybe it's better to check that ACP option before mysql request?
Post Reply

Return to “Modification Requests”