Jump to content


Welcome block for v2.2.0


  • You cannot reply to this topic
25 replies to this topic

#21 Steve

    Advanced Member

  • Administrators[Admin]
  • PipPipPip
  • 130 posts
  • Gender:Male

Posted 19 January 2009 - 02:22 PM

View Postjdoc1984, on Oct 23 2008, 12:00 PM, said:

If i only want to show the part with....

Welcome back, last visit And avatar....

WHAT to do then... I ONLY want it to be left colum, not the BIG top one there


Try this

																				  <?php
$referer = base64_encode($_SERVER["HTTP_REFERER"]);
$thispage = base64_encode($_SERVER["REQUEST_URI"]);
$id = "230604";
$time = time();

if ($this->ipsclass->member['id'])
{
// for members

// avatar 
$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 .= "<center>";
$welcometext .= $data['avatar'];
$welcometext .="<br>";

// Member text
$welcometext .= "Welcome Back {$this->ipsclass->member['members_display_name']}<br>";
$welcometext .="</center><br>";
$welcomedate= $this->ipsclass->get_date($this->ipsclass->member['last_visit'], LONG);
//$welcometext .= "You last visited {$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];

// Print Out
//$welcometext .= "There has been {$data['topics_since']} posts in {$data['posts_since']} topics since your last visit!<br>";
$welcometext .= "<hr><br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getnew\">{$this->ipsclass->lang['view_new_posts']}</a><br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=idx\">Forums</a><br/>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=search\">Search</a><br/>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=members\">Member List</a><br/>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=boardrules\">Board Rules</a><br/>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=help\">Help</a><br/>";

$welcometext .="</td></tr>";
}



// for guests
else
{
// first column
$welcometext ="<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='left'>";
// $welcometext .="Welcome Guest!<br>";
// $welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getactive\">View all of todays active posts.</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>Username:</td>
<td><input type=\"text\" size=\"15\" maxlength='150' value=\"\" name=\"UserName\" class=\"forminput\" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type=\"password\" size=\"15\" name=\"PassWord\" class=\"forminput\" /></td>
</tr>
<tr>
<td><input class=\"button\" type=\"submit\" name=\"submit\" value=\"Login\" /></td>
</tr>
</table>
</form>";
$welcometext .="<a href=\"{$this->ipsclass->base_url}act=Reg&CODE=00\">Register</a>";
$welcometext .="</td></tr></table>";
}

// Prints
echo $welcometext


?>


#22 getit

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 January 2009 - 01:50 AM

View PostKojek, on Jan 14 2009, 11:33 AM, said:

how do i integrate it with member group colour? so that user have colour on their username/display name based on group color?



+1

#23 CrouchingPanther

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 24 March 2009 - 03:03 AM

I've made adjustments to the code to display everything in 1 column, I'm not a coder so it took a while to get it right and it's a bit messy ^_^ , but I would like to add the users points to the list, please if anyone knows what code to place can they let me know. Thanks! :)



[quote]<?php

if ($this->ipsclass->member['id'])
{
// for members
echo "<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']);
echo $data['avatar'];
echo "<br><b>Welcome back<br> {$this->ipsclass->member['members_display_name']}</b>";
echo "<br><br><img src='http://www.airtimeclub.co.za/ATC/style_images/ip.boardpr/bullet2.png' />";
echo " Points {$this->ipsclass->member['moneyfield']}<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];

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);

echo "<img src='http://www.airtimeclub.co.za/ATC/style_images/ip.boardpr/bullet2.png' />";
echo " Newest member: <a href='{$this->ipsclass->base_url}showuser={$stats['last_mem_id']}'>{$stats['last_mem_name']}</a><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);
echo "<img src='http://www.airtimeclub.co.za/ATC/style_images/ip.boardpr/bullet2.png' />";
echo " Top poster: <a href='{$this->ipsclass->base_url}showuser={$row[id]}'>{$row[name]}</a> ({$row[posts]} posts)<br>";

echo "<img src='http://www.airtimeclub.co.za/ATC/style_images/ip.boardpr/bullet2.png' />";
$welcomedate= $this->ipsclass->get_date($this->ipsclass->member['last_visit'], LONG);
echo " You last visited {$welcomedate}<br>";

echo"</td></tr></table>";
}
// for guests

else
{

echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='center'>";
echo "Welcome Guest!<br>";
echo "<a href='{$this->ipsclass->base_url}act=Search&CODE=getactive'>View all of todays active posts.</a><br>";


echo "<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>Username:</td>
<td><input type='text' size='15' maxlength='150' value='' name='UserName' class='forminput' /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' size='15' name='PassWord' class='forminput' /></td>
</tr>
<tr>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<td align='center'><input class='button' type='submit' name='submit' value='Login' /></td>
</tr>
</table>
</form>";
echo "<a href='{$this->ipsclass->base_url}act=Reg&CODE=00'>Register</a>";
echo "</td></tr></table>";
}
?>[/quote]

#24 getit

    Member

  • Members
  • PipPip
  • 10 posts

Posted 26 May 2009 - 01:00 AM

demo iamge will be gr8

#25 _Marco_

    Member

  • Members
  • PipPip
  • 12 posts

Posted 09 August 2009 - 03:24 PM

can anyone upgrade this code to work for 3.0.1? thanks

#26 Gatman

    Member

  • Members
  • PipPip
  • 13 posts

Posted 09 August 2009 - 08:46 PM

yeah v.3.0.1 support please





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users