PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
sarmient
New Member
New Member


Joined: Aug 18, 2005
Posts: 9

PostPosted: Sun Dec 11, 2005 10:10 am Reply with quote Back to top

How to add this to my Forums? (as I see in your forums):
Code:
Only registered users can see links on this board!
Get registered or login to the forums!


Is there any mod or something?

Thanks in advance Smile
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Sun Dec 11, 2005 10:40 am Reply with quote Back to top

Here you go...


Code:
#################################################################
## Mod Title: Hide Links
## Mod Author: Nome <
Only registered users can see links on this board!
Get registered or login to the forums!
> 162783614
## Mod Version: 2.1.0
## Mod Description: This mod will prevent links from being shown
##           to unregistered users. Instead they'll be
##          advised to register or login.
## Mod Features:
##      - hide http links and email from unregistered users
##
## Installation Level: Very Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 2
##   includes/bbcode.php
##   language/lang_english/lang_main.php
##
#################################################################
## Author's notes:
##   In order to change the thing you get instead of a link
##   edit $replacer. By default there is a quotelike box.
##   Pay attention to the fact that the second block of $replacers
##   has a space in the first line, it's a must there :)
#################################################################
#################################################################
## History
## - 2.1.0 - Updated with latest bugfixes from phpbb groupe
## - 2.0.0 - Fixed a bug with [url] links
## - 1.0.0 - First released
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#
function bbencode_second_pass($text, $uid)
{
   global $lang, $bbcode_tpl;

#
#-----[ REPLACE WITH ]------------------------------------
#
function bbencode_second_pass($text, $uid)
{
   global $lang, $bbcode_tpl, $userdata, $phpEx, $u_login_logout;

   // The thing we replace links with. I like using a quote like box
   $replacer = '<table width="40%" cellspacing="1" cellpadding="3" border="0"><tr><td class="quote">';
   $replacer .= $lang['Links_Allowed_For_Registered_Only'] . '<br />';
   $replacer .= sprintf($lang['Get_Registered'], "<a href=\"" . append_sid('profile.' . $phpEx . '?mode=register') . "\">", "</a>");
   $replacer .= sprintf($lang['Enter_Forum'], "<a href=\"" . append_sid($u_login_logout) . "\">", "</a>");
   $replacer .= '</td></tr></table>';

#
#-----[ FIND ]------------------------------------------
#
   // matches a [url]xxxx://www.phpbb.com[/url] code..
   $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
   $replacements[] = $bbcode_tpl['url1'];

   // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
   $patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
   $replacements[] = $bbcode_tpl['url2'];

   // [url=xxxx://www.phpbb.com]phpBB[/url] code..
   $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
   $replacements[] = $bbcode_tpl['url3'];

   // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
   $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
   $replacements[] = $bbcode_tpl['url4'];

   // [email]user@domain.tld[/email] code..
   $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
   $replacements[] = $bbcode_tpl['email'];



#
#-----[ REPLACE WITH ]------------------------------------
#
   // matches a [url]xxxx://www.phpbb.com[/url] code..
   $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
   if ( !$userdata['session_logged_in'] )
   {
      $replacements[] = $replacer;
   }
   else
   {
      $replacements[] = $bbcode_tpl['url1'];
   }

   // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
   $patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
   if ( !$userdata['session_logged_in'] )
   {
      $replacements[] = $replacer;
   }
   else
   {
      $replacements[] = $bbcode_tpl['url2'];
   }

   // [url=xxxx://www.phpbb.com]phpBB[/url] code..
   $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
   if ( !$userdata['session_logged_in'] )
   {
      $replacements[] = $replacer;
   }
   else
   {
      $replacements[] = $bbcode_tpl['url3'];
   }

   // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
   $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
   if ( !$userdata['session_logged_in'] )
   {
      $replacements[] = $replacer;
   }
   else
   {
      $replacements[] = $bbcode_tpl['url4'];
   }

   // [email]user@domain.tld[/email] code..
   $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
   if ( !$userdata['session_logged_in'] )
   {
      $replacements[] = $replacer;
   }
   else
   {
      $replacements[] = $bbcode_tpl['email'];
   }

#
#-----[ FIND ]------------------------------------------
#
function make_clickable($text)
{

#
#-----[ AFTER, ADD ]------------------------------------
#
   global $userdata, $lang, $phpEx, $u_login_logout;

#
#-----[ FIND ]------------------------------------------
#
      // matches an "xxxx://yyyy" URL at the start of a line, or after a space.
      // xxxx can only be alpha characters.
      // yyyy is anything up to the first space, newline, comma, double quote or <
      $ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

      // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
      // Must contain at least 2 dots. xxxx contains either alphanum, or "-"
      // zzzz is optional.. will contain everything up to the first space, newline,
      // comma, double quote or <.
      $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);

      // matches an email@domain type address at the start of a line, or after a space.
      // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
      $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);

#
#-----[ REPLACE WITH ]------------------------------------
#
//
// Hide links from unregistered users mod
//
   if ( !$userdata['session_logged_in'] )
   {
      // The thing we replace links with. I like using a quote like box
      $replacer = ' <table width="40%" cellspacing="1" cellpadding="3" border="0"><tr><td class="quote">';
      $replacer .= $lang['Links_Allowed_For_Registered_Only'] . '<br />';
      $replacer .= sprintf($lang['Get_Registered'], "<a href=\"" . append_sid('profile.' . $phpEx . '?mode=register') . "\">", "</a>");
      $replacer .= sprintf($lang['Enter_Forum'], "<a href=\"" . append_sid($u_login_logout) . "\">", "</a>");
      $replacer .= '</td></tr></table>';

      // matches an "xxxx://yyyy" URL at the start of a line, or after a space.
      // xxxx can only be alpha characters.
      // yyyy is anything up to the first space, newline, comma, double quote or <
      $ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", $replacer, $ret);

      // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
      // Must contain at least 2 dots. xxxx contains either alphanum, or "-"
      // zzzz is optional.. will contain everything up to the first space, newline,
      // comma, double quote or <.
      $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", $replacer, $ret);

      // matches an email@domain type address at the start of a line, or after a space.
      // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
      $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", $replacer, $ret);

   }
   else
   {
      // matches an "xxxx://yyyy" URL at the start of a line, or after a space.
      // xxxx can only be alpha characters.
      // yyyy is anything up to the first space, newline, comma, double quote or <
      $ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

      // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
      // Must contain at least 2 dots. xxxx contains either alphanum, or "-"
      // zzzz is optional.. will contain everything up to the first space, newline,
      // comma, double quote or <.
      $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);

      // matches an email@domain type address at the start of a line, or after a space.
      // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
      $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
   }
//
// Hide links from unregistered users mod
//

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['A_critical_error'] =

#
#-----[ AFTER, ADD ]------------------------------------
#

//
// Hide links from unregistered users mod
//
$lang['Links_Allowed_For_Registered_Only'] = 'Only registered users can see links on this board!';
$lang['Get_Registered'] = 'Get %sregistred%s or ';
$lang['Enter_Forum'] = '%senter%s the forums!';

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
#EoM
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 8:58 am Reply with quote Back to top

have anyone complete? and can upload the php files

i cant get it working
who can give me pho en tlp files??

the version doenst matter but not lower then 2.0.15
and for bbnuke

not normal phpbb

big thx anyway
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Jun 08, 2006 9:01 am Reply with quote Back to top

this isnt realy related to a paticular version,and it does work....
just take your time to edit..
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 9:19 am Reply with quote Back to top

i cant find many thing i use CTRL+F and search but no result :S im a big n00b in php
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Jun 08, 2006 9:30 am Reply with quote Back to top

well my files are edited so i cant swap files..
or just hire someone to do it..
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 9:35 am Reply with quote Back to top

can u give me u r edited files???
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Jun 08, 2006 9:44 am Reply with quote Back to top

That´s very simple to install. Try it again and if you have several languages you need to edit the lang_main for that language in the folder modules/Forums/language.
View user's profile Send private message Visit poster's website
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 10:05 am Reply with quote Back to top

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator,
Only registered users can see links on this board!
Get registered or login to the forums!
and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.33 Server at djvid.freehostia.com Port 80


thats when i appely :'(

Forum:
Only registered users can see links on this board!
Get registered or login to the forums!

what are im doing wrong (try to start a topic to see result Confused

Edit: when i pt the orginal files back it works fine but not whit the edited
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Jun 08, 2006 10:18 am Reply with quote Back to top

That´s strange because there is only simple add or replace. How can this produce server error 500 ?


Last edited by Susann on Thu Jun 08, 2006 10:23 am; edited 1 time in total
View user's profile Send private message Visit poster's website
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 10:21 am Reply with quote Back to top

thats just the question

i think a big problem in my editing Confused im a real big n00b
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 11:15 am Reply with quote Back to top

Something changed

and now when i try to start toic
i will get blank page

look:
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Jun 08, 2006 11:25 am Reply with quote Back to top

Try it again it´s a good exercise (always backup your original file) maybe use a better editor.
After you add the code in the lang_english/lang_main.php you ´ll see this in action but only if you have a post with a link in your forum. Laughing


Last edited by Susann on Thu Jun 08, 2006 12:32 pm; edited 1 time in total
View user's profile Send private message Visit poster's website
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 12:13 pm Reply with quote Back to top

i have doing that

could u check my 2 files
may u can find the problem

Here the files
Only registered users can see links on this board!
Get registered or login to the forums!


thanks in advance Smile
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Jun 08, 2006 12:47 pm Reply with quote Back to top

who installed your site then if your knowledge is like 0 ?
And btw...do you know that your site will be deleted after 1 year....
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Thu Jun 08, 2006 12:52 pm Reply with quote Back to top

i installed by my self
and where can i see the Knowledge?

and why it will be deleted in 1 year
in that time there are many new versions

but is there something whong on php files?
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Jun 08, 2006 1:32 pm Reply with quote Back to top

The lang_main is ok and the bbcode.php produced an error
Parse error: parse error, unexpected '[' in /bbcode.php on line 208 on my site.



You need to change only this on line 207 - 208

#
// matches a
Only registered users can see links on this board!
Get registered or login to the forums!
code..
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Jun 08, 2006 2:32 pm Reply with quote Back to top

thats the rule of the free hosting you have,after one year it will be terminated,but then you can start over again...
i think your dutch....
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Thu Jun 08, 2006 2:49 pm Reply with quote Back to top

Hitwalker is this a discussion about hosting, code, knowledge or something else Question
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Jun 08, 2006 3:04 pm Reply with quote Back to top

no none of it...
i just made him aware of the fact that his site will last a year,i saw that...
View user's profile Send private message
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Fri Jun 09, 2006 12:58 am Reply with quote Back to top

changed but now i get

[hide:de1681a091]test[/hide:de1681a091]

heuh

and hitwalker: yes im dutch
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Fri Jun 09, 2006 8:51 am Reply with quote Back to top

From Line 207 to 209 looks like this:

Code:

#
   // matches a [url]xxxx://www.phpbb.com[/url] code..
   $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";


and the next is on line 211:
if ( !$userdata['session_logged_in'] )
View user's profile Send private message Visit poster's website
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Fri Jun 09, 2006 9:16 am Reply with quote Back to top

Susann wrote:
From Line 207 to 209 looks like this:

Code:

#
   // matches a [url]xxxx://www.phpbb.com[/url] code..
   $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";


and the next is on line 211:
if ( !$userdata['session_logged_in'] )


i have doing that

and now i see online the [hide]Test 1,2,3[/hide] on forum not hided Confused
View user's profile Send private message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3143
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Fri Jun 09, 2006 9:39 am Reply with quote Back to top

Works perfectly:
Only registered users can see links on this board!
Get registered or login to the forums!


Please remove my link.

Laughing
View user's profile Send private message Visit poster's website
djvideofan
New Member
New Member


Joined: Jun 08, 2006
Posts: 14

PostPosted: Fri Jun 09, 2006 9:48 am Reply with quote Back to top

but not the Hide the hide mot is not working perfectly i think
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum