Skocz do zawartości

[community.invisionpower.com - pliki] [DNO33] Post Anonymously


Rekomendowane odpowiedzi

Opublikowano

With this members are able to post in forums anonymously. All posts posted with the anonymous function will be tied to one account that you define in the Admin CP. You will be able to check the true identity behind posts in the Mod CP. Posts posted will have a generated hash in them, to be able to tell members in discussions apart. (Please read further details on this in the attached readme).

This is developed and used with the thought of letting members be able to share or ask about sensitive / personal topics in specific forums. The users will not need to be logged out to ask as a guest and you will not have to enable guest posting. That's how we use it, you may use it differently smile.png

Main Author: Preben at Mediehuset Tek (Modern version, Mads developed the initial version)

Features

  • Members of the user groups you allow will be able to post anonymously in the forums you choose
  • An md5-hash will be added to these posts to be able to tell members apart. Read the attached readme for details
  • Support is in place to have this work with quick reply, but it will require one file change and a template change

Installation

This hook requires one hook xml-file to be uploaded from the AdminCP. It also includes one file to upload.

How can I get this to work with quick reply?

You need to do a file change in the file public/js/ips.topic.js . To do this you need file access on the server where your board is installed.

Spoiler

In the file ips.topic.js, find: /* Fetch post contents */

var Post = ipb.textEditor.getEditor( ipb.topic.fastReplyId ).getText();

var isRte = ipb.textEditor.getEditor( ipb.topic.fastReplyId ).isRte();

Add this below:

var _postAsAnon = false;

if(document.getElementById('_postAsAnon')) {

var _postAsAnon = document.getElementById('_postAsAnon').checked;

}

A little bit further down, in the same file, find:

parameters: {

md5check: ipb.vars['secure_hash'],

Post: Post.encodeParam(),

isRte: isRte

},Change it to this:

parameters: {

md5check: ipb.vars['secure_hash'],

Post: Post.encodeParam(),

isRte: isRte,

_postAsAnon: _postAsAnon

},

Save the file.

Now you need to change a template bit in your templates. In your skins, find the template group Topic View, then open the template bit TopicViewTemplate.

Look for this, near the end of the template:

{parse editor="Post" options="array( 'type' => 'full', 'minimize' => 1, 'isTypingCallBack' => 'ipb.topic.isTypingCallBack', 'height' => 180, 'autoSaveKey' => 'reply-' . $topic[tid], 'warnInfo' => 'fastReply', 'modAll' => $topic['_fastReplyModAll'] )"}

<br />

Below it, add this:

<if test="custom_hw_anonhook:|:1 == 1"></if><!-- HW_CUSTOM custom anon hook point -->

Save the template. If you've done everything correctly you should now be able to reply anonymously with quick reply aswell.

Background: This is a popular feature we currently have installed on three different large Invision Power Boards we host, two of them 3.3 and one of them 3.2. First version was developed in March 2010 and it have been used and improved on two of the forums since then. (NOTE: This public version will not work on 3.2).

We hope that by sharing some of what we develop it will help us gain new ideas and more insight into developing for the Invision Power Systems. If any other developers have any hints or tips on changes that should be done to the code etc., then please let us know! smile.png

Pobierz plik

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.