Syntax ERROR!

Moderatori: janis.wd, Vecākie lietotāji

User avatar
Ernijs_E
Reģistrēts lietotājs
Atbildes: 94
Pievienojies: 09 Mar 2008, 17:24
Reputācija: 0
Atrodas: Rīga, Iecava

Syntax ERROR!

Post no Ernijs_E » 08 Apr 2008, 23:37

Sveiki.

Problēma ir tāda:

Es mēģināju pie PHPBB2 pielikt lejā čatu. Itkā visu izdarīju kā bija rakstīts moda instalācija, bet nu sartējot savu forumu izmet šādu paziņojumu:

Parse error: syntax error, unexpected ';', expecting ')' in C:\wamp\www\phpBB2\index.php on line 282

Vai kāds nevar palīdzēt? Ceru uz autsaucību.. :)

Code: Select all

<php>assign_vars&#40;array&#40;
		"META" => '<meta>'&#41;
	&#41;;

	$message = $lang&#91;'Forums_marked_read'&#93; . '<br><br>' . sprintf&#40;$lang&#91;'Click_return_index'&#93;, '<a>', '</a> '&#41;;

	message_die&#40;GENERAL_MESSAGE, $message&#41;;
&#125;
//
// End handle marking posts
//

$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . "_t"&#93;&#41; &#58; array&#40;&#41;;
$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . "_f"&#93;&#41; &#58; array&#40;&#41;;

//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat&#40;'postcount'&#41;;
$total_users = get_db_stat&#40;'usercount'&#41;;
$newest_userdata = get_db_stat&#40;'newestuser'&#41;;
$newest_user = $newest_userdata&#91;'username'&#93;;
$newest_uid = $newest_userdata&#91;'user_id'&#93;;

if&#40; $total_posts == 0 &#41;
&#123;
	$l_total_post_s = $lang&#91;'Posted_articles_zero_total'&#93;;
&#125;
else if&#40; $total_posts == 1 &#41;
&#123;
	$l_total_post_s = $lang&#91;'Posted_article_total'&#93;;
&#125;
else
&#123;
	$l_total_post_s = $lang&#91;'Posted_articles_total'&#93;;
&#125;

if&#40; $total_users == 0 &#41;
&#123;
	$l_total_user_s = $lang&#91;'Registered_users_zero_total'&#93;;
&#125;
else if&#40; $total_users == 1 &#41;
&#123;
	$l_total_user_s = $lang&#91;'Registered_user_total'&#93;;
&#125;
else
&#123;
	$l_total_user_s = $lang&#91;'Registered_users_total'&#93;;
&#125;


//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
	FROM " . CATEGORIES_TABLE . " c 
	ORDER BY c.cat_order";
if&#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
	message_die&#40;GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql&#41;;
&#125;

$category_rows = array&#40;&#41;;
while &#40;$row = $db->sql_fetchrow&#40;$result&#41;&#41;
&#123;
	$category_rows&#91;&#93; = $row;
&#125;
$db->sql_freeresult&#40;$result&#41;;

if&#40; &#40; $total_categories = count&#40;$category_rows&#41; &#41; &#41;
&#123;
	//
	// Define appropriate SQL
	//
	switch&#40;SQL_LAYER&#41;
	&#123;
		case 'postgresql'&#58;
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id 
					AND u.user_id = p.poster_id  
					UNION &#40;
						SELECT f.*, NULL, NULL, NULL, NULL
						FROM " . FORUMS_TABLE . " f
						WHERE NOT EXISTS &#40;
							SELECT p.post_time
							FROM " . POSTS_TABLE . " p
							WHERE p.post_id = f.forum_last_post_id  
						&#41;
					&#41;
					ORDER BY cat_id, forum_order";
			break;

		case 'oracle'&#58;
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id&#40;+&#41;
					AND u.user_id = p.poster_id&#40;+&#41;
				ORDER BY f.cat_id, f.forum_order";
			break;

		default&#58;
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM &#40;&#40; " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id &#41;
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id &#41;
				ORDER BY f.cat_id, f.forum_order";
			break;
	&#125;
	if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
	&#123;
		message_die&#40;GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql&#41;;
	&#125;

	$forum_data = array&#40;&#41;;
	while&#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
	&#123;
		$forum_data&#91;&#93; = $row;
	&#125;
	$db->sql_freeresult&#40;$result&#41;;

	if &#40; !&#40;$total_forums = count&#40;$forum_data&#41;&#41; &#41;
	&#123;
		message_die&#40;GENERAL_MESSAGE, $lang&#91;'No_forums'&#93;&#41;;
	&#125;

	//
	// Obtain a list of topic ids which contain
	// posts made since user last visited
	//
	if &#40;$userdata&#91;'session_logged_in'&#93;&#41;
	&#123;
		// 60 days limit
		if &#40;$userdata&#91;'user_lastvisit'&#93; <time>sql_query&#40;$sql&#41;&#41; &#41;
		&#123;
			message_die&#40;GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql&#41;;
		&#125;

		$new_topic_data = array&#40;&#41;;
		while&#40; $topic_data = $db->sql_fetchrow&#40;$result&#41; &#41;
		&#123;
			$new_topic_data&#91;$topic_data&#91;'forum_id'&#93;&#93;&#91;$topic_data&#91;'topic_id'&#93;&#93; = $topic_data&#91;'post_time'&#93;;
		&#125;
		$db->sql_freeresult&#40;$result&#41;;
	&#125;

	//
	// Obtain list of moderators of each forum
	// First users, then groups ... broken into two queries
	//
	$sql = "SELECT aa.forum_id, u.user_id, u.username 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 1 
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
			AND u.user_id = ug.user_id 
		GROUP BY u.user_id, u.username, aa.forum_id 
		ORDER BY aa.forum_id, u.user_id";
	if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
	&#123;
		message_die&#40;GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql&#41;;
	&#125;

	$forum_moderators = array&#40;&#41;;
	while&#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
	&#123;
		$forum_moderators&#91;$row&#91;'forum_id'&#93;&#93;&#91;&#93; = '<a>' . $row&#91;'username'&#93; . '</a>';
	&#125;
	$db->sql_freeresult&#40;$result&#41;;

	$sql = "SELECT aa.forum_id, g.group_id, g.group_name 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g 
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 0 
			AND g.group_type <GROUP_HIDDEN>sql_query&#40;$sql&#41;&#41; &#41;
	&#123;
		message_die&#40;GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql&#41;;
	&#125;

	while&#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
	&#123;
		$forum_moderators&#91;$row&#91;'forum_id'&#93;&#93;&#91;&#93; = '<a>' . $row&#91;'group_name'&#93; . '</a>';
	&#125;
	$db->sql_freeresult&#40;$result&#41;;

	//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array&#40;&#41;;
	$is_auth_ary = auth&#40;AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data&#41;;

	//
	// Start output of page
	//
	define&#40;'SHOW_ONLINE', true&#41;;
	$page_title = $lang&#91;'Index'&#93;;
	include&#40;$phpbb_root_path . 'includes/page_header.'.$phpEx&#41;;

	$template->set_filenames&#40;array&#40;
		'body' => 'index_body.tpl'&#41;
	&#41;;

	$template->assign_vars&#40;array&#40;
		'TOTAL_POSTS' => sprintf&#40;$l_total_post_s, $total_posts&#41;,
		'TOTAL_USERS' => sprintf&#40;$l_total_user_s, $total_users&#41;,
		'NEWEST_USER' => sprintf&#40;$lang&#91;'Newest_user'&#93;, '<a>', $newest_user, '</a>'&#41;,
// ChatBox Mod
	require_once&#40;$phpbb_root_path . 'chatbox_front.php'&#41;;
		'FORUM_IMG' => $images&#91;'forum'&#93;,
		'FORUM_NEW_IMG' => $images&#91;'forum_new'&#93;,
		'FORUM_LOCKED_IMG' => $images&#91;'forum_locked'&#93;,

		'L_FORUM' => $lang&#91;'Forum'&#93;,
		'L_TOPICS' => $lang&#91;'Topics'&#93;,
		'L_REPLIES' => $lang&#91;'Replies'&#93;,
		'L_VIEWS' => $lang&#91;'Views'&#93;,
		'L_POSTS' => $lang&#91;'Posts'&#93;,
		'L_LASTPOST' => $lang&#91;'Last_Post'&#93;, 
		'L_NO_NEW_POSTS' => $lang&#91;'No_new_posts'&#93;,
		'L_NEW_POSTS' => $lang&#91;'New_posts'&#93;,
		'L_NO_NEW_POSTS_LOCKED' => $lang&#91;'No_new_posts_locked'&#93;, 
		'L_NEW_POSTS_LOCKED' => $lang&#91;'New_posts_locked'&#93;, 
		'L_ONLINE_EXPLAIN' => $lang&#91;'Online_explain'&#93;, 

		'L_MODERATOR' => $lang&#91;'Moderators'&#93;, 
		'L_FORUM_LOCKED' => $lang&#91;'Forum_is_locked'&#93;,
		'L_MARK_FORUMS_READ' => $lang&#91;'Mark_all_forums'&#93;,
// ChatBox Mod
		'TOTAL_CHATTERS_ONLINE' => sprintf&#40;$lang&#91;'How_Many_Chatters'&#93;, $howmanychat&#41;,
		'CHATTERS_LIST' => sprintf&#40;$lang&#91;'Who_Are_Chatting' &#93;, $chatters&#41;,
		'L_CLICK_TO_JOIN_CHAT' => $lang&#91;'Click_to_join_chat'&#93;,
		'S_JOIN_CHAT' => append_sid&#40;"chatbox_mod/chatbox.$phpEx"&#41;,
		'CHATBOX_NAME' => $userdata&#91;'user_id'&#93; . '_ChatBox', // To make easier to test on my PC
		'L_LOGIN_TO_JOIN_CHAT' => $lang&#91;'Login_to_join_chat'&#93;, 

		'U_MARK_READ' => append_sid&#40;"index.$phpEx?mark=forums"&#41;&#41;
	&#41;;

	//
	// Let's decide which categories we should display
	//
	$display_categories = array&#40;&#41;;

	for &#40;$i = 0; $i < $total_forums; $i++ &#41;
	&#123;
		if &#40;$is_auth_ary&#91;$forum_data&#91;$i&#93;&#91;'forum_id'&#93;&#93;&#91;'auth_view'&#93;&#41;
		&#123;
			$display_categories&#91;$forum_data&#91;$i&#93;&#91;'cat_id'&#93;&#93; = true;
		&#125;
	&#125;

	//
	// Okay, let's build the index
	//
	for&#40;$i = 0; $i <total_categories>assign_block_vars&#40;'catrow', array&#40;
				'CAT_ID' => $cat_id,
				'CAT_DESC' => $category_rows&#91;$i&#93;&#91;'cat_title'&#93;,
				'U_VIEWCAT' => append_sid&#40;"index.$phpEx?" . POST_CAT_URL . "=$cat_id"&#41;&#41;
			&#41;;

			if &#40; $viewcat == $cat_id || $viewcat == -1 &#41;
			&#123;
				for&#40;$j = 0; $j < $total_forums; $j++&#41;
				&#123;
					if &#40; $forum_data&#91;$j&#93;&#91;'cat_id'&#93; == $cat_id &#41;
					&#123;
						$forum_id = $forum_data&#91;$j&#93;&#91;'forum_id'&#93;;

						if &#40; $is_auth_ary&#91;$forum_id&#93;&#91;'auth_view'&#93; &#41;
						&#123;
							if &#40; $forum_data&#91;$j&#93;&#91;'forum_status'&#93; == FORUM_LOCKED &#41;
							&#123;
								$folder_image = $images&#91;'forum_locked'&#93;; 
								$folder_alt = $lang&#91;'Forum_locked'&#93;;
							&#125;
							else
							&#123;
								$unread_topics = false;
								if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
								&#123;
									if &#40; !empty&#40;$new_topic_data&#91;$forum_id&#93;&#41; &#41;
									&#123;
										$forum_last_post_time = 0;

										while&#40; list&#40;$check_topic_id, $check_post_time&#41; = @each&#40;$new_topic_data&#91;$forum_id&#93;&#41; &#41;
										&#123;
											if &#40; empty&#40;$tracking_topics&#91;$check_topic_id&#93;&#41; &#41;
											&#123;
												$unread_topics = true;
												$forum_last_post_time = max&#40;$check_post_time, $forum_last_post_time&#41;;

											&#125;
											else
											&#123;
												if &#40; $tracking_topics&#91;$check_topic_id&#93; <check_post_time> $forum_last_post_time &#41;
											&#123;
												$unread_topics = false;
											&#125;
										&#125;

										if &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
										&#123;
											if &#40; $HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_name'&#93; . '_f_all'&#93; > $forum_last_post_time &#41;
											&#123;
												$unread_topics = false;
											&#125;
										&#125;

									&#125;
								&#125;

								$folder_image = &#40; $unread_topics &#41; ? $images&#91;'forum_new'&#93; &#58; $images&#91;'forum'&#93;; 
								$folder_alt = &#40; $unread_topics &#41; ? $lang&#91;'New_posts'&#93; &#58; $lang&#91;'No_new_posts'&#93;; 
							&#125;

							$posts = $forum_data&#91;$j&#93;&#91;'forum_posts'&#93;;
							$topics = $forum_data&#91;$j&#93;&#91;'forum_topics'&#93;;

							if &#40; $forum_data&#91;$j&#93;&#91;'forum_last_post_id'&#93; &#41;
							&#123;
								$last_post_time = create_date&#40;$board_config&#91;'default_dateformat'&#93;, $forum_data&#91;$j&#93;&#91;'post_time'&#93;, $board_config&#91;'board_timezone'&#93;&#41;;

								$last_post = $last_post_time . '<br>';

								$last_post .= &#40; $forum_data&#91;$j&#93;&#91;'user_id'&#93; == ANONYMOUS &#41; ? &#40; &#40;$forum_data&#91;$j&#93;&#91;'post_username'&#93; != '' &#41; ? $forum_data&#91;$j&#93;&#91;'post_username'&#93; . ' ' &#58; $lang&#91;'Guest'&#93; . ' ' &#41; &#58; '<a>' . $forum_data&#91;$j&#93;&#91;'username'&#93; . '</a> ';
								
								$last_post .= '<a><img></a>';
							&#125;
							else
							&#123;
								$last_post = $lang&#91;'No_Posts'&#93;;
							&#125;

							if &#40; count&#40;$forum_moderators&#91;$forum_id&#93;&#41; > 0 &#41;
							&#123;
								$l_moderators = &#40; count&#40;$forum_moderators&#91;$forum_id&#93;&#41; == 1 &#41; ? $lang&#91;'Moderator'&#93; &#58; $lang&#91;'Moderators'&#93;;
								$moderator_list = implode&#40;', ', $forum_moderators&#91;$forum_id&#93;&#41;;
							&#125;
							else
							&#123;
								$l_moderators = '&nbsp;';
								$moderator_list = '&nbsp;';
							&#125;

							$row_color = &#40; !&#40;$i % 2&#41; &#41; ? $theme&#91;'td_color1'&#93; &#58; $theme&#91;'td_color2'&#93;;
							$row_class = &#40; !&#40;$i % 2&#41; &#41; ? $theme&#91;'td_class1'&#93; &#58; $theme&#91;'td_class2'&#93;;

							$template->assign_block_vars&#40;'catrow.forumrow',	array&#40;
								'ROW_COLOR' => '#' . $row_color,
								'ROW_CLASS' => $row_class,
								'FORUM_FOLDER_IMG' => $folder_image, 
								'FORUM_NAME' => $forum_data&#91;$j&#93;&#91;'forum_name'&#93;,
								'FORUM_DESC' => $forum_data&#91;$j&#93;&#91;'forum_desc'&#93;,
								'POSTS' => $forum_data&#91;$j&#93;&#91;'forum_posts'&#93;,
								'TOPICS' => $forum_data&#91;$j&#93;&#91;'forum_topics'&#93;,
								'LAST_POST' => $last_post,
								'MODERATORS' => $moderator_list,

								'L_MODERATOR' => $l_moderators, 
								'L_FORUM_FOLDER_ALT' => $folder_alt, 

								'U_VIEWFORUM' => append_sid&#40;"viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"&#41;&#41;
							&#41;;
						&#125;
					&#125;
				&#125;
			&#125;
		&#125;
	&#125; // for ... categories

&#125;// if ... total_categories
else
&#123;
	message_die&#40;GENERAL_MESSAGE, $lang&#91;'No_forums'&#93;&#41;;
&#125;

//
// Generate the page
//
$template->pparse&#40;'body'&#41;;

include&#40;$phpbb_root_path . 'includes/page_tail.'.$phpEx&#41;;

?>

User avatar
karnaiss
Reģistrēts lietotājs
Atbildes: 175
Pievienojies: 21 Mar 2008, 00:57
Reputācija: 0
Atrodas: a vot

Post no karnaiss » 09 Apr 2008, 00:22

Vareji labak sito kkur uploudet, jo pa visu temu vins ir
esmu tikai cilveks

User avatar
Mr.Death
Lietpratējs
Atbildes: 1780
Pievienojies: 17 Apr 2007, 19:13
Reputācija: 0

Post no Mr.Death » 09 Apr 2008, 09:27

Man nezkāpēc šķiet ka problēma būs ar iekļaujošajām iekavām pirms 285 rindiņas, jo tās nav noslēgtas. Pamēģini iemest kādas noslēdzošās

Code: Select all

&#125;
286tajā un apskatīties, ko viņš Tev tur izmetīs.

P.s. Tālāk papētot kodu man gan šķiet ka tur kaut kas ir aprauts, jo vesela čupa ar noslēdzošajām, kas it kā neko nenoslēdz.

User avatar
Ernijs_E
Reģistrēts lietotājs
Atbildes: 94
Pievienojies: 09 Mar 2008, 17:24
Reputācija: 0
Atrodas: Rīga, Iecava

Post no Ernijs_E » 09 Apr 2008, 10:10

Es iemetu neko nemaina, teksts tas pats, errors arii, kautkas naw.

User avatar
foxsk8
Moderators
Atbildes: 5078
Pievienojies: 22 Feb 2007, 12:33
Reputācija: 0
Atrodas: Liepāja, www.notepad.lv

Post no foxsk8 » 09 Apr 2008, 13:33

Kodu liec šeit:

paste.php.lv

Kas attiecās uz modifikāciju, pameklē iekš tā saita, no kurienes ņēmi. Iesaku visu paņemt nost, uzlikt backup atpakaļ un lietot šo čata modifikāciju, kuru lieto notepads.

https://blueimp.net/ajax/
WPX.lV - E-komercijas risinājumi

deivs001
Vecākais lietotājs
Atbildes: 2011
Pievienojies: 14 Mar 2007, 13:45
Reputācija: 0

Post no deivs001 » 09 Apr 2008, 17:21

Foxsk8 nav labākais čats, jo uz Operu gļuko.

User avatar
foxsk8
Moderators
Atbildes: 5078
Pievienojies: 22 Feb 2007, 12:33
Reputācija: 0
Atrodas: Liepāja, www.notepad.lv

Post no foxsk8 » 09 Apr 2008, 17:44

deivs001 wrote:Foxsk8 nav labākais čats, jo uz Operu gļuko.
+1 , bet labāks par kaut kādu shoutbox.
WPX.lV - E-komercijas risinājumi

Pievienot atbildi

Return to “PHPBB”