SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 22, 2012, 02:23:34 pm

Login with username, password and session length
Members
Total Members: 10066
Latest: khoeidong
Stats
Total Posts: 28682
Total Topics: 4975
Online Today: 87
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 62
Total: 62
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Registered links  (Read 3300 times)
eat_me
Newbie
*
Offline Offline

Posts: 1


View Profile
« 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.  Cry

Can somebody help me? What should I add in code below to solve this problem?
Code:
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. Roll Eyes
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]

[May 17, 2012, 12:38:16 pm]

[May 15, 2012, 09:32:27 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 4.759 seconds with 21 queries.