Author |
Message |
Tommyguns
Hangin' Around
![](modules/Forums/images/avatars/Risque/fhf239.jpg)
Joined: Jul 07, 2004
Posts: 32
|
Posted:
Mon Nov 22, 2004 7:26 am |
|
How do I get the "Your IP: 65.*.***.***" showing like you do in the User Info Block? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
Spouse Contemplates Divorce
![](modules/Forums/images/avatars/d1ecfa674c890aee2698b.jpg)
Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Mon Nov 22, 2004 8:16 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Nov 22, 2004 9:11 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Tommyguns
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Nov 22, 2004 10:23 am |
|
But where do I place that in the Block.php? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Nov 22, 2004 12:55 pm |
|
At the point you want it to show. If you want it above the image, like mine, find where the image is added int $content and place it above that line. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
elrayjones
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/4544e6554183f6096def9.jpg)
Joined: Oct 08, 2004
Posts: 55
Location: Texas
|
Posted:
Tue Nov 23, 2004 4:45 am |
|
Tommyguns wrote: | But where do I place that in the Block.php? |
open block-User_Info.php
At or around line 208 find:
if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
."</b></center>" ;
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
Replace with:
if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
$content .= "<center><b>IP: " . $_SERVER["REMOTE_ADDR"] ."</b></center>" ;
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
i use $content .= "<center><b>IP: " . $_SERVER["REMOTE_ADDR"] ."</b></center>" ; |
_________________ Shopping Mall at Only registered users can see links on this board! Get registered or login! We have Video Games,Toys,DVD,Camera,Magazine Subscriptions,Music,Apparel,Inkjet,Food,Garden,Electronics,Kitchen,Cell Phones, Tapestry and much more |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Tommyguns
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Nov 23, 2004 12:58 pm |
|
I tried that but needed to do it this way to make it work:
Code:if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$content .= "<center><b>Your IP: " . $_SERVER["REMOTE_ADDR"] ."</b></center>" ;
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
elrayjones
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Nov 24, 2004 2:43 am |
|
I placed the code so the IP would show up after the user loged on. but after thinking about i think i will place it where it shows all the time. glad I could help.
EJ |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|