Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43293
Total Topics: 7522
Most Online Today: 118
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 104
Total: 104

Author Topic: Registered links  (Read 5115 times)

0 Members and 1 Guest are viewing this topic.

Offline eat_me

  • Member
  • *
  • Posts: 1
    • View Profile
Registered links
« on: September 27, 2006, 10:07:15 am »

I've modified Subs.php like in 'Registered links' mod and now if user is a guest he can't see not only links but also images (if images are posted as links like http://somewhere.com/image.gif).
But now I have a problem: if an image's url is from my forum's server, guests can't see this image.  :'(

Can somebody help me? What should I add in code below to solve this problem?
Code: [Select]
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => $user_info['is_guest'] ?
'[<a href="' . $scripturl . '?action=join">' . $txt[97] . '</a>]' : '<img src="$1" border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'before' => $user_info['is_guest'] ?
'[<a href="' . $scripturl . '?action=join">' . $txt[97] . '</a>]<div style="display:none">' : '<img src="$1" border="0" />',
'after' => $user_info['is_guest'] ?  '</div>' : '',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl', 'img'),
'disabled_after' => $user_info['is_guest'] ?  '' :  ' ($1)',

Probably I have to add variable $board_url and have to use function parse_url, but if variable $1 is data (here it's a link to an image), then ...

P.S. I'm new at php & smf. ::)

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
5871 Views
Last post October 13, 2006, 05:59:56 pm
by TeamVTEC
2 Replies
4004 Views
Last post January 07, 2007, 12:40:50 pm
by sharks
2 Replies
4472 Views
Last post February 17, 2007, 04:20:20 am
by samozin
0 Replies
4362 Views
Last post January 25, 2009, 03:37:27 am
by darklord
1 Replies
2608 Views
Last post October 11, 2011, 08:03:14 pm
by SMFHacks

+- Recent Topics

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

Powered by EzPortal