Sidebar ayın üyesi destek

Üyelerimizin de gönüllü katkıları ile phpbb desteği verilmektedir.

Moderatör: kaptangula

Forum kuralları
Burada paylaşılan kodlar, (Kod size ait değilse) başka bir sitede referans gösterilmeden paylaşılamaz. Aynı Şekilde, başka sitelerden alıntı yapılan kodlar için referans gösterilerek kod paylaşılmalıdır.
Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

@kaptangula gelince görüşürüz inşallah..
Kullanıcı avatarı
kaptangula
Moderatör
Moderatör
Mesajlar: 41
Kayıt: 23 May 2012, 20:21
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen kaptangula »

Merhaba abi yeni ayın geçen ayın poster nasıl yapabilirim yardımcı olabilirmisin?
Dosya ekleri
IMG_20210815_223310.jpg
IMG_20210815_223310.jpg (36.15 KiB) 1357 kere görüntülendi
☪ www.sambah.net ☪
Resim
Resim
Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

Yukarıda anlatılan bloktan bir tane daha yap. sonra yeni yaptığın bu blokta aşağıdaki değişiklikleri yap:
bu ayın üyesi bloğunda bul (sidebar.php):

Kod: Tümünü seç

		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;

		/*
		// Top posters_ever (minus the present month) UTC - Thx Steve 
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );
		$end_last_month = gmmktime(23, 59, 59, $month, $max_days, $year);
		*/
		 // Start time for current month
		$month_start_cur	= gmmktime (0,0,0, $month_cur, 1, $year_cur);
		$month_start		= $month_start_cur;
		$month_end			= $now;
geçen ayın üyesi için yaptığın blokta bu şekilde değiştir:

Kod: Tümünü seç

		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;

		/*
		// Top posters_ever (minus the present month) UTC - Thx Steve 
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );
		$end_last_month = gmmktime(23, 59, 59, $month, $max_days, $year);
		*/
		 // Start time for current month
		$month_start_cur	= gmmktime (0,0,0, $month_cur, 1, $year_cur);
		$month_start		= $month_start_cur;
		$month_end			= $now;
ayrıca bazı kodların aynı olmamasında fayda var. mesela:
bunun yerine:

Kod: Tümünü seç

$this->template->assign_block_vars('poster_ofmonth', array(
bunu kullanabilirsin:

Kod: Tümünü seç

$this->template->assign_block_vars('poster_oflastmonth', array(
Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

yeni bir html dosyası oluşturmana gerek yok.
bul:
template/modules/poster_ofmonth_side.html

içeriğini ekte gönderdiğim dosya içeriği ile değiştir
Dosya ekleri
poster_ofmonth_side.zip
(1.07 KiB) 39 kere indirildi
Kullanıcı avatarı
kaptangula
Moderatör
Moderatör
Mesajlar: 41
Kayıt: 23 May 2012, 20:21
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen kaptangula »

Ati10 yazdı: 15 Ağu 2021, 23:21 Yukarıda anlatılan bloktan bir tane daha yap. sonra yeni yaptığın bu blokta aşağıdaki değişiklikleri yap:
bu ayın üyesi bloğunda bul (sidebar.php):

Kod: Tümünü seç

		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;

		/*
		// Top posters_ever (minus the present month) UTC - Thx Steve 
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );
		$end_last_month = gmmktime(23, 59, 59, $month, $max_days, $year);
		*/
		 // Start time for current month
		$month_start_cur	= gmmktime (0,0,0, $month_cur, 1, $year_cur);
		$month_start		= $month_start_cur;
		$month_end			= $now;
geçen ayın üyesi için yaptığın blokta bu şekilde değiştir:

Kod: Tümünü seç

		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;

		/*
		// Top posters_ever (minus the present month) UTC - Thx Steve 
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );
		$end_last_month = gmmktime(23, 59, 59, $month, $max_days, $year);
		*/
		 // Start time for current month
		$month_start_cur	= gmmktime (0,0,0, $month_cur, 1, $year_cur);
		$month_start		= $month_start_cur;
		$month_end			= $now;
ayrıca bazı kodların aynı olmamasında fayda var. mesela:
bunun yerine:

Kod: Tümünü seç

$this->template->assign_block_vars('poster_ofmonth', array(
bunu kullanabilirsin:

Kod: Tümünü seç

$this->template->assign_block_vars('poster_oflastmonth', array(


Abi bu iki kodda aynı değilmi benmi birşey atlıyorum
☪ www.sambah.net ☪
Resim
Resim
Kullanıcı avatarı
kaptangula
Moderatör
Moderatör
Mesajlar: 41
Kayıt: 23 May 2012, 20:21
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen kaptangula »

Benim sidebar.php deki kod

Kod: Tümünü seç

//MONTH AYIN UYESI

	public function topuser_of_mounth()
	{
		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;

		/*
		// Top posters_ever (minus the present month) UTC - Thx Steve 
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );
		$end_last_month = gmmktime(23, 59, 59, $month, $max_days, $year);
		*/
		 // Start time for current month
		$month_start_cur	= gmmktime (0,0,0, $month_cur, 1, $year_cur);
		$month_start		= $month_start_cur;
		$month_end			= $now;
		
		/* Check cached data */
		if (($topposter_posts = $this->cache->get('_topposter_posts')) === false)
		{
			$sql = 'SELECT u.username, u.user_id, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_rank, MAX(u.user_type), p.poster_id, p.post_subject, MAX(p.post_time), p.post_id, COUNT(p.post_id) AS total_posts
				FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p
				WHERE u.user_id <> ' . ANONYMOUS . '

					AND u.user_id = p.poster_id
					AND p.post_visibility = ' . ITEM_APPROVED . '
					AND p.post_time BETWEEN ' . (int) $month_start . ' AND ' . (int) $month_end . '
				GROUP BY u.user_id
				ORDER BY total_posts DESC, MAX(p.post_time) DESC';

			$result = $this->db->sql_query_limit($sql, 1);
			
			$topposter_posts = array();
	
			while ($row = $this->db->sql_fetchrow($result))
			{
				$topposter_posts[] = $row;
			}
	  
			$this->db->sql_freeresult($result);

			// Cache for 5 min.
			$this->cache->put('_topposter_posts', $topposter_posts, 300);
		}

		foreach( $topposter_posts as $row )
		{
			$topuser_posts = $row['total_posts'];
			$username = ($this->auth->acl_get('u_viewprofile')) ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']);
			get_user_rank($row['user_rank'], $row['user_posts'], $row['rank_title'], $row['rank_image'], $row['rank_image_src']);
			$useravatar = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);
			$post_subject = $row['post_subject'];
			$post_id = $row['post_id'];
			$post_link = append_sid("{$this->phpbb_root_path}viewtopic.$this->php_ext", "p=" . $post_id . "#p" . $post_id);

			$this->template->assign_block_vars('poster_ofmonth', array(
				'S_TOPM'            => empty($topuser_posts) ? false : true,
				'S_SEARCH_ALLPOSTS'	=> append_sid("{$this->phpbb_root_path}search.$this->php_ext", 'author_id=' . $row['user_id'] . '&amp;sr=posts'),
				'TOPPOSTSUBJECT'	=> $post_subject,
				'U_TOPPOSTSUBJECT'	=> $post_link,
				'TOPUSER'			=> $username,
				'TOPUSER_AVATAR'	=> $useravatar,
				'TOPUSER_RANK'		=> $row['rank_title'],
				'RANK_IMG_SRC'		=> $row['rank_image_src'],
				'TOPM_POSTS_M'		=>	$topuser_posts,
			));
		}
		
		$this->template->assign_vars(array(	
			'S_TOPM'            => empty($topuser_posts) ? false : true,
		));	
	}
//MONTH AYIN UYESI END 
☪ www.sambah.net ☪
Resim
Resim
Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

haklısın, yeni kod bu şekilde olacak:

Kod: Tümünü seç

		// credit: threedi/tpotm
		// credit: threedi/tpotm
		$now = time();
		$date_today = gmdate("Y-m", $now);
		list($year_cur, $month_cur) = explode('-', $date_today);
		$month = (int) $month_cur -1;
		$year = (int) $year_cur;
		$max_days =  date( 't', gmmktime(23, 59, 59, $month, 1, $year) );

		// last month
			$from_month = 2;
			$to_month = 1;
			$month_start		= gmmktime(0, 0, 0, $month_cur-$from_month, $max_days, $year);
			$month_end			= gmmktime(23, 59, 59, $month_cur-$to_month, $max_days, $year);

Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

css değişikliğini de vermeyi unutmuşum:

Kod: Tümünü seç

/* Style the tab */
.tabtop {
  overflow: hidden;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
}

/* Style the buttons inside the tab */
.tabtop button {
  background-color: inherit;
  float: left;
  width: 50%;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 4px 6px;
  transition: 0.3s;
  font-size: 1.2em;
}

/* Change background color of buttons on hover */
.tabtop button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tabtop button.active {
  background-color: #ccc;
}

/* Create an active/current tablink class */
.tabtop button.activemobile {
  background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}
.tabcontent-mobile {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}
Kullanıcı avatarı
Ati10
Admin
Admin
Mesajlar: 973
Kayıt: 12 Eki 2006, 01:48
Konum: burhaniye
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen Ati10 »

mobile için de ekteki bloğu kullanabilirsin.
Dosya ekleri
poster_ofmonth_side_mobile.zip
(1.09 KiB) 38 kere indirildi
Kullanıcı avatarı
kaptangula
Moderatör
Moderatör
Mesajlar: 41
Kayıt: 23 May 2012, 20:21
İletişim:

Re: Sidebar ayın üyesi destek

Mesaj gönderen kaptangula »

Teşekkür ederim abi sağol baya güzel oldu ellerine sağlık.
☪ www.sambah.net ☪
Resim
Resim
Cevapla

“Phpbb3 Destek” sayfasına dön