»Forumlar »SE ? Beginners »NEWPAGESBYPATH değişikliği
  https://seditio.com.tr/eski1/forums.php?m=posts&q=1325
          Geri Dön      -      Sayfayı Yazdırmak için tıklayın
Author: hakan yildiz, Posted: 2011-03-22 18:49 GMT. This post was edited by Kaan (2011-03-23 00:08 GMT, 5633 Gün ago)
Arkada?lar S.a
Bir konuda yard?m almak istiyorum, Sorunum ?u ;

Son forum konular?n?n ana sayfada g?r?nt?s? ?ok ho? ...

Konu - Mesajlar - Okunma - G?nderen - Tarih

Olmak ?zere hepsi tablo i?inde ve kulland???m plugin ise bu
PLUGIN_latestposts
Kod:
<?PHP
/* ====================
Land Down Under - Website engine
Copyright Kaan
http://www.ntka.org

[BEGIN_SED]
File=plugins/latestposts/latestposts.php
Version=2
Updated=
Type=Plugin
Author=
Description=Ana Sayfada Son Forum Konulari
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=latestposts
Part=main
File=latestposts
Hooks=index.tags
Tags=index.tpl:{PLUGIN_latestposts}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]
====================
*/

if ( !defined('SED_CODE') ) { die("Hacking attempt."); }

$plimit = "25";   // define number of rows you want to see...

$sql = sed_sql_query("SELECT t.ft_id, t.ft_sectionid, t.ft_title, t.ft_updated, t.ft_postcount, t.ft_viewcount, t.ft_lastposterid, t.ft_lastpostername, s.fs_id, s.fs_title, s.fs_category FROM $db_forum_topics t,$db_forum_sections s
WHERE t.ft_sectionid=s.fs_id AND t.ft_movedto=0 AND t.ft_mode=0 ORDER by t.ft_updated DESC LIMIT $plimit");

$latestposts = "<table class='cells' width='100%' cellspacing='3' cellpadding='0' align='center'>";
$latestposts .= "<tr><td class=\"coltop\">Konu</td><td class=\"coltop\">Mesajlar</td><td class=\"coltop\">Okunma</td><td class=\"coltop\">Son G?nderen</td><td class=\"coltop\">Tarih</td></tr>";

$ii=0;
while ($row = sed_sql_fetcharray($sql)){
if (sed_auth('forums', $row['fs_id'], 'R')){

$ii++;
$img = ($usr['id']>0 && $row['ft_updated']>$usr['lastvisit']) ? "<a href=\"forums.php?m=posts&amp;q=".$row['ft_id']."&amp;n=unread#unread\"><img src=\"skins/$skin/img/system/arrow-unread.gif\" alt=\"\" /></a>" : "<a href=\"forums.php?m=posts&amp;q=".$row['ft_id']."\"><img src=\"skins/$skin/img/system/arrow-follow.gif\" alt=\"\" /></a> ";

$latestposts .= "<tr><td> &nbsp;";
$latestposts .= $img." <a href=\"forums.php?m=posts&amp;q=".$row['ft_id']."\">".sed_cc(sed_cutstring(stripslashes($row['ft_title']),38))."</a></td>";

$latestposts .="<td>&nbsp;(" .$row["ft_postcount"]. ") </td>";
$latestposts .="<td>&nbsp;(" .$row["ft_viewcount"]. ")</td>";
$latestposts .= "<td>&nbsp;<a href='users.php?m=details&amp;id=".$row["ft_lastposterid"]."'>".$row["ft_lastpostername"]."</a></td>";$latestposts .= "<td>&nbsp; ".date($cfg['formatmonthdayhourmin'], $row['ft_updated'] + $usr['timezone'] * 3600)."</td></tr>";

}
}

if($ii==0){
$latestposts .= "<tr><td colspan=\"5\"><center><font color='red'>Son Forum Konular?n? G?rmek i?in Giri? Yap?n?z</font></center></td></tr>";
}

$latestposts .= "</table>";

$t-> assign(array(
"PLUGIN_latestposts" => $latestposts,
));

?>


Ben NEWPAGESBYPATH eklentisini kullan?yorum, bu eklenti ile panelimden kategoriler olusturdum video, oyun, vs...
Olu?turmu? oldu?um bu kategorileri ana sayfamda index.tpl dosyas?nda g?r?nt?l?yorum, mesela kulland???m kategori kodu ve g?r?nt?lenme ?u ?ekilde

index.tpl
{PLUGIN_NEWPAGESBYPATH.oyunlar}

G?r?nt?lenme ise ana sayfada ?u ?ekilde oluyor ...

? 2011-03-18 / Oyun // -? Pro Evulation Soccer 2011 ( PES 2011 )
? 2011-03-03 / Oyun // -? Samurai Shodown (ATAR?) - Yap?m A?amas?nda
? 2011-03-01 / Oyun // -? Deneme oyun 3
? 2011-02-17 / Oyun // -? Deneme oyun 4
? 2011-02-17 / Oyun // -? Deneme oyun 5

Kulland???m eklentiyi san?r?m kaan bey yazm?? ve kodlar? ise bunlar
newpagesbypath.php
Kod:
<?PHP
/* ====================
Land Down Under - Website engine
Copyright Kaan
http://www.ntka.org

[BEGIN_SED]
File=plugins/newpagesbypath/newpagesbypath.php
Version= 1.2
Updated=01-04-2007
Type=Plugin
Author=Kaan
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=newpagesbypath
Part=main
File=newpagesbypath
Hooks=index.tags
Tags=index.tpl:{PLUGIN_NEWPAGESBYPATH.categorycodehere}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]

==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

/* ============ MASKS FOR THE HTML OUTPUTS =========== */

$cfg['plu_mask_newpagesbypath'] = "? %3\$s"." ".$cfg['separator']." "."%1\$s // -?"." %2\$s <br />";
// %1\$s = Link to the category
// %2\$s = Link to the page
// %3\$s = Date

$plu_empty = $L['None']."<br />";

function sed_get_newpagesbypath($c, $limit, $mask)
{
global $L, $db_pages, $usr, $cfg, $sed_cat, $sed_catacc, $plu_empty;

$mtch = $sed_cat[$c]['path'].".";
$mtchlen = strlen($mtch);
$catsub = array();
$catsub[] = $c;

@reset($sed_cat);
while (list($i,$x) = each($sed_cat) )
{
if (substr($x['path'],0,$mtchlen)==$mtch)
{
$catsub[] = $i;
}
}

$sql = sed_sql_query("SELECT page_id,page_cat,page_title,page_date,page_alias FROM $db_pages
WHERE page_state=0
AND page_cat NOT LIKE 'system'
AND page_cat IN ('".implode("','", $catsub)."')
ORDER by page_date DESC LIMIT $limit");

while ($row = sed_sql_fetcharray($sql))
{
$row['page_urlpar'] = (empty($row['page_alias'])) ? "id=".$row['page_id'] : "al=".$row['page_alias'];

$res .= (sed_auth('page', $row['page_cat'], 'R')) ? sprintf($mask,
"<a href=\"list.php?c=".$row['page_cat']."\">".$sed_cat[$row['page_cat']]['title']."</a>",
"<a href=\"page.php?".$row['page_urlpar']."\">".sed_cc(sed_cutstring(stripslashes($row['page_title']),68))."</a>",
date($cfg['formatyearmonthday'], $row['page_date'] + $usr['timezone'] * 3600)
) : '';
}

$res = (empty($res)) ? $plu_empty : $res;

return($res);
}


if ($cfg['plugin']['newpagesbypath']['maxpages']>0 && !empty($cfg['plugin']['newpagesbypath']['categories']))
{
$cats = explode(',', $cfg['plugin']['newpagesbypath']['categories']);
foreach($cats as $k => $i)
{
$i = trim($i);
$newpagesbypath[$i] = sed_get_newpagesbypath(
$i,
$cfg['plugin']['newpagesbypath']['maxpages'],
$cfg['plu_mask_newpagesbypath']);
}
}

$t-> assign(array(
"PLUGIN_NEWPAGESBYPATH" => $newpagesbypath,
"PLUGIN_NEWPAGESBYPATH_MAXLINES" => $cfg['plugin']['newpagesbypath']['maxpages']
));

?>


Ben bu NEWPAGESBYPATH pluginindeki olusturdu?um kategorileri ana sayfada g?sterirken, Son forum konular?ndaki gibi, ?ok ??k bi ?ekilde tablo i?erisine almak istiyorum

Yani ayn? son forum konular?nda oldu?u gibi
Konu - Mesajlar - Okunma - G?nderen - Tarih, ?eklinde yap?p tablo i?erisinde g?r?nmesini sa?lamak istiyorum

Yard?mlar?n?z i?in ?imdiden te?ekk?r ederim ...
Author: Kaan, Posted: 2011-03-23 00:06 GMT.
Orjinal NEWPAGESBYPATH eklentisimi bu yoksa bir de?i?iklik yapt?n m?.?

Bu dediklerini yani kodlar? taplo i?erisine al?r?z ama ne zaman olur bilemem di?er arkada?lar yard?mc? olursa en k?sa zamanda yap?labilir.
Author: hakan yildiz, Posted: 2011-03-23 00:11 GMT.
Kaan bey, b?t?n dosyalar? www.ntka.org' dan indirdim san?r?m hepsi orjinal
De?i?iklik olarak ise
Kod:
$cfg['plu_mask_newpagesbypath'] = "? %3\$s"." ".$cfg['separator']." "."%1\$s // -?"." %2\$s <br />";

bu sat?ra ?, /, //, -? bu i?aretleri ekledim + tablo i?erisine almay? d???nd?m ve ?ok denedim fakat sizin kadar php bilgisine sahip olmad???m i?in ba?ar?l? olamad?m
Author: Kaan, Posted: 2011-03-23 00:21 GMT.
Tablo i?erisine alacag?n?z yer buras?
Kod:
$row['page_urlpar'] = (empty($row['page_alias'])) ? "id=".$row['page_id'] : "al=".$row['page_alias'];

$res .= (sed_auth('page', $row['page_cat'], 'R')) ? sprintf($mask,
"<a href=\"list.php?c=".$row['page_cat']."\">".$sed_cat[$row['page_cat']]['title']."</a>",
"<a href=\"page.php?".$row['page_urlpar']."\">".sed_cc(sed_cutstring(stripslashes($row['page_title']),68))."</a>",
date($cfg['formatyearmonthday'], $row['page_date'] + $usr['timezone'] * 3600)
) : '';


?rnek olarak ??yle g?stereyim.
Kod:
$res = "<table class='cells' width='100%' cellspacing='3' cellpadding='0' align='center'>";
$res .= "<tr><td class=\"coltop\">Konu</td><td class=\"coltop\">Mesajlar</td><td class=\"coltop\">Okunma</td><td class=\"coltop\">Son G?nderen</td><td class=\"coltop\">Tarih</td></tr>";

Alt?na devam ediyorsun.
Kod:
while ($row = sed_sql_fetcharray($sql))
{
$row['page_urlpar'] = (empty($row['page_alias'])) ? "id=".$row['page_id'] : "al=".$row['page_alias'];

$res .= (sed_auth('page', $row['page_cat'], 'R')) ? sprintf($mask,
"<a href=\"list.php?c=".$row['page_cat']."\">".$sed_cat[$row['page_cat']]['title']."</a>",
"<a href=\"page.php?".$row['page_urlpar']."\">".sed_cc(sed_cutstring(stripslashes($row['page_title']),68))."</a>",
date($cfg['formatyearmonthday'], $row['page_date'] + $usr['timezone'] * 3600)
) : '';
}


latestpost eklentisine bakarak d?zenleme yapabilirsin.
?rne?in: s?ra no almak i?in $ii=0; kullanm???z.
while ($row = sed_sql_fetcharray($sql)) den sonra $ii++; yani artarak devam ediyor 1 2 3 diyerek bu ?ekilde d?zenlemeye ?al???rsan?z ba?arabilirsiniz.

Yukar?da vermi? oldugum kodlar sadece ?rnektir.
Author: hakan yildiz, Posted: 2011-03-23 00:33 GMT.
?nan?rm?s?n?z belki 3-4 saat aral?ks?z denemeler yapt?m, ve sonu? alamad?m PHP biliyorum diyemem ??reniyorum diyebilirim
Ek olarak ise baz? destek sitelerinden yard?m istedi?imde, kimseler yakla?mad? ve ilgilenmedi..
Mesela ben en ?ok konu a?anlar pluginini bile tablo i?erisine almay? d?s?nd?m ve yard?m istedim ama ilgilenmediler, belki gereksiz bir i? olarak g?r?ld? belkide zor bi i?ti, bilemiyorum

Zaman?n?z? ?almak istemem, son forum konular?nda ki yapm?? oldu?unuz tablolama ?ok ho?uma gitti ve acaba bunuda yapabilirmiyiz d???ncesiydi bendeki ...

Te?ekk?r ederim
Author: Kaan, Posted: 2011-03-23 01:03 GMT.
Gerekli incelemeyi yapt?kdan sonra cevab?n? bildiririm konuyu takip etmen yeterli..

Bu konu alt?nda mesaj?m? yay?nlar?m..
Author: hakan yildiz, Posted: 2011-03-23 01:19 GMT.
Sitenizi s?rekli takip ediyorum, bu konuyuda emin olun d?rt g?zle bekliyece?im
Y?l sonuna ise baz? belediyelerin i?leri var, performans paketi ve bu sitelere ciddi anlamda destek almay?da d???n?yorum

ilgilendi?iniz i?in te?ekk?r ederim
Author: Kaan, Posted: 2011-03-23 01:39 GMT. This post was edited by Kaan (2011-03-23 01:43 GMT, 5633 Gün ago)
Tam istedi?in gibi newpagesbypath.php yi alttakiyle degi?tir eklentiyi yeniden kurulum yaparak sonuccu g?rebilirsin..

:
hp]<?PHP



/* ====================

Seditio - Website engine

Copyright Neocrome

http://www.neocrome.net



[BEGIN_SED]

File=plugins/newpagesbypath/newpagesbypath.php

Version=100

Updated=2006-jan-24

Type=Plugin

Author=Neocrome

Description=

[END_SED]



[BEGIN_SED_EXTPLUGIN]

Code=newpagesbypath

Part=main

File=newpagesbypath

Hooks=index.tags

Tags=index.tpl:{PLUGIN_NEWPAGESBYPATH.categorycodehere}

Minlevel=0

Order=10

[END_SED_EXTPLUGIN]



==================== */



if (!defined('SED_CODE')) { die('Wrong URL.'); }



/* ============ MASKS FOR THE HTML OUTPUTS =========== */



$cfg['plu_mask_newpagesbypath'] = "%1\$s"."  "."%2\$s"." "."%3\$s"." "."%4\$s"." %5\$s<br />";

// %1\$s = Link to the category

// %2\$s = Link to the page

// %3\$s = Date



$plu_empty = $L['None']."<br />";



function sed_get_newpagesbypath($c, $limit, $mask)

    {

    global $L, $db_pages, $db_users, $usr, $cfg, $sed_cat, $sed_catacc, $plu_empty;



    $mtch = $sed_cat[$c]['path'].".";

    $mtchlen = strlen($mtch);

    $catsub = array();

    $catsub[] = $c;



    @reset($sed_cat);

    while (list($i,$x) = each($sed_cat) )

        {

        if (substr($x['path'],0,$mtchlen)==$mtch)

            {

            $catsub[] = $i;

            }

        }



$sql = sed_sql_query("SELECT p.*, u.user_name FROM $db_pages AS p

        LEFT JOIN $db_users AS u ON u.user_id=p.page_ownerid

        WHERE page_state=0

        AND page_cat NOT LIKE 'system'

        AND page_cat IN ('".implode("','", $catsub)."')

        ORDER by page_date DESC LIMIT $limit");



$res = "<table class='cells' width='100%' cellspacing='3' cellpadding='0' align='center'>";

$res .= "<tr><td class=\"coltop\">Katagori</td><td class=\"coltop\">Konu</td><td



class=\"coltop\">Ekleyen</td><td class=\"coltop\">?nceleme</td><td class=\"coltop\">Tarih</td></tr>";



while ($row = sed_sql_fetcharray($sql))

        {

$row['page_urlpar'] = (empty($row['page_alias'])) ? "id=".$row['page_id'] :



"al=".$row['page_alias'];

$res .= "<tr><td> &amp;nbsp;";

$res .= (sed_auth('page', $row['page_cat'], 'R')) ? sprintf($mask,

"<a href=\"list.php?c=".$row['page_cat']."\">".$sed_cat[$row['page_cat']]['title']."</a></td>",

"<td><a href=\"page.php?".$row['page_urlpar']."\">".sed_cc(sed_cutstring(stripslashes($row['page_title']),36))."



</a></td>",

"<td>".sed_build_user($row['page_ownerid'], sed_cc($row['user_name']))."</td>", "<td>".$row['page_count']."</td>", "<td>".date($cfg['formatyearmonthday'], $row['page_date'] + $usr['timezone'] * 3600) ) : ''."</td></tr>";

       

}

$res .= "</table>";

    $res = (empty($res)) ? $plu_empty : $res;

    return($res);

    }

if ($cfg['plugin']['newpagesbypath']['maxpages']>0 &&



!empty($cfg['plugin']['newpagesbypath']['categories']))

    {

    $cats = explode(',', $cfg['plugin']['newpagesbypath']['categories']);

    foreach($cats as $k => $i)

        {

        $i = trim($i);

        $newpagesbypath[$i] = sed_get_newpagesbypath(

            $i,

            $cfg['plugin']['newpagesbypath']['maxpages'],

            $cfg['plu_mask_newpagesbypath']);

        }

    }



$t-> assign(array(

    "PLUGIN_NEWPAGESBYPATH" => $newpagesbypath,

    "PLUGIN_NEWPAGESBYPATH_MAXLINES" => $cfg['plugin']['newpagesbypath']['maxpages']

        ));



?>


son mesaj 2 dakika ?nce

Ekran G?r?nt?s?
Author: hakan yildiz, Posted: 2011-03-23 13:21 GMT.
Elinize sa?l?k, tekrar te?ekk?r ederim
Lakin 3 adet hata tespit ettim
1-\ = \
2-&amp;nbsp; = ne oldu?unu anlayamad?m (bo?luk olabilir) kategorilerin yan?nda &amp;nbsp; s?ral? olarak g?r?n?yordu
3-Katagori = Kategori

Bu hatalardan anlad???m, ??enmeden oturup yazm??s?n?z tek tek, elinize sa?l?k tekrar te?ekk?r ediyorum ...
Author: Kaan, Posted: 2011-03-23 13:47 GMT.
Kodlar ?al??m?yor ise ekdeki dosyay? indirin yaz?m hatalar? olabilir di?er 2.ci olan ise siteden kaynaklanan bir sorun tesr slash kodlar?n? bazen kabul etmiyor.

Newpagesbypath ?ndir: https://seditio.com.tr/eski1/data.....-yeni.rar
Author: hakan yildiz, Posted: 2011-03-23 15:47 GMT. This post was edited by hakan yildiz (2011-03-23 19:36 GMT, 5632 Gün ago)
Kaan bey bu olaya bi a??dan seviniyorum bi a??dan ?z?l?yorum, Belki g?nlerce u?ra?t???m bir?eyi 2 saatte teslim ettiniz bu i?in g?zel taraf?
K?t? taraf? ise kendimi ?ok cahil hissettim ?uanda yapt???n?z de?i?iklikleri inceliyorum + yeni ?yeler {PLUGIN_NEWUSERS} ve en ?ok yazanlar {PLUGIN_TPOSTERS} pluiginlerine bu de?i?ikli?i yapmaya ?al???yorum ..

??in asl? onlarda da bu de?i?ikli?i isteyecektim ama, ?izgiyi a?mak istemedim ba?ar?l? olamaz isem bu de?i?ikli?i istemeye hakk?m varm? ?

son mesaj 3 saat 48 dakika ?nce

{PLUGIN_TPOSTERS} eklentisine yukar?daki yapt???n?z de?i?iklikleri yapmaya ?al???yorum ama malesef yapamad?m ..
index.tpl ile headerin yeri de?i?iyor, sayfa bembeyaz oluyor, veya heryer heryere giriyor s?k?? tepi? bi hal al?yor :S

Kaan bey {PLUGIN_TPOSTERS} ve {PLUGIN_NEWUSERS} eklentilerinede yukar?daki gibi yard?mc? olacakm?s?n?z?

Te?ekk?rler ..

Powered by SeditioPrint version