Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: Kinng - helmikuu 10, 2009, 09:02:46 AP

Otsikko: Show attachments in WAP?
Kirjoitti: Kinng - helmikuu 10, 2009, 09:02:46 AP
How can I show attachments in WAP and allow them to be downloaded (to the phone)?

Using SMF 2.0 RC 1

Thanks :)
Otsikko: Re: Show attachments in WAP?
Kirjoitti: karlbenson - helmikuu 10, 2009, 10:31:53 AP
Not currently possible.

You might need to make a mod request for this.
(even then I'm not sure whether most mobiles could support it)
Otsikko: Re: Show attachments in WAP?
Kirjoitti: aED - helmikuu 10, 2009, 11:20:01 AP
Its possible Im using it in our community http://wap.pinoyden.com

you have to modify the wireless.template.php and copy the attachment code in display.php

or this if you cant find the appropriate code in display.php

look for template_imode_display() and paste the code below where you want the attachments to appear... If you cant do it manually ill try to make a Mod for you...


// Assuming there are attachments...
        if (!empty($message['attachment']))
        {
            echo '          <div>Attached Files:<br />';
            foreach ($message['attachment'] as $attachment)
            {
                if ($attachment['is_image'])
                {
                        echo '
                                <a href="' . $attachment['href'] . ';image"><img src="' . $settings['default_theme_url'] . '/images/dl.gif" border="0" />' . $attachment['name'] . '</a> (', $attachment['size'],' - Views ' . $attachment['downloads'] . ')<br />';
                }
                else
                echo '
                                <a href="' . $attachment['href']  . "><img src="' . $settings['default_theme_url'] . '/images/dl.gif" border="0" />' . $attachment['name'] . '</a> (', $attachment['size'],' - DL ' . $attachment['downloads'] . ')<br />';
            }

            echo '
                                    </div>';
        }



Although there is some problems with some mobile browsers they cannot handle correctly the sessions when downloading which is my problem ever since that is the only problem i know when downloading through mobile phone.
Otsikko: Re: Show attachments in WAP?
Kirjoitti: Kinng - helmikuu 11, 2009, 02:08:25 AP
Lainaus käyttäjältä: aED - helmikuu 10, 2009, 11:20:01 AP
Its possible Im using it in our community http://wap.pinoyden.com

you have to modify the wireless.template.php and copy the attachment code in display.php

or this if you cant find the appropriate code in display.php

look for template_imode_display() and paste the code below where you want the attachments to appear... If you cant do it manually ill try to make a Mod for you...


// Assuming there are attachments...
        if (!empty($message['attachment']))
        {
            echo '          <div>Attached Files:<br />';
            foreach ($message['attachment'] as $attachment)
            {
                if ($attachment['is_image'])
                {
                        echo '
                                <a href="' . $attachment['href'] . ';image"><img src="' . $settings['default_theme_url'] . '/images/dl.gif" border="0" />' . $attachment['name'] . '</a> (', $attachment['size'],' - Views ' . $attachment['downloads'] . ')<br />';
                }
                else
                echo '
                                <a href="' . $attachment['href']  . "><img src="' . $settings['default_theme_url'] . '/images/dl.gif" border="0" />' . $attachment['name'] . '</a> (', $attachment['size'],' - DL ' . $attachment['downloads'] . ')<br />';
            }

            echo '
                                    </div>';
        }



Although there is some problems with some mobile browsers they cannot handle correctly the sessions when downloading which is my problem ever since that is the only problem i know when downloading through mobile phone.

Is it compatible with SMF 2.0 RC 1?
(This seems to be exactly what I need, but my site uses SMF 2.0)
Otsikko: Re: Show attachments in WAP?
Kirjoitti: aED - helmikuu 11, 2009, 07:19:39 AP
Im not sure but it might work I used that code on beta 4 so its likely that it would also work with RC1
Otsikko: Re: Show attachments in WAP?
Kirjoitti: greyknight17 - helmikuu 27, 2009, 10:14:13 IP
Kinng, is this issue resolved now?

If not, we can move it over to the Mod Request board for you unless aED has this as a work in progress already :)
Otsikko: Re: Show attachments in WAP?
Kirjoitti: Kinng - helmikuu 27, 2009, 11:13:06 IP
It doesn't seem to work (at least for me)

Wherever I insert the code in 'Wireless.template.php' I keep getting a "Template Parse Error!"  :(
Otsikko: Re: Show attachments in WAP?
Kirjoitti: aED - helmikuu 28, 2009, 08:10:38 AP
Kinng what version of smf are you using... Ill post a mod for this tonight just wait for it to be reviewed...

Ok
Otsikko: Re: Show attachments in WAP?
Kirjoitti: Kinng - helmikuu 28, 2009, 09:22:25 AP
I'm using SMF 2.0 RC1
Otsikko: Re: Show attachments in WAP?
Kirjoitti: JimM - maaliskuu 15, 2009, 11:42:18 IP
Any update on this Kinng?  I'm going through old topics trying to clear some out.  If this is solved, feel free to mark it as solved by clicking the Mark Topic Solved link at the bottom of the page under the linktree.