TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 690
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 275
  • Total: 275

Undefined index: ID_MEMBER error

Started by morskisrle, February 24, 2008, 12:04:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

morskisrle

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?

JPDeni

The error is obviously somewhere before line 23. Many times the error message does not give the line number where the actual problem is.

morskisrle

<?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.

IchBin

Do you have any custom blocks or articles that use ID_MEMBER?

morskisrle

Yeah. Use one custom block with random messages from one topic. It has an ID MEMBER in it.

IchBin

Can you post the code in it? I think it should probably have the global $ID_MEMBER in it. :)

morskisrle

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'] . '*/



IchBin

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.

morskisrle

It seems it's ok  now. I've put some test posts in the topic and now i don't get anny errors.

This website is proudly hosted on Crocweb Cloud Website Hosting.