[3.2][BETA] Anonymous Posts

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Toxyy
Registered User
Posts: 540
Joined: Mon Oct 24, 2016 3:22 pm
Contact:

[3.2][BETA] Anonymous Posts

Post by Toxyy » Sat Sep 29, 2018 5:57 am

Extension Name: Anonymous Posts
Author: toxyy
Extension Description: Post anonymously in phpbb 3.2
Extension Version: 0.9.5
    Requirements:
    • phpBB 3.2.4-RC1+
    • PHP 7+
    • custom event in functions_posting.php (ticket 15819) merged into 3.2.4-RC1
    • pr to fix how postrow.contact pm link is retrieved (ticket 15841) merged into 3.2.4-RC1
    Extension Download: https://github.com/toxyy/anonymousposts ... -0.9.5.zip
    Github repository: https://github.com/toxyy/anonymousposts
    Languages: en, tr
    Templates: all
    Features:
    • User, group, and forum permissions
    • Staff can see all info, plus a message saying the post is anonymous
    • Unique anonymous names per poster in the topic
    • Support for Normal and Special Ranks extension by kasimi/posey
    • Support for Recent Topics extension by PayBas/Sajaki
    Installation/notes:
    There are bugs, and there might be bugs that I'm not aware of. DO NOT install this on a live board if you want this to work seamlessly.

    Screenshots:
    User/group, and forum permissions -
    Image
    ----------------------------------------------------------------------------------------------------
    Image


    Normal users vs staff view -
    Image
    ----------------------------------------------------------------------------------------------------
    Image


    Checkbox option on posting page, enabled/disabled with permissions -
    Image


    Topic review is the same as viewtopic for staff and normal members -
    Image
    ----------------------------------------------------------------------------------------------------
    Image


    Topicrow reflects anonymous OP and last post:
    Image


    Notifications reflect unique anonymous poster:
    Image


    Quotes reflect unique anonymous poster:
    Image
    Last edited by Toxyy on Mon Nov 12, 2018 9:09 am, edited 42 times in total.
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Sat Sep 29, 2018 6:00 am

    reserved
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    pikachuturkey
    Registered User
    Posts: 266
    Joined: Wed Dec 20, 2006 10:34 pm
    Name: Rıza
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by pikachuturkey » Sat Sep 29, 2018 7:39 pm

    Turkish (tr) Language files for Anonymous Posts Version 0.1.0
    But i didn't understand why we altered "Similar Topics" setting
    "'ANP_LOG_MSG' => '<strong>Altered Similar Topics settings</strong>',"

    Common.php

    Code: Select all

    <?php
    
    /**
    * phpBB Extension - toxyy Anonymous Posts
    * @copyright (c) 2018 toxyy <thrashtek@yahoo.com>
    * @license GNU General Public License, version 2 (GPL-2.0)
    * 
    */
    
    if (!defined('IN_PHPBB'))
    {
    	exit;
    }
    
    if (empty($lang) || !is_array($lang))
    {
    	$lang = [];
    }
    
    $lang = array_merge($lang, [
    	'ANP_MESSAGE'	=> 'Anonim gönderi',
    	'ANP_ACTION'	=> 'Anonim olarak gönder',
    ]);

    info_acp_anonymous_posts.php

    Code: Select all

    <?php
    /**
    *
    * phpBB Extension - toxyy Anonymous Posts
    * @copyright (c) 2018 toxyy <thrashtek@yahoo.com>
    * @license GNU General Public License, version 2 (GPL-2.0)
    *
    */
    
    /**
    * DO NOT CHANGE
    */
    if (!defined('IN_PHPBB'))
    {
    	exit;
    }
    
    if (empty($lang) || !is_array($lang))
    {
    	$lang = array();
    }
    
    // DEVELOPERS PLEASE NOTE
    //
    // All language files should use UTF-8 as their encoding and the files must not contain a BOM.
    //
    // Placeholders can now contain order information, e.g. instead of
    // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
    // translators to re-order the output of data while ensuring it remains correct
    //
    // You do not need this where single placeholders are used, e.g. 'Message %d' is fine
    // equally where a string contains only two placeholders which are used to wrap text
    // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
    //
    // Some characters you may want to copy&paste:
    // ’ » “ ” …
    //
    
    $lang = array_merge($lang, array(
    	'ANP_TITLE_ACP'		=> 'Anonim Gönderiler',
    	'ANP_SETTINGS'		=> 'Anonim Gönderi ayarları',
    	'ANP_LOG_MSG'		=> '<strong>Benzer Konular ayarları değiştirildi</strong>',
            'ANP_PERMISSIONS'       => 'Anonim gönderim yapabilir',
    ));
    Health For Everyone ==> www.saglikforum.org

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Sat Sep 29, 2018 9:02 pm

    pikachuturkey wrote:
    Sat Sep 29, 2018 7:39 pm
    But i didn't understand why we altered "Similar Topics" setting
    Because I used that and another extension's files as a skeleton for another extension I was working on, which I used to make this one. Some things got missed it seems, lol. Also, it's still in dev, evidenced by how I handled the template in the installation instructions..
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    kinerity
    Community Team Member
    Community Team Member
    Posts: 1940
    Joined: Mon Sep 01, 2014 1:00 am
    Location: sudo rm -rf /
    Name: Kailey Truscott
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by kinerity » Sat Sep 29, 2018 10:22 pm

    Toxyy wrote:
    Sat Sep 29, 2018 5:57 am
    Installation/notes: Due to the limitations of events, and the nature of this extension, I cannot simply set a div to display: none and call it a day, information needs to be deleted. The quickest way to do that is to throw an {% if %} around what I don't like, as I haven't found another alternative, except figuring out how to access all the template variables in the block I need to cancel out and nulling them.

    [snip]

    So if you want to test this extension (it's in dev), do this:
    1) Open your viewtopic_body.html
    2) Find <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
    3) Add

    Code: Select all

    {% if !F_ANONPOST && !postrow.IS_ANONYMOUS || (postrow.IS_ANONYMOUS &&  marttiphpbb_grouptempvars.4) || (postrow.IS_ANONYMOUS &&  marttiphpbb_grouptempvars.5) %}
    on the line before it

    4) Find <!-- EVENT viewtopic_body_contact_fields_after -->
    5) Add

    Code: Select all

    {% endif %}
    on the line after it
    You could use jxtools to insert your template code. There's an example here. The whole topic, however, is well worth a read.
    Kailey Truscott - Community Team

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Sat Sep 29, 2018 10:24 pm

    kinerity wrote:
    Sat Sep 29, 2018 10:22 pm
    You could use jxtools to insert your template code. There's an example here. The whole topic, however, is well worth a read.
    I saw something about that but I didn't look into it. I'm not familiar with jxtools. Will it still work as intended if javascript is disabled? I don't want user's information being leaked simply because of that. If it can't, then I wouldn't really feel it's a complete solution.
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    kinerity
    Community Team Member
    Community Team Member
    Posts: 1940
    Joined: Mon Sep 01, 2014 1:00 am
    Location: sudo rm -rf /
    Name: Kailey Truscott
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by kinerity » Sat Sep 29, 2018 10:29 pm

    Toxyy wrote:
    Sat Sep 29, 2018 10:24 pm
    Will it still work as intended if javascript is disabled? I don't want user's information being leaked simply because of that.
    I haven't looked at it from that angle. I do know Javier put out some quality code, however it may be best to read it over if you understand it. It's been used in at least one extension that I know of.
    Kailey Truscott - Community Team

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Sat Sep 29, 2018 10:46 pm

    kinerity wrote:
    Sat Sep 29, 2018 10:29 pm
    I haven't looked at it from that angle. I do know Javier put out some quality code, however it may be best to read it over if you understand it. It's been used in at least one extension that I know of.
    Just tested it out. It works great, but not with javascript disabled. So unfortunately I'm going to have to find another solution in this case. Thanks for getting me to try it though.
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Mon Oct 01, 2018 1:27 am

    Updated to version 0.2.0, OP updated with additional pictures.

    Quotes, viewforum topicrow, and notifications now supported. Code reorganized. Helper class made. Removed bad config from migration. Removed old language entry.

    Uses custom event made in functions_posting.php lines (my version) 2285 - 2296, I will make the pull request later.
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    kinerity
    Community Team Member
    Community Team Member
    Posts: 1940
    Joined: Mon Sep 01, 2014 1:00 am
    Location: sudo rm -rf /
    Name: Kailey Truscott
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by kinerity » Tue Oct 02, 2018 12:28 pm

    Not a huge deal, but per the Coding Guidelines you are missing new lines at the end of your files.
    Newline at end of file
    All files should end in a newline so the last line does not appear as modified in diffs, when a line is appended to the file.
    newline.png
    newline.png (661 Bytes) Viewed 755 times
    Kailey Truscott - Community Team

    User avatar
    pikachuturkey
    Registered User
    Posts: 266
    Joined: Wed Dec 20, 2006 10:34 pm
    Name: Rıza
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by pikachuturkey » Tue Oct 02, 2018 6:12 pm

    Download link is for version 0.1.0 :D


    Turkish language files for 0.2.0

    tr/anp_install.php

    Code: Select all

    <?php
    /**
    * 
    * phpBB Extension - toxyy Anonymous Posts
    * @copyright (c) 2018 toxyy <thrashtek@yahoo.com>
    * @license GNU General Public License, version 2 (GPL-2.0)
    * 
    */
    if (!defined('IN_PHPBB'))
    {
    	exit;
    }
    if (empty($lang) || !is_array($lang))
    {
    	$lang = [];
    }
    $lang = array_merge($lang, [
    	'ANP_INSTALL_ERROR'	=> 'martti\'nin Group Template Variables eklentisi gerekli.',
    ]);
    // TRANSLATORS CAN IGNORE THIS.
    // Overwrite core error message keys with a more specific message.
    $lang = array_merge($lang, [
    	'EXTENSION_NOT_ENABLEABLE'		=> isset($lang['EXTENSION_NOT_ENABLEABLE']) ?
    		$lang['EXTENSION_NOT_ENABLEABLE'] . '<br /><br />' . sprintf($lang['ANP_INSTALL_ERROR']) :
    		null,
    	'CLI_EXTENSION_ENABLE_FAILURE'	=> isset($lang['CLI_EXTENSION_ENABLE_FAILURE']) ?
    		$lang['CLI_EXTENSION_ENABLE_FAILURE'] . '. ' . sprintf($lang['ANP_INSTALL_ERROR']) :
    		null,
    ]);

    tr/common

    Code: Select all

    <?php
    /**
    * 
    * phpBB Extension - toxyy Anonymous Posts
    * @copyright (c) 2018 toxyy <thrashtek@yahoo.com>
    * @license GNU General Public License, version 2 (GPL-2.0)
    * 
    */
    if (!defined('IN_PHPBB'))
    {
    	exit;
    }
    if (empty($lang) || !is_array($lang))
    {
    	$lang = [];
    }
    $lang = array_merge($lang, [
    	'ANP_MESSAGE'       => 'Anonim Gönderi',
    	'ANP_ACTION'        => 'Anonim olarak Gönder',
            'ANP_PERMISSIONS'   => 'Anonim olarak gönderebilir',
    ]);
    Health For Everyone ==> www.saglikforum.org

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by Toxyy » Wed Oct 03, 2018 8:52 am

    Major update 0.3.0

    -language support added in the listener
    -turkish added (I made another variable, please confirm that it's the right translation)
    -viewforum forumrow support added
    -search (including active topics) support added, for topicrow and postrow searches
    -fixed a bug where editing anonymous posts made them disappear
    -other minor fixes and code organization

    known bugs:
    -users dont receive notifications if your their is anonymous, such as someone quoting their anonymous post
    -anonymous usernames clickable in some areas (search, quotes). kind of ugly, considering the concept
    kinerity wrote:
    Tue Oct 02, 2018 12:28 pm
    Newline at end of file
    All files should end in a newline so the last line does not appear as modified in diffs, when a line is appended to the file.
    This has also been fixed.
    pikachuturkey wrote:
    Tue Oct 02, 2018 6:12 pm
    Download link is for version 0.1.0 :D
    Thanks, link updated.

    I added a new variable, I don't know turkish but it doesn't seem like you were declining any of them, so let me know if I'm right.
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    pikachuturkey
    Registered User
    Posts: 266
    Joined: Wed Dec 20, 2006 10:34 pm
    Name: Rıza
    Contact:

    Re: [3.2][DEV] Anonymous Posts

    Post by pikachuturkey » Wed Oct 03, 2018 8:05 pm

    I added a new variable, I don't know turkish but it doesn't seem like you were declining any of them, so let me know if I'm right.
    yes, you are right. 8-)
    Health For Everyone ==> www.saglikforum.org

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][ALPHA] Anonymous Posts

    Post by Toxyy » Wed Oct 03, 2018 10:43 pm

    Glad to hear it.

    Minor update 0.3.5

    -fixed poster_id equaling 0 when editing topics, causing an sql error when trying to access it
    -fixed version check not working in acp
    -dev --> alpha

    known bugs:
    -users dont receive notifications if your their is anonymous, such as someone quoting their anonymous post
    -anonymous usernames clickable in some areas (search, quotes). kind of ugly, considering the concept
    -checkbox doesn't stay checked, doesn't inherit property when editing
    -possible mystery sql error, should be fixed though
    -"Anonymous 0" in last post in search topicrow

    I feel this is now somewhat usable. Will upgrade to beta or further once the template workaround is taken care of.

    EDIT:

    Minor update 0.3.7

    -checkbox stays checked if post is anonymous
    -finally fixes poster_id not being put into db when editing, 4 editing postmodes huh
    -mystery sql error likely doesn't exist
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    User avatar
    Toxyy
    Registered User
    Posts: 540
    Joined: Mon Oct 24, 2016 3:22 pm
    Contact:

    Re: [3.2][BETA] Anonymous Posts

    Post by Toxyy » Wed Oct 17, 2018 2:20 am

    Major update 0.5.0 (0.4.0 skipped)

    0.4.0 notes:
    -notification fix is in dev
    -anonymous profile link no longer clickable in quotes
    -no longer clickable in the search postrow where it says "by {author}"
    -white space removed
    -some reorganization

    0.5.0 notes:
    -Alpha --> Beta
    -notifications work, if youve posted anonymously youll get them for quotes and stuff. should work properly in most cases. is_anonymous_list index matching is questionable in edge cases
    -no more template editing!!! contact information removed without needing to modify the template as in OP
    -some cleanup

    OP has been updated and the template hack removed as it is no longer necessary. A PR has been made to accommodate as well. All styles should be supported now, as far as I know.

    I'd say this is a lot more usable than the alpha was and is more versatile per style you have installed, so I've changed this to beta.

    Todo:
    -some approving post bug
    -recheck everything
    -optimize queries, especially how get_poster_index is used...

    -caching???

    EDIT: minor update 0.5.1
    -support added for the Normal and Special Ranks extension, removes those ranks properly now

    EDIT EDIT:

    major update 0.6.1 - optimization time (much safer to use now)
    -if running previous versions, this will populate your new mysql db posts table column automatically
    -optimization!!! much safer to use now
    --language for anonymous called as little as possible
    --same for is_staff function
    --anonymous index is now a column in the posts table, so this variable is moved into existing sql queries now
    -removed useless event
    -potentially useless other event commented out but not disabled
    -friend and foe status no longer influences anonymous posts
    -new edit bug fixed
    -(native search only) no longer able to search by author and see their anonymous posts
    --helper function made and ready to test the other 2 (sphinx has no event that i need, and who uses it anyways?)
    -(cant remember if i logged this or not), but box no longer stays checked if quoting an anonymous post
    -useless migration files removed for future people
    -migration files fixed (thank you david63)
    -since everything got optimized, minor fixes is an understatement. thanks xdebug and qcachegrind!
    -two tiny other bugs fixed after everything got jumbled around

    update 0.7.0
    -notifications support language files now
    -edit was changing anonymous index in weird circumstances
    -minor bug fixes here and there
    -mysql and postgres SHOULD be supported for author search exclusion but they are untested
    -martti's group extension isn't required anymore (sorry!)
    --anp_install.php removed from tr and en because of that

    update 0.7.5
    -recent topics extension support added
    -editing posts no longer messes with index....again
    -made two global variables for easier access

    todo:
    -approved posts bug
    -anything else that pops up

    major update 0.8.0
    -code overhaul
    --generic functions made to standardize everything, makes it easier to add/remove features in the future
    --code cleaned up. only thing left to contemplate is the use of queries, caching, and if i can get the info i need in other queries instead of my own
    --php 7.2 compatible
    I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

    My extensions:
    [3.2][BETA] Anonymous Posts || [3.2][RC] Show User Activity

    Post Reply

    Return to “Extensions in Development”

    Who is online

    Users browsing this forum: </Solidjeuh>, Shredder and 21 guests