Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

[v7.02,xx] Hide attachments with styled div


Print Track
Hi here i come with a small code snippit that hide attachment for guest with a nice message box.

Open viewthread.php find

         if ($a_files) {
            echo "<div class='emulated-fieldset'>n";
            echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>n";
            echo "<div class='attachments-list'>".$a_files."</div>n";
            echo "</div>n"
         }



Replace with this

      if (iMEMBER) {
         if ($a_files) {
            echo "<div class='emulated-fieldset'>n";
            echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>n";
            echo "<div class='attachments-list'>".$a_files."</div>n";
            echo "</div>n"; }
            } else {
            echo "n<hr /><div style='color: #000;border: #ccc 1px solid;margin: 10px 0px;padding:15px 10px 15px 50px;background-color: #e1e1e1;background-image: url(".IMAGES."error.png);background-repeat: no-repeat;background-position: 10px center;'>".$locale['attachm001']."<br />".$locale['attachm002']."</div>";
         
      }


Save and close viewthread.php

Go to locale/your_language/forum/ open main.php

Find
$locale['error-MP003'] = "No posts to move.";



Add this bellow
// Attachment messages
$locale['attachm001'] = "<strong>Acces denied!</strong>";
$locale['attachm002'] = "<a href='".BASEDIR."login.php' target='_blank'>Login</a> or <a href='".BASEDIR."register.php' target='_blank'>register</a> to download the attached file!";


Save and upload these files!

And upload this image to image folder
cdn1.iconfinder.com/data/icons/fatcow/32x32_0400/error.png
DrunkeN attached the following file:
example.png [49.93kB / 48 Downloads]

3 replies

nice!
DrunkeN Thanks for snippets but must be corrected this code:
if (iMEMBER) {
         if ($a_files) {
            echo "<div class='emulated-fieldset'>n";
            echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>n";
            echo "<div class='attachments-list'>".$a_files."</div>n";
            echo "</div>n"; }
            } else {
            echo "n<hr /><div style='color: #000;border: #ccc 1px solid;margin: 10px 0px;padding:15px 10px 15px 50px;background-color: #e1e1e1;background-image: url(".IMAGES."error.png);background-repeat: no-repeat;background-position: 10px center;'>$locale['attachm001']<br /> $locale['attachm002'] </div>";
         
      }

I have problem with syntax look this:
img192.imageshack.us/img192/1484/dfgdfgr.png
i will try this.. this what i want , can i apply to 7.01 ?

bookmarked :D
author DrunkeN
forumCode Snippet and functions - 8
replies4 posts
viewed5,130 times
activeLast updated on 6 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: DrunkeN, jikaka, byv79, angelcyber942