SimplePortal

Support => International Support => Turkish (Türkçe) => Topic started by: zeminkat on March 11, 2009, 06:20:09 PM

Title: Etiketler
Post by: zeminkat on March 11, 2009, 06:20:09 PM
Merhaba,

Gelir gelmez bir soru ile çıktım karşınıza...
Dün gece itibariyle kullanmaya başladım ve php?action=tags modunu kullanmaktayım, bu sayfadaki etiketlerimi bloc olarak nasıl gösterebilirim. Aslında bunu forumun altında gösterme gibi birşey vardı ama aradım bulamadım....

Bilen arkadaşlarımız yardımcı olursa mutlu olurum kolay gelsin.
Title: Re: Etiketler
Post by: Yağız... on March 11, 2009, 06:34:46 PM
Emin de?ilim ama ?unu deneyin:
Bir PHP blok olu?turun. ?çeri?ini ?u ?ekilde yap?n:
Code: [Select]
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'];
Title: Re: Etiketler
Post by: zeminkat on March 11, 2009, 06:38:37 PM

harika oldu hemde... Çok teşekkür ederim ilginiz, yardımınız için...

mutlu kalın.
Title: Re: Etiketler
Post by: KeReM @ on March 11, 2009, 09:36:34 PM
Merhaba,

Gelir gelmez bir soru ile çıktım karşınıza...
Dün gece itibariyle kullanmaya başladım ve php?action=tags modunu kullanmaktayım, bu sayfadaki etiketlerimi bloc olarak nasıl gösterebilirim. Aslında bunu forumun altında gösterme gibi birşey vardı ama aradım bulamadım....

Bilen arkadaşlarımız yardımcı olursa mutlu olurum kolay gelsin.

sanırım benimde benzer bir sorum olacak bende google tagged kullanıyorum google tarafından etiketlenenleri forumun altında gösterebilirmiyim.
Title: Re: Etiketler
Post by: Paragaya on March 12, 2009, 02:44:55 AM
Emin de?ilim ama ?unu deneyin:
Bir PHP blok olu?turun. ?çeri?ini ?u ?ekilde yap?n:
Code: [Select]
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'];

Burda onun cevab?n? vermi? zaten ;)
Title: Re: Etiketler
Post by: Evo on March 12, 2009, 03:25:32 AM
Ya??z'?n verdi?i kodlar ile KeReM @'in istedi?i mod farkl? modlar. Birisi tags modu di?eri google tagged. Kerem a?a??daki kodlar? dener misin.
Code: [Select]
global $db_prefix, $context, $scripturl, $txt;

loadLanguage('GoogleTagged');

$query = db_query("
SELECT g.tag, g.ID_TAG, g.hits, g.status, g.ID_TOPIC, t.ID_TOPIC
FROM {$db_prefix}googletagged as g, {$db_prefix}topics as t
WHERE g.ID_TOPIC = t.ID_TOPIC
AND g.status != 0
GROUP BY g.tag
ORDER BY RAND()
LIMIT 32
", __FILE__, __LINE__);

// FOUND SOME TAGS?
if(mysql_num_rows($query) != 0)
{
$context['googletagged'] = array();
$highest = 1 ;
$lowest = 999999999999 ;
while($row = mysql_fetch_assoc($query))
{
$context['googletagged'][] = $row;
$highest = ($row['hits'] > $highest) ? $row['hits'] : $highest ;
$lowest = ($row['hits'] < $lowest) ? $row['hits'] : $lowest ;
}
unset($row);
$maxsize = 200;
$minsize = 100;
$diff = ($highest - $lowest == 0) ? 1 : ($highest - $lowest) ;
$steps = ($maxsize - $minsize)/$diff;
foreach ($context['googletagged'] as $key => $row)
{
$context['googletagged'][$key]['size'] = ceil($minsize + ($steps * ($row['hits'] - $lowest)));
$context['googletagged'][$key]['text'] = str_replace("+", " ", $context['googletagged'][$key]['tag']);
}
unset($key,$row,$steps,$highest,$lowest,$maxsize,$minsize);
mysql_free_result($query);
}



if(isset($context['googletagged']))
{
$i = 1;
foreach($context['googletagged'] as $key => $row)
{
echo '
<a href="', $scripturl , '?action=tagged;id=', $row['ID_TAG'] ,';tag=', $row['tag'] ,'" style="font-size: '.$row['size'].'%;" title="', $row['text'] ,', ', $row['text'] ,' rap, ', $row['text'] ,' indir ">', $row['text'] ,'</a>';
echo (($i % 10) == 0) ? '<br/>' : '';
$i++;
}
unset($i,$key,$row);
}
else
{
echo $txt['googletagged_empty'];
}


Title: Re: Etiketler
Post by: KeReM @ on March 12, 2009, 08:35:54 AM
akiladami  süper oldu teşşkür ederim yardımın için :thumbsup:
Title: Re: Etiketler
Post by: Paragaya on March 12, 2009, 09:54:13 AM
Özür KeReM @ tagged okudumuşum :D

bu arada akiladami senin diğer nickin(sm.org) evolotion mu ?
Title: Re: Etiketler
Post by: Yağız... on March 12, 2009, 11:47:43 AM
Özür KeReM @ tagged okudumuşum :D

bu arada akiladami senin diğer nickin(sm.org) evolotion mu ?
Evet o ;)
Title: Re: Etiketler
Post by: KeReM @ on March 12, 2009, 12:51:06 PM
Code: [Select]
// START OF GOOGLE TAGGED MOD
   if(isset($scripturl['tags'])) {
   // START OUR DIV CONTAINER
         echo'
   <div align="center">
<table border="0" cellpadding="7" class="tborder" bgcolor="#C0C0C0" width="100%">
<tr><td height="15px" class="catbg"><center>||| GoogleTagged |||</center></td></tr>
         <tr>
         <td class="windowbg"><div id="googletagged" style="text-align:center;"> '.$txt['googletagged'].':';
      $i = 1 ;
      // WRITE OUT OUR TAGS
      global $db_prefix, $context, $scripturl, $txt;

   loadLanguage('GoogleTagged');

   $query = db_query("
      SELECT g.tag, g.ID_TAG, g.hits, g.status, g.ID_TOPIC, t.ID_TOPIC
      FROM {$db_prefix}googletagged as g, {$db_prefix}topics as t
      WHERE g.ID_TOPIC = t.ID_TOPIC
         AND g.status != 0
      GROUP BY g.tag
      ORDER BY RAND()
      LIMIT 32
   ", __FILE__, __LINE__);
     
   // FOUND SOME TAGS?
   if(mysql_num_rows($query) != 0)
   {
      $context['googletagged'] = array();
      $highest = 1 ;
      $lowest = 999999999999 ;
      while($row = mysql_fetch_assoc($query))
      {
         $context['googletagged'][] = $row;
         $highest = ($row['hits'] > $highest) ? $row['hits'] : $highest ;
         $lowest = ($row['hits'] < $lowest) ? $row['hits'] : $lowest ;
      }
      unset($row);
      $maxsize = 200;
      $minsize = 100;
      $diff = ($highest - $lowest == 0) ? 1 : ($highest - $lowest) ;
      $steps = ($maxsize - $minsize)/$diff;
      foreach ($context['googletagged'] as $key => $row)
      {
         $context['googletagged'][$key]['size'] = ceil($minsize + ($steps * ($row['hits'] - $lowest)));
         $context['googletagged'][$key]['text'] = str_replace("+", " ", $context['googletagged'][$key]['tag']);
      }
      unset($key,$row,$steps,$highest,$lowest,$maxsize,$minsize);
      mysql_free_result($query);
   }
   
   

   if(isset($context['googletagged']))
   {
      $i = 1;
      foreach($context['googletagged'] as $key => $row)
      {
         echo '
            <a href="', $scripturl , '?action=tagged;id=', $row['ID_TAG'] ,';tag=', $row['tag'] ,'" style="font-size: '.$row['size'].'%;" title="', $row['text'] ,', ', $row['text'] ,' rap, ', $row['text'] ,' indir ">', $row['text'] ,'</a>';
         echo (($i % 10) == 0) ? '<br/>' : '';
         $i++;
      }
      unset($i,$key,$row);
   }
   else
   {
      echo $txt['googletagged_empty'];
   }



      // CLOSE OUT OUR DIV
      echo '   </td>
      </tr>
          </table></div><br/>';
   }
   // END OF GOOGLE TAGGED MOD
     

buda ekledi?im ?ekli tekrar te?ekkür  :thumbsup:
Title: Re: Etiketler
Post by: postman on March 13, 2009, 02:25:50 PM
Ya??z'?n verdi?i kodlar ile KeReM @'in istedi?i mod farkl? modlar. Birisi tags modu di?eri google tagged. Kerem a?a??daki kodlar? dener misin.
Code: [Select]
global $db_prefix, $context, $scripturl, $txt;

loadLanguage('GoogleTagged');

$query = db_query("
SELECT g.tag, g.ID_TAG, g.hits, g.status, g.ID_TOPIC, t.ID_TOPIC
FROM {$db_prefix}googletagged as g, {$db_prefix}topics as t
WHERE g.ID_TOPIC = t.ID_TOPIC
AND g.status != 0
GROUP BY g.tag
ORDER BY RAND()
LIMIT 32
", __FILE__, __LINE__);

// FOUND SOME TAGS?
if(mysql_num_rows($query) != 0)
{
$context['googletagged'] = array();
$highest = 1 ;
$lowest = 999999999999 ;
while($row = mysql_fetch_assoc($query))
{
$context['googletagged'][] = $row;
$highest = ($row['hits'] > $highest) ? $row['hits'] : $highest ;
$lowest = ($row['hits'] < $lowest) ? $row['hits'] : $lowest ;
}
unset($row);
$maxsize = 200;
$minsize = 100;
$diff = ($highest - $lowest == 0) ? 1 : ($highest - $lowest) ;
$steps = ($maxsize - $minsize)/$diff;
foreach ($context['googletagged'] as $key => $row)
{
$context['googletagged'][$key]['size'] = ceil($minsize + ($steps * ($row['hits'] - $lowest)));
$context['googletagged'][$key]['text'] = str_replace("+", " ", $context['googletagged'][$key]['tag']);
}
unset($key,$row,$steps,$highest,$lowest,$maxsize,$minsize);
mysql_free_result($query);
}



if(isset($context['googletagged']))
{
$i = 1;
foreach($context['googletagged'] as $key => $row)
{
echo '
<a href="', $scripturl , '?action=tagged;id=', $row['ID_TAG'] ,';tag=', $row['tag'] ,'" style="font-size: '.$row['size'].'%;" title="', $row['text'] ,', ', $row['text'] ,' rap, ', $row['text'] ,' indir ">', $row['text'] ,'</a>';
echo (($i % 10) == 0) ? '<br/>' : '';
$i++;
}
unset($i,$key,$row);
}
else
{
echo $txt['googletagged_empty'];
}


bu sa?a dayal? ortalamak için <center></center>  nereye ekleyece?imi çözemedim.. php özürlü olarak:)
Title: Re: Etiketler
Post by: Evo on March 13, 2009, 02:37:03 PM
?unu kullanabilirsiniz.
Code: [Select]
global $db_prefix, $context, $scripturl, $txt;

loadLanguage('GoogleTagged');

$query = db_query("
SELECT g.tag, g.ID_TAG, g.hits, g.status, g.ID_TOPIC, t.ID_TOPIC
FROM {$db_prefix}googletagged as g, {$db_prefix}topics as t
WHERE g.ID_TOPIC = t.ID_TOPIC
AND g.status != 0
GROUP BY g.tag
ORDER BY RAND()
LIMIT 50
", __FILE__, __LINE__);

// FOUND SOME TAGS?
if(mysql_num_rows($query) != 0)
{
$context['googletagged'] = array();
$highest = 1 ;
$lowest = 999999999999 ;
while($row = mysql_fetch_assoc($query))
{
$context['googletagged'][] = $row;
$highest = ($row['hits'] > $highest) ? $row['hits'] : $highest ;
$lowest = ($row['hits'] < $lowest) ? $row['hits'] : $lowest ;
}
unset($row);
$maxsize = 200;
$minsize = 100;
$diff = ($highest - $lowest == 0) ? 1 : ($highest - $lowest) ;
$steps = ($maxsize - $minsize)/$diff;
foreach ($context['googletagged'] as $key => $row)
{
$context['googletagged'][$key]['size'] = ceil($minsize + ($steps * ($row['hits'] - $lowest)));
$context['googletagged'][$key]['text'] = str_replace("+", " ", $context['googletagged'][$key]['tag']);
}
unset($key,$row,$steps,$highest,$lowest,$maxsize,$minsize);
mysql_free_result($query);
}

echo '
<center>';

if(isset($context['googletagged']))
{
$i = 1;
foreach($context['googletagged'] as $key => $row)
{
echo '
<a href="', $scripturl , '?action=tagged;id=', $row['ID_TAG'] ,';tag=', $row['tag'] ,'" style="font-size: '.$row['size'].'%;" title="', $row['text'] ,'">', $row['text'] ,'</a>';
echo (($i % 10) == 0) ? '<br/>' : '';
$i++;
}
unset($i,$key,$row);
}
else
{
echo $txt['googletagged_empty'];
}

echo '
</center>';
Kodlar aras?nda <center> ve </center> kodlar? var onlar?n yerine kendi iste?ine göre sa?a sola yukar? a?a?? tablo kodlar?n? girerek istedi?in yere alabilirsin.  Div komutlar?n? kullanarak falan yerleri oras? anlayaca??n.
Title: Re: Etiketler
Post by: postman on March 13, 2009, 02:51:12 PM
akiladami teşekkürler daha iyi oldu   ;)
Title: Re: Etiketler
Post by: CybeR.BoyS on July 06, 2009, 12:46:57 PM
Tesekkurler, hem google tagget hemde tags etıketlerını bu konu sayesınde ekledım ::)
Title: Re: Etiketler
Post by: Gurbet_42 on August 18, 2009, 03:18:04 PM
Emin değilim ama şunu deneyin:
Bir PHP blok oluşturun. İçeriğini şu şekilde yapın:
Code: [Select]
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'];


Bundaki etiketlere tıkladığımızda etiketlerin olduğu sayfaya yönleniyor ,acaba direk olarak etiketlenen konuya yönlendirebilirmiyiz.

Google etiketler bloğu direk konuya yönleniyor.
Title: Re: Etiketler
Post by: grafitus on August 18, 2009, 04:34:33 PM
Gurbet_42 bu o etiket modifikasyonunun sistemine giriyor. SimplePortal'la alakası yok. Ve modifikasyon yazarına da söylesen böyle bir şeyi mantıken yapamaz. Çünkü aynı etiketi kullanan 2-3-5-... konu olabilir..
Title: Re: Etiketler
Post by: Gurbet_42 on August 19, 2009, 07:59:16 AM
Anladım sağol.
Title: Re: Etiketler
Post by: KeReM @ on January 05, 2011, 10:49:57 AM
PHP sözdizimi hatası. Kodlarınızı kontrol edin.

şuan tag ve google tagged ile ilgili kodları eklediğimde bu hatayı alıyorum nedeni ne olabilir.
Title: Re: Etiketler
Post by: Restorasyon on June 18, 2011, 07:31:55 PM
abi konuyu hortlatıyorum ama mod arkladaş öle istedi..

(http://www.mimarsinan.gen.tr/wp-content/uploads/2011/06/tag.jpg)

böyle oldu ben kurdumda. görünmüyor hiç birşey
Title: Re: Etiketler
Post by: grafitus on June 21, 2011, 05:31:20 PM
Hangi kodları eklediniz?
Title: Re: Etiketler
Post by: Restorasyon on June 22, 2011, 07:49:30 PM
İlk Yağızın verdiği kodları portalda php oluşturarak yaptım. biri göründü. daha sonra evonunkini yaptım 2.si göründü. ama anahtar kelime falan yok öle duruyolar..
Title: Re: Etiketler
Post by: grafitus on June 24, 2011, 01:53:26 PM
Hata Kayıtları'nda bununla ilgili bir hata görünüyor mu? Ve eğer forumunuzdan bir yönetici hesabı alabilirsem daha iyi bakabilirim sanırım.
Title: Re: Etiketler
Post by: grafitus on June 25, 2011, 04:10:36 AM
Sitenizi ve blokları incelemedim. Sorun, buradan kopyaladığınız kodların tek satır halinde kopyalanmış olması, yorum satırlarıyla da karışınca işlev görmez olmuşlar.

Google Tagged eklentisi kuruluydu, fakat diğer etiketler eklentisi kurulu olmadığı için diğer blğu kaldırdım.
Title: Re: Etiketler
Post by: Restorasyon on June 25, 2011, 01:24:23 PM
hmm anladım dostum çok tşk.. diğer eklentiyi nerden kurabilirim peki? yararlı olursa kurmak istiyorum çünkü..
Title: Re: Etiketler
Post by: grafitus on June 25, 2011, 03:21:43 PM
O da sanırım şu olmalı:

http://custom.simplemachines.org/mods/index.php?mod=579
SimplePortal 2.3.8 © 2008-2024, SimplePortal