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
fresh
Regular
Regular



Joined: Mar 12, 2008
Posts: 74

PostPosted: Mon Mar 17, 2008 7:06 pm Reply with quote

Does anyone one know a mod that can hide certain part of the post from non registered users? i seen it in a site i will try to find out.
It suppose to hide what ever we want from non register users fo example pictures, urls and anything we post.
 
View user's profile Send private message
fresh







PostPosted: Mon Mar 17, 2008 7:16 pm Reply with quote

Image
 
Susann
Moderator



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

PostPosted: Mon Mar 17, 2008 7:26 pm Reply with quote

Did you already checked the forums administration ? There are options and you can change the settings so that only registered members can read in one of the forums.

I ´ve not heard about such a mod beneed the hide mod.
 
View user's profile Send private message
fresh







PostPosted: Mon Mar 17, 2008 7:40 pm Reply with quote

Oh u know what i think above mod work if u post something in that certain thread then u will see the msg or something like that.
I think what u saying is easier@ Susan
 
Susann







PostPosted: Mon Mar 17, 2008 7:51 pm Reply with quote

Maybe I can find a similar mod "lol" you are looking for but I personally use since years the forums options and thats good enough.
 
fresh







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

yeah i am tryina make them post stuff in the forum by addin this mod LOL sukaz just come grab and leave lol
Hopefully they want abuse the forum by posting just hi lol
 
Susann







PostPosted: Thu Mar 20, 2008 9:17 am Reply with quote

There isn´t a perfect mod available but I found something how to this. I ´ll not translate it for you but you can try it out its easy and it looks like it works well. Smile

http://www.phpbb.de/viewtopic.php?t=118470&highlight=verstecken+hide
 
fresh







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

Thanks for the post i will try this and c Very Happy with in couple of days. I hope this will not affect ma before editing (hide link mod)
lol about the translation i think i can figure it out

http://www.phpbb.de/viewtopic.php?t=107699&highlight=hide
what is this link??? it was in the same thread that u gave me? one of the memebers posted it over there.
 
fresh







PostPosted: Sun Mar 23, 2008 4:48 am Reply with quote

Ok did any one try this??? i did but i didn't get it. This is the code i should modify right? it's in some language so i have no idea what i am doing.


Code:


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

#
#-----[ FIND ]------------------------------------------
#
   global $lang, $bbcode_tpl

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$bbcode_tpl

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $userdata

#
#-----[ FIND ]------------------------------------------
#
   // [u] and [/u] for underlining text.

#
#-----[ BEFORE, ADD ]------------------------------------------
#
   // [regged] and [/regged] for text only visible for registred users.
  $text = preg_replace("/\[regged:$uid\](.*?)\[\/regged:$uid\]/si", (( $userdata['session_logged_in'] ) ? "\\1" : ""), $text);
 
#
#-----[ FIND ]------------------------------------------
#
   // [u] and [/u] for underlining text.

#
#-----[ BEFORE, ADD ]------------------------------------------
#
   // [regged] and [/regged] for text only visible for registred users.
   $text = preg_replace("#\[regged\](.*?)\[/regged\]#si", "[regged:$uid]\\1[/regged:$uid]", $text);

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
 
Susann







PostPosted: Sun Mar 23, 2008 11:48 am Reply with quote

I don´t have a forum to test this currently but did you also add between the first (original by Highwayman):


Quote:
// [regged] and [/regged] for text only visible for registred users.
$text = preg_replace("/\[regged:$uid\](.*?)\[\/regged:$uid\]/si", (( $userdata['session_logged_in'] ) ? "\\1" : ""), $text);


within
: ""),

your text e.g.

: "Only for registered members visible"), Question
 
fresh







PostPosted: Mon Mar 24, 2008 5:41 am Reply with quote

Guess what after days of hard work i figured it out(lol@hard work).
The problem was, this code should be added 1st
Code:
 // [regged] and [/regged] for text only visible for registred users.

   $text = preg_replace("#\[regged\](.*?)\[/regged\]#si", "[regged:$uid]\\1[/regged:$uid]", $text);


then 2ndly this code should be added
Code:
 // [regged] and [/regged] for text only visible for registred users.

  $text = preg_replace("/\[regged:$uid\](.*?)\[\/regged:$uid\]/si", (( $userdata['session_logged_in'] ) ? "\\1" : ""), $text);
 


right before
Code:
// [u] and [/u] for underlining text.


plus every time when i wanna hide it i have to manually type [hide] [/hide]........and this code work with hide link mod for registered users only. For example if u have modified ur bbcode.php for hide link mod, it will still work.
 
fresh







PostPosted: Fri Apr 04, 2008 12:48 am Reply with quote

There is one problem with above code...... it only hide the content from non registered members it wont hide the content from the registered members. For example i wont it to hide it till they post something.
I found a file but do u guys think it will work with the RN? this is designed for phpbb though.
here is the link
http://www.clan-themes.co.uk/modules.php?name=Forums&file=download&id=116
 
montego
Site Admin



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

PostPosted: Fri Apr 04, 2008 5:26 am Reply with quote

fresh, can you please change your link to point to the forum thread or post where the download is attached rather than the actual download link? Clicking on that link gives me a 404 error. Thanks.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
fresh







PostPosted: Fri Apr 04, 2008 5:44 pm Reply with quote

Oh sorry about that montego
here is the actual code in that file

I already tried this code out and didn't work for me maybe i did something wrong or maybe this wont work with bbtnuke. I also seen similar mod like this in phpnuke sites but can't find a workin mod

Code:
############################################################################

## MOD HIDE | Made By / Auteur: Philiweb < http://www.philiweb.fr.st/ >
############################################################################
## Description : MOD "HIDE" (aka lockdown) - this mod allow users to hide
## a message via some "bbcodes", ex : [hide] message [/hide]. To see the
## hidden message, you must be a member and you must post a reply to
## the message...
############################################################################
## VERSION DE PHPBB : PHPBB 2.0 RC3 - RC4 - 2.0.x (gold) - 2.0.4 |02/2003|
############################################################################
## You can find the last versions and informations here on the official
## website (in English and French) :
## http://membres.lycos.fr/philiweb/accueil.php?num=15
## Info : There is also some pre-modified files if you have difficulties !
############################################################################
## And you can find some modifications to "hide" mod here :
## http://membres.lycos.fr/philiweb/accueil.php?num=23
## new : version 4 => administrators and moderators can see "hidden
## messages" immediatly...)
############################################################################
## Demo : http://membres.lycos.fr/philiweb/forums/viewtopic.php?t=167
############################################################################
## This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
############################################################################

There is 7 files to modify :

1 - posting.php
2 - viewtopic.php
3 - search.php
4 - topic_review.php // in the "/includes" directory
5 - bbcode.php // in the "/includes" directory
6 - bbcode.tpl // in the Templates/{Used template}/ directory
7 - posting_body.tpl // in the Templates/{Used template}/ directory

This mod is easy to install. (20 mn)

------------------
1 - In posting.php
------------------

Find 

if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] )
{
        $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']);
}

if( $bbcode_on )
{
        $preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
}
 

Replace by 

$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}

if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] )
{
        $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']);
        $user_sig = bbencode_third_pass($user_sig, $userdata['user_sig_bbcode_uid'], $valid);
}

if( $bbcode_on )
{
        $preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
        $preview_message = bbencode_third_pass($preview_message, $bbcode_uid, $valid);
}
 

Find 

if ( !preg_match('/^Re:/', $subject) && strlen($subject) > 0 )
{
        $subject = 'Re: ' . $subject;
}
 

Add Below 

if( !$userdata['session_logged_in'] ) {$message = hide_in_quote($message);}
else { $sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
if(!$db->sql_numrows($resultat)) {$message = hide_in_quote($message);}
}


--------------------
2 - In viewtopic.php
--------------------


Find 

//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
 

Add below 

$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
 

Find 

if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
{
        $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}

if ( $bbcode_uid != '' )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
 

Replace by 

if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
{
        $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
        $user_sig = bbencode_third_pass($user_sig, $user_sig_bbcode_uid, $valid);
}

if ( $bbcode_uid != '' )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
        $message = bbencode_third_pass($message, $bbcode_uid, $valid);
}
 
-----------------
3 - In search.php
-----------------

Find 

//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if ( $return_chars != -1 )
 

And replace it by 

//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if( $return_chars == -1 )
 

Find 

if ( $bbcode_uid != '' )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
 

Replace by 

if ( $bbcode_uid != '' )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
        $message = bbencode_third_pass($message, $bbcode_uid, FALSE);
}
 
-----------------------
4 - In topic_review.php  // in the "/includes" directory
-----------------------

Find 

        //
        // Okay, let's do the loop, yeah come on baby let's do the loop
        // and it goes like this ...
        //
        if ( $row = $db->sql_fetchrow($result) )
        {
 

Add below 

$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
 

Find 

if ( $bbcode_uid != "" )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
 

Replace by 

if ( $bbcode_uid != "" )
{
        $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
        $message = bbencode_third_pass($message, $bbcode_uid, $valid);
}
 
-----------------
5 - In bbcode.php // in the "/includes" directory
-----------------

Find 

$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); 

Add Below 

$bbcode_tpl['show'] = str_replace('{HTEXTE}', '\\1', $bbcode_tpl['show']);
 

*Before* this text 

/**
 * Does second-pass bbencoding. This should be used before displaying the message in
 * a thread. Assumes the message is already first-pass encoded, and we are given the
 * correct UID as used in first-pass encoding.
 */
 

Add this functions 

function hide_in_quote($text)
{
        $text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
        return $text;
}

function bbencode_third_pass($text, $uid, $deprotect)
{
        global $bbcode_tpl;

        // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
        // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
        $text = " " . $text;

        // First: If there isn't a "[" and a "]" in the message, don't bother.
        if (! (strpos($text, "[") && strpos($text, "]")) )
        {
                // Remove padding, return.
                $text = substr($text, 1);
                return $text;
        }
        // Patterns and replacements for URL and email tags..
        $patterns = array();
        $replacements = array();
 
        if ( $deprotect ) {
        $patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
        $replacements[0] = $bbcode_tpl['show'];
        }
        else
        {
        $patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
        $replacements[0] = $bbcode_tpl['hide'];
        }

        $text = preg_replace($patterns, $replacements, $text);
 
        // Remove our padding from the string..
        $text = substr($text, 1);

        return $text;
}
 

Find in function "bbencode_first_pass" 

// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^ \"\n\r]+?))\[/img\]#si", "[img:$uid]\\1[/img:$uid]", $text); 

Add Below 

//[hide]message[/hide]
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","[hide:$uid]\\1[/hide:$uid]", $text); 


-----------------
6 - In bbcode.tpl // in the Templates/{Used template}/ directory
-----------------
 
At the top, add 

<!-- BEGIN show -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
          <td><span class="genmed"><b>Protected Message:</b></span></td>
        </tr>
        <tr>
          <td class="quote">
                {HTEXTE}
                </td>
        </tr>
</table>
<span class="postbody">
<!-- END show -->

<!-- BEGIN hide -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
          <td><span class="genmed"><b>Protected Message:</b></span></td>
        </tr>
        <tr>
          <td class="quote">
                <center>--- If you are a *registered user* : you need to post in this topic to see the message ---</center>
                </td>
        </tr>
</table>
<span class="postbody">
<!-- END hide -->

-----------------------
7 - In posting_body.tpl // in the Templates/{Used template}/ directory
-----------------------

 This part add a button in the dialog box (newtopic,...).

In the list of "// Helpline messages", add :
 

h_help = "Hide: [hide]message[/hide] (alt+h)"; 

Find this line :
bbtags = new Array('[b]','[/b]'...

And add at the end :
'[hide]' and '[/hide]'

You will obtain something like this :
 

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[hide]','[/hide]');
 

Find 

<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>
 

Add Below : (Don't forget to adapt the "addbbcode" numbers if neccesary ! (exemple: addbbcode18 -> addbbcode20, 20 -> 22, etc) 

<td><span class="genmed">
<input type="button" class="button" accesskey="h" name="addbbcode18" value="Hide" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('h')" />
</span></td>
 

Next, you need to modify all the "addbbcodexx" in the rest of the file. (exemple : addbbcode20 -> addbbcode22)

That's all ! :-)
Philippe

IF YOU HAVE A PROBLEM ("undefined" instead of [hide]...) - Go on my website or contact me :
http://membres.lycos.fr/philiweb/download/hide/hackhide.php?ver=rc3&num=7&lang=en
Official page => http://membres.lycos.fr/philiweb/accueil.php?num=15



and here is another article i found about the hide mod and thank you mod
http://www.codezwiz.com/ftopict-10118-combine-thank-you-mod-hide-mod.html
 
rferadio
New Member
New Member



Joined: Jan 19, 2009
Posts: 1

PostPosted: Mon Jan 19, 2009 12:32 pm Reply with quote

fresh..i had this Hide hack working on raven nuke..but now it wont...maybe i did something wrong
 
View user's profile Send private message
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 ©