• 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

One click to identify, ie, click button => command

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

Post a reply
1 post • Page 1 of 1

Postby waiheke » Tue Oct 12, 2010 3:49 pm

I had to have a fast and easy way for users to identify and go OP.

I have an entry page that asks for a name and password if the user is registered.
Guests go straight to the chat as a guest.
Registered users can be of two types - regular users or OP's.
The name/password checking uses a simple MySQL database.

Guests have null status, regular registered users have a status of 0, while OP's have a status of 1.

By posting the password and the status in a session, it is carried to the chat page, in my case chat.php -> the default is index.php, I guess

If the status is null, a Please Register button appears.
If the status is 0, nothing appears.
If the status is 1 however, an Identify button appears.
The password is $px
The status level is $sx

This goes at the top of the chat page, before the <body> tag

Code: Select all
<script language="javascript">

function popUp2(URL) {
eval(window.open(URL, 'popUpWindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=400,left = 100,top = 60'));
}

</script>

This goes after the chat load sequence; if you are not sure, paste it at the bottom of the page, before the </body></html> tags

<chat.php>

Code: Select all
<?php
if (empty($px)) {

// no password means a guest
echo "<a href=javascript:popUp2('register.php')><img src=themes/default/images/register-on.gif alt=Register align=absmiddle></a>";
} else {
// not a guest then, but what status?
if ($sx == 1) {
include "ident.php";
} else {
// do nothing
}}

?>

create a new page called ident.php

<ident.php>

Code: Select all
<div class="pfc_btn">
<img src="themes/default/images/ident-off.gif" width="30" height="30"
      alt="Identify" title="Identify"
      id="pvtmsg"
  onClick="pfc.sendRequest('/identify <?php echo $px; ?>')" />
</div>

An OP only has to click a button, and my ladies can do that easily enough

:)
Last edited by waiheke on Wed Oct 27, 2010 4:08 pm, edited 1 time in total.
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Post a reply
1 post • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 20 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