[ABD] Democracy MOD 0.2.1 (reputation + warnings + reports)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
samureye
Registered User
Posts: 48
Joined: Sun Sep 10, 2006 6:27 pm

Post by samureye »

Carbofos Where exactly is the cache folder to go?

Carbofos
Registered User
Posts: 191
Joined: Thu Mar 03, 2005 5:14 pm

Post by Carbofos »

samureye
Into phpBB root folfer.

ivyivy
Registered User
Posts: 30
Joined: Sun Nov 21, 2004 8:44 pm

Post by ivyivy »

Carbofos wrote:
ivyivy wrote:I saw one error - I choose to report the a post then comes the screen that says
"are you sure you want to repoart this mod to moderators?"
yes - no
when I select yes everyhing works but when I select no I get a blank page that only has the forum header/ menu and then just empty background.

What do you see in the address bar when you select "no"?


http://www.domain.com/forum/post_report.php?mode=report

any help will be appreciated.

killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

Carbofos wrote: killyouall
I searched through the code of Democracy and Simple Subforums, but they don't intersect anything near the place where topics are moved, so for now I have no idea of the reason...
I've found a little different version of function that's responsible for making a list of forums (it's in functions_admin.php), maybe it'll work for you:

Code: Select all

function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
	global $db;

	$not_auth_forums = user_not_auth_forums(AUTH_VIEW);
	$ignore_forum_sql = ($not_auth_forums) ? "AND f.forum_id NOT IN($not_auth_forums)" : '';

	$sql = 'SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name, f.forum_parent
		FROM '. FORUMS_TABLE .' f, '. CATEGORIES_TABLE ." c
		WHERE f.cat_id = c.cat_id
			$ignore_forum_sql
		ORDER BY c.cat_order, f.cat_id, f.forum_order";

	if (!$result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, 'Could not query cat/forum info', '', __LINE__, __FILE__, $sql);
	}

	if ($rowset = @$db->sql_fetchrowset($result))
	{
		$db->sql_freeresult($result);
		$forum_list = '';

		foreach ($rowset as $rid => $row)
		{
			$cat_forum[$row['cat_id']]['cat_title'] = $row['cat_title'];
			$cat_forum[$row['cat_id']]['f'][$row['forum_id']] = $row;
		}

		foreach ($cat_forum as $cid => $c)
		{
			$forum_list .= '<optgroup label="&nbsp;'. $c['cat_title'] .'">';

			foreach ($c['f'] as $fid => $f)
			{
				$selected = ($f['forum_id'] == $select_forum) ? ' selected="selected"' : '';
				$disabled = ($f['forum_id'] == $ignore_forum) ? ' disabled="disabled"' : '';
				$forum_list .= '<option value="'. $f['forum_id'] .'" '. $selected . $disabled .'>' . (($f['forum_parent']) ? SF_SEL_SPACER : '') . $f['forum_name'] . '</option>';
			}

			$forum_list .= '</optgroup>';
		}
	}
	else
	{
		$forum_list = '<option value="-1">-- ! No Forums ! --</option>';
	}

	return '<select name="'. $box_name .'">'. $forum_list .'</select>';
}

function user_not_auth_forums ($auth_type)
{
	global $userdata;

	if ($userdata['user_level'] != ADMIN)
	{
		$auth_field_match = array(
			AUTH_VIEW       => 'auth_view',
			AUTH_READ       => 'auth_read',
			AUTH_POST       => 'auth_post',
			AUTH_REPLY      => 'auth_reply',
			AUTH_EDIT       => 'auth_edit',
			AUTH_DELETE     => 'auth_delete',
			AUTH_STICKY     => 'auth_sticky',
			AUTH_ANNOUNCE   => 'auth_announce',
			AUTH_VOTE       => 'auth_vote',
			AUTH_POLLCREATE => 'auth_pollcreate',
			AUTH_ATTACH     => 'auth_attachments',
			AUTH_DOWNLOAD   => 'auth_download'
		);

		$ignore_forum_sql = array();
		$auth_field = $auth_field_match[$auth_type];
		$is_auth_ary = auth($auth_type, AUTH_LIST_ALL, $userdata);

		foreach ($is_auth_ary as $forum_id => $is_auth)
		{
			if (!$is_auth[$auth_field])
			{
				$ignore_forum_sql[] = $forum_id;
			}
		}

		return implode(',', $ignore_forum_sql);
	}
	else
	{
		return '';
	}
}
(comment out your current make_forum_select function first so you can return to it if it makes no difference).

If this won't work, I'll have to setup an extra board and put there Democracy and Simple Subforums together so I can actually debug the code...


nope didnt work
Fatal error: Call to undefined function: make_forum_select() in /home/kazuma/public_html/Forums/modcp.php on line 619

samureye
Registered User
Posts: 48
Joined: Sun Sep 10, 2006 6:27 pm

Post by samureye »

Same here, I have a cache folder and it just doesn't work. Oh well.

Carbofos
Registered User
Posts: 191
Joined: Thu Mar 03, 2005 5:14 pm

Post by Carbofos »

killyouall
Fatal error: Call to undefined function: make_forum_select() in /home/kazuma/public_html/Forums/modcp.php on line 619

This means it didn't find that function, maybe you've removed your current one from the functions_admin.php but then didn't copy&paste the one I've posted before...

samureye
What permissions does your cache folder have?

ivyivy
That's indeed strange, this part should work properly, and I wasn't able to reproduce the bug... Have you updated from the previous version? If so, check if you haven't forgotten to replace post_report.php with the new one from the package.

samureye
Registered User
Posts: 48
Joined: Sun Sep 10, 2006 6:27 pm

Post by samureye »

Well I am using version 2.0.20 if that means anything and as for permissions, not really sure, take a look.

Image

killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

Carbofos wrote: killyouall
Fatal error: Call to undefined function: make_forum_select() in /home/kazuma/public_html/Forums/modcp.php on line 619

This means it didn't find that function, maybe you've removed your current one from the functions_admin.php but then didn't copy&paste the one I've posted before...


you meant but two //'s in frount of it and comment it out right thats what i did did you mean something else??

Switcher05
Registered User
Posts: 6
Joined: Sun Jun 18, 2006 5:01 am

Post by Switcher05 »

I have reinstalled and i get this error both times:
Fatal error: Call to undefined function: db_query() in /home/www/airplanefreaks.awardspace.com/forum/index.php on line 128

Code: Select all

(126)if ($board_config['reputation_most_respected'])
		(127){
			(128)$result = db_query('SELECT user_reputation FROM {USERS_TABLE} GROUP BY user_reputation ORDER BY user_reputation DESC LIMIT %d', $board_config['reputation_most_respected']);
Is there a fix for this? phpbb verison 2.0.21

Carbofos
Registered User
Posts: 191
Joined: Thu Mar 03, 2005 5:14 pm

Post by Carbofos »

samureye
Check "write" in other columns as well.

killyouall
// - this just comments one line, to comment out more, you need to use /* ... */
Put /* just before the function and */ after the closing bracket of that function. And then paste the other version after it.

Switcher05
Make sure you have edited includes/functions.php enough :)

killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

Carbofos wrote: killyouall
// - this just comments one line, to comment out more, you need to use /* ... */
Put /* just before the function and */ after the closing bracket of that function. And then paste the other version after it.


what other verson can you give me both versons your starting to confuse me

you want me to comment out

Code: Select all

function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
or

Code: Select all

function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
	global $db, $userdata;

	$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);

	$sql = 'SELECT f.forum_id, f.forum_name, f.forum_parent 
		FROM ' . CATEGORIES_TABLE . ' c, ' . FORUMS_TABLE . ' f
		WHERE f.cat_id = c.cat_id 
		ORDER BY c.cat_order, f.forum_order';
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
	}
and replace it with

Code: Select all

function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
   global $db;

   $not_auth_forums = user_not_auth_forums(AUTH_VIEW);
   $ignore_forum_sql = ($not_auth_forums) ? "AND f.forum_id NOT IN($not_auth_forums)" : '';

   $sql = 'SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name, f.forum_parent
      FROM '. FORUMS_TABLE .' f, '. CATEGORIES_TABLE ." c
      WHERE f.cat_id = c.cat_id
         $ignore_forum_sql
      ORDER BY c.cat_order, f.cat_id, f.forum_order";

   if (!$result = $db->sql_query($sql))
   {
      message_die(GENERAL_ERROR, 'Could not query cat/forum info', '', __LINE__, __FILE__, $sql);
   }

   if ($rowset = @$db->sql_fetchrowset($result))
   {
      $db->sql_freeresult($result);
      $forum_list = '';

      foreach ($rowset as $rid => $row)
      {
         $cat_forum[$row['cat_id']]['cat_title'] = $row['cat_title'];
         $cat_forum[$row['cat_id']]['f'][$row['forum_id']] = $row;
      }

      foreach ($cat_forum as $cid => $c)
      {
         $forum_list .= '<optgroup label="&nbsp;'. $c['cat_title'] .'">';

         foreach ($c['f'] as $fid => $f)
         {
            $selected = ($f['forum_id'] == $select_forum) ? ' selected="selected"' : '';
            $disabled = ($f['forum_id'] == $ignore_forum) ? ' disabled="disabled"' : '';
            $forum_list .= '<option value="'. $f['forum_id'] .'" '. $selected . $disabled .'>' . (($f['forum_parent']) ? SF_SEL_SPACER : '') . $f['forum_name'] . '</option>';
         }

         $forum_list .= '</optgroup>';
      }
   }
   else
   {
      $forum_list = '<option value="-1">-- ! No Forums ! --</option>';
   }

   return '<select name="'. $box_name .'">'. $forum_list .'</select>';
}

function user_not_auth_forums ($auth_type)
{
   global $userdata;

   if ($userdata['user_level'] != ADMIN)
   {
      $auth_field_match = array(
         AUTH_VIEW       => 'auth_view',
         AUTH_READ       => 'auth_read',
         AUTH_POST       => 'auth_post',
         AUTH_REPLY      => 'auth_reply',
         AUTH_EDIT       => 'auth_edit',
         AUTH_DELETE     => 'auth_delete',
         AUTH_STICKY     => 'auth_sticky',
         AUTH_ANNOUNCE   => 'auth_announce',
         AUTH_VOTE       => 'auth_vote',
         AUTH_POLLCREATE => 'auth_pollcreate',
         AUTH_ATTACH     => 'auth_attachments',
         AUTH_DOWNLOAD   => 'auth_download'
      );

      $ignore_forum_sql = array();
      $auth_field = $auth_field_match[$auth_type];
      $is_auth_ary = auth($auth_type, AUTH_LIST_ALL, $userdata);

      foreach ($is_auth_ary as $forum_id => $is_auth)
      {
         if (!$is_auth[$auth_field])
         {
            $ignore_forum_sql[] = $forum_id;
         }
      }

      return implode(',', $ignore_forum_sql);
   }
   else
   {
      return '';
   }
} 

Carbofos
Registered User
Posts: 191
Joined: Thu Mar 03, 2005 5:14 pm

Post by Carbofos »

killyouall
That's how you comment out the whole function:

Code: Select all

/*
function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
   global $db, $userdata;

   $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);

   $sql = 'SELECT f.forum_id, f.forum_name, f.forum_parent
      FROM ' . CATEGORIES_TABLE . ' c, ' . FORUMS_TABLE . ' f
      WHERE f.cat_id = c.cat_id
      ORDER BY c.cat_order, f.forum_order';
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
   }

   ..... more code here


   return $forum_list;
}
*/
Insert the other version of it after it. The point of it is that if you're not satisfied with how the new code works, you can delete it, remove /* and */ (uncomment the old function) and you're back with your previous version.
I can't tell for sure it'll work, it's just another version of the same function you have. To know the reason, I'd need to debug your code, that means your files and your database, which would be somewhat time consuming to setup at my place, but if it'll remain the only option... :)

killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

ok i will try it when i get home sorry if i was being dence ive been doign this late at night and at school so its a bit sketcky lol

Switcher05
Registered User
Posts: 6
Joined: Sun Jun 18, 2006 5:01 am

Post by Switcher05 »

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE topic_id = 5' at line 1

UPDATE phpbb_topics SET topic_title = 'Report errors', topic_type = 1, WHERE topic_id = 5

Line : 231
File : functions_post.php


Here is the line:

Code: Select all

"UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

It happens when i try to edit a post.

Carbofos
Registered User
Posts: 191
Joined: Thu Mar 03, 2005 5:14 pm

Post by Carbofos »

Switcher05
Democracy MOD doesn't edit this line, but this error is apparently because of extra ',' here:
"UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

I've looked into my functions_post.php and it wasn't there, too, so you can as well remove it :)

Locked

Return to “[2.0.x] MODs in Development”