News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

attachments in WAP2.0

Started by ukhalik2, May 09, 2010, 04:05:34 AM

Previous topic - Next topic

ukhalik2

is there any way to show attachments in wap 2.0 ?

i am using smf 2.0rc3 and guests can access attachments and links.

rd

I highly doubt there is...

WAP2 is for mobile users and thus it doesn't support some things like admin CP, images, etc.

ukhalik2

So, is there any other way to do this?
may be there should be a mobile theme by which i can do this?

shed

Quote from: Royalduke on May 09, 2010, 08:08:46 AM
I highly doubt there is...

WAP2 is for mobile users and thus it doesn't support some things like admin CP, images, etc.

i wouldnt put money on that statement :D

check out WAP2 at www.theblackberryshed.co.uk, check out the theme section for exactly what ya want :) (now it works again LOL)

rd

Quote from: shed on May 09, 2010, 05:36:12 PM
Quote from: Royalduke on May 09, 2010, 08:08:46 AM
I highly doubt there is...

WAP2 is for mobile users and thus it doesn't support some things like admin CP, images, etc.

i wouldnt put money on that statement :D

check out WAP2 at www.theblackberryshed.co.uk, check out the theme section for exactly what ya want :) (now it works again LOL)

Your WAP looks custom made O.o I can't even see hotlink images in WAP mode, why the heck would I be able to see attached stuff (I can't see attached stuff here at SMF using wap2 on my iPhone).

Anyways, this is a mobile theme that I know of and that is: http://custom.simplemachines.org/themes/index.php?lemma=2035




rd

PS: Can you give me a link to your site that has attached stuff and that can be viewed or downloaded in WAP mode?

Thanks, if not then your first link can be considered spam (in my forums it would because it doesn't seem to connect).

Yağız...

Find in ./Themes/default/Wireless.template.php:
<p>', $message['body'], '<br /><br /></p>';
Replace with:
         <p>', $message['body'], '<br />';
        foreach ($message['attachment'] as $attachment)
        {
            echo '
            <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a>
            (', $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 '<br /></p>';


Find:
                ', $message['body'], '
            </td></tr>';

Replace with:
                ', $message['body'], '<br />';
        foreach ($message['attachment'] as $attachment)
        {
            echo '
            <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a>
            (', $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 '
            </td></tr>';

Find:
            ', $message['body'], '
        </p>';
        $alternate = !$alternate;

Replace with:
            ', $message['body'], '<br />';
        foreach ($message['attachment'] as $attachment)
        {
            echo '
            <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a>
            (', $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 '
        </p>';
        $alternate = !$alternate;


You can have some logical errors (not showing not approved ones or showing them to everyone etc.). If you have any of these problems, please post there so I can fix it.

KensonPlays


Owner of Mesozoic Haven

ukhalik2

Quote from: Yağız... on May 09, 2010, 06:42:17 PM
You can have some logical errors (not showing not approved ones or showing them to everyone etc.). If you have any of these problems, please post there so I can fix it.

woww.. it worked perfectly..

but is there any way to display images also in small size (the images that are in tags?)

Yağız...

Quote from: ukhalik2 on May 11, 2010, 01:00:09 PM
Quote from: Yağız... on May 09, 2010, 06:42:17 PM
You can have some logical errors (not showing not approved ones or showing them to everyone etc.). If you have any of these problems, please post there so I can fix it.

woww.. it worked perfectly..

but is there any way to display images also in small size (the images that are in tags?)
Yes but it can "hurt" your users :P

ukhalik2

ohh but is there any way to show links to other site?

Yağız...

Nevermind, for URLs, you need to show every BBC tags. Find this in the same file as above:
            ), $message['body']), '<br>');

        echo '
        <p><u>', $message['member']['name'], '</u>:', (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br /></p>

Replace with:
            ), $message['body']), '<br>');
            $message['body'] = parse_bbc($message['body']);

        echo '
        <p><u>', $message['member']['name'], '</u>:', (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br /></p>

Find:
            ), $message['body']), '<br>');

        echo '
            <tr><td>', $message['first_new'] ? '

Replace with:
            ), $message['body']), '<br>');
            $message['body'] = parse_bbc($message['body']);

        echo '
            <tr><td>', $message['first_new'] ? '

Find:
            ), $message['body']), '<br>');

        echo $message['first_new'] ? '
        <a id="new"></a>' : '', '

Replace with:
            ), $message['body']), '<br>');
        $message['body'] = parse_bbc($message['body']);

        echo $message['first_new'] ? '
        <a id="new"></a>' : '', '

ukhalik2

Thanks very much for your kind help.

but I want to resize every image to 60x60 when in mobile view, if its possible and you feel easy to help then do, otherwise its ok :).

Yağız...

Find:
), $message['body']), '<br>');
$message['body'] = parse_bbc($message['body']);

Replace with:
), $message['body']), '<br><img>');
$message['body'] = parse_bbc($message['body']);

ukhalik2

images and links still wont show up :(

Arantor

Just resizing an image to 60x60 doesn't make the file any smaller, so you're still hurting users on mobiles by making them download the full image...

ukhalik2

Quote from: Arantor on May 15, 2010, 02:47:09 PM
Just resizing an image to 60x60 doesn't make the file any smaller, so you're still hurting users on mobiles by making them download the full image...
i know..
but they wont show up at all after altering the wireless.template.php file...

Yağız...

Find the code that I gave 3 times, and replace.

VHP_KLJ

What's about links on wap2 mode? I can't click the link on wap2 mode, please help me


Deaks

ukhalik2 did Yagiz... suggestion help?

As you have not replied I shall assume it has and I have marked this as solved, if this is incorrect please let us know and we can assist you further
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

hartiberlin

Can somebody still post how to modify the wireless template, so it will
also display links correctly ?

Big pictures are okay with me, but it should also display clickable links.

Many thanks.

Regards, Stefan.

Kindred

No...  the WAP template should display everything exactly as it does....   it should not display images, etc -- because it is WAP -- which has standards.
If you want something other than WAP - then use one of the "mobile detect mobile display" themes - don't try to corrupt a standard
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: