PDA

View Full Version : Please help me finalize the HACK of the Year!!!


humble
11-16-2001, 10:06 PM
Here's the pre-info...

Based upon the myphpchat 0.14.5 engine...
Using parts of the code scattered around on how to integrate it to use vb's user db......

THEN!!!

I added a field in the user table called 'phpchat'

Then, I added the code for the UserCP to enable or diable it per user. (this part works great so far)...

Then I created a new template, that contains a new iframe, and launches the myphpchat/index.php inside the iframe...

Then I added a new variable @ the bottom of the footer called $phpchatsystem....

Now... here's the tricky part..

in global.php, I need to add something like this:


// Check the user's preference to enable the Chat System...

$phpchatcheck=$DB_site->query_first("SELECT phpchatsys FROM user WHERE username = '".$bbuserinfo['username']."'");
if ($phpchatcheck) {
eval("\$phpchatsystem = \"".gettemplate('phpchaton')."\";");
} else {
}


Or something that....

Checks to see if the phpchatsys field for you is on or not, and if it is....

it takes that variable in the footer section, and calls my phpchaton template data...

if it's not, it either calls a phpchatoff template that's empty (been there tried that), or just does nothing is fine...

Here' my problem....

Everything works like a champ, except.... if I turn it on in my user options, it appears for me... and everyone else (even though there setting is off) gets the newtemplate passed through my $phpchatsystem

Now when I just bypass the user settings, this thing is UNREAL... it sits in your footer in a new section, and everytime a registered user logs on, they are instantly authenticated, and brought in to the myphp session... and since it's in the footer... People can navigate around ANYWHERE in the board, and still have somewhat real time chat with every other member logged in.

It works great built in to the header, the footer, and called from a seperate IE window... and all work flawless....

Except... when trying to have it user selectable... Soon as I turn it on for one member, it turns it on for all...

-=-=-=-=-=-=-=-
Quick Summary
-=-=-=-=-=-=-=-

If- you have a variable in your footer, that you want converted to a template ... that is user specific.
AND- you have a new template you want added @ the end of the footer only if that user had the option enabled in his user profile...
AND- everything else is 100% working...

HOW- and WHAT code would you add (and is it in global.php, which I assumed, cuz of the way the: [ $newpmmsg and headnewpm ] are delt with )

To check query for this user, his setting, and if so, use the new template, if not, don't.

-=-=-=-=-=-=-
Thanks!!!!!!!!!
-=-=-=-=-=-=-

humble
11-16-2001, 10:10 PM
Examples of what i'm doing...

The new template. (with table based graphic borders around it)

humble
11-16-2001, 10:13 PM
here's what the user cp looks like...

humble
11-16-2001, 10:17 PM
here's what the phpchat system, enabled in the footer looks like.

humble
11-16-2001, 10:30 PM
i'm working on several other very cool & key features... (after I get past this bug)...

#1, a Admin CP option, to enable or disable it globally...

#2, usergroup settings, so you can have seperate chat channels secured by usergroup.

#3, tightning every /command settings to work with the vb userdb, cuz as the vb hack integration sits.. it works for using vb's user db... launched in a seperate window... But all the advanced commands still use the old code for users & authentication... so they all say, you must be registered, even though they're logged in, and chatting away...

#4, integrating the phpmychat smiley options, with vb's smileys...

#5, - #10 you'll have to wait and see ;)

humble
11-16-2001, 11:17 PM
i've also tried this in my global.php


$phpchatcheck=$DB_site->query_first("SELECT phpchatsys FROM user WHERE userid=$bbuserinfo[userid]");
if ($phpchatcheck) {
eval("\$phpchatsystem = \"".gettemplate('phpchaton')."\";");
} else {
eval("\$phpchatsystem = \"".gettemplate('phpchatoff')."\";");
}


right above


$header='';
$footer='';


but still same thing, If i anyone turns it on, it's on for everyone... not just that user's page. and since it's in the footer, it turns on in every page, for every user.

snyx
11-17-2001, 01:37 AM
holly hack'atistic humble!
incredible! simply incredible!

any beta to test or what man?
I would LOVE to help!

snyx

DjSap
11-17-2001, 05:57 AM
First go to the "# Start templates #" section in global.php and add your two templates in the line that beginns with "$templatesused=."

Then add this before the line "$newpmmsg=0;"

if ($bbuserinfo['phpchatsys']==1) {
eval("\$phpchatsystem = \"".gettemplate('phpchaton')."\";");
} else {
eval("\$phpchatsystem = \"".gettemplate('phpchatoff')."\";");
}

This presumes that value "1" in the user table means that it should be on.

|DarkManX|
11-17-2001, 05:46 PM
this is awesome..........any luck with this??????

humble
11-17-2001, 08:18 PM
THAT worked like an ABSOLUTE champ!!!

I'm SOOO close to being done with this... (locally)...

so i don't know how long it would take, or If it's even 'acceptable' to package a hack instructions for this... but i'm looking in to it...

It works PERFECT.... THANK you SO very much... i've been fighting this for two days now!!!

Now my users can enable or disable it in there user cp... and i'm going to add a quick shortcut under the chat window that will instantly (one-click) disable it, and then enable it by default for everyone, and let them turn it off (via the new shortcut) or via the User Options menu...

I'm also working in a VERY simple Admin CP section, where you can globally turn it on / off.. (not adjusting the user's setting) just not running the code period if the admin flag says NO.

And then, a more complex setup, where you can add/remove public & private chat channels, and also restrict by usergroup for axs to the private channels....

(i.e. if you want board users in the default channel, but want a seperate channel for different usergroups/staff etc.)

And then... a final check of all the advanced chat commands like /join /invite /etcetc, so that they can be set by vb usergroup as well... (i.e. Users can't /invite, but mods can etc)

I can't tell you guys how much I love this so far, it's REALLY quite amazing, and secure, and integrated,... every part... shared users, new templates, new .php's, edited .php's, new tables in the db, but everything 100% is configurable/contrallable, and it works / looks SO good ;) either as a seperate IE window, or built in your headers or footers, or just the main forum summary page, you decide....

it'll basically be, put $phpchatsys where ever you want the frame to apear, and set your channels in the CP....

Because of the massive complexity of the install, i'll be looking for someone to help build a install_php for it, so that we/I can get this to the masses (if / and when it's ready)...

humble
11-17-2001, 08:19 PM
If turned off....

humble
11-17-2001, 08:21 PM
and of course...

If the refresh in every page is too much for you, or your users... when built in the footer...

Just use the direct URL and IE window , (once logged in the board)...

|DarkManX|
11-17-2001, 08:34 PM
kick ass, i hope you can get it released soon!!

Lesane
11-17-2001, 08:39 PM
Looks very tight man, i'm looking forward to this hack.

the_sisko
11-18-2001, 12:13 AM
Great stuff man, hope you get this one done soon!!!!

humble
11-18-2001, 01:35 AM
A few more tweaks and features to go...

need a bit more help though Pretty please!!!

I'm looking to create a URL, that will, with a single click, turn off the chat system....

So in member.php I created a new action statment..


// ############################### start phpchat off ###############################
if ($action=="phpchatsysoff") {
$templatesused = "redirect_updatethanks";
include("./global.php");
// check permissions, then disable the php chat system

if ($bbuserinfo[userid]==0 or $permissions['canmodifyprofile']==0) {
show_nopermission();
} else {
$DB_site->query("UPDATE user SET phpchatsys = 0 WHERE userid='$bbuserinfo[userid]'");
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"usercp.php?s=$session[sessionhash]\");");
}
}


and I put it right before the Modify Profile code....

By all rights, it should update the database for your user account, and set the flag off, (just like doing it via the UserCP, and saving)..

When I do it via the UserCP, it works great.
and during the standard redirect , it does disable the system...

But for some reason,.... when I do

http://myurlhere/member.php&action=phpchatsysoff

It says Thanks! and does the redirect..., but does NOT do the DB set command and change the phpchatsys field in the users profile 8(...

Please help!

DjSap
11-18-2001, 07:21 AM
This should work


// ########################## phpchat off ########################
if ($action=="phpchatsysoff") {
include("./global.php");

$DB_site->query("UPDATE user SET phpchatsys=0 where userid='$bbuserinfo[userid]'");

$goto="usercp.php?s=$session[sessionhash]";
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"$goto\");");
} #end phpchat off

GameCrash
11-18-2001, 11:04 AM
This is a great thing! When will it be released?

And wher can I find the phpMyChat thing?

|DarkManX|
11-18-2001, 02:44 PM
i can't wait for this thing to be released!!

looks great man!!!!

humble
11-18-2001, 05:17 PM
DJsap... you are my new BEST FRIEND!!!!

I love you man!... Thanks ... you're 2 for 2!!!!

Ok, some more teasers....

Of course, we have the UserCP option, to enable or disable, and NOW, we have the scripts for a single click url, that will also Enable or Disable the system...

We have the:

http://www.dynamicdrive.com/dynamicindex1/davidmenu.htm

Slide system all tweaked out as well.... so here's my 3 links to the new PHP chat system.

Internal means, Enabled in the footer, on every page (as seen above).. External, of course is launched in a new IE window, and leaves the phpchatsysoff.

humble
11-18-2001, 05:20 PM
And why Not Add even more to this already fine solution....

Instead of a Empty template for phpchatsysoff, i just copied the phpchatsyson box, with a URL to enable it, instead of the iframe.

humble
11-18-2001, 05:31 PM
Now for people who want to help me test this bad boy out, so we can develop a full hack to release based upon it...


Now, I couldn't have done this, or wouldn't have without the existing hack from Stasik @ https://vborg.vbsupport.ru/showthread.php?s=&threadid=21329&highlight=phpmychat ...

So to get started like I did... You must download phpmychat v0.14.5, and try to get his hack installed, so that you can use vb's users instead of the phpmychat's users.

His implementation, is external window only, and as the 214 replys summarize, it's not for the weak hearted.

After you get that working.... We're ready to start my vB hack(s) to get it 100% integrated...

I've just got a few more things I want to do to it too....

The AdminCP setting for Global Enable/Disable for the Internal system ONLY.

and the private channels being restricted by usergroup.... which is going to be a bit diffucult.... BUT they way i'm thinking of designing it.....

There will be a new menu in the AdminCP... Where you can have lets say 10 channel fields, and a checkbox for public or private.... and if the private is selected, it then looks at another field that basically looks for 'and require access to forumid="xx"'...

i.e.

The CP menu would have:

Channel Name: --------- Public or Private -------- Require Forum ID
=============================================
Boardname ---------------Public --------------------- None
Moderators ---------------Private -------------------- 12
Admins ---------------------Private---------------------13

Where forum 12 = my Moderators forum, where only the moderator's usergroup has access... and 13 = the admin's forum, where only the admin usergroup has access...

so you can continue to do your security as vb designed, but also allowed to use that check, to secure your Chat channels as well!

|DarkManX|
11-20-2001, 11:16 PM
any updates on this baby?? :)

Dark Blaze
12-02-2001, 04:50 PM
All I can say for this hack is that it's excellent, superb, and in french Il est tres bien ;)

Just thought I should spice it up with french, not that I am one, just happen to know the language :)

humble
12-02-2001, 10:53 PM
Sorry for the slacking...

I've had more computer drama then anyone should ever have to deal with, all in one week...

It's taking a bit to get back on my feet... and i'll be sure to resume this project again in a bit.

Dark Blaze
12-03-2001, 04:02 PM
Originally posted by humble
Sorry for the slacking...

I've had more computer drama then anyone should ever have to deal with, all in one week...

It's taking a bit to get back on my feet... and i'll be sure to resume this project again in a bit.

That's ok humble, we all understand that real life is far more important than the vitual life :)

We all will be waiting for when you decide you are ready to continue this project.

Have a nice day :)

certify
12-12-2001, 11:35 AM
I'm looking high and low for a chat system that intergrates with Vb. So far none is complted. :(

pezz
12-17-2001, 04:48 AM
Can't wait till this is released! Looks amazing!!!

spazeman
12-19-2001, 09:53 AM
sweet, that hack kicks ass! I know my users would die for that :cool:

sphinx
12-29-2001, 04:30 PM
yeah sounds excellent m8

kypdurron
01-30-2002, 08:45 PM
this is much better than I can have ever dreamed..

I wish I would have seen this before I started my own "hack" at integrating the two..

Look at my integration:

http://www.ospina.com

and for dual screens, I did:

http://www.ospina.com/index3.html

If you need to "test" anything...let me know! I will
most definetly help! Some php and SQL and a server
I will be willing to (somewhat) hose my boards if needed :-)

I got most of the smilies the same, from the same directory.
The problem is that the phpmychat "smilie" interpreter works really different, so many smilies had to be redone with different
codes. Not a problem, since I match it up on vbulletin anyway..

Inzagi
01-30-2002, 09:03 PM
@humble

Hi,
sorry if this already had been mention but I couldn't discovert it.

How does this chat system affect the server load and how the bandwith on a huge board with 100 users curretly online and perhaps 30 using the chat constantly ?

Any chance it will rok properly for bigger boards?

kypdurron
01-30-2002, 09:10 PM
Originally posted by Inzagi
@humble

Hi,
sorry if this already had been mention but I couldn't discovert it.

How does this chat system affect the server load and how the bandwith on a huge board with 100 users curretly online and perhaps 30 using the chat constantly ?

Any chance it will rok properly for bigger boards?

I wish I can tell you, but I haven't got that many users on my boards yet. I have an E250 DEDICATED to my boards, and
haven't seen my load averages above:
load averages: 0.05, 0.09, 0.10
With 15 people on at once....
I'll answer this better in about 6 months ;-)

Twin-x
03-15-2002, 03:05 PM
Any news yet !!!!

X-Fan
03-22-2003, 12:44 PM
Any progress with this at all?