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

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 05:44:49 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 59
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 48
  • Total: 49
  • @rjen

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

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pascal37

yaw dost siteler için yukarıya doğru kayan text olarak site sismlerini koymak istiyorum yardımm!

bbTURK

<marquee behavior="scroll" direction="up" width="100%" height="50" scrollamount="2" scrolldelay="0" class="style2 style4" onmouseover="this.stop()" onmouseout="this.start()">
                    <a href="http://www.aksav.org.tr/tr/242_1.htm">Festival , Türk Sineması'nın en ünlü isimlerinin geçidine sahne olacak. </a><br>
                    <a href="http://www.aksav.org.tr/tr/242_2.htm">Dev Bir Ä°sim Daha Ağırlanacak: CHRISTOPHER LAMBERT </a>

                    <a href="http://www.aksav.org.tr/tr/242_3.htm">Shekhar Kapur ve Oscar Ödüllü ünlü oyuncu Meryl Streep'in oyuncu kızı Mamie Gummer Antalya'da... </a></marquee>

altınportakalın sitesinden aldım. istediğin site isimlerini adreslerini ekle

pascal37

bunu kurdum fakat linkleri birer satır arayla göstermek istiyorum. bu modulde ise yanyana yazıyor

bbTURK

marquee behavior="scroll" direction="up" width="100%" height="50" scrollamount="2" scrolldelay="0" class="style2 style4" onmouseover="this.stop()" onmouseout="this.start()">
                    <a href="http://www.aksav.org.tr/tr/242_1.htm">Festival , Türk Sineması'nın en ünlü isimlerinin geçidine sahne olacak. </a><br><br>
                    <a href="http://www.aksav.org.tr/tr/242_2.htm">Dev Bir Ä°sim Daha Ağırlanacak: CHRISTOPHER LAMBERT </a><br><br>

                    <a href="http://www.aksav.org.tr/tr/242_3.htm">Shekhar Kapur ve Oscar Ödüllü ünlü oyuncu Meryl Streep'in oyuncu kızı Mamie Gummer Antalya'da... </a></marquee>


bunudene her link arasına <br><br> yazdım.

pascal37

teşekkür ederim oldu.

peki bu blok çok küçük gözüküyor bunu nasıl biraz uzatabilirim aşağıya doğru?

bbTURK

<table height="120" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><marquee behavior="scroll" direction="up" width="100%" height="50" scrollamount="2" scrolldelay="0" class="style2 style4" onmouseover="this.stop()" onmouseout="this.start()">
                    <a href="http://www.aksav.org.tr/tr/242_1.htm">Festival , Türk Sineması'nın en ünlü isimlerinin geçidine sahne olacak. </a><br><br>
                    <a href="http://www.aksav.org.tr/tr/242_2.htm">Dev Bir Ä°sim Daha Ağırlanacak: CHRISTOPHER LAMBERT </a><br><br>

                    <a href="http://www.aksav.org.tr/tr/242_3.htm">Shekhar Kapur ve Oscar Ödüllü ünlü oyuncu Meryl Streep'in oyuncu kızı Mamie Gummer Antalya'da... </a></marquee></td>
  </tr>
</table>


height kısmını isterdiğin yüksekliğe göre değiştir.

alp

#76
php bloc da yapılacak


Günün en aktif üyeleri

global $db_prefix, $scripturl, $memberContext, $txt, $modSettings;
$maxlength=20;

// $starttime = strtotime('24 hours ago'); //posters laatste 24 uur
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y')); //posters vandaag
$list_count = 5;

$poster = array();

$request = db_query("
SELECT  m.ID_MEMBER, COUNT(m.ID_MEMBER) as postCount
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
WHERE m.posterTime > " . $starttime . "
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? " AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
GROUP BY m.ID_MEMBER
ORDER BY postCount DESC LIMIT " . $list_count, __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($request))
{
    loadMemberData(array($row['ID_MEMBER']));
    loadMemberContext($row['ID_MEMBER']);
$membername = (strlen($memberContext[$row['ID_MEMBER']]['name']) > $maxlength) ? substr($memberContext[$row['ID_MEMBER']]['name'],0,$maxlength) : $memberContext[$row['ID_MEMBER']]['name'];
$poster[$row['ID_MEMBER']] = array (
  'id' => $row['ID_MEMBER'],
  'count' => $row['postCount'],
  'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $memberContext[$row['ID_MEMBER']]['name'] . '">' . '<font color="' . $memberContext[$row['ID_MEMBER']]['group_color'] . '">' . $membername . '</font>' . '</a>' );
}
mysql_free_result($request);

echo '<table width=100%>';
foreach($poster as $top_user)
{
echo '<tr>
      <td align="left" width=75%>' . $top_user['link'] . '</td>
      <td align="left">| '. $top_user['count'] . '</td>
      </tr>';
}
echo '</table>';



********************
En aktif  üyeler2
$numberofposters = 10; // You can change this to however many you want


require_once "SSI.php";
$top_posters = ssi_topPoster($numberofposters, "return");

foreach ($top_posters as $poster)
{
  echo

$poster['link'] , ' (', $poster['posts'] , ')<br />';
}


**********
sitede kullandığım( www.sanalworld.net ) aktif üyeler

global $db_prefix, $scripturl, $modSettings;

$memberstoshow = 10;
$matchperiod = false;
$countmodsandadmins = true; // not yet implemented
// Change this to the time you want the contest to start [http://www.onlineconversion.com/unix_time.htm]
$starttime = time() - 604800; // Last week posters
$endtime = time();  // Change this to the time you want the contest to end
$where_period = '';

if (!empty($modSettings['MemberColorLink'])) // check if MemberColorLink mod is installed and enabled         
{
    if ($matchperiod) // select only posts matching period
        $where_period = "AND m.posterTime > $starttime AND m.posterTime < $endtime";
    $query = db_query(
        "SELECT m.realName, m.ID_MEMBER, mg.onlineColor, m.posts
         FROM {$db_prefix}members AS m
         LEFT JOIN {$db_prefix}membergroups AS mg ON (m.ID_GROUP = mg.ID_GROUP AND m.ID_GROUP)
         $where_period
         ORDER BY m.posts DESC
         LIMIT 0,$memberstoshow", __FILE__, __LINE__);
}
else
{
    if ($matchperiod) // select only posts matching period
        $where_period = "WHERE posterTime > $starttime AND posterTime < $endtime";
    $query = db_query(
        "SELECT realName, ID_MEMBER, posts
         FROM {$db_prefix}members
         $where_period
         ORDER BY posts DESC
         LIMIT 0,$memberstoshow", __FILE__, __LINE__);
}

$firstrecord = true;
while ($row = mysql_fetch_assoc($query))
{
    if ($firstrecord)
    {
        $biggest = $row['posts'];
        $firstrecord = false;
    }
    $bar_length = intval(($row['posts']/$biggest) * 40);

    if(isset($row['onlineColor']))
        $style = 'color: '. $row['onlineColor'];
    else
        $style = '';

    echo '
    <table width="100%" border="0">
    <tr>
    <td><div class="smalltext"><a style="' . $style . '" href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a> (' . $row['posts'] . ')</div></td>
    <td><div align="right"><img src="' . $settings['images_url'] . '/bar.gif" width="' . $bar_length . '" height="10" title="' . $bar_length*2.5 . '%" alt="" /></div></td>
    </tr>
    </table>
    ';
}

alp

Karma Blocks Package v0

ilk önce aşağıdaki paketi paketlerden yükleyin (1.1.3 ve 1.1.4 e uyumlu hale getirildi)
http://rapidshare.com/files/65635651/Karma_Blocks_Package_v0.4.zip

paketi yükledikten sonra


Themes/default/languages/Modifications.turkish.php de
bul
?>
üstüne ekle

// Karma Blocks Package v0.4
$txt['karma_applauds'] = "Applauds";
$txt['karma_smites'] = "Smites";
$txt['karma_applaud_color'] = "green";
$txt['karma_smite_color'] = "red"; //html can be used (red - #ff0000)


daha sonra php box oluÅŸurup
Karma Log,Lowest Karma (en düşük karma sahipleri),
Top Karma(en yüksek karma sahipleri)

birini php box a yapıştırın

demo:  www.sanalworld.net Top 10 Karma ya bakınız


Karma Log
ssi_karmalog();

Lowest Karma
ssi_lowestkarma();

Top Karma

ssi_topkarma();


ssi_topkarma('10');
şeklinde yaparsanız en yüksek 10 karma sahibini gösterir

alp

Linkit - A member submittable links block

bu blokta üyeler favori linklerini ekleyebilme alanı veriyor.sadece linki ekleyen üye görebilir.
ekran görüntüsü:


php box oluşturun kodu içine kopyalayın
//////////////////////////////////////////////
// Linkit Version 1.7.1
// Developed by Thurnok
// thurnok -AT- tinyport .DOT. net
// Complete Computer Services
// August 22, 2006
//
// Last update May 18, 2007
//
// 1.7.1:
// - added explicit sort by ID when $li_sort = 0 so that if you edit your database table, changing ID numbers,
// you can sort by the ID instead of the order data was entered into the table
//
// This is a php block and/or php Article snippet.  It works in any block
// position (left/right/center/frontpage/article).
// It allows for multiple columns of links via a table.
//
// Linkit allows you to give your users the ability to add links to your
// site in a Tiny Portal block that you designate.  Your Admins can
// edit/remove entries, and you determine what 'groups' can post links!
// You can also give groups abilities to edit or delete links as well.
// Additionally, you can allow members to edit/delete their own submissions.
//
// This script will create a table for the links using your current
// TP table prefix followed by linkit (ex: smf_tp_linkit) and using your
// current database credential information.
// NOTE: Your database user/permissions used for SMF must allow you to
// create a table or you will never be able to store the links.  You
// can create the table manually if necessary.
//
//////////////////////////////////////////////

/*
****************************************
****************************************
*** !! User Configuration Section !! ***
****************************************
****************************************
*/
// *****   SECURITY OPTIONS   *****
// who has addlink access? -  format is array('<groupnum>', '<groupnum>', ...)
// Example: $li_addlink_groups = array('14');
$li_addlink_groups = array('');
// who can edit links? - same format as addlink
$li_editlink_groups = array('');
// who can delete links? - same format as addlink
$li_dellink_groups = array('');
// group that you want members denied usage even if in a group above
$li_deny_groups = array('');
// members you want to deny usage even if allowed above
$li_deny_members = array('');
// allow members to edit/delete their own links? (0 = No, 1 = Yes)
$li_edit_own = 0;
$li_del_own = 0;

// *****   LAYOUT OPTIONS   *****
// size of the edit boxes (<input>)
$li_editbox_size = 15;
// max size of the input for the URL Name (30 or less is best)
$li_urlname_maxsize = 30;
// sorting option - 0 = chronological, 1 = alphabetic, 2 = submitter
$li_sort = 0;
// sorting direction - 0 = ascending, 1 = descending
$li_sort_direction = 0;
// number of columns of links to display
$li_columns = 1;
// want to add your own styles to the rows/columns?  change the tag info here
$li_start_row = '<tr>';
$li_start_col = '<td>';
// approximate number of lines displayed in block 0 = unlimited
$li_blocklines = 30;

// you can make the columns use one of TinyPortal's text classes ("normaltext" or "smalltext") or none.
// this will add to the $li_start_col variable the classtype you choose (0 = no class, 1 = smalltext, 2 = normaltext)
// if you are making your own text styles in the $li_start_col variable above, you should set $li_useclass = 0
$li_useclass = 1;

// make it easier to use non-blanking spaces (TP blocks/articles will remove them from your code the next time you edit the same block/article)
// using a variable instead, will let you keep that code intact.
$nbsp = '&'.'nbsp;';

// *****   OTHER OPTIONS   *****
// you can set the tablename to other than linkit if you like
$li_tablename = "linkit";
// and the title displayed
$li_title = "Link Ekleme Alanı!";
// add some descriptive text here if you like to display under title
$li_desc = "Favori Linklerinizi Ekleyin ".$nbsp."Eklediğiniz Linkler Sadece Siz Görebilirsiniz.";
// Print our title - or comment the line to not display a title
if (!empty($li_title))
echo '<center><b>' . $li_title . '</b></center><br />';
if (!empty($li_desc))
echo '<font size=1>' . $li_desc . '</font><p />';
/*
****************************************
****************************************
*/

//////////////////////////////////////////////
//
// The rest of this you should leave as is
// unless you are overly industrious :)
//
//////////////////////////////////////////////
// globals for database vars
global $db_prefix, $tp_prefix;
// globals for user information
global $context, $user_info, $ID_MEMBER;

// fix for TP 0.8.6 and lower
if (empty($tp_prefix)){
$tp_prefix = $settings['tp_prefix'];
}

switch ($li_useclass){
case 1:
$li_classtxt = ' class="smalltext" ';
$li_start_col = substr($li_start_col, 0, -1) . $li_classtxt . '>';
break;
case 2:
$li_classtxt = ' class="normaltext" ';
$li_start_col = substr($li_start_col, 0, -1) . $li_classtxt . '>';
break;
default:
$li_classtxt = '';
break;
}

// get our script url (including parameters - like ?page=6)
$myself = $_SERVER['REQUEST_URL'];

// put the SMF table prefix in front of your tablename from above
$li_tablename = $tp_prefix . $li_tablename;
// check if user is in a group that is allowed to add links
$li_add_auth = array_intersect($li_addlink_groups, $user_info['groups']);
// check if user is in a group that is allowed to edit links
$li_edit_auth = array_intersect($li_editlink_groups, $user_info['groups']);
// check if user is in a group that is allowed to delete links
$li_del_auth = array_intersect($li_dellink_groups, $user_info['groups']);
// deny if in one of the deny groups or members
if (array_intersect($li_deny_groups, $user_info['groups']) || @in_array($ID_MEMBER, $li_deny_members)){
$li_add_auth = false;
$li_edit_auth = false;
$li_del_auth = false;
$li_edit_own = false;
$li_del_own = false;
}
// Admins are always allowed to add/edit/delete links
if ($context['user']['is_admin']){
$li_add_auth = 1;
$li_edit_auth = 1;
$li_del_auth = 1;
}

// set up all our functions ahead of time
// function to create table if not already there
function LinkitCreateTable($li_tablename) {
// set up the query that will create the table appropriately
$dbquery = "CREATE table $li_tablename (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
url_name TEXT, url TEXT, submitted_by TEXT);";
if (!mysql_query($dbquery)) {
die("Query Failed!  Table NOT Created!<br />\n");
}
}

// function to add links to the table
function LinkitAddLink($li_tablename, $li_urlname, $li_urllink, $li_submittedby) {
if ( (strtolower(substr($li_urllink, 0, 7)) != "http://") && (strtolower(substr($li_urllink, 0, 6)) != "ftp://") ){
$li_urllink = "http://" . $li_urllink;
}
// first see if this would be a duplicate, if so, do not post it
$dbquery = "SELECT * FROM $li_tablename
WHERE url LIKE '" . $li_urllink . "'";
$dbresult = mysql_query($dbquery);
if ($row = mysql_fetch_assoc($dbresult)){
// if a row is found, then there's already this link in table, don't dupe it
return;
}
$dbquery = "INSERT INTO $li_tablename VALUES (0, \"$li_urlname\", \"$li_urllink\", \"$li_submittedby\");";
if (!mysql_query($dbquery)) {
die("Query Failed!  Link NOT Inserted into database!<br />\n");
}
}

// function to edit links in the table
function LinkitEditLink($li_tablename, $li_urlname, $li_urllink, $li_id) {
// make sure only one ID is actually in there
if ((string)(int)$li_id === (string)$li_id){
// change only values that were there in form
$dbquery = "UPDATE $li_tablename SET ";
if ($li_urlname){
// if there was a url name provided, add it to UPDATE query
$dbquery .= "url_name=\"$li_urlname\" ";
}
if ($li_urllink){
// add HTTP:// if necessary at front of link to prevent BASE URL applying in front of link provided
if ( (strtolower(substr($li_urllink, 0, 7)) != "http://") && (strtolower(substr($li_urllink, 0, 6)) != "ftp://") ){
$li_urllink = "http://" . $li_urllink;
}
// since url link was provided, add it to UPDATE query
if ($li_urlname){
// since we already added url name, put comma and space before the url link update part
$dbquery .= ", url=\"$li_urllink\" ";
} else {
// didn't have an url name added, so no comma needed
$dbquery .= "url=\"$li_urllink\" ";
}
}
// add rest of query
$dbquery .= "WHERE id=\"$li_id\";";
if (!mysql_query($dbquery)) {
die("Query Failed!  Link NOT modified in database!<br />\n");
}
}
}

// function to delete links from the table
function LinkitDelLink($li_tablename, $li_id) {
// delete link(s) in $li_id
$dbquery = "DELETE FROM $li_tablename WHERE id in ( " . $li_id . ")";
if (!mysql_query($dbquery)) {
die("Query Failed!  Link NOT Deleted from database!<br />\n");
}
}

///////////  MAIN CODE HERE  ////////////
// convert $_POST vars to prevent undefined index errors
$li_add = empty($_POST['li_add']) ? 0 : 1;
$li_edit = empty($_POST['li_edit']) ? 0 : 1;
$li_del = empty($_POST['li_del']) ? 0 : 1;
$li_urlname = empty($_POST['li_urlname']) ? '' : $_POST['li_urlname'];
$li_urllink = empty($_POST['li_urllink']) ? '' : $_POST['li_urllink'];
$li_checklist = empty($_POST['li_checklist']) ? '' : $_POST['li_checklist'];

// if someone just added a link, post it to the database
if ($li_add){
$li_urlname = trim($li_urlname);
$li_urllink = trim($li_urllink);
if ($li_urlname && $li_urllink){
LinkitAddLink($li_tablename, $li_urlname, $li_urllink, $user_info['username']);
}
}

// if someone just edited a link, modify it in database
if ($li_edit && $li_checklist){
$li_urlname = trim($li_urlname);
$li_urllink = trim($li_urllink);
if ($li_urlname || $li_urllink){
LinkitEditLink($li_tablename, $li_urlname, $li_urllink, $li_checklist);
}
}

// if someone just deleted a link, remove it from database
if ($li_del && $li_checklist){
LinkitDelLink($li_tablename, $li_checklist);
}

////////////  MAIN DISPLAY CODE HERE  ///////////////

// set query to select all data in appropriate order
switch ($li_sort){
// alphabetical order
case 1:
$dbquery = $li_sort_direction ? "SELECT * from $li_tablename ORDER BY url_name DESC" : "SELECT * from $li_tablename ORDER BY url_name";
break;
// submitted by order
case 2:
$dbquery = $li_sort_direction ? "SELECT * from $li_tablename ORDER BY submitted_by DESC" : "SELECT * from $li_tablename ORDER BY submitted_by";
break;
// chronological order
default:
$dbquery = $li_sort_direction ? "SELECT * from $li_tablename ORDER BY id DESC" : "SELECT * from $li_tablename ORDER BY id ASC";
}

$dbresult = mysql_query($dbquery);
if (!$dbresult){
if (mysql_errno() == 1146){
// table doesn't exist, create it!
LinkitCreateTable($li_tablename);
// get our result again
$dbresult = mysql_query($dbquery);
if (!$dbresult) die("Unexpected error: " . mysql_error());
} else {
die("Unexpected error: " . mysql_error());
}
}

// javascript validations
echo '
<script type="text/javascript">
<!--
function addCheck(){
urlname = document.li_form.li_urlname;
urllink = document.li_form.li_urllink;
if (urlname.value.replace(/ /g,"") == "" || urllink.value.replace(/ /g,"") == ""){
alert("Missing information - Must supply both URL Name and URL Link!");
return false;
}
}

function editCheck(){
retval = false;
checklist = "";
numchecked = 0;
urlname = document.li_form.li_urlname;
urllink = document.li_form.li_urllink;
checkboxes = document.li_form.li_checkbox;
if (urlname.value.replace(/ /g,"") != "" || urllink.value.replace(/ /g,"") != ""){
for (i=0; i<checkboxes.length; i++){
if (checkboxes[i].checked == true){
checklist = checkboxes[i].value;
numchecked++;
}
}
switch (numchecked){
case 0:
alert("You must select a link to edit first!");
break;
case 1:
document.li_form.li_checklist.value = checklist;
retval = true;
break;
default:
alert("You can only edit one link at a time!");
break;
}
} else {
alert("No information entered!");
}
return retval;
}

function delCheck(){
retval = false;
checklist = "";
checkboxes = document.li_form.li_checkbox;
for (i=0; i<checkboxes.length; i++){
if (checkboxes[i].checked == true){
checklist += (checklist != "" ? "," : "") + checkboxes[i].value;
}
}
document.li_form.li_checklist.value = checklist;
if (checklist != ""){
retval = true;
}
if (!retval){
alert("Select a link first!");
}
return retval;
}

function urlTest(){
urllink = document.li_form.li_urllink.value;
if (urllink.replace(/ /g,"") != ""){
if (urllink.toLowerCase().substr(0, 7) != "http://" && urllink.toLowerCase().substr(0, 8) != "https://"){
urllink = "http://" + urllink;
}
// display a new window and open url in it
window.open(urllink, "TestUrl", "width=600px, height=400px, resizable, scrollbars", true);
} else {
alert("Need a link to test!");
}
}

// -->
</script>
';

// if we set number of lines, make that setting here
if (!empty($li_blocklines)){
// pad according to class chosen
switch ($li_useclass){
case 1:
// smalltext class - padding 8 for IE, and 5 for all other browsers
$li_blocklines += empty($context['browser']['is_ie']) ? 5 : 8;
break;
case 2:
// normaltext class - padding 14 for IE, and 9 for all other browsers
$li_blocklines += empty($context['browser']['is_ie']) ? 9 : 14;
break;
default:
// no class - padding 10 for IE, 9 for all other browsers
$li_blocklines += empty($context['browser']['is_ie']) ? 9 : 10;
}
echo '
<div style="width: 100%; overflow: auto; height: '.$li_blocklines.'em;">
';
}

// start our form
if (empty($context['browser']['is_ie'])){
echo "\n" . '<form name="li_form" action="' . $myself . '" method=post'.$li_classtxt.'>' . "\n";
} else {
echo "\n" . '<form name="li_form" action="' . $myself . '" method=post>' . "\n";
}

// preset our current column to first column
$li_current_column = 1;

// start our table and first row
echo '<center><table width="90%" border="0"><tr>' . "\n";

// gets set to 1 if there is at least one radio button made next to a link
$li_link_owner = 0;

// parse our data out
while ($row = mysql_fetch_assoc($dbresult)){
// new row?
if ($li_current_column > $li_columns){
// time to end current row and start new one
$li_current_column = 1;
echo "</tr>\n" . $li_start_row . "\n";
}
// each link has a column to start with
echo ' ' . $li_start_col;
// if they have edit or delete privileges then display checkbox
if ($li_edit_auth || $li_del_auth){
echo '<input type=checkbox name="li_checkbox" id="li_checkbox" value="'.$row['id'].'" /> ';
} elseif (($user_info['username'] == $row['submitted_by']) && ($li_edit_own || $li_del_own)){
// if they own this link in the list, and either edit own or delete own is on, display checkbox
echo '<input type=checkbox name="li_checkbox" id="li_checkbox" value="'.$row['id'].'" /> ';
$li_link_owner = 1;
}
echo '<a href="' . $row['url'] . '" title="Submitted by ' . $row['submitted_by'] . '" target=_blank>' . $row['url_name'] . '</a></td>' . "\n";
// next column number
$li_current_column++;
}

// end our last row and our table
echo "</tr>\n</table></center>\n";

// if there are checkboxes, add the check/uncheck all
if ($li_edit_auth || $li_del_auth || ($li_link_owner && ($li_edit_own || $li_del_own))){
echo '<div'.$li_classtxt.'><input type=checkbox name="li_checkall" value="" onClick="invertAll(this, this.form, \'li_checkbox\');"> Check/Uncheck all</input></div>';
}

// if user is allowed to add/edit/delete links (or their own and one exists), display URL Name and URL Link edit boxes
if ($li_add_auth || $li_edit_auth || $li_del_auth || ($li_link_owner && ($li_edit_own || $li_del_own))){
echo '<br />
<div'.$li_classtxt.'>Link Adı</div>
<input type=text name="li_urlname" size=' . $li_editbox_size . ' maxlength=' . $li_urlname_maxsize . '><br />
<div'.$li_classtxt.'>Link:</div>
<input type=text name="li_urllink" size=' . $li_editbox_size . '><input type=button name="li_testurl" value="Test" onClick="return urlTest()"><br /><br />
';
}
// if user is allowed to add links, display Add button
if ($li_add_auth){
echo '<input type=submit name="li_add" value="Ekle" onClick="return addCheck()" />  ';
}
// if user is allowed to edit links (or their own and one exists), display edit link button
if ($li_edit_auth || ($li_link_owner && $li_edit_own)){
echo '<input type=submit name="li_edit" value="Edit" onClick="return editCheck()" />  ';
}
// if user is allowed to delete links (or their own and one exists), display delete link button
if ($li_del_auth || ($li_link_owner && $li_del_own)){
echo '<input type=submit name="li_del" value="Sil" onClick="return delCheck()" />';
}

// our hidden elements
echo '<input type=hidden name="li_checklist" value="">';

// and finally, end our form
echo '</form>';

// if we added the <div> for our blocklines, close it here
if (!empty($li_blocklines))
echo '</div>';

// free the result for good measure
mysql_free_result($dbresult);

alp

ziyaretçilerin sayfa gösterim limiti (Guest Page View Limit ()
bu blok ziyaretçilerin 3 konu ya baktıktan sonra otomatik olarak kayıt sayfasına açıyor.diğer sayfalara geçisi engelliyor.
*************
php bloc oluşturup kodu kopyalayın

//////////////////////////////////////////////
// Guest Page View Limit 1.2
//////////////////////////////////////////////
// Developed by TPH Thurnok
// TinyPortal Hosting - Your premier TP/SMF host
// http://www.tinyportalhosting.com
// November 16, 2006
//
// Last update: March 10, 2007
//    added &gpvl=exceeded to redirect so scripting can be done in registration
//    to allow detecting user got there by exceeding the page view limit
//
// This is designed for a phpblock.
// This allows you to limit the number of pages a guest can view on your site
// before being redirected to the registration page.
//
// Requirements:
// In order for this to work, you must place this in a phpblock that is displayed
// on all pages.  For any pages where this block is not displayed, that page will
// not be counted against the guest.  It is recommended you do not display a title
// or frame for the block so that it is basically invisible to the user.
//
// This script will create a table for the storage of IPs and the count of pages.
// It is a very simple IP based count.  No session info or other info is used.
// Therefore, if you set this to a very high value, and a user has a dynamic IP, you
// may be ineffective as the user may simply get a new IP the next time they visit your site.
//
//////////////////////////////////////////////

/*
****************************************
****************************************
*** !! User Configuration Section !! ***
****************************************
****************************************
*/
// Set the maximum number of pages you want to limit a normal guest to view
$gpvl_MaxPages = 3;
// Set the maximum number of pages to limit "special" guests to (usually for high limit guests)
$gpvl_MaxPagesSpecial = 1000;

// Set the IPs for "special" guests in an array - Example: array('12.1.4.70', '3.88.129.211', '42.150.220.200');
$gpvl_SpecialIPs = array();

// Set the IPs you want excluded from the limit - like google/spiders etc. in an array - same format as "special" guest array
$gpvl_ExcludeIPs = array('127.0.0.1');

// set the table name you want to use (without a prefix - prefix will be auto added)
$gpvl_table = 'guest_page_limit';
/*
****************************************
****************************************
*/

//////////////////////////////////////////////
//
// The rest of this you should leave as is
// unless you are overly industrious :)
//
//////////////////////////////////////////////
// globals for database vars
global $db_prefix, $tp_prefix;
// globals for user information
global $context, $scripturl;

// fix for TP 0.8.6 and lower
if (empty($tp_prefix)){
$tp_prefix = $settings['tp_prefix'];
}
$gpvl_table = $tp_prefix . $gpvl_table;

$myself = $_SERVER['REQUEST_URL'];
// first seperate the parameters from the URL, to avoid possible search string in the URL itself
$parms = str_replace($scripturl, "", $myself);
// then see if we are actually at the registration page (action=register)
$gpvl_at_register = stristr($parms, "action=register") ? true : false;
// or if we are at the login page (action=login)
$gpvl_at_login = stristr($parms, "action=login") ? true : false;
// or if we are at the password reminder page (action=reminder)
$gpvl_at_reminder = stristr($parms, "action=reminder") ? true : false;

// only for limiting guests, so if not a guest - get out (unless at registration/login/reminder page)
if ($context['user']['is_guest'] && !$gpvl_at_register && !$gpvl_at_login && !$gpvl_at_reminder){
// preset to max pages in case we fall thru
$gpvl_NumPages = $gpvl_MaxPages;

// what is our IP?
$gpvl_ip = empty($_SERVER['REMOTE_ADDR']) ? getenv('REMOTE_ADDR') : $_SERVER['REMOTE_ADDR'];
// if we got an IP (and it is not an excluded IP), do the work, otherwise, send them to registration
if ($gpvl_ip && strtoupper($gpvl_ip) != "NULL"){
if (in_array($gpvl_ip, $gpvl_ExcludeIPs)){
$gpvl_NumPages = 0;
} else {
// if they are a "special" guest, set their max pages to the "special" max pages setting
if (in_array($gpvl_ip, $gpvl_SpecialIPs)){
$gpvl_MaxPages = $gpvl_MaxPagesSpecial;
}
// test for table existance
$gpvl_result = @mysql_query('SELECT pageviews FROM '.$gpvl_table.' WHERE ip = "'.$gpvl_ip.'" LIMIT 1');
if (!$gpvl_result){
if (mysql_errno() == 1146){
// table doesn't exist, create it!
@mysql_query('CREATE table '.$gpvl_table.'(ip TEXT, pageviews INT UNSIGNED NOT NULL)');
$gpvl_NumPages = 1;
@mysql_query('INSERT INTO '.$gpvl_table.' VALUES ("'.$gpvl_ip.'", 1)');
} else {
die("Guest Page View Limit - Unexpected error: " . mysql_error());
}
} else {
if (mysql_num_rows($gpvl_result)){
// found this IP already in table
$row = mysql_fetch_assoc($gpvl_result);
$gpvl_NumPages = $row['pageviews'] + 1;
@mysql_query('UPDATE '.$gpvl_table.' SET pageviews = '.$gpvl_NumPages.' WHERE ip = "'.$gpvl_ip.'"');
} else {
// not in table yet, insert it
$gpvl_NumPages = 1;
@mysql_query('INSERT INTO '.$gpvl_table.' VALUES ("'.$gpvl_ip.'", 1)');
}
mysql_free_result($gpvl_result);
}
}
}

// Send to registration if they are at or above max pages
if ($gpvl_NumPages > 0 && $gpvl_NumPages >= $gpvl_MaxPages){
header("Location: ".$scripturl."?action=register&gpvl=exceeded");
}
}



$gpvl_MaxPages = 3;
3 istediÄŸiniz gibi deÄŸiÅŸtirin siz