Açiklama :
Bu Blok Portalinize bildigimiz Board Panel blokunu ekleyecektir, ek bir güzelligi ise üyenin avatarini’da gösterecektir.
Uygulama :
ACP Home > Portal > Add Cutom Blocks > :
Block Name: Board Panel Portal Için
Block Title: Hosgeldiniz [ Istediginiz Herhangi Baska Birsey ]
Block PHP/HTML:
<?php
if ($this->ipsclass->member[‘id’])
{
// for members
$welcometext =”<table cellpadding=’0′ cellspacing=’0′ border=’0′ width=’100%’ align=’center’><tr><td align=’left’>”;// avatar (1st column)
$welcomequery1 = $this->ipsclass->DB->query(”SELECT * FROM ibf_member_extra WHERE id = ” . $this->ipsclass->member[‘id’]);
$avatar = $this->ipsclass->DB->fetch_row($welcomequery1);
$data[‘avatar’] = $this->ipsclass->get_avatar($avatar[‘avatar_location’], 1,$avatar[‘avatar_size’], $avatar[‘avatar_type’]);
$welcometext .= $data[‘avatar’];
$welcometext .=”</td>”;// Member text (2nd column)
$welcometext .=”<td align=’left’>”;
$welcometext .= “Tekrar Hoşgeldiniz <b>{$this->ipsclass->member[‘members_display_name’]}</b><br>”;$welcomedate= $this->ipsclass->get_date($this->ipsclass->member[‘last_visit’], LONG);
$welcometext .= “Son Ziyaretiniz {$welcomedate}<br>”;$welcomequery2 = $this->ipsclass->DB->query(”SELECT COUNT(DISTINCT(t.tid)) as tcnt, COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE p.post_date < “.time().” AND p.post_date > “.$this->ipsclass->member[‘last_visit’].” AND p.topic_id=t.tid”);
$row = $this->ipsclass->DB->fetch_row($welcomequery2);
$data[‘topics_since’] = $row[tcnt];
$data[‘posts_since’] = $row[pcnt];$welcometext .= “Son Gelişinizden Sonra <b>{$data[‘topics_since’]}</b> Yeni Mesaj Bulunuyor Ve <b>{$data[‘posts_since’]}</b> Toplam Konu!<br>”;
$welcometext .= “<a href=”{$this->ipsclass->base_url}act=Search&CODE=getnew”>{$this->ipsclass->lang[‘view_new_posts’]}</a><br>”;
$welcometext .=”</td>”;// forum stats (3rd column)
$welcometext .=”<td align=’left’>”;
$welcometext .=”Istatistikler:<br>”;if ( ! is_array( $this->ipsclass->cache[‘stats’] ) )
{
$this->ipsclass->cache[‘stats’] = array();
$this->ipsclass->DB->simple_exec_query( array( ‘delete’ => ‘cache_store’, ‘where’ => “cs_key=’stats’” ) );
$this->ipsclass->DB->do_insert( ‘cache_store’, array( ‘cs_array’ => 1, ‘cs_key’ => ’stats’, ‘cs_value’ =>addslashes(serialize($this->ipsclass->cache[‘stats’])) ) );
}
$stats = $this->ipsclass->cache[‘stats’];
if ($this->users_online > $stats[‘most_count’])
{
$stats[‘most_count’] = $this->users_online;
$stats[‘most_date’] = time();
$this->ipsclass->DB->do_update( ‘cache_store’,array( ‘cs_array’ => 1, ‘cs_value’ => addslashes(serialize($stats)) ),”cs_key=’stats’”);
}
$total_posts = $stats[‘total_replies’] + $stats[‘total_topics’];
$total_posts= $this->ipsclass->do_number_format($total_posts);$welcometext .= “Toplam Üye: <b>{$stats[‘mem_count’]}</b>, Konu <b>{$stats[‘total_topics’]}</b><br>”;
$welcometext .= “Cevap: <b>{$stats[‘total_replies’]}</b>, Mesaj: <b>{$total_posts}<br></b>”;
$welcometext .= “Son Kayit Olan: <b><a href=”{$this->ipsclass->base_url}showuser={$stats[‘last_mem_id’]}”>{$stats[‘last_mem_name’]}</a></b><br>”;$welcomequery3 = $this->ipsclass->DB->query(”SELECT `id`,`name`,`posts` FROM ibf_members WHERE 1 ORDER BY `posts` DESC LIMIT 1″);
$row = $this->ipsclass->DB->fetch_row($welcomequery3);$welcometext .= “En Çok Yazan: <b><a href=”{$this->ipsclass->base_url}showuser={$row[id]}”>{$row[name]}</a> ({$row[posts]} Mesaj)</b><br>”;
$welcometext .=”</td></tr></table>”;
}
// for guests
else
{
// first column
$welcometext =”<table cellpadding=’0′ cellspacing=’0′ border=’0′ width=’100%’ align=’center’><tr><td align=’left’>”;
$welcometext .=”Hoşgeldiniz<br>”;
$welcometext .= “<a href=”{$this->ipsclass->base_url}act=Search&CODE=getactive”>Bugünün En Aktif Konularini Oku.</a><br>”;
$welcometext .=”</td>”;
// second column
$welcometext .=”<td align=’left’>”;
$welcometext .=”<form action=”{$this->ipsclass->base_url}act=Login&CODE=01” method=”post” name=”LOGIN” onsubmit=”return ValidateForm()”>
<input type=”hidden” name=”CookieDate” value=”1” checked=”checked” />
<table width=”50%” border=”0” cellspacing=”0” cellpadding=”0”>
<tr>
<td>Üye Adi:</td>
<td><input type=”text” size=”15” maxlength=’150′ value=”” name=”UserName” class=”forminput” /></td>
</tr>
<tr>
<td>Sifre:</td>
<td><input type=”password” size=”15” name=”PassWord” class=”forminput” /></td>
</tr>
<tr>
<td><input class=”button” type=”submit” name=”submit” value=”Giriş” /></td>
</tr>
</table>
</form>”;
$welcometext .=”<a href=”{$this->ipsclass->base_url}act=Reg&CODE=00”>Üye Degilseniz Buradan Olun</a>”;
$welcometext .=”</td></tr></table>”;
}echo “$welcometext”;
?>