Recent with recent Blogs added

Forum rules
This forum is not for support requests.

Only post Modifications for Board3 Portal 2.0.x in this forum.
Locked

Topic author
brut.me
Active Member
Posts: 10
Joined: 3. March 2014 12:53

Recent with recent Blogs added

Post by brut.me »

Hello, so I started working on recent Blogs. I am totalle newbie in php, but I am trying to add a forth row in recent block with a list of new blogs. It is enough for my needs now. But it shows me some error. I know that is something with bad table, but how can I repair it? My new code in Recent

Code: Select all

//
		// Recent blogs
		//
		$sql = 'SELECT blog_subject, user_id, blog_id
			FROM ' . BLOGS . ' t
			WHERE blog_deleted = 0
				AND blog_approved = 1
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY blog_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['blog_subject']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_topics', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}blog.$phpEx", 'u=' . $row['user_id'] . '&b=' . $row['blog_id'])
				));
			}
		}
		$db->sql_freeresult($result);
and this is the error:

Code: Select all

SQL ERROR [ mysqli ]

Table 'phpbb_db.blogs' doesn't exist [1146]

SQL

SELECT blog_subject, user_id, blog_id FROM BLOGS t WHERE blog_deleted = 0 AND blog_approved = 1 AND forum_id <> 145 ORDER BY blog_time DESC LIMIT 10

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 189
CALL: dbal->sql_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 231
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/includes/db/dbal.php
LINE: 170
CALL: dbal_mysqli->_sql_query_limit()

FILE: [ROOT]/portal/modules/portal_recent.php
LINE: 179
CALL: dbal->sql_query_limit()

FILE: [ROOT]/portal.php
LINE: 120
CALL: portal_recent_module->get_template_center()
How can i write the table correct? can someone double chack it, if the other changes are good ?
Locked

Return to “Modifications - In Development v2.0.x”