Advertisement:

Author Topic: Anonymous Board Mod  (Read 124777 times)

Offline Huf

  • Newbie
  • *
  • Posts: 2
Re: Anonymous Board Mod
« Reply #220 on: December 21, 2011, 04:48:49 PM »
Lupin, isn't your board 1.x?

Huf, is there a field "anonymous_board" in your database?  Try to manually run the install.php script and see what's happening, I'm curious as to whether or not the script is running. I haven't been able to recreate the issue so I can't test it myself.  It should be a column under {dbprefix}boards.

Alright, I checked the database and there is a column "anonymous_board" in the "smf_boards" table. The column's value for all other areas is 0 and for the anonymous area it's 1. This was the case when I posted my previous message as well, I just forgot to mention it. :-[

I backtracked the mod's installation on the Theme and Source files to see if for some reason something would have been omitted, but all the changes were there. The only thing that was different that in the install.xml was in the Post.template.php file where installation xml says this:
Code: [Select]
<file name="$themedir/Post.template.php">
<operation>
<search position="after"><![CDATA[
// Finally, the submit buttons.
]]></search>
<add><![CDATA[
// anonymous board mod
if ( $context['anonymous_board'] )
echo ' '. $txt['Post_anonymous'] .' <input type="checkbox" name="post_unanon" />';

]]></add>
</operation>
</file>
which should place the anonymous board mod changes after the "//Finally..." line but in my board's Post.template.php the anonymous board modification is before the "//Finally..." line. :o Not that it makes any difference in the end, since the "//Finally..." line is just a comment, but I still found that a bit weird. :laugh:

I just checked the error log again and the last errors of the matter have been from December 18th. I tried making a new topic in the anonymous area and now the "Post with your username" checkbox appeared and I could start a topic anonymously.

I haven't touched anything, haven't made any changes or anything and now it works. I'm the only admin that touches any files or packages as well so no-one else has done any modifications either. I'm stumped. Some mysterious things are happening. ;D

I'll be doing some testing on my forum still, but at the moment the problem seems to have been fixed. I wonder if it was some kind of a caching problem or something, my forum has had some other problems with it as well and that's the only thing I've tampered with these past couple of days. ???

In any case, I'll be reporting back if the error appears again or if I can determine what it actually was that was causing it but at the moment it seems to be working for all different usergroups without a problem so all is well.

Happy Holidays and thanks for the great mod!  :)

Offline JMV290

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
    • Boyah Forums
Re: Anonymous Board Mod
« Reply #221 on: December 21, 2011, 05:15:23 PM »
Thank you very much.  I'll take a look and might have to rework the query to see what it's inserting the code there. Glad it works for you.  I should have a fix up within the next few days.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,620
  • Gender: Male
    • Kindred-999 on GitHub
Re: Anonymous Board Mod
« Reply #222 on: December 21, 2011, 06:19:51 PM »
it is inserting the code correctly.

search position = after
means
add code = before the searched position
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Anonymous Board Mod
« Reply #223 on: December 21, 2011, 10:27:52 PM »
Yes, I use the SMF 1.1 version of the mod. I'd greatyl appreciate any input on how I can solve this problem. Thank you.

Offline distante

  • SMF Hero
  • ******
  • Posts: 2,013
  • Gender: Male
  • Me pueden encontrar en : www.smfsimple.com
    • LosDesadaptados on Facebook
    • @LosDesadaptados on Twitter
    • Desadaptados.net!
Re: Anonymous Board Mod
« Reply #224 on: February 05, 2012, 10:22:57 AM »
Is there some way to pass a whole forum into a "Anonymous Board" changing the current posts? (and all the way around)

I have a hidden "girl talk" sub forum for members only that I like to make public but using the anonymous feature, to see how it works (and if don't go back to be a "normal" board)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,620
  • Gender: Male
    • Kindred-999 on GitHub
Re: Anonymous Board Mod
« Reply #225 on: February 08, 2012, 11:53:58 AM »
hmmmm....

MYSITE/index.php?action=post2;start=0;board=11
8: Undefined index: anonymous_board
File: /MYSITEDIR/Themes/default/Post.template.php
Line: 746

the offending line is:
if ( $context['anonymous_board'] )
which implies that the value is never set in the context array...


Also, setting a board to anonymous (with the checkbox) works...  but I see no option at all to allow the user to NOT be anonymous. (did you remove that functionality?)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Scorpii

  • Newbie
  • *
  • Posts: 7
Re: Anonymous Board Mod
« Reply #226 on: February 08, 2012, 12:51:21 PM »
Exact same error here, trying to track it down..

hxxp:www.mysite.com/forum/index.php?action=post;board=86.0 [nonactive]
Undefined index: anonymous_board
File: /home/user/public_html/forum/Themes/default/Post.template.php
Line: 602

here are lines 601, 602, 603
Code: [Select]
// anonymous board mod
if ( $context['anonymous_board'] )
echo ' '. $txt['Post_anonymous'] .' <input type="checkbox" name="post_unanon" />';

The option to allow anonymous appears on replies for me as well, but not on the initial post. Would apprecialte any feedback, going to try to trace down where the variable was set.. was thinking of trying to put an isset check in but would probably just clear up the errors and not fix the issue i'm guessing..

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,620
  • Gender: Male
    • Kindred-999 on GitHub
Re: Anonymous Board Mod
« Reply #227 on: February 08, 2012, 01:16:22 PM »
that is a good point... every single mod that sets a variable like this should always check to see if it's set...   of course, as you say, it removed the error but won't fix the underlying problem.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Anonymous Board Mod
« Reply #228 on: February 15, 2012, 02:03:54 PM »
Yes, I use the SMF 1.1 version of the mod. I'd greatyl appreciate any input on how I can solve this problem. Thank you.

I wanted tpo bump this and would greatly appreciate a fix for this problem. Thank you!

Offline shazoo!

  • Jr. Member
  • **
  • Posts: 129
  • Gender: Female
Unable to start an anonymous topic
« Reply #229 on: April 10, 2012, 10:30:20 AM »
Running 2.0.2 The anonymous option does not show up on a new topic but it does on the replies.

What do I need to do to fix this?

It seems to come and go for no apparent reason

« Last Edit: April 10, 2012, 12:09:59 PM by shazoo! »

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Anonymous Board Mod
« Reply #230 on: April 11, 2012, 12:18:58 AM »
Any news on the problem running this mod on SMF 1.1?

Offline shazoo!

  • Jr. Member
  • **
  • Posts: 129
  • Gender: Female
Re: Anonymous Board Mod
« Reply #231 on: April 18, 2012, 02:05:18 PM »
Has anyone figured out how to add the check box to quick reply?

Offline littlenicki

  • Jr. Member
  • **
  • Posts: 195
Re: Anonymous Board Mod
« Reply #232 on: July 18, 2012, 03:51:50 AM »
Looks like a dead mod?
Fomer SMF user. Switched to Invision Power Board and VBulletin

Offline shazoo!

  • Jr. Member
  • **
  • Posts: 129
  • Gender: Female
Re: Anonymous Board Mod
« Reply #233 on: July 19, 2012, 09:20:38 AM »
seems to be the case

Offline MiY4Gi

  • Full Member
  • ***
  • Posts: 523
  • Gender: Male
  • Mm...
    • MyAnimeClub.net
Re: Anonymous Board Mod
« Reply #234 on: July 19, 2012, 09:38:09 AM »
No mods are dead on SMF until an admin, the acting developer, or another developer says so. A little patience wouldn't go amiss. I'm also interested in this mod. Also, when enough people start experiencing the same error, one of the users usually manages to isolate and fix the problem.
Check out my new website, MyAnimeClub.net. I plan to create the largest anime community, and most fun and user-friendly anime forum in the world. It's still in the development stage though.

Offline shazoo!

  • Jr. Member
  • **
  • Posts: 129
  • Gender: Female
Re: Anonymous Board Mod
« Reply #235 on: July 19, 2012, 04:25:38 PM »
Technically that may be true, but no one has even ventured to answer my questions since April
After 3 months, I gave up.

Offline littlenicki

  • Jr. Member
  • **
  • Posts: 195
Re: Anonymous Board Mod
« Reply #236 on: July 23, 2012, 05:08:53 PM »
Since people have been looking for a fix for well over a year this sounds like abandoned to me. Sad but true.
Fomer SMF user. Switched to Invision Power Board and VBulletin

Offline MiY4Gi

  • Full Member
  • ***
  • Posts: 523
  • Gender: Male
  • Mm...
    • MyAnimeClub.net
Re: Anonymous Board Mod
« Reply #237 on: July 27, 2012, 08:29:31 PM »
Here's the fix for the Anonymous Board Mod (SMF 2.0) all you guys have been waiting for.

In Load.php

Find:

Code: [Select]
'cur_topic_starter' => empty($topic) ? 0 : $row['id_member_started'],

Then below the above code add:

Code: [Select]
                                'anonymous_board' => $row['anonymous_board'],

Next, find and delete:

Code: [Select]
$context['anonymous_board'] = $row['anonymous_board'];

Now find:

Code: [Select]
else
{
// Otherwise the topic is invalid, there are no moderators, etc.
$board_info = array(
'moderators' => array(),
'error' => 'exist'
);
$topic = null;
$board = 0;
}
$smcFunc['db_free_result']($request);
}

And below the above code add:

Code: [Select]

        // Is the board anonymous?   
$context['anonymous_board'] = $board_info['anonymous_board'];

This is what your final code should look like:

Code: [Select]
// Basic operating information. (globals... :/)
$board_info = array(
'id' => $board,
'moderators' => array(),
'cat' => array(
'id' => $row['id_cat'],
'name' => $row['cname']
),
'name' => $row['bname'],
'description' => $row['description'],
'num_topics' => $row['num_topics'],
'unapproved_topics' => $row['unapproved_topics'],
'unapproved_posts' => $row['unapproved_posts'],
'unapproved_user_topics' => 0,
'parent_boards' => getBoardParents($row['id_parent']),
'parent' => $row['id_parent'],
'child_level' => $row['child_level'],
'theme' => $row['id_theme'],
'override_theme' => !empty($row['override_theme']),
'profile' => $row['id_profile'],
'redirect' => $row['redirect'],
'posts_count' => empty($row['count_posts']),
'cur_topic_approved' => empty($topic) || $row['approved'],
'cur_topic_starter' => empty($topic) ? 0 : $row['id_member_started'],
                                'anonymous_board' => $row['anonymous_board'],
);

// Load the membergroups allowed, and check permissions.
$board_info['groups'] = $row['member_groups'] == '' ? array() : explode(',', $row['member_groups']);

do
{
if (!empty($row['id_moderator']))
$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '">' . $row['real_name'] . '</a>'
);
}
while ($row = $smcFunc['db_fetch_assoc']($request));

// If the board only contains unapproved posts and the user isn't an approver then they can't see any topics.
// If that is the case do an additional check to see if they have any topics waiting to be approved.
if ($board_info['num_topics'] == 0 && $modSettings['postmod_active'] && !allowedTo('approve_posts'))
{
$smcFunc['db_free_result']($request); // Free the previous result

$request = $smcFunc['db_query']('', '
SELECT COUNT(id_topic)
FROM {db_prefix}topics
WHERE id_member_started={int:id_member}
AND approved = {int:unapproved}
AND id_board = {int:board}',
array(
'id_member' => $user_info['id'],
'unapproved' => 0,
'board' => $board,
)
);

list ($board_info['unapproved_user_topics']) = $smcFunc['db_fetch_row']($request);
}

if (!empty($modSettings['cache_enable']) && (empty($topic) || $modSettings['cache_enable'] >= 3))
{
// !!! SLOW?
if (!empty($topic))
cache_put_data('topic_board-' . $topic, $board_info, 120);
cache_put_data('board-' . $board, $board_info, 120);
}
}
else
{
// Otherwise the topic is invalid, there are no moderators, etc.
$board_info = array(
'moderators' => array(),
'error' => 'exist'
);
$topic = null;
$board = 0;
}
$smcFunc['db_free_result']($request);
}

        // Is the board anonymous?   
$context['anonymous_board'] = $board_info['anonymous_board'];

Now it's just up to the mod developer to incorporate the above code into the mod. If you would like to know what was causing the problem, then read this thread.
« Last Edit: July 27, 2012, 08:57:36 PM by MiY4Gi »
Check out my new website, MyAnimeClub.net. I plan to create the largest anime community, and most fun and user-friendly anime forum in the world. It's still in the development stage though.

Offline shazoo!

  • Jr. Member
  • **
  • Posts: 129
  • Gender: Female
Re: Anonymous Board Mod
« Reply #238 on: July 27, 2012, 08:38:41 PM »
Here's the Anonymous Board Mod SMF 2.0 fix all you guys have been waiting for.

In Load.php

Find:

Code: [Select]
'cur_topic_starter' => empty($topic) ? 0 : $row['id_member_started'],

Then below the above code add:

Code: [Select]
                                'anonymous_board' => $row['anonymous_board'],

Next, find and delete:

Code: [Select]
$context['anonymous_board'] = $row['anonymous_board'];

Now find:

Code: [Select]
else
{
// Otherwise the topic is invalid, there are no moderators, etc.
$board_info = array(
'moderators' => array(),
'error' => 'exist'
);
$topic = null;
$board = 0;
}
$smcFunc['db_free_result']($request);
}

And below the above code add:

Code: [Select]

        // Is the board anonymous?   
$context['anonymous_board'] = $board_info['anonymous_board'];

This is what your final code should look like:

Code: [Select]
// Basic operating information. (globals... :/)
$board_info = array(
'id' => $board,
'moderators' => array(),
'cat' => array(
'id' => $row['id_cat'],
'name' => $row['cname']
),
'name' => $row['bname'],
'description' => $row['description'],
'num_topics' => $row['num_topics'],
'unapproved_topics' => $row['unapproved_topics'],
'unapproved_posts' => $row['unapproved_posts'],
'unapproved_user_topics' => 0,
'parent_boards' => getBoardParents($row['id_parent']),
'parent' => $row['id_parent'],
'child_level' => $row['child_level'],
'theme' => $row['id_theme'],
'override_theme' => !empty($row['override_theme']),
'profile' => $row['id_profile'],
'redirect' => $row['redirect'],
'posts_count' => empty($row['count_posts']),
'cur_topic_approved' => empty($topic) || $row['approved'],
'cur_topic_starter' => empty($topic) ? 0 : $row['id_member_started'],
                                'anonymous_board' => $row['anonymous_board'],
);

// Load the membergroups allowed, and check permissions.
$board_info['groups'] = $row['member_groups'] == '' ? array() : explode(',', $row['member_groups']);

do
{
if (!empty($row['id_moderator']))
$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '">' . $row['real_name'] . '</a>'
);
}
while ($row = $smcFunc['db_fetch_assoc']($request));

// If the board only contains unapproved posts and the user isn't an approver then they can't see any topics.
// If that is the case do an additional check to see if they have any topics waiting to be approved.
if ($board_info['num_topics'] == 0 && $modSettings['postmod_active'] && !allowedTo('approve_posts'))
{
$smcFunc['db_free_result']($request); // Free the previous result

$request = $smcFunc['db_query']('', '
SELECT COUNT(id_topic)
FROM {db_prefix}topics
WHERE id_member_started={int:id_member}
AND approved = {int:unapproved}
AND id_board = {int:board}',
array(
'id_member' => $user_info['id'],
'unapproved' => 0,
'board' => $board,
)
);

list ($board_info['unapproved_user_topics']) = $smcFunc['db_fetch_row']($request);
}

if (!empty($modSettings['cache_enable']) && (empty($topic) || $modSettings['cache_enable'] >= 3))
{
// !!! SLOW?
if (!empty($topic))
cache_put_data('topic_board-' . $topic, $board_info, 120);
cache_put_data('board-' . $board, $board_info, 120);
}
}
else
{
// Otherwise the topic is invalid, there are no moderators, etc.
$board_info = array(
'moderators' => array(),
'error' => 'exist'
);
$topic = null;
$board = 0;
}
$smcFunc['db_free_result']($request);
}

        // Is the board anonymous?   
$context['anonymous_board'] = $board_info['anonymous_board'];

Now it's just up to the mod developer to incorporate the above code into the mod. If you would like to know what was causing the problem, then read this thread.
THis fixes the issue where the checkbox doesn't show on a new topic?  nice!!

Now if someone could figure out how to add it to the quick reply

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: Anonymous Board Mod
« Reply #239 on: July 27, 2012, 08:40:18 PM »
It working properly on 2.0.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.