I get this error every time i go onoto the forum
8: Undefined index: ID_MEMBER
Datoteka: /home/selovese/public_html/Themes/default/TPortal.template.php (main_below sub template - eval?)
Linija: 23
The code is:
<div style="margin-bottom: 4px;">', theme_linktree() , '</div>';
What can be the problem?
The error is obviously somewhere before line 23. Many times the error message does not give the line number where the actual problem is.
<?php
// Version: 0.9; TPortal
// TPortal template - for frontpage.
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// show the linktree
if((isset($context['TPortal']['boardnews'][0]['options']['linktree']) && $context['TPortal']['front_type']!='frontblock') || $context['TPortal']['front_type']=='frontblock')
echo '
<div style="margin-bottom: 4px;">', theme_linktree() , '</div>';
This is the whole code before it with the line 23.
Do you have any custom blocks or articles that use ID_MEMBER?
Yeah. Use one custom block with random messages from one topic. It has an ID MEMBER in it.
Can you post the code in it? I think it should probably have the global $ID_MEMBER in it. :)
Sorry, was busy with some stuff..
ok this is the only block with id_member:
global $db_prefix, $scripturl;
$topic_number = 1272.0; // fill in the number of the topic you want to pull your info from
$query = db_query(
"SELECT *
FROM {$db_prefix}messages
WHERE `ID_TOPIC` = $topic_number
ORDER BY RAND( )
LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($query);
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);
// set up your printout
// variables:
// $row['ID_MEMBER']
// $row['posterName']
// $row['body']
echo '
<div style="text-align: center; width: 170px; height: 150px; overflow: auto; margin-top:20%; margin-bottom: 0%;">' . $row['body'] . '<br />';
echo '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . ' </a> ' ;
echo '<a style="color:red;" href="http://seloveselo.com/index.php?topic=1272.msg104#new">Idi na temu</a></div>';
/*sta je bilo ' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '*/
Judging by the look of your code, if you call a topic or post that doesn't have those fields set you'll get that error.
It seems it's ok now. I've put some test posts in the topic and now i don't get anny errors.