Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BBtoNuke Mods
Author Message
dirtbag
Regular
Regular



Joined: Nov 09, 2003
Posts: 73

PostPosted: Tue Mar 14, 2006 6:48 pm Reply with quote

Hello i seen that MOD used on this PHPBB forum along with some other where the links are hidden for non registered members.. Does anyone know where i can find this as i have had no luck..

i am using

phpnuke 7.6
and phpbb forums 2.0.17

thanks for any help..
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Mar 14, 2006 7:15 pm Reply with quote

have fun...

Code:


#################################################################
## Mod Title: Hide Links
## Mod Author: Nome < [ Only registered users can see links on this board! Get registered or login! ] > 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
dirtbag







PostPosted: Tue Mar 14, 2006 7:47 pm Reply with quote

thank you sir by chance you know of the new site they started a while for phpbb mods ported to phpnuke.. i found about a month ago but didnt bookmark it... it was like the guys from the old portedmods.com started a new one??

any help appreciated
 
Steptoe
Involved
Involved



Joined: Oct 09, 2004
Posts: 293

PostPosted: Tue Mar 14, 2006 9:54 pm Reply with quote

[ Only registered users can see links on this board! Get registered or login! ]

_________________
My Spelling is NOT incorrect, it's Creative 
View user's profile Send private message
fresh
Regular
Regular



Joined: Mar 12, 2008
Posts: 74

PostPosted: Mon Mar 17, 2008 10:03 am Reply with quote

Does this work with raven nuke???
 
View user's profile Send private message
Susann
Moderator



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

PostPosted: Mon Mar 17, 2008 10:21 am Reply with quote

I use this mod since several forums versions and Nuke versions inclusive RavenNuke.
For lang german there is a updated version of hide links available at [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
fresh







PostPosted: Mon Mar 17, 2008 12:13 pm Reply with quote

ok there is a problem there is no language/lang_english/lang_main.php in raven nuke. It only has language/lang_english ??
 
Susann







PostPosted: Mon Mar 17, 2008 1:56 pm Reply with quote

Check:
/modules/Forums/language/lang_english/lang_main.php
 
fresh







PostPosted: Mon Mar 17, 2008 6:02 pm Reply with quote

thanks bro
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Mar 17, 2008 8:17 pm Reply with quote

"bro"? killing me wuvUbaby

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
fresh







PostPosted: Wed Mar 19, 2008 5:50 pm Reply with quote

ok i guess it is sis:D thanks sis?? Embarassed Bang Head
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Mar 20, 2008 8:03 am Reply with quote

Maybe the user name Susann confused you? ROTFL - Just having fun with you Wink
 
View user's profile Send private message
fresh







PostPosted: Fri Mar 21, 2008 2:34 am Reply with quote

Yeah when i think about coders i only think about guys LOL i can't see a chick is doing nuke LOL
 
Susann







PostPosted: Fri Mar 21, 2008 8:57 am Reply with quote

fresh wrote:
Yeah when i think about coders i only think about guys LOL i can't see a chick is doing nuke LOL


"To err is human."
You know nothing about me or my interests and passion but be sure its not cooking. ROTFL
 
Raven







PostPosted: Fri Mar 21, 2008 9:51 am Reply with quote

Susann wrote:
You know nothing about me or my interests and passion but be sure its not cooking. ROTFL


killing me - Now THAT's funny Wink
 
khaled_dxb
Regular
Regular



Joined: Jan 15, 2007
Posts: 66

PostPosted: Sat Sep 06, 2008 7:20 am Reply with quote

Ok, i wanted to do this with Attached Images (using attachmod) can this be done? if so - where - thanks!

edit: Note that if a user is not registered or not logged in, attachmod does not display the images, however there is no message that tells the guest that the image is not visible due to their status (not logged in).

_________________
Khaled 
View user's profile Send private message
Susann







PostPosted: Sat Sep 06, 2008 8:43 am Reply with quote

I would use for this a standard phpBB mod wich tells you as anonymus or guest something like" only registered members can view all topics and pictures" at the top of your board.
I downloaded such a mod just cant find it because I changed my PC a time ago.
 
thebishop
Worker
Worker



Joined: Aug 30, 2005
Posts: 244
Location: Flying to close to the sun

PostPosted: Sun Oct 25, 2009 4:30 am Reply with quote

Susann wrote:
Check:
/modules/Forums/language/lang_english/lang_main.php


sorry for the old post resurection.

I just installed this hack and the problem is that if i use the "/modules/Forums/language/lang_english/lang_main.php" the link points the user to register through the forums and not through the nuke site.

The blocked link says either "get registered or enter the forums"

If the user clicks on "get registered" it will take them to the copa confirmation dialog, which they can't use to register.

If they click on the enter the forums link it then takes them to register through nuke which is what i want.

How do i get rid of the "get registered" link so it only shows the link to the nuke registration ?

I would like it to say Get registered and link to the nuke registration only.

[edit]

What would i change is this code to make the blocked link mod just say
"get registered" and link directly to my nuke site registration form, Not the forums registration form.
Code:


$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!';


Thanks
 
View user's profile Send private message
Susann







PostPosted: Tue Oct 27, 2009 10:23 am Reply with quote

I have not touched this since a long time but I think
you can just comment out:

//$lang['Enter_Forum'] = '%senter%s the forums!';
and remove the "or" also from:

Quote:
$lang['Get_Registered'] = 'Get %sregistred%s or ';


the link to register I have changed at my site to:
/modules.php?name=Your_Account&op=new_user

However, I don´t find it negative to have there two different links and therefore I will not change this.
 
thebishop







PostPosted: Tue Oct 27, 2009 2:32 pm Reply with quote

Susann wrote:
I have not touched this since a long time but I think
you can just comment out:

//$lang['Enter_Forum'] = '%senter%s the forums!';
and remove the "or" also from:

Quote:
$lang['Get_Registered'] = 'Get %sregistred%s or ';


the link to register I have changed at my site to:
/modules.php?name=Your_Account&op=new_user

However, I don´t find it negative to have there two different links and therefore I will not change this.


Thanks Susann and i will give that a try.

I didn't want anyone registering through the forums due to spammers, But i have implemented bbantispam and also enabled the visual confirmation from the forums admin area.

With bbantispam installed and the visual confirmation enabled in my forums/admin area, When a user tries to register through the forums they get rejected because there is no way for them to enter the forums confirmation code because bbantispam is asking them for a word not a code.

Then when a user tries to register the correct way (through nuke), bbantispam then makes them confirm themselves as being human, twice.

I have found this to be very effective and has stopped spambot registrations completely and also does not allow anyone to use the forum registration link.

I just wanted to know how to change this because with two links, it was confusing my new members on how to register.

P.S. this was kind of linked to another problem i was having with the nuke_bbconfirm table missing so i thought i would add this link to show others how i fixed that, [ Only registered users can see links on this board! Get registered or login! ] Smile
 
Susann







PostPosted: Tue Oct 27, 2009 2:43 pm Reply with quote

The registration through nuke instead of forums was corrected in RavenNuke since a long time.
I have never used bbantispam and don´t need it but maybe for standard Nuke its a solution.
 
thebishop







PostPosted: Tue Oct 27, 2009 4:44 pm Reply with quote

Susann wrote:
The registration through nuke instead of forums was corrected in RavenNuke since a long time.
I have never used bbantispam and don´t need it but maybe for standard Nuke its a solution.


Yea ravennuke is good about that and thats why people should use it instead of regular nuke. I have just got so used to nuke 7.6 that i know it better. BBantispam is really good for stopping spam bots.
 
thebishop







PostPosted: Tue Oct 27, 2009 5:37 pm Reply with quote

Susann wrote:
I have not touched this since a long time but I think
you can just comment out:

//$lang['Enter_Forum'] = '%senter%s the forums!';
and remove the "or" also from:

Quote:
$lang['Get_Registered'] = 'Get %sregistred%s or ';


the link to register I have changed at my site to:
/modules.php?name=Your_Account&op=new_user

However, I don´t find it negative to have there two different links and therefore I will not change this.



I tired commenting that code out and then the only link that is showed is the one that says "Get Registered" and points the client to the forums registration copa form, which they cannot use, and I do not want them to use to try to register.

What i want is it to say "get Registered" and then point them to the nuke registraion link. The following code
Code:
"$lang['Enter_Forum'] = '%senter%s the forums!';"
actually points them to the right place, But it's confusing because it says "Enter the forums"

I want the link to say "Get Registered" and then point them to either
Code:
/modules.php?name=Your_Account&op=new_user

Like your site does, Or

Code:
 http://www.mydomain/modules.php name=your_account&redirect=index


Sorry if I'm being confusing but this is a case of changing "Enter Forums" which points the user were i want them to go, But i need it to say Get registered instead.

I hope I'm making myself more clear.
 
Susann







PostPosted: Wed Oct 28, 2009 6:49 pm Reply with quote

Yes, I know what you mean and you can change the links, the text or the code but you need to test it out. I just broke one site with the hide mod. Therefore I can´t test it there anymore.
From my older site:


Code:
$lang['Get_Registered'] = '<a href="http://www.mysite.de/modules.php?name=Your_Account&op=new_user">Registrieren</a> oder ';

$lang['Enter_Forum'] = '%sEinloggen%s !';
 
thebishop







PostPosted: Wed Oct 28, 2009 7:16 pm Reply with quote

Well at least i have gotten it to not direct people to the copa forums thing, It still says "Enter Forums" but their directed to log in or create a new account.

So that will have to do i guess. Thanks for your help Susann.
This isn't even my site anymore, I'm just helping a clan member take it over. Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BBtoNuke Mods

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©