News:

Wondering if this will always be free?  See why free is better.

Main Menu

SSI Rehberi

Started by forsakenlad, August 25, 2005, 06:51:20 PM

Previous topic - Next topic

Hoochie Coochie Man

Vallahi Bana da Sinan yardım etmişti, mesela şöyle birşey var..
http://www.simplemachines.org/community/index.php?topic=47018.msg1533635#msg1533635

ve de ardından Yağızın gösterdiği o dökümantasyonları çıkardı, en iyisi oraları bi incele istersen..
İnadına SMF 1.1.X

Pяηѕѕ LF

Tesekkür ettim Yagiz onlari okumustum ama ordan birsey cikartamamistim benim yapmak istedigimle ilgili.

Hem bu aralar hiç gözükmüyorsun  :P suskunsun umarim hersey yolundadir.

Böyle kalsin yoruldum irelde belki tekrar bakarim.

Tesekkürler ettim Erhan, Yagiz.


Kolay gelsin.
1.1.21 Default

[SiNaN]

#343
Kodlarınızda;

Bul:

,
         ssi_recentTopics() ,


Değiştir:

;
    $array = ssi_boardNews(null, null, 'array');

echo '
<table border="0" class="ssi_table">';
foreach ($array as $post)
echo '
<tr>
<td align="left" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';
echo


Düzenleyeceğiniz kısım sadece şurası:

echo '
<table border="0" class="ssi_table">';
foreach ($array as $post)
echo '
<tr>
<td align="left" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';


Orta Seviye SSI Derslerinde daha ayrıntılı anlatışmıştı.
Former SMF Core Developer | My Mods | SimplePortal

Pяηѕѕ LF

Sinan bu kodlar farkli geldi. Erhanin örnek verdigi sitedeki gibi  :-\ ben son konulari ajax son konulara benzetmek istiyorum daha düzenli olmasi için.
1.1.21 Default

_dropturk_

selam arkadaşlar kucuk bır sorunum war evt sorun su ajax tab menu ıle require("SSI.php"); sayfasını require edemıyorum veri tabanı hataası verıyor sanırım. Invalid request variable. neden boyle yapıyor olabılır. bu arada Ajax Tabs Content Script (v 2.2) e require wtmeye calısıyorum.

_dropturk_

Quote from: _dropturk_ on September 14, 2008, 05:02:14 PM
selam arkadaşlar kucuk bır sorunum war evt sorun su ajax tab menu ıle require("SSI.php"); sayfasını require edemıyorum veri tabanı hataası verıyor sanırım. Invalid request variable. neden boyle yapıyor olabılır. bu arada Ajax Tabs Content Script (v 2.2) e require wtmeye calısıyorum.

arkadaslar soruna sebep olan kaynak kodları buldum.

   // Same goes for numeric keys.
   foreach (array_merge(array_keys($_POST), array_keys($_GET), array_keys($_FILES)) as $key)
      if (is_numeric($key))
         die('Invalid request variable.');


ve kaynak kodları kaldırdım ama hala ne işe yaaradıklarını cozemedım.bilen warsa yassın lutfen.

hasan1

arkadaslar bir kategori ye yazılmış son 10 konuyu son 10 mesajlar gibi liste halinde forumun bir yerinde göstermik istiyorum SSI ile olur diolar nasıl yapabilirim acaba

erdem86

SSI ile çağırdığım verilerin (mesela doğum günleri) üzerine tıklandığında, farklı pencerede açılması için nasıl bir ayar yapmalıyım?



Teşekkürler.. :)

Evo™

@erdem86 SSI.php açın

Code (Bul) Select
// Show today's birthdays.
function ssi_todaysBirthdays($output_method = 'echo')
{
   global $context, $scripturl;

   if (!smf_loadCalendarInfo() || empty($context['calendar_birthdays']))
      return array();

   if ($output_method != 'echo')
      return $context['calendar_birthdays'];

   foreach ($context['calendar_birthdays'] as $member)
      echo '
         <a href="', $scripturl, '?action=profile;u=', $member['id'], '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>' . (!$member['is_last'] ? ', ' : '');
}



Code (Değiştir) Select

// Show today's birthdays.
function ssi_todaysBirthdays($output_method = 'echo')
{
   global $context, $scripturl;

   if (!smf_loadCalendarInfo() || empty($context['calendar_birthdays']))
      return array();

   if ($output_method != 'echo')
      return $context['calendar_birthdays'];

   foreach ($context['calendar_birthdays'] as $member)
      echo '
         <a target="_blank" href="', $scripturl, '?action=profile;u=', $member['id'], '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>' . (!$member['is_last'] ? ', ' : '');
}

erdem86

^^ Çok teşekkür ederim.

PHP bilmediğim için mantığını da anlayamamıştım, bunu da öğrenmiş oldum.. :)

Evo™

Arkadaşlar SSI ile ilgili konulara baktım ama ben forumdan sadece belirlediğim bölümdeki İd numarası x olan konuyu göstermek istiyorum nasıl yapabilirim acaba varmı öyle birşey.

forsakenlad

Eren "forsakenlad" Yaşarkurt
SMF Friend & Former Team Member

hasan1

Quote from: hasan1 on September 17, 2008, 09:57:18 AM
arkadaslar bir kategori ye yazılmış son 10 konuyu son 10 mesajlar gibi liste halinde forumun bir yerinde göstermik istiyorum SSI ile olur diolar nasıl yapabilirim acaba

arkadaslar bana yardım edebilicek yokmu acaba

Özgür

Quote from: hasan1 on September 19, 2008, 09:43:03 PM
Quote from: hasan1 on September 17, 2008, 09:57:18 AM
arkadaslar bir kategori ye yazılmış son 10 konuyu son 10 mesajlar gibi liste halinde forumun bir yerinde göstermik istiyorum SSI ile olur diolar nasıl yapabilirim acaba

arkadaslar bana yardım edebilicek yokmu acaba

Bu kadar hazırcı olmayın. Konunun ilk mesajında var.
So Long

Evo™

#355
@*eren çok teşekkürler.


Eren hocam mesaj id'sini yazınca çok iyi bir şekilde çekiyor ancak tamamını değilde mesajın bir kısmını çektirebilirmiyim. http://www.simplemachines.org/community/index.php?topic=240522.msg1566595#msg1566595 burada anlatılmış ancak sanırım bu mod ile pek benzer değil aynı şeyi buna nasıl uygulayabilirim acaba.

Evo™

Üstteki soruma cevap verebilecek var mı acaba.

forsakenlad

Var. SSI.php'ni aç ssi_grabMessage fonksiyonunu aşağıdaki şekilde değiştir:

// Return a single post
function ssi_grabMessage($message_id = null, $length = null, $output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context, $func;
loadLanguage('Stats');

if ($message_id !== null)
$message_id = (int) $message_id;
elseif (isset($_GET['ID_MSG']))
$message_id = (int) $_GET['ID_MSG'];
else
die("Please specify a message id");

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

$request = db_query("
SELECT
m.icon, m.subject, m.body, IFNULL(mem.realName, m.posterName) AS posterName,
m.posterTime, m.ID_MSG, t.ID_TOPIC, m.ID_MEMBER, m.smileysEnabled, b.name
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards as b)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE m.ID_MSG = $message_id
AND m.ID_TOPIC = t.ID_TOPIC
AND t.ID_BOARD = b.ID_BOARD
AND FIND_IN_SET(-1, b.memberGroups)
", __FILE__, __LINE__);
$return = array();

if (mysql_num_rows($request) == 0)
{
if ($output_method == 'echo')
die($txt['smf_news_error2']);
else return;
}

$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'] = doUBBC($row['body'], $row['smileysEnabled']);

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

$return[] = array(
'icon' => '<img src="' . $settings['images_url'] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" />',
'subject' => $row['subject'],
'time' => timeformat($row['posterTime']),
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '">'.$txt['gsm_read_more'].'</a>',
'new_comment' => '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.0">'. $txt['gsm_comment']. '</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']
),
  );
mysql_free_result($request);

if ($output_method != 'echo')
return $return;

foreach ($return as $news)
echo '<table border="0" width="100%" align="center" class="smfNews">
<tr>
<td>', $news['icon'], ' <b>', $news['subject'], '</b><span class="smaller"><br />', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '<br /><br /></span>
</td>
</tr>
<tr>
<td>', $news['body'], '<br /><br />
</td>
</tr>
<tr>
<td>', $news['link'], ' | ', $news['new_comment'], '
</td>
</tr>
</table>';
}


Daha sonra çekmek istediğin mesaja aynı boardnews teki gibi length değişkeni eklemen lazım:

ssi_grabMessage($message_id = 1, $length = 50, $output_method = 'echo');
Eren "forsakenlad" Yaşarkurt
SMF Friend & Former Team Member

Evo™

#358
Eren çok teşekkürler sağolasın.

forsakenlad

Eren "forsakenlad" Yaşarkurt
SMF Friend & Former Team Member

Advertisement: