SimplePortal
Support => International Support => Turkish (Türkçe) => Topic started 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.
-
Emin de?ilim ama ?unu deneyin:
Bir PHP blok olu?turun. ?çeri?ini ?u ?ekilde yap?n:
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'];
-
harika oldu hemde... Çok teşekkür ederim ilginiz, yardımınız için...
mutlu kalın.
-
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.
-
Emin de?ilim ama ?unu deneyin:
Bir PHP blok olu?turun. ?çeri?ini ?u ?ekilde yap?n:
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 ;)
-
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.
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'];
}
-
akiladami süper oldu teşşkür ederim yardımın için :thumbsup:
-
Özür KeReM @ tagged okudumuşum :D
bu arada akiladami senin diğer nickin(sm.org) evolotion mu ?
-
Özür KeReM @ tagged okudumuşum :D
bu arada akiladami senin diğer nickin(sm.org) evolotion mu ?
Evet o ;)
-
// 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:
-
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.
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:)
-
?unu kullanabilirsiniz.
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.
-
akiladami teşekkürler daha iyi oldu ;)
-
Tesekkurler, hem google tagget hemde tags etıketlerını bu konu sayesınde ekledım ::)
-
Emin değilim ama şunu deneyin:
Bir PHP blok oluşturun. İçeriğini şu şekilde yapın:
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.
-
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..
-
Anladım sağol.
-
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.
-
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
-
Hangi kodları eklediniz?
-
İ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..
-
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.
-
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.
-
hmm anladım dostum çok tşk.. diğer eklentiyi nerden kurabilirim peki? yararlı olursa kurmak istiyorum çünkü..
-
O da sanırım şu olmalı:
http://custom.simplemachines.org/mods/index.php?mod=579