ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > SMF Forum Mods

Inline attachment mod for SMF2.0b3

(1/4) > >>

slinouille:
Hello all  :)

Fist of all I'd like to thank mouser for this exceptionnal mod.
I've been using for a long time in my SMF1.x forum.

After some problems, I've decided to go to the SMF2.0b3, and I really needed to have this excellent mod to work on this new version of SMF.

So I've done some modification in order to adapt the orignal IA mod. If someone is interested, I can post here the modification to do.
Just ask !

Bye

Slin

mouser:
Yes please post! (you could send me the updated file(s) as well if you don't mind! [email protected]) -- my smf skills are being forgotten so it will be useful when we upgrade :)

slinouille:
Great  :Thmbsup:

I'm not a specialist of php or things like that I'm just a simple "guy that adapt things using his brain" ...  ;)

So here it is ... you'll need the original modification.xml file because I'll not write all code but jsut adaptations ;-) ... I'l send to mouser the modification_smf2.0b3 file (I've not modified the headers and things like that ... it's not my source code ... I respect the authors as much as I can)

in display.template.php

1. find

--- Code: PHP ---// Show the post itself, finally!echo '                                                                </div></td>                                                        </tr></table>...
2. Select code until

--- Code: PHP ---...                        // If we had unapproved attachments clean up.                        if ($last_approved_state == 0)                                echo '                                                                        </fieldset>';                         echo '                                                                        </div>';                }
3. Copy the code from original modification.xml file

4. modify PART 2 by

--- Code: PHP ---//---------------------------------------------------------------------------                // PART 2 - original code                // Show the post itself, finally!                // ATTN: it's not clear if this mod interferes with the inline modificiation feature new to 1.1RC2 and 1.1RC3 (see last img src line below)                echo '                                                                </div></td>                                                        </tr></table>                                                        <hr width="100%" size="1" class="hrcolor" />';                if ($ignoring)                        echo '                          <div id="msg_', $message['id'], '_ignored_prompt" style="display: none;">', $txt['ignoring_user'], '  <a href="#msg', $message['id'], '" onclick="return ignoreToggles[', $message['id'], '].toggle()">', $txt['show_ignore_user_post'], '</a></div>';                 echo '                                                        <div class="post" id="msg_', $message['id'], '"', '>';                 if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])                        echo '                                                                <div style="margin: 2ex; padding: 1ex; border: 2px dashed #cc3344; color: black; font-weight: bold;">                                                                        ', $txt['post_awaiting_approval'], '                                                                </div>';                echo '                                                                ', $message['body'], '                                                        </div>', $message['can_modify'] ? '                                                        <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="' . $txt['quick_modify'] . '" title="' . $txt['quick_modify'] . '" align="right" id="modify_button_' . $message['id'] . '" style="cursor: ' . ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '                                                </td>                                        </tr>';                                 // Now for the attachments, signature, ip logged, etc...                echo '                                        <tr id="msg_', $message['id'], '_footer">                                                <td valign="bottom" class="smalltext" width="85%">                                                        <table width="100%" border="0" style="table-layout: fixed;"><tr>                                                                <td colspan="2" class="smalltext" width="100%">';                //---------------------------------------------------------------------------
4. modify PART 4 by

--- Code: PHP ---//---------------------------------------------------------------------------                // PART 4 - original code but MODIFIED to skip inlined images                // Assuming there are attachments...                if (!empty($message['attachment']))                {                        echo '                                                                        <hr width="100%" size="1" class="hrcolor" />                                                                        <div style="overflow: auto; width: 100%;">';                        $last_approved_state = 1;                        foreach ($message['attachment'] as $attachment)                        {                                // Show a special box for unapproved attachments...                                if ($attachment['is_approved'] != $last_approved_state)                                {                                        $last_approved_state = 0;                                        echo '                                                                        <fieldset>                                                                                <legend>', $txt['attach_awaiting_approve'], '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';sesc=', $context['session_id'], '">', $txt['approve_all'], '</a>]</legend>';                                }                         //---------------------------------------------------------------------------
5. Modify last part starting by \\back to orginal code with this code

--- Code: PHP ---//---------------------------------------------------------------------------                                // Back to original code                                if ($attachment['is_image'])                                {                                        if ($attachment['thumbnail']['has_thumb'])                                                echo '                                                                        <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';                                        else                                                echo '                                                                        <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';                                }                                echo '                                                                                <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';                                 if (!$attachment['is_approved'])                                        echo '                                                                                [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';sesc=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';sesc=', $context['session_id'], '">', $txt['delete'], '</a>] ';                                echo '                                                                                (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';                        }                         echo '                                                                        </div>';                }                //---------------------------------------------------------------------------

In Post.template.php file

7. After code

--- Code: PHP ---// What about smileys?        if (!empty($context['smileys']['postform']))
insert the suggested code in modification.xml file.

8. Modify sentence

--- Code: PHP ---<select onchange="surroundText(this.options[this.selectedIndex].value,\'\', document.forms.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0; document.forms.', $context['post_form'], '.', $context['post_box_name'], '.focus(document.forms.', $context['post_form'], '.', $context['post_box_name'], '.caretPos);" style="margin-bottom: 1ex;">
by


--- Code: PHP ---<select onchange="surroundText(this.options[this.selectedIndex].value,\'\', document.getElementById(\''. $context['post_box_name'].'\')); this.selectedIndex = 0; document.forms.', $context['post_form'], '.', $context['post_box_name'], '.focus(document.forms.', $context['post_form'], '.', $context['post_box_name'], '.caretPos);" style="margin-bottom: 1ex;">
That's all folks ! Your favorite mod is back in your SMF2.0b3 forum  :D

Mouser, I'll send you the file tomorrow .. I need to sleep

Bye

SliN

slinouille:
Hello mouser !

I've created a clean "InlineAttachementMod" installer ;-)

Can I distribuate this update with your agreement?

Bye

SliN

MatthewSchenker:
Good Morning,
I just found this post (sorry, I posted a question about this elsewhere in the forum).
Has the new modification been developed for 2.0 beta?  I really need this modification -- it's become essential to my forum!!
Thanks,
Matthew

Navigation

[0] Message Index

[#] Next page

Go to full version