Avatar in welcomepanel
Started by filipv, Jan 12 2006 06:37 AM
36 replies to this topic
#21
Posted 01 September 2006 - 07:03 PM
Use the last widescreen post.
you can edit it by going to admin cp>Look & Feel>Edit Template HTML>skin uportal
And on the right you should see
WelcomePanel
Replace all that code w/ the code from widescreen's post above.
Save template and then it should work!
you can edit it by going to admin cp>Look & Feel>Edit Template HTML>skin uportal
And on the right you should see
WelcomePanel
Replace all that code w/ the code from widescreen's post above.
Save template and then it should work!
#22
Posted 02 September 2006 - 12:07 AM
Hi, I did what you said Phoenix but no avatar showed up after I saved the template bit and refreshed the site so I put back my original code for now which is:
<tr>
<td class='row1' colspan='2'>
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td class="row1" width="50%">{ipb.lang['it_is_now']} {$data['time']}.<br/>
{ipb.lang['last_visited']} {$data['lastv']}.<br/>
{ipb.lang['there_has_been']} {$data['posts_since']} {ipb.lang['posts_in']} {$data['topics_since']}<br/>
{ipb.lang['topics_since_last_visit']}<br/>
<a href="{ipb.script_url}act=Search&CODE=getnew">{ipb.lang['view_newposts']}</a></td>
<td class="row1" width="50%">{ipb.lang['forum_stats']}<br/>
{ipb.lang['mem_count']} {$data['stats']['MEM_COUNT']}, {ipb.lang['total_topics']} {$data['stats']['TOTAL_TOPICS']}<br/>
{ipb.lang['total_replies']} {$data['stats']['TOTAL_REPLIES']}, {ipb.lang['total_posts']} {$data['stats']['TOTAL_POSTS']}<br/>
{ipb.lang['newest_member']} <a href="{ipb.script_url}showuser={$data['stats']['LAST_MEM_ID']}">{$data['stats']['LAST_MEM_NAME']}</a><br/>
{ipb.lang['top_thread_starter']} <a href="{ipb.script_url}showuser={$data['tt_id']}">{$data['tt_name']}</a> ({$data['tt_num']})<br/>
{ipb.lang['top_poster']} <a href="{ipb.script_url}showuser={$data['tp_id']}">{$data['tp_name']}</a> ({$data['tp_num']})<br/></td>
</tr>
</table>
</td>
</tr>
#23
Posted 02 September 2006 - 06:37 AM
Sorry I left out this part
In ./sources/action_public/uportal.php
Find:
Replace with:
In ./sources/action_public/uportal.php
Find:
$data['avatar'] = $this->ipsclass->get_avatar( $member['avatar'], 1, $member['avatar_size'] );
Replace with:
//**** Start Avatar Fix ****//
$avatar_query = $this->ipsclass->DB->query("SELECT * FROM ibf_member_extra WHERE id = " . $this->ipsclass->member['id']);
$avatar = $this->ipsclass->DB->fetch_row($avatar_query);
$data['avatar'] = $this->ipsclass->get_avatar( $avatar['avatar_location'], 1, $avatar['avatar_size'], $avatar['avatar_type']);
//**** End Avatar Fix ****//
#26
Posted 24 September 2006 - 08:10 AM
highlander, on Sep 24 2006, 03:40 AM, said:
what i would like to know is... i get an error when people are not logged in and the welcome panel is active... anyone have af ix for this?
NO, because it works. Recheck your edits. When People aren't logged in it turns into a login block. It is possible your error is elsewhere.
What version of IPB are you running?
#27
Posted 24 September 2006 - 05:43 PM
the error was inside uportal.php and i fixed it with an edit that is on invsionize
that is the corrected line and that is the correct format... now i wonder, yes it converts into a login box, but how to edit that box when its in login form???
$today = mktime (0,0,0,date("m"),date("d"),date("Y"));
that is the corrected line and that is the correct format... now i wonder, yes it converts into a login box, but how to edit that box when its in login form???
#36
Posted 19 January 2009 - 12:10 PM
this block work fine in ipb 2.3.6
in italian
<?php
if ($this->ipsclass->member['id'])
{
// for members
$welcometext ="<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='center'>";
// avatar (1st row)
$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></tr>";
$welcometext .="<tr>";
// Member text (2nd row)
$welcometext .="<td align='left'>";
$welcometext .= "Bentornato <font color=#FF3333><strong>{$this->ipsclass->member['members_display_name']}</strong></font><br>";
$welcomedate= $this->ipsclass->get_date($this->ipsclass->member['last_visit'], LONG);
$welcometext .= "Sei stato qui {$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 .= "Ci sono {$data['topics_since']} risposte in {$data['posts_since']} topic dalla tua ultima visita!<br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getnew\">{$this->ipsclass->lang['view_new_posts']}</a><br>";
$welcometext .="</td></tr></table>";
}
// for guests
else
{
// first row
$welcometext ="<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='center'>";
$welcometext .="<img src=\"style_images/defcon/noavatar.gif\" alt=\"Non sei iscritto\" border=0 />";
$welcometext .="</td></tr>";
// second row
$welcometext .="<tr><td>";
$welcometext .="Benvenuto visitatore!<br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getactive\">Vedi i post di oggi.</a><br>";
$welcometext .="</td>";
// third row
$welcometext .="<tr>";
$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=\"30%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>Username:</td>
<td><input type=\"text\" size=\"15\" maxlength='100' 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 .="</td></tr></tr></table>";
}
echo "$welcometext";
?>in italian
#37
Posted 19 January 2009 - 02:20 PM
This is the modified code that I use as the navigation block.
<?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
?>
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users













