Messages - slinouille [ switch to compact view ]

Pages: [1] 2next
1
SMF Forum Mods / Re: Inline attachment mod for SMF2.0b3
« on: May 05, 2008, 08:41 AM »
Okay I've found why!
Because you're using 2.0 Beta 3.1 Public and not 2.0 Beta 3 Public

Please found the version updated here

Bye

SliN

2
SMF Forum Mods / Re: Inline attachment mod for SMF2.0b3
« on: May 05, 2008, 08:13 AM »
Any ideas?  Has anyone been able to fix this problem?
-MatthewSchenker (May 05, 2008, 05:56 AM)
Hello,

I've tried the mod on a fresh install of SMF2b3, and no error occurs.
You have probably done modification of display.template.php or post.template.php files  :huh:

Slin

3
SMF Forum Mods / Re: Inline attachment mod for SMF2.0b3
« on: May 04, 2008, 09:32 AM »
Hello guys!

Here it is!

I'm preparing another version quite different but based on the code provided by mouser ;-)

Mouser, tell me if this install satisfies you  :)

Bye

4
SMF Forum Mods / Re: Inline attachment mod for SMF2.0b3
« on: April 12, 2008, 06:14 AM »
Hello mouser !

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

Can I distribuate this update with your agreement?

Bye

SliN

5
SMF Forum Mods / Re: Inline attachment mod for SMF2.0b3
« on: April 09, 2008, 03:48 PM »
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 [Select]
  1. // Show the post itself, finally!
  2. echo '
  3.                                                                 </div></td>
  4.                                                         </tr></table>
  5. ...

2. Select code until
Code: PHP [Select]
  1. ...
  2.                         // If we had unapproved attachments clean up.
  3.                         if ($last_approved_state == 0)
  4.                                 echo '
  5.                                                                         </fieldset>';
  6.  
  7.                         echo '
  8.                                                                         </div>';
  9.                 }

3. Copy the code from original modification.xml file

4. modify PART 2 by
Code: PHP [Select]
  1. //---------------------------------------------------------------------------
  2.                 // PART 2 - original code
  3.                 // Show the post itself, finally!
  4.                 // 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)
  5.                 echo '
  6.                                                                 </div></td>
  7.                                                         </tr></table>
  8.                                                         <hr width="100%" size="1" class="hrcolor" />';
  9.                 if ($ignoring)
  10.                         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>';
  11.  
  12.                 echo '
  13.                                                         <div class="post" id="msg_', $message['id'], '"', '>';
  14.  
  15.                 if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  16.                         echo '
  17.                                                                 <div style="margin: 2ex; padding: 1ex; border: 2px dashed #cc3344; color: black; font-weight: bold;">
  18.                                                                         ', $txt['post_awaiting_approval'], '
  19.                                                                 </div>';
  20.                 echo '
  21.                                                                 ', $message['body'], '
  22.                                                         </div>', $message['can_modify'] ? '
  23.                                                         <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'] . '\')" />' : '' , '
  24.                                                 </td>
  25.                                         </tr>';
  26.  
  27.                
  28.                 // Now for the attachments, signature, ip logged, etc...
  29.                 echo '
  30.                                         <tr id="msg_', $message['id'], '_footer">
  31.                                                 <td valign="bottom" class="smalltext" width="85%">
  32.                                                         <table width="100%" border="0" style="table-layout: fixed;"><tr>
  33.                                                                 <td colspan="2" class="smalltext" width="100%">';
  34.                 //---------------------------------------------------------------------------

4. modify PART 4 by
Code: PHP [Select]
  1. //---------------------------------------------------------------------------
  2.                 // PART 4 - original code but MODIFIED to skip inlined images
  3.                 // Assuming there are attachments...
  4.                 if (!empty($message['attachment']))
  5.                 {
  6.                         echo '
  7.                                                                         <hr width="100%" size="1" class="hrcolor" />
  8.                                                                         <div style="overflow: auto; width: 100%;">';
  9.                         $last_approved_state = 1;
  10.                         foreach ($message['attachment'] as $attachment)
  11.                         {
  12.                                 // Show a special box for unapproved attachments...
  13.                                 if ($attachment['is_approved'] != $last_approved_state)
  14.                                 {
  15.                                         $last_approved_state = 0;
  16.                                         echo '
  17.                                                                         <fieldset>
  18.                                                                                 <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>';
  19.                                 }
  20.  
  21.                         //---------------------------------------------------------------------------

5. Modify last part starting by \\back to orginal code with this code
Code: PHP [Select]
  1. //---------------------------------------------------------------------------
  2.                                 // Back to original code
  3.                                 if ($attachment['is_image'])
  4.                                 {
  5.                                         if ($attachment['thumbnail']['has_thumb'])
  6.                                                 echo '
  7.                                                                         <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 />';
  8.                                         else
  9.                                                 echo '
  10.                                                                         <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
  11.                                 }
  12.                                 echo '
  13.                                                                                 <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';
  14.  
  15.                                 if (!$attachment['is_approved'])
  16.                                         echo '
  17.                                                                                 [<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>] ';
  18.                                 echo '
  19.                                                                                 (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
  20.                         }
  21.  
  22.                         echo '
  23.                                                                         </div>';
  24.                 }
  25.                 //---------------------------------------------------------------------------


In Post.template.php file

7. After code
Code: PHP [Select]
  1. // What about smileys?
  2.         if (!empty($context['smileys']['postform']))

insert the suggested code in modification.xml file.

8. Modify sentence
Code: PHP [Select]
  1. <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]
  1. <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

Pages: [1] 2next
Go to full version