Codice del post nel titolo della discussione su viewforum
Inviato: 30/10/2012, 13:20
Inserendo delle faccine all'interno del post, nel titolo in viewforum.php viene riportata parte di codice:
Il problema potrebbe risiedere che nel viewforum.php ho inserito una query per leggere il primo posts di ogni discussione (riporto tutte le vars assegnate allo stesso template perchè magari è proprio lì l'errore.. MAH?):
e in viewforum_body.html (template) in prossimità del title ho inserito la chiamata alla query:
IN CONCLUSIONE:
Se vado a leggere punto il mouse sopra il titolo in viewforum.php mi compare il primo post della discussione e se c'è una faccina all'interno del post, nel titolo compare tutto il codice del post dal punto in cui ho inserito la faccina e subito dopo l'apertura degli apostrofi del tag <img src=
E' possibile vederlo appunto posizionandosi sopra il titolo in viewforum.php
P.S.:
Il problema è complesso:
Questa query è stata posizionata subito sopra $template->assign_block_vars('topicrow', array
In quanto è l'unico posto che mi consente di farlo funzionare, cambiando $row in $rows (altrimenti succede un'altro casino!), resta il fatto che il casino resta ugualmente!!
Il problema potrebbe risiedere che nel viewforum.php ho inserito una query per leggere il primo posts di ogni discussione (riporto tutte le vars assegnate allo stesso template perchè magari è proprio lì l'errore.. MAH?):
Codice: Seleziona tutto
$sql = "SELECT post_text FROM ".POSTS_TABLE." WHERE topic_id = $topic_id ORDER BY post_time ASC LIMIT 0,1";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$template->assign_block_vars('topicrow', array(
'POST_TEXT' => $rows['post_text'],
'FORUM_ID' => $topic_forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']),
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'PAGINATION' => topic_generate_pagination($replies, $view_topic_url),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $topic_forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false,
'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false,
'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false,
'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false,
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread',
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $topic_forum_id . '&t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
);
Codice: Seleziona tutto
<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.POST_TEXT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
Se vado a leggere punto il mouse sopra il titolo in viewforum.php mi compare il primo post della discussione e se c'è una faccina all'interno del post, nel titolo compare tutto il codice del post dal punto in cui ho inserito la faccina e subito dopo l'apertura degli apostrofi del tag <img src=
E' possibile vederlo appunto posizionandosi sopra il titolo in viewforum.php
P.S.:
Il problema è complesso:
Codice: Seleziona tutto
$sql = "SELECT post_text FROM ".POSTS_TABLE." WHERE topic_id = $topic_id ORDER BY post_time ASC LIMIT 0,1";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
In quanto è l'unico posto che mi consente di farlo funzionare, cambiando $row in $rows (altrimenti succede un'altro casino!), resta il fatto che il casino resta ugualmente!!