24 Haz 2021 07:04 Yeni Konu Oluştur

Haberler:

Üye kayıt esnasında E-posta adresinizin doğru olduğuna ve Aktivasyon Mailinize bakmayı unutmayın.


Smf Manşet Haber

Başlatan snrj, 19 May 2014 02:04

« önceki - sonraki »

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

*

  1. 3,084

  2. 584

  3. 973
19 May 2014 02:04 Son düzenlenme: 22 Mar 2016 22:46 snrj

smf slider şeklinde belirlediğiniz board ki konuları otomatik olarak çeken manşet haber eklentisi

made in teknoromi.com reklamımıda yapayım arada :D
hemen anlatıma geçeyim
boardindex.template.php de bul
echo '
 <div id="boardindex_table">
üstüne ekle
//teknoromi.com manşet haber code
teknoromicom_manset($board =1, $limit = 10, $start = null, $length = 200, $output_method = 'echo');
//teknoromi.com manşet haber code
bul (sayfa sonunda)
?>üstüne ekle
//teknoromi.com manşet haber code
function teknoromicom_manset($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
{
 global $scripturl, $txt, $settings, $modSettings, $context;
 global $smcFunc;
 
 loadLanguage('Stats');

 // Must be integers....
 if ($limit === null)
 $limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 0;
 else
 $limit = (int) $limit;

 if ($start === null)
 $start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
 else
 $start = (int) $start;

 if ($board !== null)
 $board = (int) $board;
 elseif (isset($_GET['board']))
 $board = (int) $_GET['board'];

 if ($length === null)
 $length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
 else
 $length = (int) $length;

 $limit = max(0, $limit);
 $start = max(0, $start);
 
 // Make sure guests can see this board.
 $request = $smcFunc['db_query']('', '
 SELECT id_board
 FROM {db_prefix}boards
 WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
 AND ') . 'FIND_IN_SET(-1, member_groups) != 0
 LIMIT 1',
 array(
 'current_board' => $board,
 )
 );
 if ($smcFunc['db_num_rows']($request) == 0)
 {
 if ($output_method == 'echo')
 die($txt['ssi_no_guests']);
 else
 return array();
 }
 list ($board) = $smcFunc['db_fetch_row']($request);
 $smcFunc['db_free_result']($request);

 // Load the message icons - the usual suspects.
 $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless');
 $icon_sources = array();
 foreach ($stable_icons as $icon)
 $icon_sources[$icon] = 'images_url';
 
 // Find the post ids.
 $request = $smcFunc['db_query']('', '
 SELECT t.id_first_msg
 FROM {db_prefix}topics as t
 LEFT JOIN {db_prefix}boards as b ON (b.id_board = t.id_board)
 WHERE t.id_board = {int:current_board}' . ($modSettings['postmod_active'] ? '
 AND t.approved = {int:is_approved}' : '') . '
 AND {query_see_board}
 ORDER BY t.id_first_msg DESC
 LIMIT ' . $start . ', ' . $limit,
 array(
 'current_board' => $board,
 'is_approved' => 1,
 )
 );
 
 $posts = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 $posts[] = $row['id_first_msg'];
 $smcFunc['db_free_result']($request);

 if (empty($posts))
 return array();

 // Find the posts.
 $request = $smcFunc['db_query']('', '
 SELECT
 m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
 t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg, m.id_board
 FROM {db_prefix}topics AS t
 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
 LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 WHERE t.id_first_msg IN ({array_int:post_list})
 ORDER BY t.id_first_msg DESC
 LIMIT ' . count($posts),
 array(
 'post_list' => $posts,
 )
 );
 $return = array();
 $recycle_board = !empty($modSettings['recycle_enable']) && !empty($modSettings['recycle_board']) ? (int) $modSettings['recycle_board'] : 0;
 while ($row = $smcFunc['db_fetch_assoc']($request))
{// If we want to limit the length of the post.
if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
{
$row['body'] = $smcFunc['substr']($row['body'], 0, $length);
$cutoff = false;

$last_space = strrpos($row['body'], ' ');
$last_open = strrpos($row['body'], '<');
$last_close = strrpos($row['body'], '>');
if (empty($last_space) || ($last_space == $last_open + 3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
$cutoff = $last_open;
elseif (empty($last_close) || $last_close < $last_open)
$cutoff = $last_space;

if ($cutoff !== false)
$row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
$row['body'] .= '...';
}

$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

if (!empty($recycle_board) && $row['id_board'] == $recycle_board)
$row['icon'] = 'recycled';

// Check that this message icon is there...
if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';

// Censor everything.
censorText($row['body']);
censorText($row['subject']);

// BBC-atize the message.
$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);
         $secimyap = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $row['body'], $sonuc);
   // src="" içindekini al.
 if(!empty($sonuc[0]) && !empty($sonuc[1]))
   $ilkresim = $sonuc [1] [0];
 
  else{ // Resim bulunmazsa default resim ekle
     $ilkresim = $settings['theme_url'] . '/images/resimyok.jpg';
   }
 censorText($row['subject']);
 censorText($row['body']);

 $return[] = array(
 'id' => $row['id_topic'],
 'message_id' => $row['id_msg'],
 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" alt="' . $row['icon'] . '">',
 'subject' => $row['subject'],
 'short_subject' => shorten_subject($row['subject'], 37),
 'resim' => $ilkresim,
 'time' => timeformat($row['poster_time']),
 'timestamp' => forum_time(true, $row['poster_time']),
 'body' => $row['body'],
 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
 'link' => '<a class="yorum" href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
 'replies' => $row['num_replies'],
 'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'],
 'comment_link' => !empty($row['locked']) ? '' : '<a class="yorum" href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'poster' => array(
 'id' => $row['id_member'],
 'name' => $row['poster_name'],
 'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
 'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
 ),
 'locked' => !empty($row['locked']),
 'is_last' => false
 );
 }
 $smcFunc['db_free_result']($request);

 if (empty($return))
 return $return;

 $return[count($return) - 1]['is_last'] = true;

 if ($output_method != 'echo')
 return $return;
          echo'
               <script type="text/javascript">
               /* <![CDATA[ */
               var woo_jcarousellite_settings = {"autoStart":"6","interval":"6","speed":"600","hoverPause":"1","visible":"4","scroll":"1","circular":"1"};
                /* ]]> */
                </script>
                <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/teknoromi.js"></script>
                <div style="width: 1024px; margin-left: auto; margin-right: auto;">
                <div id="sliderWrap">
 <div id="slider" class="slider">
 <div  id="slides" class="slides">
 <ul >';
 foreach ($return as $news)
     {
  echo '<li class="slide slide-count-4"><div class="tekno">
 <a href="', $news['href'], '"> <img src="', $news['resim'], '" alt="', $news['subject'], '" class="slide-image wp-post-image" height="100" width="216"/></a>
 <h3><a href="', $news['href'], '">', $news['short_subject'], '</a></h3>
 <div>', $news['time'], ' </div>
 <div class="entry">', temizle($news['body']), ' </div>
 </div></li>';
     }
          echo'</ul>
       <div class="fix"></div></div>
               <a sl-processed="1" href="#" class="next btn-next"><img src="', $settings['default_theme_url'], '/images/leftControl.png"/></a>
       <a sl-processed="1" href="#" class="previous btn-previous"><img src="', $settings['default_theme_url'], '/images/rightControl.png"/></a></div>
   </div></div>';
}
function temizle($haber) {
     $strs=explode('<',$haber);
     $res=$strs[0];
     for($i=1;$i<count($strs);$i++)
     {
         if(!strpos($strs[$i],'>'))
             $res = $res.'&lt;'.$strs[$i];
         else
             $res = $res.'<'.$strs[$i];
     }
     return strip_tags($res);   
 }
 //teknoromi.com manşet haber code
index.css en alta ekle

#sliderWrap {min-height: 250px;position: relative;border-radius:5px;}
.single #sliderWrap {margin-bottom: 25px;}
#sliderWrap .title {color: #FFFFFF;font: bold 22px/24px 'PT Sans',Arial,sans-serif;margin: 0 0 15px;position: relative;text-transform: uppercase;}
#sliderWrap .title span {background:#353737;padding-right:10px;}
.slider { position: absolute; z-index: 5; height: 220px; }
#slides { width: 1024px !important; }
#slides:first-child .slide {display: none;}
#sliderWrap .slides ul { margin: 0px; padding: 0px; list-style: none; float: left; }
.slides ul li.slide { margin: 0; float: left; position: relative; width: 255px !important; height: 240px !important; }
#sliderWrap .slides ul li.slide.hover { z-index: 5; }
#sliderWrap .slides ul li.slide .tekno { -ms-interpolation-mode: bicubic; position: absolute; left: 10px; top: 5px; width: 234px; height: 210px; }
#sliderWrap .slides ul li.slide img {background: none repeat scroll 0% 0% #ccc;border: 1px solid #ccc;padding: 6px;}
#sliderWrap .slides ul li.slide .tekno h3  { margin: 0; font-size: 20px; padding: 10px 4px 3px; }
#sliderWrap .slides ul li.slide .tekno h3 a  { font-family: 'PT Sans',Arial,sans-serif;color: #000;
font-size: 11px; }
#sliderWrap .slides ul li.slide .tekno p  { line-height: 18px; margin-bottom: 0.5em; padding: 3px 10px 10px; color: #707070;font-size: 11px;}
#sliderWrap .slider a.previous {position: absolute;right: -60px;width: 51px;z-index: 9999;top: 50%;}
#sliderWrap .slider a.next {height: 51px;left: -40px;position: absolute;top: 50%;z-index: 9999;}
#sliderWrap .slider a.previous:hover, #sliderWrap .slider a.next:hover { opacity: 0.9; }
#sliderWrap .post-meta {padding: 15px 4px;}
#sliderWrap .button {}
#sliderWrap .button a:link, #sliderWrap .button a:visited {color:#000000;}
#sliderWrap .slides ul li.slide.hover .tekno .button {display: inline-block;}
son olarak şu koddaki kısımı
teknoromicom_manset($board = 1, $limit = 10, $start = null, $length = 200, $output_method = 'echo');
$board = 1, istediğiniz board numarasını giriniz
ekte verdiğim resimleri Themes/default/images klasörüne
ekte verdiğim js dosyasını Themes/default/scripts klasörüne kopyalıyın
emeğe saygı bir teşekkür etmeden geçmeyin teknoromi.com




  1. 632

  2. 251
teşekkürler çok güzel bir mod.

bir sorunum var.

bu değişiklikleri yapınca manşet alanı site dışına taşıyor.

ilgili width alanını değiştirip taşmayacak şekilde ayarladım ama bu seferde sadece benim pc ekranıma göre ayarlanmış oluyor. crome den ekran zoom ayarlamasını yapıp tüm ekranlara göre kontrol ettiğimde çözünütlüğü yükselttikçe manşet ekranı küçülüyor . düşürdükçe ekranın dışına çıkıyor. otomatik ayar sistemi yapılabilirmi? ne olursa olsun smf sınırlarının dışına çıkmaması sağlanırmı?

width ayarına %100 , normal ,auto gibi kodlar yazarak denemeler yaptım ama beceremedim.

saygılar .


*

  1. 3,084

  2. 584

  3. 973
her çözünürlüğe göre ayarlamak zor olur



  1. 632

  2. 251

Çok güzel kardeşim ellerine sağlık.

Bunu SimplePortal!a uygulayabilir miyiz?

*

  1. 1,131

  2. 105

  3. 331
Alıntı yapılan: crazy_man - 01 May 2015 18:41Çok güzel kardeşim ellerine sağlık.

Bunu SimplePortal!a uygulayabilir miyiz?
Evet.

Php oluştur diyin ve altdakileri yapıştırın. Css vb. ilk mesajın bilgileri doğrultusunda ekleyin.
//teknoromi.com manşet haber code
teknoromicom_manset($board =1, $limit = 10, $start = null, $length = 200, $output_method = 'echo');
//teknoromi.com manşet haber code
//teknoromi.com manşet haber code
function teknoromicom_manset($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
{
 global $scripturl, $txt, $settings, $modSettings, $context;
 global $smcFunc;
 
 loadLanguage('Stats');

 // Must be integers....
 if ($limit === null)
 $limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 0;
 else
 $limit = (int) $limit;

 if ($start === null)
 $start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
 else
 $start = (int) $start;

 if ($board !== null)
 $board = (int) $board;
 elseif (isset($_GET['board']))
 $board = (int) $_GET['board'];

 if ($length === null)
 $length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
 else
 $length = (int) $length;

 $limit = max(0, $limit);
 $start = max(0, $start);
 
 // Make sure guests can see this board.
 $request = $smcFunc['db_query']('', '
 SELECT id_board
 FROM {db_prefix}boards
 WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
 AND ') . 'FIND_IN_SET(-1, member_groups) != 0
 LIMIT 1',
 array(
 'current_board' => $board,
 )
 );
 if ($smcFunc['db_num_rows']($request) == 0)
 {
 if ($output_method == 'echo')
 die($txt['ssi_no_guests']);
 else
 return array();
 }
 list ($board) = $smcFunc['db_fetch_row']($request);
 $smcFunc['db_free_result']($request);

 // Load the message icons - the usual suspects.
 $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless');
 $icon_sources = array();
 foreach ($stable_icons as $icon)
 $icon_sources[$icon] = 'images_url';
 
 // Find the post ids.
 $request = $smcFunc['db_query']('', '
 SELECT t.id_first_msg
 FROM {db_prefix}topics as t
 LEFT JOIN {db_prefix}boards as b ON (b.id_board = t.id_board)
 WHERE t.id_board = {int:current_board}' . ($modSettings['postmod_active'] ? '
 AND t.approved = {int:is_approved}' : '') . '
 AND {query_see_board}
 ORDER BY t.id_first_msg DESC
 LIMIT ' . $start . ', ' . $limit,
 array(
 'current_board' => $board,
 'is_approved' => 1,
 )
 );
 
 $posts = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 $posts[] = $row['id_first_msg'];
 $smcFunc['db_free_result']($request);

 if (empty($posts))
 return array();

 // Find the posts.
 $request = $smcFunc['db_query']('', '
 SELECT
 m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
 t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg, m.id_board
 FROM {db_prefix}topics AS t
 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
 LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 WHERE t.id_first_msg IN ({array_int:post_list})
 ORDER BY t.id_first_msg DESC
 LIMIT ' . count($posts),
 array(
 'post_list' => $posts,
 )
 );
 $return = array();
 $recycle_board = !empty($modSettings['recycle_enable']) && !empty($modSettings['recycle_board']) ? (int) $modSettings['recycle_board'] : 0;
 while ($row = $smcFunc['db_fetch_assoc']($request))
 {
 // If we want to limit the length of the post.
 if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $cutoff = false;

 $last_space = strrpos($row['body'], ' ');
 $last_open = strrpos($row['body'], '<');
 $last_close = strrpos($row['body'], '>');
 if (empty($last_space) || ($last_space == $last_open   3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
 $cutoff = $last_open;
 elseif (empty($last_close) || $last_close < $last_open)
 $cutoff = $last_space;

 if ($cutoff !== false)
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $row['body'] .= '...';
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 if (!empty($recycle_board) && $row['id_board'] == $recycle_board)
 $row['icon'] = 'recycled';

 // Check that this message icon is there...
 if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
 // $row['body'] içerisinde <img> kodu ara
   $secimyap = preg_match_all('/<img. src=[\'"]([^\'"] )[\'"].*>/i', $row['body'], $sonuc);
   // src="" içindekini al.
 if(!empty($sonuc[0]) && !empty($sonuc[1]))
   $ilkresim = $sonuc [1] [0];
 
  else{ // Resim bulunmazsa default resim ekle
     $ilkresim = $settings['theme_url'] . '/images/resimyok.jpg';
   } censorText($row['subject']);
 censorText($row['body']);

 $return[] = array(
 'id' => $row['id_topic'],
 'message_id' => $row['id_msg'],
 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" alt="' . $row['icon'] . '">',
 'subject' => $row['subject'],
 'short_subject' => shorten_subject($row['subject'], 37),
 'resim' => $ilkresim,
 'time' => timeformat($row['poster_time']),
 'timestamp' => forum_time(true, $row['poster_time']),
 'body' => $row['body'],
 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
 'link' => '<a class="yorum" href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
 'replies' => $row['num_replies'],
 'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'],
 'comment_link' => !empty($row['locked']) ? '' : '<a class="yorum" href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'poster' => array(
 'id' => $row['id_member'],
 'name' => $row['poster_name'],
 'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
 'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
 ),
 'locked' => !empty($row['locked']),
 'is_last' => false
 );
 }
 $smcFunc['db_free_result']($request);

 if (empty($return))
 return $return;

 $return[count($return) - 1]['is_last'] = true;

 if ($output_method != 'echo')
 return $return;
          echo'
               <script type="text/javascript">
               /* <![CDATA[ */
               var woo_jcarousellite_settings = {"autoStart":"6","interval":"6","speed":"600","hoverPause":"1","visible":"4","scroll":"1","circular":"1"};
                /* ]]> */
                </script>
                <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/teknoromi.js"></script>
                <div style="width: 1024px; margin-left: auto; margin-right: auto;">
                <div id="sliderWrap">
 <div id="slider" class="slider">
 <div  id="slides" class="slides">
 <ul >';
 foreach ($return as $news)
     {
  echo '<li class="slide slide-count-4"><div class="tekno">
 <a href="', $news['href'], '"> <img src="', $news['resim'], '" alt="', $news['subject'], '" class="slide-image wp-post-image" height="100" width="216"/></a>
 <h3><a href="', $news['href'], '">', $news['short_subject'], '</a></h3>
 <div>', $news['time'], ' </div>
 <div class="entry">', temizle($news['body']), ' </div>
 </div></li>';
     }
          echo'</ul>
       <div class="fix"></div></div>
               <a sl-processed="1" href="#" class="next btn-next"><img src="', $settings['default_theme_url'], '/images/leftControl.png"/></a>
       <a sl-processed="1" href="#" class="previous btn-previous"><img src="', $settings['default_theme_url'], '/images/rightControl.png"/></a></div>
   </div></div>';
}
function temizle($haber) {
     $strs=explode('<',$haber);
     $res=$strs[0];
     for($i=1;$i<count($strs);$i  )
     {
         if(!strpos($strs[$i],'>'))
             $res = $res.'&lt;'.$strs[$i];
         else
             $res = $res.'<'.$strs[$i];
     }
     return strip_tags($res);   
 }
 //teknoromi.com manşet haber code




  1. 632

  2. 251

Parse error: syntax error, unexpected T_LNUMBER in .../public_html/Sources/PortalBlocks.php(3592) : eval()'d code on line 115

şeklinde hata alıyorum neden olabilir?

*

  1. 1,131

  2. 105

  3. 331
function teknoromicom_manset($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
{
 global $scripturl, $txt, $settings, $modSettings, $context;
 global $smcFunc;
 
 loadLanguage('Stats');

 // Must be integers....
 if ($limit === null)
 $limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 0;
 else
 $limit = (int) $limit;

 if ($start === null)
 $start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
 else
 $start = (int) $start;

 if ($board !== null)
 $board = (int) $board;
 elseif (isset($_GET['board']))
 $board = (int) $_GET['board'];

 if ($length === null)
 $length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
 else
 $length = (int) $length;

 $limit = max(0, $limit);
 $start = max(0, $start);
 
 // Make sure guests can see this board.
 $request = $smcFunc['db_query']('', '
 SELECT id_board
 FROM {db_prefix}boards
 WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
 AND ') . 'FIND_IN_SET(-1, member_groups) != 0
 LIMIT 1',
 array(
 'current_board' => $board,
 )
 );
 if ($smcFunc['db_num_rows']($request) == 0)
 {
 if ($output_method == 'echo')
 die($txt['ssi_no_guests']);
 else
 return array();
 }
 list ($board) = $smcFunc['db_fetch_row']($request);
 $smcFunc['db_free_result']($request);

 // Load the message icons - the usual suspects.
 $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless');
 $icon_sources = array();
 foreach ($stable_icons as $icon)
 $icon_sources[$icon] = 'images_url';
 
 // Find the post ids.
 $request = $smcFunc['db_query']('', '
 SELECT t.id_first_msg
 FROM {db_prefix}topics as t
 LEFT JOIN {db_prefix}boards as b ON (b.id_board = t.id_board)
 WHERE t.id_board = {int:current_board}' . ($modSettings['postmod_active'] ? '
 AND t.approved = {int:is_approved}' : '') . '
 AND {query_see_board}
 ORDER BY t.id_first_msg DESC
 LIMIT ' . $start . ', ' . $limit,
 array(
 'current_board' => $board,
 'is_approved' => 1,
 )
 );
 
 $posts = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 $posts[] = $row['id_first_msg'];
 $smcFunc['db_free_result']($request);

 if (empty($posts))
 return array();

 // Find the posts.
 $request = $smcFunc['db_query']('', '
 SELECT
 m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
 t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg, m.id_board
 FROM {db_prefix}topics AS t
 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
 LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 WHERE t.id_first_msg IN ({array_int:post_list})
 ORDER BY t.id_first_msg DESC
 LIMIT ' . count($posts),
 array(
 'post_list' => $posts,
 )
 );
 $return = array();
 $recycle_board = !empty($modSettings['recycle_enable']) && !empty($modSettings['recycle_board']) ? (int) $modSettings['recycle_board'] : 0;
 while ($row = $smcFunc['db_fetch_assoc']($request))
 {
 // If we want to limit the length of the post.
 if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $cutoff = false;

 $last_space = strrpos($row['body'], ' ');
 $last_open = strrpos($row['body'], '<');
 $last_close = strrpos($row['body'], '>');
 if (empty($last_space) || ($last_space == $last_open   3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
 $cutoff = $last_open;
 elseif (empty($last_close) || $last_close < $last_open)
 $cutoff = $last_space;

 if ($cutoff !== false)
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $row['body'] .= '...';
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 if (!empty($recycle_board) && $row['id_board'] == $recycle_board)
 $row['icon'] = 'recycled';

 // Check that this message icon is there...
 if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
 // $row['body'] içerisinde <img> kodu ara
   $secimyap = preg_match_all('/<img. src=[\'"]([^\'"] )[\'"].*>/i', $row['body'], $sonuc);
   // src="" içindekini al.
 if(!empty($sonuc[0]) && !empty($sonuc[1]))
   $ilkresim = $sonuc [1] [0];
 
  else{ // Resim bulunmazsa default resim ekle
     $ilkresim = $settings['theme_url'] . '/images/resimyok.jpg';
   } censorText($row['subject']);
 censorText($row['body']);

 $return[] = array(
 'id' => $row['id_topic'],
 'message_id' => $row['id_msg'],
 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" alt="' . $row['icon'] . '">',
 'subject' => $row['subject'],
 'short_subject' => shorten_subject($row['subject'], 37),
 'resim' => $ilkresim,
 'time' => timeformat($row['poster_time']),
 'timestamp' => forum_time(true, $row['poster_time']),
 'body' => $row['body'],
 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
 'link' => '<a class="yorum" href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
 'replies' => $row['num_replies'],
 'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'],
 'comment_link' => !empty($row['locked']) ? '' : '<a class="yorum" href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'poster' => array(
 'id' => $row['id_member'],
 'name' => $row['poster_name'],
 'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
 'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
 ),
 'locked' => !empty($row['locked']),
 'is_last' => false
 );
 }
 $smcFunc['db_free_result']($request);

 if (empty($return))
 return $return;

 $return[count($return) - 1]['is_last'] = true;

 if ($output_method != 'echo')
 return $return;
          echo'
               <script type="text/javascript">
               /* <![CDATA[ */
               var woo_jcarousellite_settings = {"autoStart":"6","interval":"6","speed":"600","hoverPause":"1","visible":"4","scroll":"1","circular":"1"};
                /* ]]> */
                </script>
                <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/teknoromi.js"></script>
                <div style="width: 1024px; margin-left: auto; margin-right: auto;">
                <div id="sliderWrap">
 <div id="slider" class="slider">
 <div  id="slides" class="slides">
 <ul >';
 foreach ($return as $news)
     {
  echo '<li class="slide slide-count-4"><div class="tekno">
 <a href="', $news['href'], '"> <img src="', $news['resim'], '" alt="', $news['subject'], '" class="slide-image wp-post-image" height="100" width="216"/></a>
 <h3><a href="', $news['href'], '">', $news['short_subject'], '</a></h3>
 <div>', $news['time'], ' </div>
 <div class="entry">', temizle($news['body']), ' </div>
 </div></li>';
     }
          echo'</ul>
       <div class="fix"></div></div>
               <a sl-processed="1" href="#" class="next btn-next"><img src="', $settings['default_theme_url'], '/images/leftControl.png"/></a>
       <a sl-processed="1" href="#" class="previous btn-previous"><img src="', $settings['default_theme_url'], '/images/rightControl.png"/></a></div>
   </div></div>';
}
function temizle($haber) {
     $strs=explode('<',$haber);
     $res=$strs[0];
     for($i=1;$i<count($strs);$i  )
     {
         if(!strpos($strs[$i],'>'))
             $res = $res.'&lt;'.$strs[$i];
         else
             $res = $res.'<'.$strs[$i];
     }
     return strip_tags($res);   
 }
 
teknoromicom_manset($board =1, $limit = 10, $start = null, $length = 200, $output_method = 'echo');
Kodlar aşağıya doğru okunuyor şöyle bir yaptım çalışır diye umut ediyorum bir bakın olmaz ise simpleportal kurup bakmak gerekicek.



  1. 632

  2. 251

Parse error: syntax error, ...
Hata veriyor dostum :(



  1. 632

  2. 251
Ellerine sağlık kardeşim şimdi modu kuruyorum :)

*

  1. 3,084

  2. 584

  3. 973



  1. 632

  2. 251
28 Mar 2016 03:15 #10 Son düzenlenme: 28 Mar 2016 13:47 snrj
Alıntı yapılan: snrj - 19 May 2014 02:04alıntı ilk konu yer kaplamaması için silindi

Merhaba kurulumu sorunsuz yaptım ama anasayfa görünmüyor bana yardımcı olurmusunuz,board id girdim yinede çıkmadI.Smf 2.0.11 version yardımcı olursanız sevinirim.

*

  1. 3,084

  2. 584

  3. 973
28 Mar 2016 13:48 #11 Son düzenlenme: 28 Mar 2016 14:24 snrj
kodu şimdi denedim localhost ta herhangi bir sıkıntı görünmüyor sitenize şimdi bakıyorum

baktım yaptım çalıştı :D
board kendinize göre düzeltebisiriniz



  1. 632

  2. 251
Kardeşim ellerine sağlık çok güzel olmuş çok sağol

*

  1. 3,084

  2. 584

  3. 973
çoklu bölüm seçme için boardindex.templatedeki değişiklikleri geri alıp alttakini uygulayın
boardindex.template.php de bul
echo '
 <div id="boardindex_table">


üstüne ekle
global $scripturl, $txt, $settings, $modSettings, $context, $smcFunc, $color_profile;
$parameters = array(
  'board' => array(1,2),
  'limit' => '10',
  'length' => '400',
);
teknoromi($parameters);


bul (sayfa sonunda)
?>
öncesine ekle
function teknoromi($parameters)
{
global $scripturl, $txt, $settings, $modSettings, $context, $smcFunc, $color_profile;
 $block_parameters = array(
 'board' => 'boards',
 'limit' => 'int',
 'start' => 'int',
 'length' => 'int',
 'avatar' => 'check',
 
 );
 $board = $parameters['board'];
 $limit = !empty($parameters['limit']) ? (int) $parameters['limit'] : 30;
 $start = !empty($parameters['start']) ? (int) $parameters['start'] : 0;
 $length = isset($parameters['length']) ? (int) $parameters['length'] : 500;
 $avatars = !empty($parameters['avatar']);
 

 $limit = max(0, $limit);
 $start = max(0, $start);

 loadLanguage('Stats');

 $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
 $icon_sources = array();
 foreach ($stable_icons as $icon)
 $icon_sources[$icon] = 'images_url';

 $board_count = count($parameters['board']);
 
 $board_limit = 1;
 $where = 'FIND_IN_SET(-1, member_groups)';
 if ($board_count > 1)
 {
 $where = 'id_board IN ({array_int:board_list}) AND ' . $where;
 $board_limit = $board_count;
 }
 $request = $smcFunc['db_query']('', '
 SELECT id_board
 FROM {db_prefix}boards
 WHERE ' . $where . '
 LIMIT {int:limit}',
 array(
 'board_list' => $parameters['board'],
 'limit' => $board_limit,
 )
 );
 if ($smcFunc['db_num_rows']($request) == 0)
 {
 if ($output_method == 'echo')
 die($txt['ssi_no_guests']);
 else
 return array();
 }
 
 $allowed_boards = array();
 while($row = $smcFunc['db_fetch_row']($request))
 $allowed_boards[] = $row[0];
 $smcFunc['db_free_result']($request);
 
 if ($board_count > 0)
 $parameters['board'] = array_intersect($parameters['board'], $allowed_boards);
 else
 $parameters['board'] = $allowed_boards;

 if (count($parameters['board']) == 0)
 $parameters['board'] = array(0);

// Find the post ids.
 $request = $smcFunc['db_query']('', '
 SELECT id_first_msg, icon
 FROM {db_prefix}topics AS t INNER JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg)
 WHERE t.id_board IN ({array_int:board_list})' . ($modSettings['postmod_active'] ? '
 AND t.approved = {int:is_approved}' : '') . '
 ORDER BY id_first_msg DESC
 LIMIT ' . $start . ', ' . $limit,
 array(
 'board_list' => $parameters['board'],
 'is_approved' => 1,
 
 )
 );
 $posts = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 $posts[] = $row['id_first_msg'];
 $smcFunc['db_free_result']($request);


 $request = $smcFunc['db_query']('', '
 SELECT
 m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
 t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, mem.avatar,
 a.id_attach, a.attachment_type, a.filename, t.num_views
 FROM {db_prefix}topics AS t
 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
 LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
 WHERE t.id_first_msg IN ({array_int:post_list})
 ORDER BY t.id_first_msg DESC
 LIMIT ' . (!empty($per_page) ? '{int:start}, ' : '') . '{int:limit}',
 array(
 'post_list' => $posts,
 'start' => $start,
 'limit' => !empty($per_page) ? $per_page : $limit,
 )
 );
 $return = array();
 $colorids = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 {
 $limited = false;
 if (($cutoff = $smcFunc['strpos']($row['body'], '[cutoff]')) !== false)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $limited = true;
 }
 elseif (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $limited = true;
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 // Only place an ellipsis if the body has been shortened.
 if ($limited)
 $row['body'] .= '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a>';

 if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 {
 $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
 $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
 }
 else
 {
 $avatar_width = '';
 $avatar_height = '';
 }

 if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

 
 // If we want to limit the length of the post.
 if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $cutoff = false;
 $last_space = strrpos($row['body'], ' ');
 $last_open = strrpos($row['body'], '<');
 $last_close = strrpos($row['body'], '>');
 if (empty($last_space) || ($last_space == $last_open + 3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
 $cutoff = $last_open;
 elseif (empty($last_close) || $last_close < $last_open)
 $cutoff = $last_space;

 if ($cutoff !== false)
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $row['body'] .= '...';
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 if (!empty($recycle_board) && $row['id_board'] == $recycle_board)
 $row['icon'] = 'recycled';

 // Check that this message icon is there...
 if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
 // $row['body'] içerisinde <img> kodu ara
   $secimyap = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $row['body'], $sonuc);
   // src="" içindekini al.
 if(!empty($sonuc[0]) && !empty($sonuc[1]))
   $ilkresim = $sonuc [1] [0];
  else{ // Resim bulunmazsa default resim ekle
     $ilkresim = $settings['theme_url'] . '/images/resimyok.jpg';
   }
 censorText($row['subject']);
 censorText($row['body']);

 $row['body'] = preg_replace('~class="bbc_img~i', 'class="bbc_img sp_article', $row['body']);

 if (!empty($row['id_member']))
 $colorids[$row['id_member']] = $row['id_member'];

 $return[] = array(
 'id' => $row['id_topic'],
 'message_id' => $row['id_msg'],
 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
 'subject' => $row['subject'],
 'short_subject' => shorten_subject($row['subject'], 33),
 'resim' => $ilkresim,
 'time' => timeformat($row['poster_time']),
 'views' => $row['num_views'],
 'body' => $row['body'],
 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
 'link' => '<a class="yorum" href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
 'replies' => $row['num_replies'],
 'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'],
 'comment_link' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'new_comment' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'poster' => array(
 'id' => $row['id_member'],
 'name' => $row['poster_name'],
 'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
 'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
 ),
 'locked' => !empty($row['locked']),
 'is_last' => false,
 'avatar' => array(
 'name' => $row['avatar'],
 'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
 'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
 'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
 ),
 );
 }
$smcFunc['db_free_result']($request);


 $return[count($return) - 1]['is_last'] = true;

 if (!empty($colorids) &&($colorids) !== false)
 {
 foreach ($return as $k => $p)
 {
 if (!empty($color_profile[$p['poster']['id']]['link']))
 $return[$k]['poster']['link'] = $color_profile[$p['poster']['id']]['link'];
 }
 }

          echo'
               <script type="text/javascript">
               /* <![CDATA[ */
               var woo_jcarousellite_settings = {"autoStart":"6","interval":"6","speed":"600","hoverPause":"1","visible":"4","scroll":"1","circular":"1"};
                /* ]]> */
                </script>
                <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/teknoromi.js"></script>
                <div style="width: 1024px; margin-left: auto; margin-right: auto;">
                <div id="sliderWrap">
 <div id="slider" class="slider">
 <div  id="slides" class="slides">
 <ul >';
 foreach ($return as $news)
     {
  echo '<li class="slide slide-count-4"><div class="tekno">
 <a href="', $news['href'], '"> <img src="', $news['resim'], '" alt="', $news['subject'], '" class="slide-image wp-post-image" height="100" width="216"/></a>
 <h3><a href="', $news['href'], '">', $news['short_subject'], '</a></h3>
 <div>', $news['time'], ' </div>
 <div class="entry">', temizle($news['body']), ' </div>
 </div></li>';
     }
          echo'</ul>
       <div class="fix"></div></div>
               <a sl-processed="1" href="#" class="next btn-next"><img src="', $settings['default_theme_url'], '/images/leftControl.png"/></a>
       <a sl-processed="1" href="#" class="previous btn-previous"><img src="', $settings['default_theme_url'], '/images/rightControl.png"/></a></div>
   </div></div>';
}

function temizle($haber) {
     $strs=explode('<',$haber);
     $res=$strs[0];
     for($i=1;$i<count($strs);$i++)
     {
         if(!strpos($strs[$i],'>'))
             $res = $res.'&lt;'.$strs[$i];
         else
             $res = $res.'<'.$strs[$i];
     }
     return strip_tags($res);   
 }
 //teknoromi.com manşet haber code


bölümleri kendinize göre belirleyin alttaki kodu
'board' => array(1,2), 'board' => array(3,5,30,35),

şeklinde değiştirebilirsiniz



  1. 632

  2. 251
Alıntı yapılan: snrj - 31 Mar 2016 22:11çoklu bölüm seçme için boardindex.templatedeki değişiklikleri geri alıp alttakini uygulayın
boardindex.template.php de bul
echo '
 <div id="boardindex_table">


üstüne ekle
global $scripturl, $txt, $settings, $modSettings, $context, $smcFunc, $color_profile;
$parameters = array(
  'board' => array(1,2),
  'limit' => '10',
  'length' => '400',
);
teknoromi($parameters);


bul (sayfa sonunda)
?>
öncesine ekle
function teknoromi($parameters)
{
global $scripturl, $txt, $settings, $modSettings, $context, $smcFunc, $color_profile;
 $block_parameters = array(
 'board' => 'boards',
 'limit' => 'int',
 'start' => 'int',
 'length' => 'int',
 'avatar' => 'check',
 
 );
 $board = $parameters['board'];
 $limit = !empty($parameters['limit']) ? (int) $parameters['limit'] : 30;
 $start = !empty($parameters['start']) ? (int) $parameters['start'] : 0;
 $length = isset($parameters['length']) ? (int) $parameters['length'] : 500;
 $avatars = !empty($parameters['avatar']);
 

 $limit = max(0, $limit);
 $start = max(0, $start);

 loadLanguage('Stats');

 $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
 $icon_sources = array();
 foreach ($stable_icons as $icon)
 $icon_sources[$icon] = 'images_url';

 $board_count = count($parameters['board']);
 
 $board_limit = 1;
 $where = 'FIND_IN_SET(-1, member_groups)';
 if ($board_count > 1)
 {
 $where = 'id_board IN ({array_int:board_list}) AND ' . $where;
 $board_limit = $board_count;
 }
 $request = $smcFunc['db_query']('', '
 SELECT id_board
 FROM {db_prefix}boards
 WHERE ' . $where . '
 LIMIT {int:limit}',
 array(
 'board_list' => $parameters['board'],
 'limit' => $board_limit,
 )
 );
 if ($smcFunc['db_num_rows']($request) == 0)
 {
 if ($output_method == 'echo')
 die($txt['ssi_no_guests']);
 else
 return array();
 }
 
 $allowed_boards = array();
 while($row = $smcFunc['db_fetch_row']($request))
 $allowed_boards[] = $row[0];
 $smcFunc['db_free_result']($request);
 
 if ($board_count > 0)
 $parameters['board'] = array_intersect($parameters['board'], $allowed_boards);
 else
 $parameters['board'] = $allowed_boards;

 if (count($parameters['board']) == 0)
 $parameters['board'] = array(0);

// Find the post ids.
 $request = $smcFunc['db_query']('', '
 SELECT id_first_msg, icon
 FROM {db_prefix}topics AS t INNER JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg)
 WHERE t.id_board IN ({array_int:board_list})' . ($modSettings['postmod_active'] ? '
 AND t.approved = {int:is_approved}' : '') . '
 ORDER BY id_first_msg DESC
 LIMIT ' . $start . ', ' . $limit,
 array(
 'board_list' => $parameters['board'],
 'is_approved' => 1,
 
 )
 );
 $posts = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 $posts[] = $row['id_first_msg'];
 $smcFunc['db_free_result']($request);


 $request = $smcFunc['db_query']('', '
 SELECT
 m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
 t.num_replies, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, mem.avatar,
 a.id_attach, a.attachment_type, a.filename, t.num_views
 FROM {db_prefix}topics AS t
 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
 LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
 WHERE t.id_first_msg IN ({array_int:post_list})
 ORDER BY t.id_first_msg DESC
 LIMIT ' . (!empty($per_page) ? '{int:start}, ' : '') . '{int:limit}',
 array(
 'post_list' => $posts,
 'start' => $start,
 'limit' => !empty($per_page) ? $per_page : $limit,
 )
 );
 $return = array();
 $colorids = array();
 while ($row = $smcFunc['db_fetch_assoc']($request))
 {
 $limited = false;
 if (($cutoff = $smcFunc['strpos']($row['body'], '[cutoff]')) !== false)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $limited = true;
 }
 elseif (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $limited = true;
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 // Only place an ellipsis if the body has been shortened.
 if ($limited)
 $row['body'] .= '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a>';

 if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 {
 $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
 $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
 }
 else
 {
 $avatar_width = '';
 $avatar_height = '';
 }

 if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

 
 // If we want to limit the length of the post.
 if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 {
 $row['body'] = $smcFunc['substr']($row['body'], 0, $length);
 $cutoff = false;
 $last_space = strrpos($row['body'], ' ');
 $last_open = strrpos($row['body'], '<');
 $last_close = strrpos($row['body'], '>');
 if (empty($last_space) || ($last_space == $last_open + 3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
 $cutoff = $last_open;
 elseif (empty($last_close) || $last_close < $last_open)
 $cutoff = $last_space;

 if ($cutoff !== false)
 $row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
 $row['body'] .= '...';
 }

 $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

 if (!empty($recycle_board) && $row['id_board'] == $recycle_board)
 $row['icon'] = 'recycled';

 // Check that this message icon is there...
 if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
 $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
 // $row['body'] içerisinde <img> kodu ara
   $secimyap = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $row['body'], $sonuc);
   // src="" içindekini al.
 if(!empty($sonuc[0]) && !empty($sonuc[1]))
   $ilkresim = $sonuc [1] [0];
  else{ // Resim bulunmazsa default resim ekle
     $ilkresim = $settings['theme_url'] . '/images/resimyok.jpg';
   }
 censorText($row['subject']);
 censorText($row['body']);

 $row['body'] = preg_replace('~class="bbc_img~i', 'class="bbc_img sp_article', $row['body']);

 if (!empty($row['id_member']))
 $colorids[$row['id_member']] = $row['id_member'];

 $return[] = array(
 'id' => $row['id_topic'],
 'message_id' => $row['id_msg'],
 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
 'subject' => $row['subject'],
 'short_subject' => shorten_subject($row['subject'], 33),
 'resim' => $ilkresim,
 'time' => timeformat($row['poster_time']),
 'views' => $row['num_views'],
 'body' => $row['body'],
 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
 'link' => '<a class="yorum" href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
 'replies' => $row['num_replies'],
 'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'],
 'comment_link' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'new_comment' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
 'poster' => array(
 'id' => $row['id_member'],
 'name' => $row['poster_name'],
 'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
 'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
 ),
 'locked' => !empty($row['locked']),
 'is_last' => false,
 'avatar' => array(
 'name' => $row['avatar'],
 'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
 'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
 'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
 ),
 );
 }
$smcFunc['db_free_result']($request);


 $return[count($return) - 1]['is_last'] = true;

 if (!empty($colorids) &&($colorids) !== false)
 {
 foreach ($return as $k => $p)
 {
 if (!empty($color_profile[$p['poster']['id']]['link']))
 $return[$k]['poster']['link'] = $color_profile[$p['poster']['id']]['link'];
 }
 }

          echo'
               <script type="text/javascript">
               /* <![CDATA[ */
               var woo_jcarousellite_settings = {"autoStart":"6","interval":"6","speed":"600","hoverPause":"1","visible":"4","scroll":"1","circular":"1"};
                /* ]]> */
                </script>
                <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/teknoromi.js"></script>
                <div style="width: 1024px; margin-left: auto; margin-right: auto;">
                <div id="sliderWrap">
 <div id="slider" class="slider">
 <div  id="slides" class="slides">
 <ul >';
 foreach ($return as $news)
     {
  echo '<li class="slide slide-count-4"><div class="tekno">
 <a href="', $news['href'], '"> <img src="', $news['resim'], '" alt="', $news['subject'], '" class="slide-image wp-post-image" height="100" width="216"/></a>
 <h3><a href="', $news['href'], '">', $news['short_subject'], '</a></h3>
 <div>', $news['time'], ' </div>
 <div class="entry">', temizle($news['body']), ' </div>
 </div></li>';
     }
          echo'</ul>
       <div class="fix"></div></div>
               <a sl-processed="1" href="#" class="next btn-next"><img src="', $settings['default_theme_url'], '/images/leftControl.png"/></a>
       <a sl-processed="1" href="#" class="previous btn-previous"><img src="', $settings['default_theme_url'], '/images/rightControl.png"/></a></div>
   </div></div>';
}

function temizle($haber) {
     $strs=explode('<',$haber);
     $res=$strs[0];
     for($i=1;$i<count($strs);$i++)
     {
         if(!strpos($strs[$i],'>'))
             $res = $res.'&lt;'.$strs[$i];
         else
             $res = $res.'<'.$strs[$i];
     }
     return strip_tags($res);   
 }
 //teknoromi.com manşet haber code


bölümleri kendinize göre belirleyin alttaki kodu
'board' => array(1,2), 'board' => array(3,5,30,35),

şeklinde değiştirebilirsiniz

Kardeşim cansın yaa kaç gündür uğraşıyorum nasıl yaparım diye ellerine sağlık...


MENU ×