Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 05-06-2002, 10:21 PM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lets see, the files we would have to edit would be, newreply.php and newpost.php

First, I guess we would have to add another column to our 'post' table.. we would execute this mysql query:

Code:
ALTER TABLE post ADD proxyip VARCHAR(16) not null AFTER ipaddress
in newthread.php find
Code:
    if ($logip==1 or $logip==2) {
      $ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
    } else {
      $ipaddress="";
    }
And change it to
Code:
    if ($logip==1 or $logip==2) {
      $ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
	if (getenv("HTTP_X_FORWARDED_FOR")!="") {
		$proxyip=getenv("HTTP_X_FORWARDED_FOR");
	}
}
    } else {
      $ipaddress="";
      $proxyip="";
    }
That should get $proxyip set. I'm not quite sure how iff works, but if I'm not mistaken instead of using
Code:
	if (getenv("HTTP_X_FORWARDED_FOR")!="") {
		$proxyip=getenv("HTTP_X_FORWARDED_FOR");
	}
would it be:
Code:
$proxyip=iif(getenv("HTTP_X_FORWARDED_FOR")!="",getenv("HTTP_X_FORWARDED_FOR"));
Can someone confirm it?

Now we have to add it to the sql table...
Reply With Quote
  #12  
Old 05-06-2002, 11:33 PM
RDX1 RDX1 is offline
 
Join Date: Apr 2002
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<? echo $HTTP_X_FORWARDED_FOR; ?>

would this work for a normal page to display the real address?
Reply With Quote
  #13  
Old 05-06-2002, 11:44 PM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, if they were using a proxy that gave out that variable. Most proxys do, some dont.

use this btw:

Code:
<?=$HTTP_X_FORWARDED_FOR;?>
Easyer way to echo out stuff
Reply With Quote
  #14  
Old 05-07-2002, 12:18 AM
heretic's Avatar
heretic heretic is offline
 
Join Date: Nov 2001
Posts: 285
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have you tested this out yet?
Reply With Quote
  #15  
Old 05-07-2002, 12:38 AM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, hehe. Its not done. I'm just, starting it out hoping someone else will jump in and help some. Here is the next part I supose

in newthread.php still, find:
Code:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
Replace by:
Code:
      $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,proxyip,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$proxyip','$iconid','1')");
Ok, I think thats basically it that has to be done in newthread.php. The proxy IP, if there is now inserted into there.

Now I'll take a look at newreply.php, as there will be stuff to edit in there. Also I'm unsure about how it will effect other sql queries, since there is now another column in there. I'll look at, edit post, and a fiew more things to see if the post template is modified anywhere else.
Reply With Quote
  #16  
Old 05-07-2002, 12:54 AM
heretic's Avatar
heretic heretic is offline
 
Join Date: Nov 2001
Posts: 285
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the only thing is when users try to find the query, they might not find it if they've added hacks that add there.

I'm not much help php-wise, I'm learning myself

also, I think if we're going the way of adding some kind of proxy icon in the postbit, don't you have to define it in functions.php?
Reply With Quote
  #17  
Old 05-07-2002, 01:03 AM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

umm, I dunno T_T

Thats why I need more help. lol

I'm going to put what I think all of it is into a text file, then let someone look at it. Maybe they could help
Reply With Quote
  #18  
Old 05-07-2002, 01:44 AM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okie, I've taken a look at everything. And the only modifications for getting the proxy IP is done. Aswell it wont interfer with other sql queries. But if you have another hack installed you have to adjust the one line thats listed in there.

Now, what I want is to make it so that you have to edit the postbit template, and under the posts add something like '$proxydetector'

if there is something in the the sql column proxyip, then it will print out something determined via a template, if not it wont return anything.

Problem is is that I dont know anything about templates. Can someone help me from here. I attached what I managed sofar.
Attached Files
File Type: txt proxydetector.txt (3.3 KB, 15 views)
Reply With Quote
  #19  
Old 05-07-2002, 07:53 AM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah well, no one helped (except heretic) so I ended up learning more about templates etc. I figured it all out and will be releasing a version tommorow.

Thanks ppl ^_^ :bunny:

I managed to get it together alredy: https://vborg.vbsupport.ru/showthrea...threadid=38358
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04129 seconds
  • Memory Usage 2,260KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete