Reusing attachments.html

phpBB3 and MOD challenges setup by the staff to test and challenge your phpBB3 coding skills.

Reusing attachments.html

Postby Michaelo » 14 Dec 2008, 14:24

As usual I'm not entirely sure if this is the correct forums but I have looked at all the alternatives and it seems right...

I am having some difficulty understanding how the contents of the attachment.html file is actually visible to (or used by) viewtopics_body...

The process is: viewtopics calls the parse_attachments function which assigns variables to the attachment.html file...
Now, the bit that confuses me is, viewtopics never includes the attachment.html file, nor can I find any other method to include it or its contents... yet the contents (attachments) are displayed in viewtopics_body...

I have probably missed something obvious, but it wouldn't be the first time...

If anyone can shed some light on this it would be gratefully appreciated...
Mike
Stargate Portal (Dev Site) phpBB 3.0.9 version II 99%.
Kiss Portal Engine (Dev Site) phpBB 3.0.10 99%.
User avatar
Michaelo    
Supporter
Supporter
 
Posts: 342
Joined: 17 Sep 2006, 09:02
Location: Dublin, Ireland
Favorite Team: Miami Dolphins
Gender: Male
phpBB Knowledge: 9




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Reusing attachments.html

Postby topdown » 14 Dec 2008, 14:45

Around line 1297 in viewtopic.php
Code: Select all
   if (!empty($attachments[$row['post_id']]))
   {
      parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count);
   }


and we know that the parse_attachments function includes the attachments template, so there it is.

This is actually useful to me also, I need to search it out anyway for my mod ;)
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3030
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Reusing attachments.html

Postby Michaelo » 14 Dec 2008, 16:46

and we know that the parse_attachments function includes the attachments template, so there it is.

Sorry I should have been a little clearer... I have already written my own attachments parser (not using the attachments file) and it works fine but I have re-invented the wheel...

It must be assign_display... sometimes you cant see the woods for the trees :thumbsup:
Update: I've had another read through and I see it... many thanks...
Mike
Stargate Portal (Dev Site) phpBB 3.0.9 version II 99%.
Kiss Portal Engine (Dev Site) phpBB 3.0.10 99%.
User avatar
Michaelo    
Supporter
Supporter
 
Posts: 342
Joined: 17 Sep 2006, 09:02
Location: Dublin, Ireland
Favorite Team: Miami Dolphins
Gender: Male
phpBB Knowledge: 9


Return to phpBB3 Challenges at phpBB Academy

Who is online

Users browsing this forum: No registered users and 2 guests