SimplePortal

Support => Turkish (Türkçe) => International Support => Ki?iselle?tirme => Topic started by: JANJ@N on February 19, 2011, 02:32:26 PM

Title: Bir konunun son mesajını gösterme
Post by: JANJ@N on February 19, 2011, 02:32:26 PM
seçilen bir konuya yazılan son mesajın içeriğini , resim varsa resimi gösterebilir miyiz  :0
Title: Re: Bir konunun son mesajını gösterme
Post by: JANJ@N on February 22, 2011, 09:56:44 AM
bunu çok istemiştim ama sanırım mümkün değil  :|
Title: Re: Bir konunun son mesajını gösterme
Post by: grafitus on March 07, 2011, 11:12:56 AM
Biraz geç oldu ama. Bunu kullanabilirsiniz:
Code: [Select]
global $smcFunc, $scripturl;

$topic = 2;

$request = $smcFunc['db_query']('', '
SELECT t.id_topic, m.subject, m.body
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
WHERE t.id_topic = {int:topic}
LIMIT 1',
array(
'topic' => $topic,
)
);
list($id_topic, $subject, $body) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$body = parse_bbc($body);

echo '
<strong><a href="', $scripturl, '?topic=', $id_topic, '.0">', $subject, '</a></strong>
<p>', $body, '</p>';
Title: Re: Bir konunun son mesajını gösterme
Post by: JANJ@N on March 10, 2011, 04:54:16 AM
önemli değil ne demek, gerçekten çok iyi oldu, teşekürler

birde, mesajın linkine tıklayınca, ilk mesaja gidiyor, tıklandığında son mesaja götürebilir miyiz
Title: Re: Bir konunun son mesajını gösterme
Post by: grafitus on March 10, 2011, 09:53:01 AM
Bunu kullanın:
Code: [Select]
global $smcFunc, $scripturl;

$topic = 2;

$request = $smcFunc['db_query']('', '
SELECT t.id_topic, t.id_last_msg, m.subject, m.body
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
WHERE t.id_topic = {int:topic}
LIMIT 1',
array(
'topic' => $topic,
)
);
list($id_topic, $id_last_msg, $subject, $body) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$body = parse_bbc($body);

echo '
<strong><a href="', $scripturl, '?topic=', $id_topic, '.msg', $id_last_msg, '#new">', $subject, '</a></strong>
<p>', $body, '</p>';
Title: Re: Bir konunun son mesajını gösterme
Post by: JANJ@N on March 10, 2011, 12:32:40 PM
teşekürler :)
Title: Re: Bir konunun son mesajını gösterme
Post by: JANJ@N on March 10, 2011, 01:21:46 PM
peki şöyle bi düzenleme mümkünmü,  resim olan mesajlarda, tek resim çekebilirmiyiz, resmin boyutu orj büyüklükte çıkıyor, kendimiz belirleyebilirmiyiz boyutları,   senin bir kategorideki konuların resimlerini çeken bi kodun vardı ya, o mantıkla yani, mesajdaki yazııyı göstrmese de olur
Title: Re: Bir konunun son mesajını gösterme
Post by: birlikteforum on December 19, 2013, 04:07:40 AM
Üzerinden uzun bir süre geçmiş ama resim ve karakter sınırlaması yapabilirmiyiz.
veya belli bir satırdan sonra devamını oku gibi
Title: Re: Bir konunun son mesajını gösterme
Post by: grafitus on February 07, 2014, 05:46:48 PM
Üzerinden uzun bir süre geçmiş ama resim ve karakter sınırlaması yapabilirmiyiz.
veya belli bir satırdan sonra devamını oku gibi
Buyrun, umarim hala ihtiyaciniz vardir:
Code: [Select]
global $smcFunc, $scripturl;

$topic = 2;

$request = $smcFunc['db_query']('', '
SELECT t.id_topic, t.id_last_msg, m.subject, m.body
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
WHERE t.id_topic = {int:topic}
LIMIT 1',
array(
'topic' => $topic,
)
);
list($id_topic, $id_last_msg, $subject, $body) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$body = shorten_subject($body, 120) . '<a href="' . $scripturl . '?topic=' . $id_topic . '">...</a>'; // 120 karakterden oncesini alir.
$body = parse_bbc($body);

echo '
<strong><a href="', $scripturl, '?topic=', $id_topic, '.msg', $id_last_msg, '#new">', $subject, '</a></strong>
<p>', $body, '</p>';
SimplePortal 2.3.8 © 2008-2024, SimplePortal