1
El_Jordo
IP Addresses in Forums
  • 2003/4/27 20:03

  • El_Jordo

  • Just popping in

  • Posts: 64

  • Since: 2003/4/23


Is there a way for administrators to track IP addresses in the standard XOOPS forum module? It must be there, since IPs appear in Comments. But I've looked and can't find it in the forums. Thanks!

2
Jack404
Re: IP Addresses in Forums
  • 2003/7/4 22:09

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


BUMP!

I saw the IP.gif file in the images directory, but how would we go about implementing this in XOOPS2? I really liked that feature in XOOPS 1.3.8, and I'm a bit disappointed it was taken out.

Could someone please help us find the code we need?

Thanks in advance!

3
kain
Re: IP Addresses in Forums
  • 2003/7/4 23:18

  • kain

  • Just popping in

  • Posts: 56

  • Since: 2002/1/9 9


i'm speaking for XOOPS 1.3.8
i don't like the ip.gif so i replaced with a piece of code

in /modules/newbb/class/class.forumposts.php
find
$ip_image

and take this:
Quote:

if ( $adminview ) {
?>


$ip_image = "IP: ".$this->posterip()." - posterip()."');\">WHOIS
";

} else {

$ip_image = "IP: nascosto
";



please don't consider whois.php, is a php page that can whois a certain ip, remove it.

for the lazy:

Quote:

if ( $adminview ) {
$ip_image = "IP: ".$this->posterip()."
";

} else {

$ip_image = "IP: nascosto
";

}

i've made also an algorithm to crypt the ip for non admin user, but i think that is better leaving "nascosto" (hidden or protected)

4
Jack404
Re: IP Addresses in Forums
  • 2003/7/4 23:52

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


I found this text in XOOPS 2 in modules/newbb/class/class.forumposts.php on lines 383 to 385:

Quote:

function posterip(){
return $this->poster_ip;
}


How would I go about using this function in association with the IP.gif file?

5
Jack404
Re: IP Addresses in Forums
  • 2003/7/4 23:53

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


I also found this, starting on line 221:

Quote:

function getPost($id) {
$sql = 'SELECT p.*, t.post_text, tp.topic_status FROM '.$this->db->prefix('bb_posts').' p LEFT JOIN '.$this->db->prefix('bb_posts_text').' t ON p.post_id=t.post_id LEFT JOIN '.$this->db->prefix('bb_topics').' tp ON tp.topic_id=p.topic_id WHERE p.post_id='.$id;
$array = $this->db->fetchArray($this->db->query($sql));
$this->post_id = $array['post_id'];
$this->pid = $array['pid'];
$this->topic_id = $array['topic_id'];
$this->forum_id = $array['forum_id'];
$this->post_time = $array['post_time'];
$this->uid = $array['uid'];
$this->poster_ip = $array['poster_ip'];
$this->subject = $array['subject'];
$this->nohtml = $array['nohtml'];
$this->nosmiley = $array['nosmiley'];
$this->icon = $array['icon'];
$this->attachsig = $array['attachsig'];
$this->post_text = $array['post_text'];
if ($array['pid'] == 0) {
$this->istopic = true;
}
if ($array['topic_status'] == 1) {
$this->islocked = true;
}
}

6
kain
Re: IP Addresses in Forums
  • 2003/7/5 0:30

  • kain

  • Just popping in

  • Posts: 56

  • Since: 2002/1/9 9


not sure of this, since i don't know much about x2's code, but maybe you have to modify templates.. the way your forums looks like.

7
Jack404
Re: IP Addresses in Forums
  • 2003/7/5 0:34

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


I've gotten as far as having the IP.gif show up in the forums, but I'm not sure what to put in alt="" for the img tags. I've tried <{$poster_ip}>, and this doesn't work. Where does XOOPS assign things like <{$topic_post.poster_from}> that are used in the templates? If someone can point that to me, I'd be able to figure out the rest

8
YourHelp
Re: IP Addresses in Forums
  • 2003/7/5 1:34

  • YourHelp

  • Friend of XOOPS

  • Posts: 479

  • Since: 2003/6/9 6


this is another reason why i enjoyed 1.3 XOOPS better also the avatars on registration where another thing that i wished was not taken out of xoops2 oh well

9
Jack404
Re: IP Addresses in Forums
  • 2003/7/5 2:22

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


Ack, I guess I'd better hope a Dev reads this and can point me in the right direction...

I've looked EVERYWHERE for where the template <{$variables}> are defined, but no luck yet. Does anyone have an idea?

10
Jack404
Re: IP Addresses in Forums
  • 2003/7/5 4:46

  • Jack404

  • Just popping in

  • Posts: 56

  • Since: 2003/5/16


Hehe, just figured it out. XOOPS actually already defines a template variable for it. Just put <{$topic_post.post_poster_ip}> where you'd like the IP address to show up. For example, this is my template for newbb_thread.html:

Quote:



<{$topic_post.poster_uname}>
<{$lang_postedon}> <{$topic_post.post_date}>




<{if $topic_post.poster_uid != 0}>

<{$topic_post.poster_rank_title}>
<{$topic_post.poster_rank_image}>
<{$lang_joined}>: <{$topic_post.poster_regdate}>
<{$lang_from}>: <{$topic_post.poster_from}>
<{$lang_posts}>: <{$topic_post.poster_postnum}>
<{$topic_post.poster_status}>


<{else}>



<{/if}>


<{$topic_post.post_title}>
<{$topic_post.post_text}>






<{if $xoops_isadmin || $xoops_ismoderator == true}>


alt="<{$topic_post.post_poster_ip}>" /><{$lang_edit}><{$lang_delete}><{$lang_reply}>


<{elseif $xoops_isuser == true && $xoops_userid == $topic_post.poster_uid}>


<{$lang_edit}><{$lang_reply}>


<{elseif $viewer_can_post == true}>


<{$lang_reply}>


<{else}>



<{/if}>




Login

Who's Online

306 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 306


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits