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

Recent

Welcome to TinyPortal. Please login or sign up.

May 02, 2024, 05:26:29 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,176
  • Total Topics: 21,220
  • Online today: 127
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 93
  • Total: 93

Blok yazılımcıkları (Block Snippets)

Started by sarba126, March 29, 2006, 07:59:02 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

alp

Anket anasayfada gösterimi

php box da yapılacak.
// display most recent poll from board number 1
tp_showPoll(13663.0);   (en altta)

13663.0 buraya sizin adres çubuğundaki numarayı yazacaksınız

//Enhanced showPoll block
// Shows poll in block from specified topic,
// or the most recent from specified board
//
// Author: Greybrow
// Version: 2007-04-24 22:00
// Features:
// shows poll (or polls) that fits in a block
//         voting or scores (when voted or can't vote)
// shows question as a topic link
// shows poll from specified topic
// shows most recent poll from specified board
//
// based on ssi_showPoll();
// added block hacks by Raysr and Thurnok from:
//    http://tpblocks.ccs-net.com/index.php?topic=25
//    http://tpblocks.ccs-net.com/index.php?topic=40
//
// usage:
// - copy whole code to phpblock.
// - at the end of the code use function
// tp_showPoll(topic number or null, 'echo' or null, board number or null)
// or
// copy the function to SSI.php
// put only the function call in phpblock
//
// examples:
// show the poll from topic 34
// tp_showPoll(34);                     
//
// show the most recent poll from the board number 5
// tp_showPoll(null,'echo',5);           
//
// keep in mind, that if board is specified, topic is ignored
// so it will display the same as above
// tp_showPoll(34,'echo',5)             
//
// put the array with poll from board 5 into $thepoll variable
// $thepoll = tp_showPoll(null,null,5); 
//
// if you call the function more than once,
// with different options, block will show more polls
// but I'm not sure if voting would work correctly :(
///////////////////////////////////////////////////////

function tp_showPoll($topic = null, $output_method = 'echo', $board = null)
{
global $db_prefix, $txt, $ID_MEMBER, $settings, $boardurl, $sc, $user_info;
global $context;

$boardsAllowed = boardsAllowedTo('poll_view');

if (empty($boardsAllowed))
return array();

if ($topic === null && isset($_REQUEST['ssi_topic']))
$topic = (int) $_REQUEST['ssi_topic'];
else
$topic = (int) $topic;

if ($board === null)
{
// board not chosen, so get the one from specified topic
$request = db_query("
SELECT
p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD
FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
WHERE p.ID_POLL = t.ID_POLL
AND t.ID_TOPIC = $topic
AND b.ID_BOARD = t.ID_BOARD
AND $user_info[query_see_board]" . (!in_array(0, $boardsAllowed) ? "
AND b.ID_BOARD IN (" . implode(', ', $boardsAllowed) . ")" : '') . "
LIMIT 1", __FILE__, __LINE__);
}
else
{
// board chosen, so lets try to get the most recent poll from it
$board = (int) $board;
$request = db_query("
SELECT
p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD, t.ID_TOPIC
FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
WHERE p.ID_POLL = t.ID_POLL
AND b.ID_BOARD = t.ID_BOARD
AND b.ID_BOARD = $board
AND $user_info[query_see_board]" . (!in_array(0, $boardsAllowed) ? "
AND $board IN (" . implode(', ', $boardsAllowed) . ")" : '') . "
ORDER BY p.ID_POLL DESC
LIMIT 1", __FILE__, __LINE__);
}

// Either this topic has no poll, or the user cannot view it.
if (mysql_num_rows($request) == 0)
return array();

$row = mysql_fetch_assoc($request);
mysql_free_result($request);

if($topic == 0)
$topic = (int)$row['ID_TOPIC'];

// Check if they can vote.
if ((!empty($row['expireTime']) && $row['expireTime'] < time()) || $user_info['is_guest'] || !empty($row['votingLocked']) || !allowedTo('poll_vote', $row['ID_BOARD']))
$allow_vote = false;
else
{
$request = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}log_polls
WHERE ID_POLL = $row[ID_POLL]
AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);
$allow_vote = mysql_num_rows($request) == 0;
mysql_free_result($request);
}
$request = db_query("
SELECT COUNT(DISTINCT ID_MEMBER)
FROM {$db_prefix}log_polls
WHERE ID_POLL = $row[ID_POLL]", __FILE__, __LINE__);
list ($total) = mysql_fetch_row($request);
mysql_free_result($request);

$request = db_query("
SELECT ID_CHOICE, label, votes
FROM {$db_prefix}poll_choices
WHERE ID_POLL = $row[ID_POLL]", __FILE__, __LINE__);
$options = array();
$total_votes = 0;
while ($rowChoice = mysql_fetch_assoc($request))
{
censorText($rowChoice['label']);

$options[$rowChoice['ID_CHOICE']] = array($rowChoice['label'], $rowChoice['votes']);
$total_votes += $rowChoice['votes'];
}
mysql_free_result($request);

$return = array(
'id' => $row['ID_POLL'],
'image' => empty($pollinfo['votingLocked']) ? 'poll' : 'locked_poll',
'question' => $row['question'],
'total_votes' => $total,
'is_locked' => !empty($pollinfo['votingLocked']),
'allow_vote' => $allow_vote,
'topic' => $topic
);

// Calculate the percentages and bar lengths...
$divisor = $total_votes == 0 ? 1 : $total_votes;
foreach ($options as $i => $option)
{
$bar = floor(($option[1] * 100) / $divisor);
$barWide = $bar == 0 ? 1 : floor(($bar * 5) / 6);
$return['options'][$i] = array(
'id' => 'options-' . $i,
'percent' => $bar,
'votes' => $option[1],
'bar' => '<span style="white-space: nowrap;"><img src="' . $settings['images_url'] . '/poll_left.gif" alt="" /><img src="' . $settings['images_url'] . '/poll_middle.gif" width="' . $barWide . '" height="12" alt="-" /><img src="' . $settings['images_url'] . '/poll_right.gif" alt="" /></span>',
'option' => parse_bbc($option[0]),
'vote_button' => '<input type="' . ($row['maxVotes'] > 1 ? 'checkbox' : 'radio') . '" name="options[]" id="options-' . $i . '" value="' . $i . '" class="check" />'
);
}

$return['allowed_warning'] = $row['maxVotes'] > 1 ? sprintf($txt['poll_options6'], $row['maxVotes']) : '';

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

if ($return['allow_vote'])
{
echo '
<form action="', $boardurl, '/SSI.php?ssi_function=pollVote" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="poll" value="', $return['id'], '" />
<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
<tr>
<td colspan="2" class="smalltext"><a href="', $boardurl, '/index.php?topic=', $return['topic'], '"><b>', $return['question'], '</b></a></td>
</tr>
<tr>
<td class="smalltext">', $return['allowed_warning'], '</td>
</tr>';
foreach ($return['options'] as $option)
echo '
<tr>
<td class="smalltext"><label for="', $option['id'], '">', $option['vote_button'], '</td><td class="smalltext">', $option['option'], '</label></td>
</tr>';
echo '
<tr>
<td colspan="2" class="smalltext"><input type="submit" value="', $txt['smf23'], '" /></td>
</tr>
</table>
<input type="hidden" name="sc" value="', $sc, '" />
</form>';
}
else
{
echo '
<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
<tr>
<td colspan="2" class="smalltext"><a href="', $boardurl, '/index.php?topic=', $return['topic'], '"><b>', $return['question'], '</b></a></td>
</tr>';
foreach ($return['options'] as $option)
echo '
<tr>
<td colspan="2" align="left" valign="top" style="font-style: italic" class="smalltext">', $option['option'], '</td>
</tr>
<tr>
<td align="left" class="smalltext">', $option['bar'], '</td>
<td align="left" class="smalltext">', $option['votes'], ' (', $option['percent'], '%)</td>
</tr>';
echo '
<tr>
<td colspan="2" class="smalltext"><b>', $txt['smf24'], ': ', $return['total_votes'], '</b></td>
</tr>
</table>';
}
}

///////////////////////////////////////
// display most recent poll from board number 1
tp_showPoll(13663.0);   

alp

burada eklediğim bloclar ingilizce bölümünden alınmıştır.anlatımlar bana aittir (vakit buldukça yeni bloclar eklemeye devam edecem)

alp


Image Viewer(resim görüntüleyici)
ftp ana dizine atacağın 16 resim p1...p16 diye aşağıdaki gibi olacaktır
üstte 8 küçük altta 8 küçük resim ortada büyük boyutlu resim.hangi resme tıklarsanız o büyür
ekran görüntüsü

   

scriptbox oluşturun kodu içine kopyalayın
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Jenny Blewitt (webmaster@webdesignsdirect.com) -->
<!-- Web Site:  http://www.webdesignsdirect.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic.src = imgOn;
   }
}
//  End -->
</script>

<center>
<table width=500 border=0 cellspacing=0 cellpadding=0>
<tr>
<td><a href="javascript:doPic('p1.jpg');"><img src="p1.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p2.jpg');"><img src="p2.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p3.jpg');"><img src="p3.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p4.jpg');"><img src="p4.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p5.jpg');"><img src="p5.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p6.jpg');"><img src="p6.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p7.jpg');"><img src="p7.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p8.jpg');"><img src="p8.jpg" width=90 height=60 border=0></td>
</tr>
<tr>
<td colspan=8 align=center><img name="mainpic" src="p1.jpg" width=500 height=300 border=0></td>
</tr>
<tr>
<td><a href="javascript:doPic('p9.jpg');"><img src="p9.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p10.jpg');"><img src="p10.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p11.jpg');"><img src="p11.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p12.jpg');"><img src="p12.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p13.jpg');"><img src="p13.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p14.jpg');"><img src="p14.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p15.jpg');"><img src="p15.jpg" width=90 height=60 border=0></td>
<td><a href="javascript:doPic('p16.jpg');"><img src="p16.jpg" width=90 height=60 border=0></td>
</tr>
</table>
</center>


küçük resimlerin boyutu width=90 height=60 siz ayarlayın bunu
resme tıklandığında büyüyen resmin boyutu width=500 height=300 bunuda istediğiniz gibi değiştirin

bbTURK

arkadaşlar blok yazılımcıkları konusu biraz büyüdü. aradıklarımızı daha rahat bulabilmek için ilk mesaja içindekiler ekledim. gözmden kaçan blok yazılımcıkları için uyarın.

alp

bbTURK yeni bir konu da keşke yapsaydın listeyi.çünkü 9 sayfa olmuş içerinde bloklardan çok sorunlarına çözüm aramış.hem çok eski tarihli bloklarda var (ör:otomatik meta tag )smf onu direk yapıyor artık

alp

#85
buyrun herkesin istediÄŸi forumdan son konular:


global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER, $user_info, $modSettings, $user_profile;

//////////////////////////////////////////// ---------- Unconditional Exclude
//
$exclude_boards = array(); // KEEP (to preserve variable declaration)
// $exclude_boards = array(5); //  Exclude single board
// $exclude_boards = array(5, 8); //  Exclude multiple boards
$ex_board_clause = !empty($exclude_boards) ? ' AND b.ID_BOARD NOT IN (' . implode(', ', $exclude_boards) . ')' : '';
//
//

//////////////////////////////////////////// ---------- Use in TP PHP Article (no title or frame from theme)
// This will give most recent XX posted to topics -OR-
// most recent XX unreplied to topics -OR-
// topics posted to in last XX hours -OR-
// most recent XX topics on topic notify list
//
// Sorts by most recent reply (descending; most recent first) -OR-
//          creation order (descending; most recent first)
//
// All in the detailed topic format
//
//
// Default
// index.php?page=##
// most recent posted to topics - will list
// number equal to  $settings['number_recent_posts']
//
// index.php?page=##;count=50 or index.php?page=##;type=last;count=50
// 50 most recently posted to topics
//
// index.php?page=##;type=unreplied or index.php?page=##;type=unreplied;count=50
// Most recent unreplied to topics - will
// list number specified in 'count' or default to
// number equal to  $settings['number_recent_posts']
//
// index.php?page=##;type=hours or index.php?page=##;type=hours;count=12
// Topics posted to in last number of hours
// specified in 'count' or default to 24.
//
// index.php?page=##;type=notify or index.php?page=##;type=notify;count=50
// Topics in topic notifcation list up to number
// specified in 'count' or a maximum of 100 topics.
//
// *** Admins Only ***
// index.php?page=##;type=notify;user=XXX or index.php?page=##;type=notify;user=XXX;count=50
// Topics in topic notifcation list of specified user up to number
// specified in 'count' or a maximum of 100 topics.
//
// index.php?page=##;type=started or index.php?page=##;type=started;count=50
// Topics started by current user list up to number
// specified in 'count' or a maximum of 100 topics.
//
// *** Admins Only ***
// index.php?page=##;type=notify;user=XXX or index.php?page=##;type=started;user=XXX;count=50
// Topics started by specified user up to number
// specified in 'count' or a maximum of 100 topics.
//
// Add argument order=create to sort by topic creation sequence (most recent first)
// rather than by last reply sequence

$do_query = 1;

//////////////////////////////////////////// ---------- Poor Man's Global Announcements Block (center block - no Title/Frame)
// Delete documentation comments above and marked section below
//
// $announce_topics = array(254, 568, 675, 678); // Topic ID's to be 'Announced'
//
// $heading = '<center>Announcements<center>';
// $where_clause = 't.ID_TOPIC IN (' . implode(', ', $announce_topics) . ')';
// $limit_clause = '';
// $order_clause = 't.ID_LAST_MSG DESC';
////////////////////////////////////////////   

//////////////////////////////////////////// ---------- Last 5 Topics Started by User Block (center block - no Title/Frame)
// Delete documentation comments above and marked section below
//
// $heading = 'Most Recent Topics You Started';
// $where_clause = 'ms.ID_MEMBER = '.$ID_MEMBER;
// $limit_clause = 'LIMIT 5';
// $order_clause = 't.ID_FIRST_MSG DESC';
////////////////////////////////////////////   

//////////////////////////////////////////// ---------- Boardindex Most Recent Topics Arguments
//
// Comment out the Info Center's Most Recent Posts Code and Insert this
// to show Most Recent Topics in full detail style instead
//
// $list_count = $settings['number_recent_posts'];
// $where_clause = 't.ID_LAST_MSG >= ' . ($modSettings['maxMsgID'] - 50 * min($list_count, 5));
// $limit_clause = 'LIMIT ' . $list_count;
// $order_clause = 't.ID_LAST_MSG DESC';
////////////////////////////////////////////   

////////////////////////////////////////////  ------ Remove down to next mark to use in block/boardindex ------
//
if (empty($settings['number_recent_posts']))
$number_recent_posts = 20;
else
$number_recent_posts = $settings['number_recent_posts'];

        if( isset($_GET['type']) )
$list_type = $_GET['type'];
else
$list_type = 'last';

        if( isset($_GET['count']) )
$list_count = $_GET['count'];
else
{
$list_count = $number_recent_posts;
if ($list_type == 'notify')
$list_count = 100;
elseif ($list_type == 'hours')
$list_count = 24;
}

if ($list_count <= 0)
{
$list_count = $number_recent_posts;
if ($list_type == 'hours')
$list_count = 24;
}

if ($list_count > 100)
$list_count = 100;

        if( isset($_GET['order']) )
$list_order = $_GET['order'];
else
$list_order = 'lastpost';

        if( $list_order == 'create' )
$order_clause = 't.ID_FIRST_MSG DESC';
else
$order_clause = 't.ID_LAST_MSG DESC';

if ($list_type == 'hours')
{
$list_from = strtotime($list_count.' hours ago');
$where_clause = 'ml.posterTime >= ' . $list_from;
$limit_clause = ' ';
$heading = 'Topics Posted To In Last '. $list_count . ' Hours';
}
elseif ($list_type == 'unreplied')
{
$where_clause = 't.numReplies = 0';
if ($list_count == 0)
{
$limit_clause = ' ';
$heading = 'Unreplied To Topics';
}
else
{
$limit_clause = 'LIMIT ' . $list_count;
$heading = $list_count . ' Most Recent Unreplied To Topics';
}
}
elseif ($list_type == 'notify')
{
if (isset($_GET['user']) && $user_info['is_admin'])
{
$watched_topics = array();
$request = db_query("SELECT ID_TOPIC FROM {$db_prefix}log_notify WHERE ID_MEMBER = {$_GET['user']} AND ID_BOARD = 0", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$watched_topics[] = $row['ID_TOPIC'];
mysql_free_result($request);
$heading = $list_count . ' Most Recent Topics Being Watched by User # '.$_GET['user'];
$where_clause = 't.ID_TOPIC IN (' . implode(', ', $watched_topics) . ')';
$limit_clause = 'LIMIT ' . $list_count;
if (empty($watched_topics))
$do_query = 0;
}
else
{
$watched_topics = array();
$request = db_query("SELECT ID_TOPIC FROM {$db_prefix}log_notify WHERE ID_MEMBER = {$ID_MEMBER} AND ID_BOARD = 0", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$watched_topics[] = $row['ID_TOPIC'];
mysql_free_result($request);
$heading = $list_count . ' Most Recent Topics Being Watched';
$where_clause = 't.ID_TOPIC IN (' . implode(', ', $watched_topics) . ')';
$limit_clause = 'LIMIT ' . $list_count;
if (empty($watched_topics))
$do_query = 0;
}
}
elseif ($list_type == 'started')
{
if (isset($_GET['user']) && $user_info['is_admin'])
{
$where_clause = 'ms.ID_MEMBER = '.$_GET['user'];
$limit_clause = 'LIMIT ' . $list_count;
        if( $list_order == 'create' )
{
$order_clause = 't.ID_FIRST_MSG DESC';
$heading = 'Most Recent Topics Started by User '.$_GET['user'];
}
else
{
$order_clause = 't.ID_LAST_MSG DESC';
$heading = 'Most Recently Posted To Topics Started by User '.$_GET['user'];
}
}
else
{
$where_clause = 'ms.ID_MEMBER = '.$ID_MEMBER;
$limit_clause = 'LIMIT ' . $list_count;
        if( $list_order == 'create' )
{
$order_clause = 't.ID_FIRST_MSG DESC';
$heading = 'Most Recent Topics You Started';
}
else
{
$order_clause = 't.ID_LAST_MSG DESC';
$heading = 'Most Recently Posted To Topics You Started';
}
}
}
else
{
$where_clause = 't.ID_LAST_MSG >= ' . ($modSettings['maxMsgID'] - 90 * min($list_count, 5));
$limit_clause = 'LIMIT ' . $list_count;

}
//
////////////////////////////////////////////  ------ Remove up to first mark to use in block/boardindex ------

$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';

$groupcolors = array();
$request = db_query("SELECT ID_GROUP, onlineColor FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$groupcolors[$row['ID_GROUP']] = $row['onlineColor'];
mysql_free_result($request);

$topics = array();

if ($do_query == 1)
{
$request = db_query("
SELECT
ms.subject AS firstSubject, ms.posterTime AS firstPosterTime, ms.ID_TOPIC, t.ID_BOARD, b.name AS bname,
t.numReplies, t.numViews, ms.ID_MEMBER AS ID_FIRST_MEMBER, ml.ID_MEMBER AS ID_LAST_MEMBER,
ml.posterTime AS lastPosterTime, IFNULL(mems.realName, ms.posterName) AS firstPosterName,
IFNULL(meml.realName, ml.posterName) AS lastPosterName,
mems.ID_GROUP as mems_group, meml.ID_GROUP as meml_group,
ml.subject AS lastSubject, b.memberGroups,
ml.icon AS lastIcon, ms.icon AS firstIcon, t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS lastModifiedTime,
LEFT(ml.body, 384) AS lastBody, LEFT(ms.body, 384) AS firstBody,
ml.smileysEnabled AS lastSmileys, ms.smileysEnabled AS firstSmileys, t.ID_FIRST_MSG, t.ID_LAST_MSG,"
. ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= ml.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . "
FROM ({$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)
LEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
WHERE " . $where_clause . $ex_board_clause . "
AND t.ID_TOPIC = ms.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? " AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND ms.ID_MSG = t.ID_FIRST_MSG
AND ml.ID_MSG = t.ID_LAST_MSG
AND " . $user_info['query_see_board'] . "
ORDER BY " . $order_clause . " " . $limit_clause, __FILE__, __LINE__);


$topic_ids = array();
while ($row = mysql_fetch_assoc($request))
{
if ($row['ID_POLL'] > 0 && $modSettings['pollMode'] == '0')
continue;

$topic_ids[] = $row['ID_TOPIC'];

// Clip the strings first because censoring is slow :/. (for some reason?)
$row['firstBody'] = strip_tags(strtr(parse_bbc($row['firstBody'], $row['firstSmileys'], $row['ID_FIRST_MSG']), array('<br />' => '
')));
if (strlen($row['firstBody']) > 128)
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(parse_bbc($row['lastBody'], $row['lastSmileys'], $row['ID_LAST_MSG']), array('<br />' => '
')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

$row['lastSubject'] = $row['firstSubject'];
$row['lastBody'] = $row['firstBody'];

// Decide how many pages the topic should have.
$topic_length = $row['numReplies'] + 1;
if ($topic_length > $modSettings['defaultMaxMessages'])
{
$tmppages = array();
$tmpa = 1;
for ($tmpb = 0; $tmpb < $topic_length; $tmpb += $modSettings['defaultMaxMessages'])
{
$tmppages[] = '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.' . $tmpb . ';topicseen">' . $tmpa . '</a>';
$tmpa++;
}
// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = 'Ã,« ' . implode(' ', $tmppages);
// Or skip a few?
else
$pages = '« ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= '  <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all">' . $txt[190] . '</a>';
$pages .= ' »';
}
else
$pages = '';

// We need to check the topic icons exist... you can never be too sure!
if (empty($modSettings['messageIconChecks_disable']))
{
// First icon first... as you'd expect.
if (!isset($icon_sources[$row['firstIcon']]))
$icon_sources[$row['firstIcon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['firstIcon'] . '.gif') ? 'images_url' : 'default_images_url';
// Last icon... last... duh.
if (!isset($icon_sources[$row['lastIcon']]))
$icon_sources[$row['lastIcon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['lastIcon'] . '.gif') ? 'images_url' : 'default_images_url';
}

$color_start = !empty($groupcolors[$row['mems_group']]) ? $groupcolors[$row['mems_group']] : '';
$color_last = !empty($groupcolors[$row['meml_group']]) ? $groupcolors[$row['meml_group']] : '';

// And build the array.
$topics[$row['ID_TOPIC']] = array(
'id' => $row['ID_TOPIC'],
'first_post' => array(
'id' => $row['ID_FIRST_MSG'],
'member' => array(
'name' => $row['firstPosterName'],
'id' => $row['ID_FIRST_MEMBER'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],
'link' => !empty($row['ID_FIRST_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['firstPosterName'] . '">' . '<font color="' . $color_start . '">' . $row['firstPosterName'] . '</font>' . '</a>' : $row['firstPosterName']
),
'time' => timeformat($row['firstPosterTime']),
'timestamp' => forum_time(true, $row['firstPosterTime']),
'subject' => $row['firstSubject'],
'preview' => $row['firstBody'],
'icon' => $row['firstIcon'],
'icon_url' => $settings[$icon_sources[$row['firstIcon']]] . '/post/' . $row['firstIcon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen">' . $row['firstSubject'] . '</a>'
),
'last_post' => array(
'id' => $row['ID_LAST_MSG'],
'member' => array(
'name' => $row['lastPosterName'],
'id' => $row['ID_LAST_MEMBER'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'],
'link' => !empty($row['ID_LAST_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'] . '">' . '<font color="' . $color_last . '">' . $row['lastPosterName'] . '</font>' . '</a>' : $row['lastPosterName']
),
'time' => timeformat($row['lastPosterTime']),
'timestamp' => forum_time(true, $row['lastPosterTime']),
'subject' => $row['lastSubject'],
'preview' => $row['lastBody'],
'icon' => $row['lastIcon'],
'icon_url' => $settings[$icon_sources[$row['lastIcon']]] . '/post/' . $row['lastIcon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'],
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'] . '">' . $row['lastSubject'] . '</a>'
),
'new' => $row['isRead'],
'new_from' => $row['new_from'],
'new_href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['new_from'] . ';topicseen#new',
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['new_from']) . ';topicseen' . ($row['numReplies'] == 0 ? '' : 'new'),
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['new_from']) . ';topicseen#msg' . $row['new_from'] . '">' . $row['firstSubject'] . '</a>',
'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['isSticky']),
'is_locked' => !empty($row['locked']),
'is_poll' => $modSettings['pollMode'] == '1' && $row['ID_POLL'] > 0,
'is_hot' => $row['numReplies'] >= $modSettings['hotTopicPosts'],
'is_very_hot' => $row['numReplies'] >= $modSettings['hotTopicVeryPosts'],
'is_posted_in' => false,
'icon' => $row['firstIcon'],
'icon_url' => $settings[$icon_sources[$row['firstIcon']]] . '/post/' . $row['firstIcon'] . '.gif',
'subject' => $row['firstSubject'],
'pages' => $pages,
'replies' => $row['numReplies'],
'views' => $row['numViews'],
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bname'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bname'] . '</a>'
)
);

determineTopicClass($topics[$row['ID_TOPIC']]);
}
mysql_free_result($request);

if (!empty($modSettings['enableParticipation']) && !empty($topic_ids))
{
$result = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}messages
WHERE ID_TOPIC IN (" . implode(', ', $topic_ids) . ")
AND ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
if (empty($topics[$row['ID_TOPIC']]['is_posted_in']))
{
$topics[$row['ID_TOPIC']]['is_posted_in'] = true;
$topics[$row['ID_TOPIC']]['class'] = 'my_' . $topics[$row['ID_TOPIC']]['class'];
}
}
mysql_free_result($result);
}

}

if (!empty($topics))
    {
    echo '
        <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;margin:0px;"' : 'style="margin:0px;"', '>
            <table border="0" width="100%" cellspacing="1" cellpadding="1" class="bordercolor">
                <tr>';

    echo '
                    <td class="titlebg" colspan="7">', $heading, '</td>';
    echo '
                </tr>';

    echo '
<tr class="titlebg">
<td width="10%" colspan="2"> </td>
<td>', $txt[70], '
</td><td width="14%">', $txt[109], '
</td><td width="4%" align="center">', $txt[110], '
</td><td width="4%" align="center">', $txt[301], '
</td><td width="24%">', $txt[111], '
</td>
</tr>';

foreach ($topics as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));

echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="6%">
<img src="' . $settings['images_url'] . '/topic/' . $topic['class'] . '.gif" alt="" />
</td><td class="windowbg2" valign="middle" align="center" width="4%">
<img src="' . $topic['first_post']['icon_url'] . '" alt="" align="middle" />
</td><td class="windowbg' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '' , '" width="48%" valign="middle">' , $topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' : '' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'];
if ($topic['new'] == 0)
{
echo '
';
}
echo '
<span class="smalltext">', $topic['pages'], '<br>', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>
<td class="windowbg2" valign="middle" width="14%">
', $topic['first_post']['member']['link'], '</td>
<td class="windowbg" valign="middle" width="4%" align="center">
', $topic['replies'], '</td>
<td class="windowbg" valign="middle" width="4%" align="center">
', $topic['views'], '</td>
<td class="windowbg2" valign="middle" width="22%">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
<span class="smalltext">
', $topic['last_post']['time'], '<br />
', $txt[525], ' ', $topic['last_post']['member']['link'], '
</span>
</td>
</tr>';
}

    echo '</table></div>';

    }
else
    echo '<b><u>'.$heading.'<br><br>No Topics Match Search Criteria</u></b>';

alp

Ãœyelerin Profilinde mesaj


üyenin Profil kısmında günün belirli zamanları ile günaydın [üye adı ]iyi akşamlar [üye adı ]i gibi çıkacak

TPortalBlocks.template.php de

bul
// Tportal userbox
function TPortal_userbox()
{
          global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

        echo'<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
        echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

        if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
                echo $context['user']['avatar']['image'] . '<br />';

        // If the user is logged in, display stuff like their name, new messages, etc.
        if ($context['user']['is_logged'])
        {

                echo '<span class="normaltext">
                                                        ', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';

                // Only tell them about their messages if they can read their messages!
                if ($context['allow_pm']){
                        echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';

                }
                // Are there any members waiting for approval?
                if (!empty($context['unapproved_members']))
                        echo '<br />'.$bullet.'<a href="', $scripturl, '?action=regcenter">'.$txt['tp_unapproved_members'].'<b> '. $context['unapproved_members']  . '</b></a>';

                if(isset($context['TPortal']['userbox']['unread'])){
                      echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
                               <br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
                               <br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
               }

                // Is the forum in maintenance mode?
                if ($context['in_maintenance'] && $context['user']['is_admin'])
                        echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';
                // Show the total time logged in?
                if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
                {
                        echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';

                         echo '<br />'.$context['user']['total_time_logged_in']['days'] . 'd ';
                         echo $context['user']['total_time_logged_in']['hours'] . 'h ';
                         echo $context['user']['total_time_logged_in']['minutes'] .'m';
                }
               if(isset($context['TPortal']['userbox']['time'])){
                     echo '<br />'.$bullet. $context['current_time'];
               }

// module links - do not show if none
if($context['TPortal']['show_download']=='1')
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet5.' <a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
}
// admin parts etc.
             if(!isset($context['TPortal']['can_submit_article']))
                  $context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks')))
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpoptions.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-tools'].'</b></p>';
              // can we submit an article?
              if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
                       echo $bullet4.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';

// upload a file?
              if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
                       echo $bullet4.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';

// tpadmin checks
if (allowedTo('tp_settings'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '<br />'.$bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}

               echo '</div>';
        }
        // Otherwise they're a guest - so politely ask them to register or login.
        else
        {
                echo '
                                                        ', $txt['welcome_guest'], '<br />
                                                        ', $context['current_time'], '<br />

                                                        <form action="', $scripturl, '?action=login2" method="post" >
                                                                <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                                                                <select name="cookielength">
                                                                        <option value="60">', $txt['smf53'], '</option>
                                                                        <option value="1440">', $txt['smf47'], '</option>
                                                                        <option value="10080">', $txt['smf48'], '</option>
                                                                        <option value="302400">', $txt['smf49'], '</option>
                                                                        <option value="-1" selected="selected">', $txt['smf50'], '</option>
                                                                </select>
                                                                <input type="submit" value="', $txt[34], '" /><br />
                                                                ', $txt['smf52'], '
                                                        </form>';
// module links
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet2.'<a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
        }
echo '<br /></td></tr></table>';

}

DeÄŸiÅŸtir
// Tportal userbox
function TPortal_userbox()
{
          global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

        echo'<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
        echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

        if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
                echo $context['user']['avatar']['image'] . '<br />';

        // If the user is logged in, display stuff like their name, new messages, etc.
        if ($context['user']['is_logged'])
        {

                echo '<span class="normaltext">
<SCRIPT LANGUAGE="JavaScript">

<!--Begin

datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour > 18) display = "Evening";
else if (thehour >12) display = "Afternoon";
else display = "Morning";
var greeting = ("Good " + display + "!");
document.write(greeting);

//  End -->

</script> <br> <b>', $context['user']['name'], '</b></span>';

                // Only tell them about their messages if they can read their messages!
                if ($context['allow_pm']){
                        echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';

                }
                // Are there any members waiting for approval?
                if (!empty($context['unapproved_members']))
                        echo '<br />'.$bullet.'<a href="', $scripturl, '?action=regcenter">'.$txt['tp_unapproved_members'].'<b> '. $context['unapproved_members']  . '</b></a>';

                if(isset($context['TPortal']['userbox']['unread'])){
                      echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
                               <br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
                               <br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
               }

                // Is the forum in maintenance mode?
                if ($context['in_maintenance'] && $context['user']['is_admin'])
                        echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';
                // Show the total time logged in?
                if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
                {
                        echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';

                         echo '<br />'.$context['user']['total_time_logged_in']['days'] . 'd ';
                         echo $context['user']['total_time_logged_in']['hours'] . 'h ';
                         echo $context['user']['total_time_logged_in']['minutes'] .'m';
                }
               if(isset($context['TPortal']['userbox']['time'])){
                     echo '<br />'.$bullet. $context['current_time'];
               }

// module links - do not show if none
if($context['TPortal']['show_download']=='1')
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet5.' <a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
}
// admin parts etc.
             if(!isset($context['TPortal']['can_submit_article']))
                  $context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks')))
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpoptions.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-tools'].'</b></p>';
              // can we submit an article?
              if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
                       echo $bullet4.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';

// upload a file?
              if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
                       echo $bullet4.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';

// tpadmin checks
if (allowedTo('tp_settings'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '<br />'.$bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}

               echo '</div>';
        }
        // Otherwise they're a guest - so politely ask them to register or login.
        else
        {
                echo '
                                                        ', $txt['welcome_guest'], '<br />
                                                        ', $context['current_time'], '<br />

                                                        <form action="', $scripturl, '?action=login2" method="post" >
                                                                <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                                                                <select name="cookielength">
                                                                        <option value="60">', $txt['smf53'], '</option>
                                                                        <option value="1440">', $txt['smf47'], '</option>
                                                                        <option value="10080">', $txt['smf48'], '</option>
                                                                        <option value="302400">', $txt['smf49'], '</option>
                                                                        <option value="-1" selected="selected">', $txt['smf50'], '</option>
                                                                </select>
                                                                <input type="submit" value="', $txt[34], '" /><br />
                                                                ', $txt['smf52'], '
                                                        </form>';
// module links
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
      <b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet2.'<a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
        }
echo '<br /></td></tr></table>';

}



if (thehour > 18) display = "Evening";
else if (thehour >12) display = "Afternoon";
else display = "Morning";
var greeting = ("Good " + display + "!");
document.write(greeting);

koyu siyah ile yazılı olan yerleri siz değiştirin

alp

    
md5 block

bu blok herhangi br kelime yada şifre ekliyorsunuz gönder butonuna tıkladığınızda , girmiş olduğunuz karakterleri md5 e çevirip geri veriyor olay bu ve md5 de tahmininiz üzere bir şifreleme olayı oluyor

php box oluştur içine kopyala
echo ' <center>';

$sifre = strip_tags($_POST['sifre']);
$sifrele = md5($sifre);

if (empty($sifre)) {
echo '
md5 e çevirmek istediğiniz karakterleri giriniz<br><br>
<form method="POST" action="">
<p><input type="text" name="sifre" size="56"><br>
<input type="submit" value="Gönder" name="submit"></p>
</form>';
}
else{
echo ' md5 e çevirmek istediğiniz sifreniz <b><font size="4" color="#FF0000">'.$sifre.'</font></b><br>';
echo '<br> md5 e çevilirmiş hali : <br><b><font size="4" color="#FF0000">'.$sifrele.'</font></b>';
echo '
<br><br>Tekrar Çevir <br>
<form method="POST" action="">
<p><input type="text" name="sifre" size="56"><br>
<input type="submit" value="Gönder" name="submit"></p>
</form>';
}

alp

Günlük Sayac
Daily Counter (tiny portal bloc)
bu bloc sitenizde günlük sayaç imkanı verir

php box oluştur içine kopyalayın
// Daily Counter Script
// September 4, 2007
// Tim Antley - www.bayoumx.com

// Stores the day of week and hit count in a file.
// If current day is same as file's day-stamp, counter is incremented by one.
// If day is different, counter resets to 1.

// Specify 'silent' in URL will suppress output after incrementing count.
// Place a question mark between script name; ie. daily_counter.php?silent

// There is no error checking for the file.

$counter_file = 'daily_counter.csv'; // can use your own filename here.

// Should not have to edit anything below this line.

$today = getdate(); // Array for today's information

$handle = @fopen($counter_file, "r"); // Read-only access

$data = @fgetcsv($handle, 1000, ','); // Reads file comma-separated values & places into array $data.

@fclose($handle);

$counter = $data[1];

if($data[0]==$today['mday']) // Check file's day-stamp against current day.
{
$counter++;
}
else
{
$counter=1;
}

$output = $today['mday'].', '.$counter; // Format output into comma-separated values for file.

$handle = @fopen($counter_file, "w");

@fwrite($handle, $output);

@fclose($handle);

if(!isset($_GET['silent'])) // Display output unless 'silent' appears in URL.
{
echo $counter;
}

alp

#89
Accordion Style Menu Block  (deÄŸiÅŸik menuler)
bunu uyguladığınızda menuleriniz daha değişik bir stilde oluşacak


ana dizine atın (index.php olduğu yere)
http://rapidshare.com/files/65979139/mootools-accordion.js

demo: http://test.gforumx.com/smf1/
Accordion Menu Test ve Mini-User CP Accordion Test bunlara bakın bunun gibi olacak menuleriniz

Themes/<kendi teman>/index.template.php
bul

</head>

önüne ekle

<script type="text/javascript" src="mootools-accordion.js"></script>

<script type="text/javascript">
window.onload = function() {
var accordion = new Accordion(\'h3.atStart\', \'div.atStart\', {
opacity: false,
onActive: function(toggler, element){
toggler.setStyle(\'color\', \'#ff3300\');
},

onBackground: function(toggler, element){
toggler.setStyle(\'color\', \'#222\');
}
}, $(\'accordion\'));

}
</script>


Themes/senin teman/style.css

en baÅŸa ekle
/* Accordion Style Menu Block */
.toggler {
color: #222;
margin: 0;
padding: 2px 5px;
background: #eee;
border-bottom: 1px solid #ddd;
border-right: 1px solid #ddd;
border-top: 1px solid #f5f5f5;
border-left: 1px solid #f5f5f5;
font-size: 11px;
font-weight: normal;
font-family: 'Andale Mono', sans-serif;
}

.element {

}

.element p {
margin: 0;
padding: 4px;
}

.float-right {
padding:10px 20px;
float:right;
}

blockquote {
padding:5px 0 5px 30px;
}

/* END! Accordion Style Menu Block */


script box oluştur içine kopyala
<div class="accordion">
<h3 class="toggler atStart">Item 1</h3>
<div class="element atStart">
Description 1
</div>
</div>


kendinize göre editlemeyi unutmayın
<h3 class="toggler atStart">Test 1</h3>
<div class="element atStart">
This is a Test 1, if you want to know why, Don't ask me, This is not my fault, Hey after all this Is a test! :P
</div>


ana dizine atın
http://rapidshare.com/files/65979139/mootools-accordion.js

demo: http://test.gforumx.com/smf1/
Accordion Menu Test ve Mini-User CP Accordion Test bunlara bakın bunun gibi olacak menuleriniz