Advertisement:

Show attachments in WAP?

Aloittaja Kinng, helmikuu 10, 2009, 09:02:46 AP

« edellinen - seuraava »

Kinng

How can I show attachments in WAP and allow them to be downloaded (to the phone)?

Using SMF 2.0 RC 1

Thanks :)

karlbenson

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)

aED

#2
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.

Kinng

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 [nofollow]

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)

aED

Im not sure but it might work I used that code on beta 4 so its likely that it would also work with RC1

greyknight17

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 :)

Kinng

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!"  :(

aED

Kinng what version of smf are you using... Ill post a mod for this tonight just wait for it to be reviewed...

Ok

Kinng


JimM

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.
Jim "JimM" Moore
Former Support Specialist

Advertisement: