• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Help understanding coding instructions on this forum

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby MarkHoward » Tue Oct 20, 2009 7:48 am

I am having a lot of trouble making any progress in trying to get some things going with phpFreeChat in a test situation on localhost.
I believe it is because I don't know how to interpret some of the coding instructions used here.
eg
Code: Select all
 require_once dirname(__FILE__)."/chat/src/pfcinfo.class.php";

I don't understand where __FILE__ gets set or how to test what it's current value is.
and
Code: Select all
$info  = new pfcInfo( md5("Whatever you Want") );

WHAT do I put in "Whatever you Want"? Anything at all? and if it IS anything at all why don't the instructions just say "A" or "B" or something.

Some other times it says
Code: Select all
 md5(__FILE__)

I can't understand what should be in __FILE__ in my situation (and where it gets set.

I keep reading all these instructions that seem work fine for everyone else, except me. And when I ask about the errors I get - there are no responses.

I am sorry if I am too much of a newbie. I'm finding this very frustrating as I have nobody else to ask.
Last edited by MarkHoward on Tue Oct 20, 2009 7:52 am, edited 1 time in total.
MarkHoward
Member
 
Posts: 20
Joined: Sun Jul 19, 2009 12:47 am
Top

Postby OldWolf » Tue Oct 20, 2009 8:39 am

MarkHoward wrote:I am having a lot of trouble making any progress in trying to get some things going with phpFreeChat in a test situation on localhost.
I believe it is because I don't know how to interpret some of the coding instructions used here.
eg
Code: Select all
 require_once dirname(__FILE__)."/chat/src/pfcinfo.class.php";

I don't understand where __FILE__ gets set or how to test what it's current value is.

That's a system constant... set by the system. If you google __FILE__, the php.net manual on it is the first result.
MarkHoward wrote:and
Code: Select all
$info  = new pfcInfo( md5("Whatever you Want") );

WHAT do I put in "Whatever you Want"? Anything at all? and if it IS anything at all why don't the instructions just say "A" or "B" or something.

I wrote "Whatever you Want" because it's... whatever you want? I felt the wording was clear enough it didn't warrant further instruction. I'm not sure how using the letter's A or B would make it more clear that the user can use whatever they want there.
MarkHoward wrote:Some other times it says
Code: Select all
 md5(__FILE__)

I can't understand what should be in __FILE__ in my situation (and where it gets set.

See above.
MarkHoward wrote:I keep reading all these instructions that seem work fine for everyone else, except me. And when I ask about the errors I get - there are no responses.

I am sorry if I am too much of a newbie. I'm finding this very frustrating as I have nobody else to ask.

I'm going to take a shot at this and say you're probably new to PHP? If that's the case, I'd really recommend some PHP primers/tutorials to get yourself more familiar with the language. As far as who to ask, I'm a big fan of self education... so my first step, and my suggestion to others for a first step, is always google or some other search tool. I of course understand if something is difficult to word into a google search or the answer just doesn't seem to be available, at which point forums are a great resource (ours, or for more general questions, a php forum like phpfreaks... since they have a lot more people around all the time). Like I mentioned above though, things like __FILE__ are very easy to track down on google.

Thanks,
OldWolf
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby MarkHoward » Tue Oct 20, 2009 9:01 am

Thanks OldWolf. Yes new to php and don't really want to become a php programmer - just enough to (even if mechanically) get a couple of simple things going.
OK about __FILE__ It seems that in the localhost environment, what it is returning is a local directory path which the code is then tacking a web type path on to. And that combination is failing (see my " Number of people in chat....? " post)
Re the md5 parameter (which I now see returns a hash of the parameter) I guess what I really should have asked is "If I put "bonkers" in there, does that have to match up with an md5("bonkers") somewhere else in the system? I just have no idea if I choose a "Whatever you Want" what the ramifications of that choice are. Or are there none at all, and it really is a completely random string - and there are NO ramifications?
Thank you for your patience.
MarkHoward
Member
 
Posts: 20
Joined: Sun Jul 19, 2009 12:47 am
Top

Postby OldWolf » Tue Oct 20, 2009 9:16 am

__FILE__ should be functionally the same in a local and web version... that's one for phpfreaks.

As for the ramifications... there aren't any if you are only doing the chat portion. But, that string is how you identify the chat server... so if you wanted to, for example, check how many users are in the chat with the other script, you need to use the same identifier.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub