vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Inline attachments and guests (https://vborg.vbsupport.ru/showthread.php?t=39808)

sdenvers 06-13-2002 11:20 AM

Inline attachments and guests
 
I want to allow guests to view all forums including a Pictures forum, but not allow them to view inline attachments (i.e. the pictures) in the Pictures forum until they've registered. I've set to disallow download of attachments in Pictures, but it doesn't seem to work as I've also set to view attachments inline. So right now they can see the pics...

Ideally, guests would get a small picture of my choice, say "Sign up to view this pic", and registered users would get the pic.

Is this possible with vB 2.2.6, or does it require a hack?

Cheers,
Simon

Logician 06-14-2002 11:10 AM

It requires a hack and here it is: ;)

First create your image and put it into yourboard\images\ directory.

Then edit admin\functions.php and find:

PHP Code:

if($dobbimagecode and ($bbuserinfo[userid]==or $bbuserinfo[showimages])) { 

BEFORE that line add:

PHP Code:

 if($bbuserinfo[userid]==0) {
      
// do [img]https://vborg.vbsupport.ru/[/img]
      
$myimagelock='onlock.gif';
      
$bbcode preg_replace("/(\[)(img)(])(\r\n)*([^\"".iif($allowdynimg,"","\?\&")."]*)(\[\/img\])/siU""<img src=\"images\\$myimagelock\" border=\"0\" alt=\"Register to View This Image\">"$bbcode);
    } 

Replace "onlock.gif" with your new image (be careful about the caps of file name!) and save your file. That's it, now if the forum viewer is a guest, all images will be displayed to him as your custom image while other board members will be ablo to see them as they are. (One downside: This hack will convert images in user profiles too)

BTW I liked your idea, can be useful for some people.. :cool:

Enjoy..
Logician


All times are GMT. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01016 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete