Finding out if a person is logged in an invisionfree forum?

Rinpun

Ex TH Member
Reaction score
105
Now I don't know if this is possible or not, but I might as well ask it for the hey of it. Considering I don't have a server that is my own to lend out (otherwise I'd just do this in vBulletin and I could find out what to do from its source code), Alexander hosts his Goth's High forum with invisionfree. One of the extra things, however, is a simple sidebar of my own design that Alexander is constantly sizing up. But, the last button, which he added recently, is "Log Out". However, this shows up when you are logged out as well! This is because it is simply a button on the sidebar that doesn't use any language to set any data on it. Now, what I'm wondering is, is it possible to find out if the person is logged into this forum or not? And would there be some sort of code for it? Then, of course, I'd be able to at least make the Log Out disappear when logged out, but if possible, I'd like to extend it to have some text box entries for logging in as well.

Thank you for your time :)

~Rinpun
 
Reaction score
125
Well can you edit invision with php? cause if you can i can give you some basic php codes to show all users on line, nut thats prolly not what you want.
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
MeRcChRiS said:
Well can you edit invision with php? cause if you can i can give you some basic php codes to show all users on line, nut thats prolly not what you want.

Whats the codes? I wanna see them :)
 

Rinpun

Ex TH Member
Reaction score
105
Yea, the question is, what kind of cookie does it create? Like how would I access invisionfree's cookie?
 

mase

____ ___ ____ __
Reaction score
154
Thehelper does that too, if you log out then go to The Helper Home and scroll down til you see "Forum Controls" it will say:
Forum Search
Register Here
User Preferences
Member List
Forum Leaders
Archive
Log Out

I doubt TH has nething to do with it since they used vBulletiens original template.
 
P

Persen

Guest
Log in to to your invisionfree forum, and it will set a cookie. Find it and check it's name. Then just match it using $_COOKIE[].
 

mixmax2

RedArmyGangsta
Reaction score
31
Find out what cookie the invisionfree board is setting for logged in users, then on the bar do some php...

PHP:
<?php
if (isset($_COOKIE['Name_of_one_of_the_cookies_that_is_used_for_checking_login']))
   echo '<a href="logout.php">Logout</a>';
?>

Very straightforward, if the cookie is set, you display the logout button, if not, you dont.

You access invision's cookie by opening up the php file that processes the login information, it should set 2 cookies, if not more, mininum of 2 to track their username, and md5 encoded password.
 

Rinpun

Ex TH Member
Reaction score
105
It makes sense, except invisionfree's board doesn't allow you to see its php code. It only does so if you buy it, but that defeats the purpose of asking this question, because I would already know how to tweak it from there. Unfortunately, I've tried removing cookies and stuff, and I can't figure out the name of whatever it is that holds the cookie data for logging in and stuff. I know one exists though, I just wish I could find it -_-
 
Reaction score
125
DDRtists said:
Whats the codes? I wanna see them :)
Code:
<?php require("Path to SSI.php"); ?> (Put very top of page)

<?php ssi_whosOnline(); ?> (anywhere you want it to show up)
Because this is mostly for smf and i dont think you can edit files with a invisionfree board, so yeah.
 
P

Persen

Guest
You do not need to view the code. Log in to the forums, and check in your browser's cookie list.
 

Rinpun

Ex TH Member
Reaction score
105
I think I have it now. However, can I check if the cookie is set in Javascript somehow? Cause last time I tried using php on Invisionfree it didn't seem to work so well for some reason.

Edit:

Thanks for your help Persen. You steered me in the right direction and now I have it all figured out and working fine. It uses Javascript to switch the letters displayed based on the cookie's information and a function to "switch" the link it goes to based on the letters displayed.

I don't know why it took me so long to find the solution as I already know this stuff. Guess I'm just stupid like that :D
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
MeRcChRiS said:
Code:
<?php require("Path to SSI.php"); ?> (Put very top of page)

<?php ssi_whosOnline(); ?> (anywhere you want it to show up)
Because this is mostly for smf and i dont think you can edit files with a invisionfree board, so yeah.

Thats for SMF, and has nothing to do with IF. Also, that does not check whos online, that echos the whos online thing at the bottom.

What your wanting to do would be( This is for SMF, btw ):

Code:
if($context['user']['is_logged'])
{

}
 

Rinpun

Ex TH Member
Reaction score
105
Alright, break it apart guys >_>

You can't read any of the invisionfree files or ANYTHING whatsoever. That is not how to solve the issue.

The thing I was able to do is first check my browser cookies (don't know why I didn't think of this part before...this was Persen's helping hand) and I found out that it's the name of the site plus "member_id" that is the used cookie...the exact same system as the Invision Power Board (as I found on google at one point). So, for Alexander's Goth's High site, I had to access the "Goths_Highmember_id" cookie. Then, I made use of a googled function that reads off parameters of the cookie (because, for some reason, javascript can access this cookie but not what is in it directly).

Code:
(Parameter finder)
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

(Finding if it's logged in or not)
function LoggedFinding() {
if (getCookie('Goths_Highmember_id') == 0)
{
document.getElementById('18').innerHTML = "Register Here";
document.getElementById('22').innerHTML = "Log In";
}
else
{
document.getElementById('18').innerHTML = "My Controls";
document.getElementById('22').innerHTML = "Log Out";
}
}

I found a parameter that was dynamic in finding out if the person is logged in or not, and then switch two buttons' inner HTML to reflect it. Then I give the buttons a dynamic action when you click on them that, based on the inner HTML inside, link you to a location. Works pretty well :)
 

Rinpun

Ex TH Member
Reaction score
105
You flamed and Mercchris flamed back. That is all.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs
  • Monovertex Monovertex:
    @The Helper I'm really not seeing the "Signature" link in the sidebar on that page. Here's a screenshot:
  • The Helper The Helper:
    I have reported it - I was wondering why nobody I have given sigs to over the last few years have used them

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top