Blok TP-Błąd

Zaczęty przez DorBerrt, Kwiecień 28, 2009, 09:39:42 AM

« poprzedni - następny »

0 użytkowników i 1 Gość przegląda ten wątek.

DorBerrt

Co może być w tym kodzie nie tak?Po kilku odświeżeniach strony pojawia sie logo baner forum,oraz (lub) Wybija błąd kod poniżej:
You have an error in your SQL syntax;
check the manual that corresponds to your MySQL
server version for the right syntax to use near ')
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT 1' at line 6
Plik: /home/xxxxxxxxxx/xxxxxxxxxxxx/xxxxxx/Sources/Load.php(1735)
: eval()'d code(48) : eval()'d code
Linia: 50
Uwaga: Wygląda na to, że twoja baza danych wymaga uaktualnienia.
Pliki forum mają obecnie wersję SMF 1.1.8, podczas gdy baza danych jest w wersji SMF 1.1.5. Powinieneś uruchomić najnowszą wersję upgrade.php.

Ale po kolejnym odświeżeniu ponownie wyświetla losowe wątki-
dodam ze baza jest w wersji 1.1.8
Tu kod bloku pobrany z http://www.tinyportal.net/index.php
/topic,11142.20.html

Lub sam kod poniżej,może wiesz co z nim jest nie tak?

global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context;
global $func;
$length= 300;

loadLanguage('Stats');

if ($length === null)
$length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
else
$length = (int) $length;

// Make sure guests can see this board.
$request = db_query("
SELECT ID_BOARD
FROM {$db_prefix}boards
WHERE FIND_IN_SET(-1, memberGroups)
        ORDER BY rand()
LIMIT 1", __FILE__, __LINE__);

list ($board) = mysql_fetch_row($request);
mysql_free_result($request);

// Load the message icons - the usual suspects.
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find the post ids.
$request = db_query("
SELECT ID_FIRST_MSG
FROM {$db_prefix}topics
WHERE ID_BOARD = $board
ORDER BY rand()
LIMIT 1", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
$posts[] = $row['ID_FIRST_MSG'];
mysql_free_result($request);

// Find the posts.
$request = db_query("
SELECT
m.icon, m.subject, m.body, IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime,
t.numReplies, t.ID_TOPIC, m.ID_MEMBER, m.smileysEnabled, m.ID_MSG, t.locked
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE t.ID_FIRST_MSG IN (" . implode(', ', $posts) . ")
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT 1", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
{
// If we want to limit the length of the post.
if (!empty($length) && $func['strlen']($row['body']) > $length)
{
$row['body'] = $func['substr']($row['body'], 0, $length);
// The first space or line break. (<br />, etc.)
        $cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '<'));

if ($cutoff !== false)
$row['body'] = $func['substr']($row['body'], 0, $cutoff);
$row['body'] .= '...';
}

$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);

// Check that this message icon is there...
if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

censorText($row['subject']);
censorText($row['body']);

$return[] = array(
'id' => $row['ID_TOPIC'],
'message_id' => $row['ID_MSG'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'subject' => $row['subject'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['numReplies'] . ' ' . ($row['numReplies'] == 1 ? $txt['smf_news_1'] : $txt['smf_news_2']) . '</a>',
'replies' => $row['numReplies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . ';num_replies=' . $row['numReplies'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . ';num_replies=' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => !empty($row['ID_MEMBER']) ? $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] : '',
'link' => !empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>' : $row['posterName']
),
'locked' => !empty($row['locked']),
);
}
mysql_free_result($request);

foreach ($return as $news)
{
echo '
<div>
<a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
<div class="smaller">', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">', $news['body'], '</div>

', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
</div>';
}

Pozdrawiam

Nolt

To pytanie myślę powinieneś kierować do ludzi którzy napisali ten kod. Nie pomogę Ci z tym.
PMIĘTAJ O KORZYSTANIU Z OPCJI SZUKAJ
nie udzielam pomocy poza forum i na PW

DorBerrt

Ok rozumiem,ja tez w nim nic nie widze jak Ty.
trzeba bedzie jakoś skorzystać z pomocy kolegi co zna perfect angielski
Jak coś bede wiedział i  to napisze dla potomności he he

Pozdrawiam
Pozdrawiam

DorBerrt

Odnośnie tego problemu
heh Nolt wchodze do phpadmin i faktycznie nie zgodna wersja,po imporcie bazy danych
zapomniałem ze była ona nie na tej wersji tylko wcześniejszej
zrobiłem upgrade i śmiga bardzo ładnie bez problemowo.
Także po każdym imporcie bazy z wcześniejszej wersji należy zrobic upgrade.
Tak na marginesie moze komuś sie przyda:
po wszystkim trzeba ściągnąć plik Settings.php i w miejscu $maintenance = 2;
zmienić na $maintenance = 0;
i się cieszyć z powodzenia upgrade

Pozdrawiam i dzięki za pomoc
Pozdrawiam