Hide code (links) until reply 1.0.0

[en] Hide code in topic until the user reply in this topic.
[sk] Skrytie kódu pred užívateľov čo nenapísali v téme odpoveď.

Hide code (links) until reply 1.0.0

Postby drndos » Mon Mar 30, 2009 6:33 pm

MOD Title (EN): Hide code (links) until reply
MOD Title (SK): Skrytie kódu (odkazov) pred odpoveďou
MOD Description (EN): Hide code in topic until the user reply in this topic.
MOD Description (SK): Skrytie kódu pred užívateľov čo nenapísali v téme odpoveď.
MOD Version: 1.0.0

Works with: phpBB 3.0.x
Language: English, Slovak

Author: Drndos
License: GNU General Public License v2

Screenshot: prosilver
Demo board: prosilver

MOD Format: ModX

Download :
Hide_code_until_reply_1_0_0.rar
(21.73 KiB) Downloaded 818 times

If you would like to be informed about new versions of MOD, please register.

If you like this MOD please donate (ak sa vám modifikácia páči prosim vás prispejte)
User avatar
drndos
Site Admin
Site Admin
 
Posts: 227
Joined: Thu Feb 19, 2009 6:07 pm

Re: Hide code (links) until reply 1.0.0

Postby drndos » Fri Apr 10, 2009 9:14 pm

You can simply add forum ids of forums that you want to exclude or include:
open includes/bbcode.php
find:
Code: Select all
if ($topic_id>0)

for only one forum - before add:
Code: Select all
$forum_id   = request_var('f', 0);
if($forum_id == "35")
{

for two or more forums - before add:
Code: Select all
$forum_id   = request_var('f', 0);
if($forum_id == "35" ||$forum_id == "25")
{

(do similar for more ids)
for all forums except one - before add:
Code: Select all
$forum_id   = request_var('f', 0);
if($forum_id <> "35")
{

for all forums except two or more - before add:
Code: Select all
$forum_id   = request_var('f', 0);
if($forum_id <> "35" && $forum_id <> "25")
{

(do similar for more ids)

And in all cases do this:
find:
Code: Select all
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');

Before add:
Code: Select all
}
User avatar
drndos
Site Admin
Site Admin
 
Posts: 227
Joined: Thu Feb 19, 2009 6:07 pm

Re: Hide code (links) until reply 1.0.0

Postby dzooky » Sun Apr 12, 2009 10:34 am

Zajimavy MOD. No uvital by som ho v spolipraci s nejakym thanks MODom. Pre mna je to ovela praktickejsie ako "spamovanie"
dzooky
User
User
 
Posts: 1
Joined: Sun Apr 12, 2009 10:32 am

Re: Hide code (links) until reply 1.0.0

Postby Ultiweap » Thu Apr 16, 2009 2:16 pm

Hey mate,

I would like to know how to install this mod. Where should I put the MODX File and what should I change in the phpbb3 files.

Thanks in advance for any help.
Ultiweap
User
User
 
Posts: 3
Joined: Thu Apr 16, 2009 2:14 pm

Re: Hide code (links) until reply 1.0.0

Postby drndos » Thu Apr 16, 2009 2:41 pm

Hello,

Here are instructions how to install mods http://www.phpbb.com/kb/article/how-to- ... ification/

You don't have to copy none of those file to your forum, the mod is very easy and you should only edit some files. Try to open Hide_code_until_reply.xml with your favorite web browser and follow the instructions.
User avatar
drndos
Site Admin
Site Admin
 
Posts: 227
Joined: Thu Feb 19, 2009 6:07 pm

Re: Hide code (links) until reply 1.0.0

Postby Ultiweap » Thu Apr 16, 2009 2:53 pm

Ok mate,

But when I change the HTML code in the notepad I need to press enter or simply copy and paste the line you ask to copy just before the the word to fine?
Ultiweap
User
User
 
Posts: 3
Joined: Thu Apr 16, 2009 2:14 pm

Re: Hide code (links) until reply 1.0.0

Postby drndos » Thu Apr 16, 2009 3:03 pm

You should edit the files with PSPad www.pspad.com, or wordpad,
Yes add it on the new line (all instructions are in the modx file)
It should look like this:
Code: Select all
$topic_id   = request_var('t', 0);
    if ($topic_id>0)
    {
      global $user;
        global $db;
      $sql = 'SELECT *
        FROM ' . POSTS_TABLE . '
        WHERE topic_id ="' . $topic_id . '"
      AND poster_id ="' . $user->data["user_id"] . '"';
       $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      if(empty($row)) $code = $user->lang['HAVE_TO_REPLY'];
    }
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');

and lang like this:
Code: Select all
'HAVE_TO_REPLY'           => 'You have to reply to view this code',
'HIDDEN_USERS_ONLINE'         => '%d hidden users online',
User avatar
drndos
Site Admin
Site Admin
 
Posts: 227
Joined: Thu Feb 19, 2009 6:07 pm

Re: Hide code (links) until reply 1.0.0

Postby Ultiweap » Thu Apr 16, 2009 5:08 pm

Thanks a lot man. It works well.
Ultiweap
User
User
 
Posts: 3
Joined: Thu Apr 16, 2009 2:14 pm

Re: Hide code (links) until reply 1.0.0

Postby lansiko » Sat May 09, 2009 8:02 am

This looks like a simple and elegant MOD. Is it possible to use image as the locked message rather than just plain text? That will be cool...
lansiko
User
User
 
Posts: 1
Joined: Sat May 09, 2009 7:57 am

Re: Hide code (links) until reply 1.0.0

Postby drndos » Sat May 09, 2009 7:12 pm

try adding the html code in instead of the plain text in language file ... like <img src="path_to_image" />
User avatar
drndos
Site Admin
Site Admin
 
Posts: 227
Joined: Thu Feb 19, 2009 6:07 pm

Next

Return to Hide code (links) until reply / Skrytie kódu (odkazov) pred odpoveďou

Who is online

Users browsing this forum: No registered users and 1 guest

cron