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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 10:08:42 AM

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

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.

alqo

bbTURK tekrardan seLam.

sorum:
forum mesajları var orta blokta ordan katagori seçiyorum 5 tane  seçe  biliyorum bunları 30  40 yapa  bilirmiyiz?..

Åžindiden Yardımların için  saÄŸol?

bbTURK

forumda daha önce soruldu biraz forumu karıştır

Paragaya

ArkadaÃ...Ÿlar Php blok kodlarÃ,,±na bu kodlarÃ,,± girebilirsiniz

Bu kodlarÃ,,± kullanabilirsiniz

$top_posters = ssi_topPoster(5, 'array');

echo '
<ol>';

foreach ($top_posters as $poster)
{
loadMemberData($poster['id']);
loadMemberContext($poster['id']);

echo '
<li>
<div style="float: left; padding: 0px 5px 5px 0px;">', $memberContext[$poster['id']]['avatar']['image'], '</div>
', $poster['link'], '<br />', $poster['posts'], ' ', $txt['posts'], '
<br style="clear: left;" />
</li>';
}

echo '
</ol>';


loadMemberData() ve loadMemberContext() fonksiyonlarÃ,,± ile ayrÃ,,±ntÃ,,±lÃ,,± üye bilgilerini yükleyebilirsiniz. ÃÅ"ye bilgileri $memberContext dizisinde üyenin idsinin indexi içerisine yüklenir. Bu fonksiyonlarÃ,,± kullandÃ,,±ktan sonra aÃ...ŸaÃ,,ŸÃ,,±daki kodlarla $memberContext dizisindeki bilgileri görüntüleyebilirsiniz:

echo '<pre>';
print_r($memberContext);
echo '</pre>';


KodlarÃ,,± Yazan ---> sm.org'daki  [SiNaN] ' a teÃ...Ÿekkürler.

Paragaya

Admin Panelinden Php blok oluÃ...Ÿturup bu kodlarÃ,,± okutun :)


//  Top 10 karma

$members_result = db_query("
SELECT ID_MEMBER, realName, posts , karmaGood
FROM {$db_prefix}members
ORDER BY karmaGood DESC
LIMIT 10", __FILE__, __LINE__);
$context['repkarma'] = array();
$max_num_posts = 1;
while ($row_members = mysql_fetch_assoc($members_result))
{
$context['repkarma'][] = array(
'name' => $row_members['realName'],
'id' => $row_members['ID_MEMBER'],
'karma' => $row_members['karmaGood'],
'num_posts' => $row_members['posts'],
'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
);

if ($max_num_posts < $row_members['posts'])
$max_num_posts = $row_members['posts'];
}
mysql_free_result($members_result);




bbTURK

Paragaya çapraz gönderi yapmaz sevinirm. bi blok için ya buraya mesaj yaz yada konu aç ikisinide yapman gerekmez. bloklar için teÃ...Ÿekküler :D

Paragaya


captain1520

ArkadaÃ...Ÿlar BenÃ,,±m Ã,,±stedÃ,,±Ã,,ŸÃ,,±m anket.. forumdakÃ,,± tum anketlerÃ,,± gostedÃ,,±kten sonrada sonuçlarÃ,,± göstersÃ,,±n oyle yapamÃ,,±yormuyuz

Paragaya

Yeni bir php blok ekleyin ve içine bu kodlarÃ,,± girin.
global $context, $db_prefix, $scripturl, $txt;
   //Tag cloud from http://www.prism-perfect.net/archive/php-tag-cloud-tutorial/     
   $query = "SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
      FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l WHERE t.ID_TAG = l.ID_TAG
      GROUP BY l.ID_TAG
      ORDER BY l.ID DESC LIMIT 50";
   $result = db_query($query, __FILE__, __LINE__);
     
   // here we loop through the results and put them into a simple array:
   // $tag['thing1'] = 12;
   // $tag['thing2'] = 25;
   // etc. so we can use all the nifty array functions
   // to calculate the font-size of each tag
   $tags = array();
   $tags2 = array();
   while ($row = mysql_fetch_array($result))
   {
       $tags[$row['tag']] = $row['quantity'];
       $tags2[$row['tag']] = $row['ID_TAG'];
   }
     
   if(count($tags2) > 0)
   {
      // change these font sizes if you will
      $max_size = 250; // max font size in %
      $min_size = 100; // min font size in %
     
      // get the largest and smallest array values
      $max_qty = max(array_values($tags));
      $min_qty = min(array_values($tags));
     
      // find the range of values
      $spread = $max_qty - $min_qty;
      if (0 == $spread)
      { // we don't want to divide by zero
          $spread = 1;
      }
         
      // determine the font-size increment
      // this is the increase per tag quantity (times used)
      $step = ($max_size - $min_size)/($spread);
         
      // loop through our tag array
      $context['poptags'] = '';
      $row_count = 0;
      foreach ($tags as $key => $value)
      {
         $row_count++;
          // calculate CSS font-size
          // find the $value in excess of $min_qty
          // multiply by the font-size increment ($size)
          // and add the $min_size set above
          $size = $min_size + (($value - $min_qty) * $step);
          // uncomment if you want sizes in whole %:
          // $size = ceil($size);
     
          // you'll need to put the link destination in place of the #
          // (assuming your tag links to some sort of details page)
          $context['poptags'] .= '<a href="' . $scripturl . '?action=tags;id=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
          // perhaps adjust this title attribute for the things that are tagged
         $context['poptags'] .= ' title="'.$value.' things tagged with '.$key.'"';
         $context['poptags'] .= '>'.$key.'</a> ';
         if ($row_count > 5)
         {
            $context['poptags'] .= '<br />';
            $row_count =0;
         }
         // notice the space at the end of the link
      }
   }
         if(isset($context['poptags']))
            echo $context['poptags'];





Gurbet_42

Quote from: Paragaya on April 20, 2009, 08:59:34 AM
Yeni bir php blok ekleyin ve içine bu kodlarÃ,,± girin.
global $context, $db_prefix, $scripturl, $txt;
   //Tag cloud from http://www.prism-perfect.net/archive/php-tag-cloud-tutorial/     
   $query = "SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
      FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l WHERE t.ID_TAG = l.ID_TAG
      GROUP BY l.ID_TAG
      ORDER BY l.ID DESC LIMIT 50";
   $result = db_query($query, __FILE__, __LINE__);
     
   // here we loop through the results and put them into a simple array:
   // $tag['thing1'] = 12;
   // $tag['thing2'] = 25;
   // etc. so we can use all the nifty array functions
   // to calculate the font-size of each tag
   $tags = array();
   $tags2 = array();
   while ($row = mysql_fetch_array($result))
   {
       $tags[$row['tag']] = $row['quantity'];
       $tags2[$row['tag']] = $row['ID_TAG'];
   }
     
   if(count($tags2) > 0)
   {
      // change these font sizes if you will
      $max_size = 250; // max font size in %
      $min_size = 100; // min font size in %
     
      // get the largest and smallest array values
      $max_qty = max(array_values($tags));
      $min_qty = min(array_values($tags));
     
      // find the range of values
      $spread = $max_qty - $min_qty;
      if (0 == $spread)
      { // we don't want to divide by zero
          $spread = 1;
      }
         
      // determine the font-size increment
      // this is the increase per tag quantity (times used)
      $step = ($max_size - $min_size)/($spread);
         
      // loop through our tag array
      $context['poptags'] = '';
      $row_count = 0;
      foreach ($tags as $key => $value)
      {
         $row_count++;
          // calculate CSS font-size
          // find the $value in excess of $min_qty
          // multiply by the font-size increment ($size)
          // and add the $min_size set above
          $size = $min_size + (($value - $min_qty) * $step);
          // uncomment if you want sizes in whole %:
          // $size = ceil($size);
     
          // you'll need to put the link destination in place of the #
          // (assuming your tag links to some sort of details page)
          $context['poptags'] .= '<a href="' . $scripturl . '?action=tags;id=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
          // perhaps adjust this title attribute for the things that are tagged
         $context['poptags'] .= ' title="'.$value.' things tagged with '.$key.'"';
         $context['poptags'] .= '>'.$key.'</a> ';
         if ($row_count > 5)
         {
            $context['poptags'] .= '<br />';
            $row_count =0;
         }
         // notice the space at the end of the link
      }
   }
         if(isset($context['poptags']))
            echo $context['poptags'];






Güzel bir blok eklentisi ancak bu Ã...ŸÃ¶yle yapÃ,,±labilir mi, etiketlenen kelimeye tÃ,,±kladÃ,,±gÃ,,±mÃ,,±zda direk o kunuya gÃ,,±tse,bu haliyle etiket sayfasÃ,,±na yönleniyor.

Paragaya

O zaman o etkiket modu deistirilmesi gerekir çünkü  ssi yapÃ,,±yoruz moddan cekiyoruz tag modunda son etiketlere yönlendirdiÃ,,Ÿi için biz onu deistiremiyoruz ;)