SSI Rehberi

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

Previous topic - Next topic

jOkErGuEsT

Tavsiyen için sağol, o zaman recenTopics kullanayım :)

[SiNaN]

jOkErGuEsT:

Eğer kullanacağınız dosya SSI.php'nin yanında olacaksa:

require(dirname(__FILE__) . '/SSI.php');

Ama örneğin kullanacağınız dosya site diye bir dizinde, forumunuz ise forum diye bir dizinde ise; o zaman:

require('home/site/public_html/forum/SSI.php');

gibi bir dizin olmalı, yani tam dizini yazmalısınız.

hukuk:

Eğer SSI.php'yi forum sayfalarına da dahil ederseniz kullanabilirsiniz. Ama örneğin sadece recentTopics fonksiyonunu ana sayfada kullancaksanız, BoardIndex.php doysasına o fonksiyonu kopyalayıp adını değiştirerek kullanabilirsiniz.
Former SMF Core Developer | My Mods | SimplePortal

jOkErGuEsT

Forum dışında kullanacağım, teşekkürler. :)

hukuk (judge)

#303
Acaba <?php$content=implode("", file("http://site/forum/SSI.php?ssi_function=recentPosts"));?> bu kodu board index.php'ye ne şekilde ekleyeceğiz?Birde ssideki recent postta verilen yanıtları tek konu olarak göstermek mümkünmü.Mesela normal son mesajlarda bu şekilde bir değişiklik yapmak için http://www.simplemachines.org/community/index.php?topic=61593.0 adresindeki uygulamayı yapmak yeterli oluyordu.Ssi phpde bu şekilde bir değişiklik yapmak mümkünmü?Birde board indexte.php değişiklik yapmak yerine board.index.templatede değişiklik yapmak daha doğru olmazmı?
Board index
<?php
/**********************************************************************************
* BoardIndex.php                                                                  *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* The single function this file contains is used to display the main
board index.  It uses just the following functions:

void BoardIndex()
- shows the board index.
- uses the BoardIndex template, and main sub template.
- may use the boardindex subtemplate for wireless support.
- updates the most online statistics.
- is accessed by ?action=boardindex.

bool calendarDoIndex()
- prepares the calendar data for the board index.
- takes care of caching it for speed.
- depends upon these settings: cal_showeventsonindex,
  cal_showbdaysonindex, cal_showholidaysonindex.
- returns whether there is anything to display.
*/

// Show the board index!
function BoardIndex()
{
global $txt$scripturl$db_prefix$ID_MEMBER$user_info$sourcedir;
global $modSettings$context$settings;

// For wireless, we use the Wireless template...
if (WIRELESS)
$context['sub_template'] = WIRELESS_PROTOCOL '_boardindex';
else
loadTemplate('BoardIndex');

// Remember the most recent topic for optimizing the recent posts feature.
$most_recent_topic = array(
'timestamp' => 0,
'ref' => null
);

// Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control.
$result_boards db_query("
SELECT
c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description,
b.numPosts, b.numTopics, b.ID_PARENT, IFNULL(m.posterTime, 0) AS posterTime,
IFNULL(mem.memberName, m.posterName) AS posterName, m.subject, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName," 
. ($user_info['is_guest'] ? "
1 AS isRead, 0 AS new_from" 
"
(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead, IFNULL(lb.ID_MSG, -1) + 1 AS new_from,
c.canCollapse, IFNULL(cc.ID_MEMBER, 0) AS isCollapsed"
) . ",
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, m.ID_MSG,
IFNULL(mods_mem.ID_MEMBER, 0) AS ID_MODERATOR, mods_mem.realName AS modRealName
FROM 
{$db_prefix}boards AS b
LEFT JOIN 
{$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN 
{$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN 
{$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
LEFT JOIN 
{$db_prefix}collapsed_categories AS cc ON (cc.ID_CAT = c.ID_CAT AND cc.ID_MEMBER = $ID_MEMBER)" '') . "
LEFT JOIN 
{$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN 
{$db_prefix}members AS mods_mem ON (mods_mem.ID_MEMBER = mods.ID_MEMBER)
WHERE 
$user_info[query_see_board]. (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" 
''), __FILE____LINE__);

// Run through the categories and boards....
$context['categories'] = array();
while ($row_board mysql_fetch_assoc($result_boards))
{
// Haven't set this category yet.
if (empty($context['categories'][$row_board['ID_CAT']]))
{
$context['categories'][$row_board['ID_CAT']] = array(
'id' => $row_board['ID_CAT'],
'name' => $row_board['catName'],
'is_collapsed' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == && $row_board['isCollapsed'] > 0,
'can_collapse' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == 1,
'collapse_href' => isset($row_board['canCollapse']) ? $scripturl '?action=collapse;c=' $row_board['ID_CAT'] . ';sa=' . ($row_board['isCollapsed'] > 'expand' 'collapse;') . '#' $row_board['ID_CAT'] : '',
'collapse_image' => isset($row_board['canCollapse']) ? '<img src="' $settings['images_url'] . '/' . ($row_board['isCollapsed'] > 'expand.gif" alt="+"' 'collapse.gif" alt="-"') . ' border="0" />' '',
'href' => $scripturl '#' $row_board['ID_CAT'],
'boards' => array(),
'new' => false
);
$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' $row_board['ID_CAT'] . '" href="' . (isset($row_board['canCollapse']) ? $context['categories'][$row_board['ID_CAT']]['collapse_href'] : $context['categories'][$row_board['ID_CAT']]['href']) . '">' $row_board['catName'] . '</a>';
}

// If this board has new posts in it (and isn't the recycle bin!) then the category is new.
if (empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $row_board['ID_BOARD'])
$context['categories'][$row_board['ID_CAT']]['new'] |= empty($row_board['isRead']) && $row_board['posterName'] != '';

// Collapsed category - don't do any of this.
if ($context['categories'][$row_board['ID_CAT']]['is_collapsed'])
continue;

// Let's save some typing.  Climbing the array might be slower, anyhow.
$this_category = &$context['categories'][$row_board['ID_CAT']]['boards'];

// This is a parent board.
if (empty($row_board['ID_PARENT']))
{
// Is this a new board, or just another moderator?
if (!isset($this_category[$row_board['ID_BOARD']]))
{
// Not a child.
$isChild false;

$this_category[$row_board['ID_BOARD']] = array(
'new' => empty($row_board['isRead']),
'id' => $row_board['ID_BOARD'],
'name' => $row_board['boardName'],
'description' => $row_board['description'],
'moderators' => array(),
'link_moderators' => array(),
'children' => array(),
'link_children' => array(),
'children_new' => false,
'topics' => $row_board['numTopics'],
'posts' => $row_board['numPosts'],
'href' => $scripturl '?board=' $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' $scripturl '?board=' $row_board['ID_BOARD'] . '.0">' $row_board['boardName'] . '</a>'
);
}
if (!empty($row_board['ID_MODERATOR']))
{
$this_category[$row_board['ID_BOARD']]['moderators'][$row_board['ID_MODERATOR']] = array(
'id' => $row_board['ID_MODERATOR'],
'name' => $row_board['modRealName'],
'href' => $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'],
'link' => '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'] . '" title="' $txt[62] . '">' $row_board['modRealName'] . '</a>'
);
$this_category[$row_board['ID_BOARD']]['link_moderators'][] = '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'] . '" title="' $txt[62] . '">' $row_board['modRealName'] . '</a>';
}
}
// Found a child board.... make sure we've found its parent and the child hasn't been set already.
elseif (isset($this_category[$row_board['ID_PARENT']]['children']) && !isset($this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]))
{
// A valid child!
$isChild true;

$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']] = array(
'id' => $row_board['ID_BOARD'],
'name' => $row_board['boardName'],
'description' => $row_board['description'],
'new' => empty($row_board['isRead']) && $row_board['posterName'] != '',
'topics' => $row_board['numTopics'],
'posts' => $row_board['numPosts'],
'href' => $scripturl '?board=' $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' $scripturl '?board=' $row_board['ID_BOARD'] . '.0">' $row_board['boardName'] . '</a>'
);

// Counting child board posts is... slow :/.
if (!empty($modSettings['countChildPosts']))
{
$this_category[$row_board['ID_PARENT']]['posts'] += $row_board['numPosts'];
$this_category[$row_board['ID_PARENT']]['topics'] += $row_board['numTopics'];
}

// Does this board contain new boards?
$this_category[$row_board['ID_PARENT']]['children_new'] |= empty($row_board['isRead']);

// This is easier to use in many cases for the theme....
$this_category[$row_board['ID_PARENT']]['link_children'][] = &$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['link'];
}
// Child of a child... just add it on...
elseif (!empty($modSettings['countChildPosts']))
{
if (!isset($parent_map))
$parent_map = array();

if (!isset($parent_map[$row_board['ID_PARENT']]))
foreach ($this_category as $id => $board)
{
if (!isset($board['children'][$row_board['ID_PARENT']]))
continue;

$parent_map[$row_board['ID_PARENT']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['ID_PARENT']]);
$parent_map[$row_board['ID_BOARD']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['ID_PARENT']]);

break;
}

if (isset($parent_map[$row_board['ID_PARENT']]))
{
$parent_map[$row_board['ID_PARENT']][0]['posts'] += $row_board['numPosts'];
$parent_map[$row_board['ID_PARENT']][0]['topics'] += $row_board['numTopics'];
$parent_map[$row_board['ID_PARENT']][1]['posts'] += $row_board['numPosts'];
$parent_map[$row_board['ID_PARENT']][1]['topics'] += $row_board['numTopics'];

continue;
}

continue;
}
// Found a child of a child - skip.
else
continue;

// Prepare the subject, and make sure it's not too long.
censorText($row_board['subject']);
$row_board['short_subject'] = shorten_subject($row_board['subject'], 24);
$this_last_post = array(
'id' => $row_board['ID_MSG'],
'time' => $row_board['posterTime'] > timeformat($row_board['posterTime']) : $txt[470],
'timestamp' => forum_time(true$row_board['posterTime']),
'subject' => $row_board['short_subject'],
'member' => array(
'id' => $row_board['ID_MEMBER'],
'username' => $row_board['posterName'] != '' $row_board['posterName'] : $txt[470],
'name' => $row_board['realName'],
'href' => $row_board['posterName'] != '' && !empty($row_board['ID_MEMBER']) ? $scripturl '?action=profile;u=' $row_board['ID_MEMBER'] : '',
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MEMBER'] . '">' $row_board['realName'] . '</a>' $row_board['realName']) : $txt[470],
),
'start' => 'msg' $row_board['new_from'],
'topic' => $row_board['ID_TOPIC']
);

// Provide the href and link.
if ($row_board['subject'] != '')
{
$this_last_post['href'] = $scripturl '?topic=' $row_board['ID_TOPIC'] . '.msg' . ($user_info['is_guest'] ? $modSettings['maxMsgID'] : $row_board['new_from']) . (empty($row_board['isRead']) ? ';boardseen' '') . '#new';
$this_last_post['link'] = '<a href="' $this_last_post['href'] . '" title="' $row_board['subject'] . '">' $row_board['short_subject'] . '</a>';
}
else
{
$this_last_post['href'] = '';
$this_last_post['link'] = $txt[470];
}

// Set the last post in the parent board.
if (empty($row_board['ID_PARENT']) || ($isChild && !empty($row_board['posterTime']) && $this_category[$row_board['ID_PARENT']]['last_post']['timestamp'] < forum_time(true$row_board['posterTime'])))
$this_category[$isChild $row_board['ID_PARENT'] : $row_board['ID_BOARD']]['last_post'] = $this_last_post;
// Just in the child...?
if ($isChild)
{
$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['last_post'] = $this_last_post;

// If there are no posts in this board, it really can't be new...
$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['new'] &= $row_board['posterName'] != '';
}
// No last post for this board?  It's not new then, is it..?
elseif ($row_board['posterName'] == '')
$this_category[$row_board['ID_BOARD']]['new'] = false;

// Determine a global most recent topic.
if (!empty($row_board['posterTime']) && forum_time(true$row_board['posterTime']) > $most_recent_topic['timestamp'])
$most_recent_topic = array(
'timestamp' => forum_time(true$row_board['posterTime']),
'ref' => &$this_category[$isChild $row_board['ID_PARENT'] : $row_board['ID_BOARD']]['last_post'],
);
}
mysql_free_result($result_boards);

// Load the users online right now.
$result db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM 
{$db_prefix}log_online AS lo
LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))"__FILE____LINE__);

$context['users_online'] = array();
$context['list_users_online'] = array();
$context['online_groups'] = array();
$context['num_guests'] = 0;
$context['num_buddies'] = 0;
$context['num_users_hidden'] = 0;

$context['show_buddies'] = !empty($user_info['buddies']);

while ($row mysql_fetch_assoc($result))
{
if (empty($row['realName']))
{
$context['num_guests']++;
continue;
}
elseif (empty($row['showOnline']) && !allowedTo('moderate_forum'))
{
$context['num_users_hidden']++;
continue;
}

// Some basic color coding...
if (!empty($row['onlineColor']))
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '" style="color: ' $row['onlineColor'] . ';">' $row['realName'] . '</a>';
else
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '">' $row['realName'] . '</a>';

$is_buddy in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$context['num_buddies']++;
$link '<b>' $link '</b>';
}

$context['users_online'][$row['logTime'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl '?action=profile;u=' $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$context['list_users_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' $link '</i>' $link;

if (!isset($context['online_groups'][$row['ID_GROUP']]))
$context['online_groups'][$row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'color' => $row['onlineColor']
);
}
mysql_free_result($result);

krsort($context['users_online']);
krsort($context['list_users_online']);
ksort($context['online_groups']);

$context['num_users_online'] = count($context['users_online']) + $context['num_users_hidden'];

// Track most online statistics?
if (!empty($modSettings['trackStats']))
{
// Determine the most users online - both all time and per day.
$total_users $context['num_guests'] + $context['num_users_online'];

// More members on now than ever were?  Update it!
if (!isset($modSettings['mostOnline']) || $total_users >= $modSettings['mostOnline'])
updateSettings(array('mostOnline' => $total_users'mostDate' => time()));

$date strftime('%Y-%m-%d'forum_time(false));

// One or more stats are not up-to-date?
if (!isset($modSettings['mostOnlineUpdated']) || $modSettings['mostOnlineUpdated'] != $date)
{
$request db_query("
SELECT mostOn
FROM 
{$db_prefix}log_activity
WHERE date = '
$date'
LIMIT 1"
__FILE____LINE__);

// The log_activity hasn't got an entry for today?
if (mysql_num_rows($request) == 0)
{
db_query("
INSERT IGNORE INTO 
{$db_prefix}log_activity
(date, mostOn)
VALUES ('
$date', $total_users)"__FILE____LINE__);
}
// There's an entry in log_activity on today...
else
{
list ($modSettings['mostOnlineToday']) = mysql_fetch_row($request);

if ($total_users $modSettings['mostOnlineToday'])
trackStats(array('mostOn' => $total_users));

$total_users max($total_users$modSettings['mostOnlineToday']);
}
mysql_free_result($request);

updateSettings(array('mostOnlineUpdated' => $date'mostOnlineToday' => $total_users));
}
// Highest number of users online today?
elseif ($total_users $modSettings['mostOnlineToday'])
{
trackStats(array('mostOn' => $total_users));
updateSettings(array('mostOnlineUpdated' => $date'mostOnlineToday' => $total_users));
}
}

// Set the latest member.
$context['latest_member'] = &$context['common_stats']['latest_member'];

// Load the most recent post?
if ((!empty($settings['number_recent_posts']) && $settings['number_recent_posts'] == 1) || $settings['show_sp1_info'])
$context['latest_post'] = $most_recent_topic['ref'];

if (!empty($settings['number_recent_posts']) && $settings['number_recent_posts'] > 1)
{
require_once($sourcedir '/Recent.php');

if (($context['latest_posts'] = cache_get_data('boardindex-latest_posts:' md5($user_info['query_see_board'] . $user_info['language']), 180)) == null)
{
$context['latest_posts'] = getLastPosts($settings['number_recent_posts']);
cache_put_data('boardindex-latest_posts:' md5($user_info['query_see_board'] . $user_info['language']), $context['latest_posts'], 180);
}

// We have to clean up the cached data a bit.
foreach ($context['latest_posts'] as $k => $post)
{
$context['latest_posts'][$k]['time'] = timeformat($post['raw_timestamp']);
$context['latest_posts'][$k]['timestamp'] = forum_time(true$post['raw_timestamp']);
}
}

$settings['display_recent_bar'] = !empty($settings['number_recent_posts']) ? $settings['number_recent_posts'] : 0;
$settings['show_member_bar'] &= allowedTo('view_mlist');
$context['show_stats'] = allowedTo('view_stats') && !empty($modSettings['trackStats']);
$context['show_member_list'] = allowedTo('view_mlist');
$context['show_who'] = allowedTo('who_view') && !empty($modSettings['who_enabled']);

// Set some permission related settings.
$context['show_login_bar'] = $user_info['is_guest'] && !empty($modSettings['enableVBStyleLogin']);
$context['show_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);

// Load the calendar?
if ($context['show_calendar'])
$context['show_calendar'] = calendarDoIndex();

$context['page_title'] = $txt[18];
}

// Called from the BoardIndex to display the current day's events on the board index.
function calendarDoIndex()
{
global $modSettings$context$user_info$scripturl$sc$ID_MEMBER;

// Make sure at least one of the options is checked.
if (empty($modSettings['cal_showeventsonindex']) && empty($modSettings['cal_showbdaysonindex']) && empty($modSettings['cal_showholidaysonindex']))
return false;

// Get the current forum time and check whether the statistics are up to date.
if (empty($modSettings['cal_today_updated']) || $modSettings['cal_today_updated'] != strftime('%Y%m%d'forum_time(false)))
updateStats('calendar');

// Load the holidays for today, ...
if (!empty($modSettings['cal_showholidaysonindex']) && isset($modSettings['cal_today_holiday']))
$holidays unserialize($modSettings['cal_today_holiday']);
// ... the birthdays for today, ...
if (!empty($modSettings['cal_showbdaysonindex']) && isset($modSettings['cal_today_birthday']))
$bday unserialize($modSettings['cal_today_birthday']);
// ... and the events for today.
if (!empty($modSettings['cal_showeventsonindex']) && isset($modSettings['cal_today_event']))
$events unserialize($modSettings['cal_today_event']);

// No events, birthdays, or holidays... don't show anything.  Simple.
if (empty($holidays) && empty($bday) && empty($events))
return false;

// This shouldn't be less than one!
if (empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1)
$days_for_index 86400;
else
$days_for_index $modSettings['cal_days_for_index'] * 86400;

$context['calendar_only_today'] = $modSettings['cal_days_for_index'] == 1;

// Get the current member time/date.
$now forum_time();

// This is used to show the "how-do-I-edit" help.
$context['calendar_can_edit'] = allowedTo('calendar_edit_any');

// Holidays between now and now + days.
$context['calendar_holidays'] = array();
for ($i $now$i $now $days_for_index$i += 86400)
{
if (isset($holidays[strftime('%Y-%m-%d'$i)]))
$context['calendar_holidays'] = array_merge($context['calendar_holidays'], $holidays[strftime('%Y-%m-%d'$i)]);
}

// Happy Birthday, guys and gals!
$context['calendar_birthdays'] = array();
for ($i $now$i $now $days_for_index$i += 86400)
if (isset($bday[strftime('%Y-%m-%d'$i)]))
{
foreach ($bday[strftime('%Y-%m-%d'$i)] as $index => $dummy)
$bday[strftime('%Y-%m-%d'$i)][$index]['is_today'] = strftime('%Y-%m-%d'$i) == strftime('%Y-%m-%d'forum_time());
$context['calendar_birthdays'] = array_merge($context['calendar_birthdays'], $bday[strftime('%Y-%m-%d'$i)]);
}

$context['calendar_events'] = array();
$duplicates = array();
for ($i $now$i $now $days_for_index$i += 86400)
{
if (empty($events[strftime('%Y-%m-%d'$i)]))
continue;

foreach ($events[strftime('%Y-%m-%d'$i)] as $ev => $event)
{
if (empty($event['topic']) || (count(array_intersect($user_info['groups'], $event['allowed_groups'])) != || allowedTo('admin_forum')))
{
if (isset($duplicates[$events[strftime('%Y-%m-%d'$i)][$ev]['topic'] . $events[strftime('%Y-%m-%d'$i)][$ev]['title']]))
{
unset($events[strftime('%Y-%m-%d'$i)][$ev]);
continue;
}

$this_event = &$events[strftime('%Y-%m-%d'$i)][$ev];
$this_event['href'] = $this_event['topic'] == '' $scripturl '?topic=' $this_event['topic'] . '.0';
$this_event['modify_href'] = $scripturl '?action=' . ($this_event['topic'] == 'calendar;sa=post;' 'post;msg=' $this_event['msg'] . ';topic=' $this_event['topic'] . '.0;calendar;') . 'eventid=' $this_event['id'] . ';sesc=' $sc;
$this_event['can_edit'] = allowedTo('calendar_edit_any') || ($this_event['poster'] == $ID_MEMBER && allowedTo('calendar_edit_own'));
$this_event['is_today'] = (strftime('%Y-%m-%d'$i)) == strftime('%Y-%m-%d'forum_time());
$this_event['date'] = strftime('%Y-%m-%d'$i);

$duplicates[$this_event['topic'] . $this_event['title']] = true;
}
else
unset($events[strftime('%Y-%m-%d'$i)][$ev]);
}

if (!empty($events[strftime('%Y-%m-%d'$i)]))
$context['calendar_events'] = array_merge($context['calendar_events'], $events[strftime('%Y-%m-%d'$i)]);
}

for ($i 0$n count($context['calendar_birthdays']); $i $n$i++)
$context['calendar_birthdays'][$i]['is_last'] = !isset($context['calendar_birthdays'][$i 1]);
for ($i 0$n count($context['calendar_events']); $i $n$i++)
$context['calendar_events'][$i]['is_last'] = !isset($context['calendar_events'][$i 1]);

// This is used to make sure the header should be displayed.
return !empty($context['calendar_holidays']) || !empty($context['calendar_birthdays']) || !empty($context['calendar_events']);
}

?>


Saygılar

jOkErGuEsT

Şimdi şöyle yapsam çalışır mı?
<?php
$SSI
="http://www.siteadı/forum/SSI.php";

require(
$SSI);

ssi_news();

recentPosts();

?>

hukuk (judge)

Onu şu şekilde deneyebilirsin :

note pada yapıştırıp x.php olarak kaydet, ftp'den web sitene at, sonra çalıştır.

jOkErGuEsT

Yok şuan bir index hazırlıyorum da index.php'in içine yerleştirsem çalışır mı?

[SiNaN]

hukuk:

SSI.php

Bul:

FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)

Değiştir:

FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b, {$db_prefix}topics AS t)

Bul:

AND $user_info[query_see_board]
ORDER BY m.ID_MSG DESC


Değiştir:

AND $user_info[query_see_board]
AND m.ID_MSG = t.ID_LAST_MSG
ORDER BY m.ID_MSG DESC


BoardIndex.php'de bilgileri almalısınız. Ardından BoardIndex.template.php'de bu bilgileri kullanmalısınız. Tam olarak nereye eklemek istiyorsunuz? Son mesajların yerine mi?

jOkErGuEsT:

Türkçesi ne oluyor bilmiyorum ama absolute url'yi girmelisiniz.

http://www.benimsitem.com/forum/SSI.php => Yanlış
/home/benimsitem/public_html/forum/SSI.php => Doğru

Absolute url'yi Eklentilerin kaydedildiği dizin ayarlarından kopyalayabilirsiniz.
Former SMF Core Developer | My Mods | SimplePortal

hukuk (judge)

#308
Verdiğin SSi kodları için çok teşekkür ederim.Evet usta aynen forumdaki son mesajların yerine eklemek istiyorum.Board index template:

<?php
// Version: 1.1; BoardIndex

function template_main()
{
global $context$settings$options$txt$scripturl$modSettings;

// Show some statistics next to the link tree if SP1 info is off.
echo '
<table width="100%" cellpadding="3" cellspacing="0">
<tr>
<td valign="bottom">'
theme_linktree(), '</td>
<td align="right">'
;
if (!$settings['show_sp1_info'])
echo '
'
$txt[19], ': '$context['common_stats']['total_members'], ' &nbsp;&#38;#8226;&nbsp; '$txt[95], ': '$context['common_stats']['total_posts'], ' &nbsp;&#38;#8226;&nbsp; '$txt[64], ': '$context['common_stats']['total_topics'], '
'
, ($settings['show_latest_member'] ? '<br />' $txt[201] . ' <b>' $context['common_stats']['latest_member']['link'] . '</b>' $txt[581] : '');
echo '
</td>
</tr>
</table>'
;

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div class="tborder" style="border-bottom: 0;">
<div class="titlebg" align="center" style="padding: 5px 5px 5px 5px;">'
$txt[102], '</div>
</div>
<table border="0" width="100%" cellspacing="0" cellpadding="5" class="tborder" style="border-bottom: 0;">
<tr>
<td class="windowbg2" valign="middle" align="center" height="60">'
;

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="width: 90%; padding: 2px;"><b>'
$context['news_lines'][0], '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 $settings['newsfader_time'], ';
// Fade from... what text color?  To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 248, "g": 248, "b": 248};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
var foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

var backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

var backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
var foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

var backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

var backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"'
implode('",
"'
$context['fader_news_lines']), '"
);
// ]]></script>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>'
;
}

// Show the "Board name      Topics  Posts    Last Post" header.
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr class="titlebg">
<td colspan="2">'
$txt[20], '</td>
<td width="6%" align="center">'
$txt[330], '</td>
<td width="6%" align="center">'
$txt[21], '</td>
<td width="22%" align="center">'
$txt[22], '</td>
</tr>'
;

/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
and boards. (see below.) */
foreach ($context['categories'] as $category)
{
// Show the category's name, and let them collapse it... if they feel like it.
echo '
<tr>
<td colspan="5" class="catbg" height="18">'
;

// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])
echo '
<a href="'
$category['collapse_href'], '">'$category['collapse_image'], '</a>';

echo '
'
$category['link'], '
</td>
</tr>'
;

// Only if it's NOT collapsed..
if (!$category['is_collapsed'])
{
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<tr>
<td class="windowbg" width="6%" align="center" valign="top"><img src="'
$settings['images_url'], $board['new'] ? '/on.gif" alt="' $txt[333] . '" title="' $txt[333] : '/off.gif" alt="' $txt[334] . '" title="' $txt[334], '" border="0" /></td>
<td class="windowbg2" align="left" width="60%">
<a name="b'
$board['id'], '"></a>
<b>'
$board['link'], '</b><br />
'
$board['description'];

// Show the "Moderators: ".  Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '<i class="smalltext"><br />
'
count($board['moderators']) == $txt[298] : $txt[299], ': 'implode(', '$board['link_moderators']), '</i>';

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
$children[] = $child['new'] ? '<b>' $child['link'] . '</b>' $child['link'];

echo '
<i class="smalltext"><br />
'
$txt['parent_boards'], ': 'implode(', '$children), '</i>';
}

echo '
</td>
<td class="windowbg" valign="middle" align="center" width="6%">'
$board['topics'], '</td>
<td class="windowbg" valign="middle" align="center" width="6%">'
$board['posts'], '</td>';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
echo '
<td class="windowbg2" valign="middle" width="22%">
<span class="smalltext">
'
$board['last_post']['time'], '<br />
'
$txt['smf88'], ' '$board['last_post']['link'], '<br />
'
$txt[525], ' '$board['last_post']['member']['link'], '
</span>
</td>
</tr>'
;
}
}
}

// Show the "New Posts" and "No New Posts" legend.
if ($context['user']['is_logged'])
{
echo '
<tr class="titlebg">
<td colspan="2" align="left">
<img src="' 
$settings['images_url'] . '/' $context['user']['language'] . '/new_some.gif" alt="' $txt[333] . '" border="0" />&nbsp;&nbsp;<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/new_none.gif" alt="' $txt[334] . '" border="0" />
</td>
<td colspan="3" align="right" class="smalltext">'
;
// Show the mark all as read button?
if ($settings['show_mark_read'])
echo '
<a href="'
$scripturl'?action=markasread;sa=all;sesc=' $context['session_id'] . '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/markread.gif" alt="' $txt[452] . '" border="0" />' $txt[452]), '</a>';
echo '
</td>
</tr>'
;
}

echo '
</table>'
;

// Here's where the "Info Center" starts...
echo '
<br />
<br />
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="titlebg">
<td align="center" colspan="2">'
$txt[685], '</td>
</tr>'
;

// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<tr>
<td class="catbg" colspan="2">'
$txt[214], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="'
$scripturl'?action=recent">
<img src="'
$settings['images_url'], '/post/xx.gif" alt="'$txt[214], '" border="0" /></a>
</td>
<td class="windowbg2">'
;

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<b><a href="'
$scripturl'?action=recent">'$txt[214], '</a></b><br />
<span class="smalltext">
'
$txt[234], ' &quot;'$context['latest_post']['link'], '&quot; '$txt[235], ' ('$context['latest_post']['time'], ')<br />
</span>'
;
}

// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table  class="windowbg2" cellspacing="1" width="100%" cellpadding="0"  border="1">
 <tr>
<th class="windowbg" style="background-color : #FFFFFF" align="center" width="43%">KONU BAŞLIĞI</th>
                                                                        <th class="windowbg" style="background-color : #FFFFFF" align="center" width="12%">SON MESAJ/CEVAP</th>
 </tr>'
;


/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '

<tr>
<td class="windowbg2" style="background-color : #FFFFFF" align="left" title="mesajın sahibi '
.$ID_MEMBER_STARTED.'">'$post['link'], '</td>
                                                                        <td class="windowbg2" style="background-color : #FFFFFF" align="center">'
$post['poster']['link'], '</td>
                                                                 </tr>'
;
echo '
</table>'
;
}
echo '
</td>
</tr>'
;
         }


// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<tr>
<td class="catbg" colspan="2">'
$context['calendar_only_today'] ? $txt['calendar47b'] : $txt['calendar47'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="'
$scripturl'?action=calendar">
<img src="'
$settings['images_url'], '/icons/calendar.gif" border="0" width="20" alt="'$txt['calendar24'], '" /></a>
</td>
<td class="windowbg2" width="100%">
<span class="smalltext">'
;

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span style="color: #'
$modSettings['cal_holidaycolor'], ';">'$txt['calendar5'], ' 'implode(', '$context['calendar_holidays']), '</span><br />';

// People's birthdays.  Like mine.  And yours, I guess.  Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span style="color: #'
$modSettings['cal_bdaycolor'], ';">'$context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="'
$scripturl'?action=profile;u='$member['id'], '">'$member['is_today'] ? '<b>' ''$member['name'], $member['is_today'] ? '</b>' '', isset($member['age']) ? ' (' $member['age'] . ')' '''</a>'$member['is_last'] ? '<br />' ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span style="color: #'
$modSettings['cal_eventcolor'], ';">'$context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
'
$event['can_edit'] ? '<a href="' $event['modify_href'] . '" style="color: #FF0000;">*</a> ' ''$event['href'] == '' '' '<a href="' $event['href'] . '">'$event['is_today'] ? '<b>' $event['title'] . '</b>' $event['title'], $event['href'] == '' '' '</a>'$event['is_last'] ? '<br />' ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="'
$scripturl'?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">'$txt['calendar_how_edit'], '</a>)';
}
echo '
</span>
</td>
</tr>'
;
}

// Show a member bar.  Not heavily ornate, but functional at least.
if ($settings['show_member_bar'])
{
echo '
<tr>
<td class="catbg" colspan="2">'
$txt[331], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
'
$context['show_member_list'] ? '<a href="' $scripturl '?action=mlist">' '''<img src="'$settings['images_url'], '/icons/members.gif" border="0" width="20" alt="'$txt[332], '" />'$context['show_member_list'] ? '</a>' '''
</td>
<td class="windowbg2" width="100%">
<b>'
$context['show_member_list'] ? '<a href="' $scripturl '?action=mlist">' $txt[332] . '</a>' $txt[332], '</b><br />
<span class="smalltext">'
$txt[200], '</span>
</td>
</tr>'
;
}

// Show YaBB SP1 style information...
if ($settings['show_sp1_info'])
{
echo '
<tr>
<td class="catbg" colspan="2">'
$txt[645], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="'
$scripturl'?action=stats">
<img src="'
$settings['images_url'], '/icons/info.gif" alt="'$txt[645], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
<table border="0" width="90%"><tr>
<td class="smalltext">
'
$txt[490], ': <b>'$context['common_stats']['total_topics'], '</b> &nbsp;&nbsp;&nbsp;&nbsp; '$txt[489], ': <b>'$context['common_stats']['total_posts'], '</b><br />
'
, !empty($context['latest_post']) ? $txt[659] . ':
&quot;' 
$context['latest_post']['link'] . '&quot;  (' $context['latest_post']['time'] . ')<br />' '''
<a href="'
$scripturl'?action=recent">'$txt[234], '</a>'$context['show_stats'] ? '<br />
<a href="' 
$scripturl '?action=stats">' $txt['smf223'] . '</a>' '''
</td>
<td class="smalltext">
'
$txt[488], ': <b>'$context['show_member_list'] ? '<a href="' $scripturl '?action=mlist">' $context['common_stats']['total_members'] . '</a>' $context['common_stats']['total_members'], '</b><br />
'
$txt[656], ': <b>'$context['common_stats']['latest_member']['link'], '</b><br />';
// If they are logged in, show their unread message count, etc..
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '
'
$txt['smf199'], ': <b><a href="'$scripturl'?action=pm">'$context['user']['messages'], '</a></b> '$txt['newmessages3'], ': <b><a href="'$scripturl'?action=pm">'$context['user']['unread_messages'], '</a></b>';
echo '
</td>
</tr></table>
</td>
</tr>'
;
}

// "Users online" - in order of activity.
echo '
<tr>
<td class="catbg" colspan="2">'
$txt[158], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
'
$context['show_who'] ? '<a href="' $scripturl '?action=who">' '''<img src="'$settings['images_url'], '/icons/online.gif" alt="'$txt[158], '" border="0" />'$context['show_who'] ? '</a>' '''
</td>
<td class="windowbg2" width="100%">'
;

if ($context['show_who'])
echo '
<a href="'
$scripturl'?action=who">';

echo $context['num_guests'], ' '$context['num_guests'] == $txt['guest'] : $txt['guests'], ', ' $context['num_users_online'], ' '$context['num_users_online'] == $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{
echo ' (';

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' '$context['num_buddies'] == $txt['buddy'] : $txt['buddies'];

// How about hidden users?
if (!empty($context['num_users_hidden']))
echo $context['show_buddies'] ? ', ' ''$context['num_users_hidden'] . ' ' $txt['hidden'];

echo ')';
}

if ($context['show_who'])
echo '</a>';

echo '
<span class="smalltext">'
;

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
echo '
'
$txt[140], ':<br />'implode(', '$context['list_users_online']);

echo '
<br />'
$context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' 
$scripturl '?action=stats">' $txt['smf223'] . '</a>' '''
</span>
</td>
</tr>'
;

// If they are logged in, but SP1 style information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_sp1_info'])
{
echo '
<tr>
<td class="catbg" colspan="2">'
$txt[159], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
'
$context['allow_pm'] ? '<a href="' $scripturl '?action=pm">' '''<img src="'$settings['images_url'], '/message_sm.gif" alt="'$txt[159], '" border="0" />'$context['allow_pm'] ? '</a>' '''
</td>
<td class="windowbg2" valign="top">
<b><a href="'
$scripturl'?action=pm">'$txt[159], '</a></b><br />
<span class="smalltext">
'
$txt[660], ' '$context['user']['messages'], ' '$context['user']['messages'] == $txt[471] : $txt[153], '.... '$txt[661], $context['allow_pm'] ? ' <a href="' $scripturl '?action=pm">' $txt[662] . '</a>' ''' '$txt[663], '
</span>
</td>
</tr>'
;
}

// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<tr>
<td class="catbg" colspan="2">
'
$txt[34], ' <a href="'$scripturl'?action=reminder" class="smalltext">(' $txt[315] . ')</a>
</td>
</tr>
<tr>
<td class="windowbg" width="20" align="center">
<a href="'
$scripturl'?action=login">
<img src="'
$settings['images_url'], '/icons/login.gif" alt="'$txt[34], '" border="0" /></a>
</td>
<td class="windowbg2" valign="middle">
<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<table border="0" cellpadding="2" cellspacing="0" align="center" width="100%"><tr>
<td valign="middle" align="left">
<label for="user"><b>'
$txt[35], ':</b><br /><input type="text" name="user" id="user" size="15" /></label>
</td>
<td valign="middle" align="left">
<label for="passwrd"><b>'
$txt[36], ':</b><br /><input type="password" name="passwrd" id="passwrd" size="15" /></label>
</td>
<td valign="middle" align="left">
<label for="cookielength"><b>'
$txt[497], ':</b><br /><input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="'$modSettings['cookieTime'], '" /></label>
</td>
<td valign="middle" align="left">
<label for="cookieneverexp"><b>'
$txt[508], ':</b><br /><input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</td>
<td valign="middle" align="left">
<input type="submit" value="'
$txt[34], '" />
</td>
</tr></table>
</form>
</td>
</tr>'
;
}

echo '
</table>'
;
}

?>

[SiNaN]

Peki farkı ne olacak ki? Görünümü mü?
Former SMF Core Developer | My Mods | SimplePortal

hukuk (judge)

Portaldaki son mesajlar hareket ediyor maksad forumla entegrasyon olsun, yani bir nevi seninde dediğin gibi görüntü aynı olsun, aslında işlev olarak sabit mesajlar daha güzel ama kimse işlevle ilgilenmiyor ne yazıkki.

[SiNaN]

Eğer sadece görünümü değiştirmek istiyorsanız zaten aynı bilgi yükleniyor. BoardIndex.template.php'de şu kısmı istediğiniz şekilde düzenleyin:

            echo '
                       
                     <tr>
                           <td class="windowbg2" style="background-color : #FFFFFF" align="left" title="mesajın sahibi '.$ID_MEMBER_STARTED.'">', $post['link'], '</td>
                                                                        <td class="windowbg2" style="background-color : #FFFFFF" align="center">', $post['poster']['link'], '</td>
                                                                 </tr>';
Former SMF Core Developer | My Mods | SimplePortal


[SiNaN]

BoardIndex.template.php

Bul:

         echo '
                  <table  class="windowbg2" cellspacing="1" width="100%" cellpadding="0"  border="1">
                   <tr>
                           <th class="windowbg" style="background-color : #FFFFFF" align="center" width="43%">KONU BAŞLIĞI</th>
                                                                        <th class="windowbg" style="background-color : #FFFFFF" align="center" width="12%">SON MESAJ/CEVAP</th>
                         </tr>';
                 

         /* Each post in latest_posts has:
               board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
               subject, short_subject (shortened with...), time, link, and href. */
         foreach ($context['latest_posts'] as $post)
            echo '
                       
                     <tr>
                           <td class="windowbg2" style="background-color : #FFFFFF" align="left" title="mesajın sahibi '.$ID_MEMBER_STARTED.'">', $post['link'], '</td>
                                                                        <td class="windowbg2" style="background-color : #FFFFFF" align="center">', $post['poster']['link'], '</td>
                                                                 </tr>';
         echo '
                  </table>';


Değiştir:

echo '
<table  class="windowbg2" cellspacing="1" width="100%" cellpadding="0"  border="0">
<tr>
<th class="windowbg" align="left" width="40%">', $txt[118], '</th>
<th class="windowbg" align="left" width="25%">', $txt[20], '</th>
<th class="windowbg" align="left" width="12%">', $txt[29], '</th>
<th class="windowbg" align="left" width="16%">', $txt[317], '</th>
</tr>
</table>
      <marquee onmouseover="this.stop()" onmouseout="this.start()" scrollAmount="2" direction="up" height="200px">
<table cellpadding="0" cellspacing="0" width="100%" border="0">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<tr>
<td class="windowbg" valign="middle" width="43%">', $post['link'], '</td>
<td class="windowbg" valign="middle" width="27%">', $post['board']['link'], '</td>
<td class="windowbg" valign="middle" width="12%">', $post['poster']['link'], '</td>
<td class="windowbg" valign="middle" width=18%">', $post['time'], '</td>
</tr>';
echo '
</table>
</marquee>';
Former SMF Core Developer | My Mods | SimplePortal

hukuk (judge)

#314
Allah senden razı olsun,
Çalışmalarında başarılar.

jOkErGuEsT

[SiNaN];
Ben bu adresi dediğin şekle nasıl çevirebilirim?
http://www.simplemachines.org/community/SSI.php

Seni de çok yordum :)

[SiNaN]

O adres hosta göre değişir. Bana SSI kullandığınız dosyanın ve SSI.php yerine anlatır mısınız?

Örneğin:

Kullanacağım sayfa ana dizinde, SSI.php "forum" dizininde.
Kullanacağım sayfa "site" dizininde, SSI.php "forum" dizininde.
Kullanacağım sayfa "site" dizininde, SSI.php ana dizinde.

gibi bir açıklama yeterli olur.
Former SMF Core Developer | My Mods | SimplePortal

jOkErGuEsT

Kullanacağım site ile kullanacağım SSI aynı site üzerinde değil; yani başka siteden SSI çekmek istiyorum.

[SiNaN]

$welcome = implode("", file('http://www.simplemachines.org/community/SSI.php?ssi_function=welcome'));
echo $welcome;

$topics = implode("", file('http://www.simplemachines.org/community/SSI.php?ssi_function=recentTopics'));
echo $topics;
Former SMF Core Developer | My Mods | SimplePortal

jOkErGuEsT

Quote from: [SiNaN] on August 24, 2008, 09:23:52 AM
$welcome = implode("", file('http://www.simplemachines.org/community/SSI.php?ssi_function=welcome'));
echo $welcome;

$topics = implode("", file('http://www.simplemachines.org/community/SSI.php?ssi_function=recentTopics'));
echo $topics;


Çok, çok teşekkür ederim :D

Allah senden razı olsun :)

Advertisement: