Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2014, 03:15 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,962
Kyttias is on a distinguished road
Default Addon: Frei Chat (Facebook-like Messenger)

edit: Here's a link to a screenshot of this in action!

I talked with HoF about this a little bit and finally got Frei Chat to work. (I got it to work with 1.3.4, I haven't asked him how much is different about what we're doing in regards to earlier versions, but it's worth a shot?)

Download it (you can go ahead and grab the free version).

Once downloaded, open it up and add the entire freichat folder to your Mysidia directory. So: <where you have Mysidia installed>/freichat.

Run the installer: <Mysidia>/freichat/installation/index.php

Follow the directions for a Customized integration.

-

step 01. Database host is probably localhost. Table prefix is not required. In fact, this should be the same general information you're using for Mysidia itself, as found in inc/config.php (just in case you've forgotten your database username and password). Fill all that basic stuff in. On this page you'll also be making your own admin password, so, do remember it. Hit submit. Let it create tables. Hit next.

-

step 02. Open up Notepad or some text editor. It's going to ask you to "Copy-paste the following code after <head> tag in your index.php or your template/theme file". For now, paste this into the open text editor so you definitely don't lose it - but no need to save it. Double click their box with code if you're having trouble highlighting it, then use a copy shortcut.

-

step 03. It's actually going to go into <Mysidia>/classes/class_template.php, (class_menu works as well, it's what I was using previously, but not everyone even uses the built in menu). Scroll to the very bottom, and after the ?> paste the code they gave you in. Yes, after. The code you paste actually opens a new set of php brackets, so it's ok. <b>Now</b>, delete the the Freichat comments about uninstalling (for whatever reason, if I don't, everything is very unhappy). That's everything from <!-- to -->, the title, too. Save. (If you need to reupload your file via FTP, do so now. Do so every time I remind you to save after changes.)

-

step 04. Hit done. Give it your url. Hit submit. You should be able to see the chat in the corner of the iframe they show you. If not, go up a bit and hit submit again after making sure you have followed all previous steps correctly. So, now that we can see it, hit yes.

-

step 05. Here we're doing user authentication. Ignore the skip it, we're doing this. Keep scrolling down, and it gives an example code and asks you to make the modifications necessary to it. To save you the trouble, here's what you're going to:

Go back to the code you pasted into class_template.php and find $ses=null;.

Replace that line with the following:

PHP Code:
$mysidia Registry::get("mysidia");
if(
$mysidia->user->isloggedin)

    
$ses $mysidia->user->uid//tell freichat the userid of the current user

    
setcookie("freichat_user""LOGGED_IN"time()+3600"/"); // *do not change -> freichat code
}
else {
    
$ses null//tell freichat that the current user is a guest

    
setcookie("freichat_user"nulltime()+3600"/"); // *do not change -> freichat code

-

step 06. Save and hit done. They'll pop an iframe again. The chat on the side may or may not have a 'fake' user on it, this is it doing it's testing. Don't be surprised if it says no one is online at this point. If logged out, log in. Or, even if you are logged in, log out, and log back in (and heck, this may be unnecessary). Hit done.

-

step 07. Here it's verifying that it can find you. If it has errors here, again, double check everything we've done so far. Make sure things open have saved, etc. If everything's fine, congrats! Proceed. (I ended up getting a blank page, and this is not supposed to happen. If you did, too, just keep reading anyway--)

-

step 08. The rest should be a breeze. If you used the default prefix when installing the Mysidia database, the tables you need to find the users is adopts_users, and the columns are username and uid. If you did not use adopts_ when you created your site, use whatever you did create. For those who got a blank page, if you try to reload it's going to try and get you to reinstall everything (ugh), just open up ~/freichat/hardcode.php - not to follow the reinstall instructions, but to continue on manually. At the bottom you'll see this:

PHP Code:
/* Custom driver */
$usertable='login'//specifies the name of the table in which your user information is stored.
$row_username='root'//specifies the name of the field in which the user's name/display name is stored.
$row_userid='loginid'//specifies the name of the field in which the user's id is stored (usually id or userid) 
Change it to:
PHP Code:
/* Custom driver */
$usertable='adopts_users'//specifies the name of the table in which your user information is stored.
$row_username='username'//specifies the name of the field in which the user's name/display name is stored.
$row_userid='uid'//specifies the name of the field in which the user's id is stored (usually id or userid) 
*the avatar info isn't changing because Mysidia actually doesn't keep the avatar data in the users table. =| (I'll try to work on an inevitable work around for this?)

I'll try and make this guide clearer if need be.

Freichat Admin Panel
You'll want to go into <yoursite.com/whatever>/freichat and hit 'administer' to change a few things.

The second button from the top (looks like a book) on the admin panel for freichat will let you decide guest settings and all sorts of things you'll want to configure. I can't guarantee 'Only your Buddies' in 'Who should be on the online users list' will work. You'll want to set 'Show Avatar' to no, because I can't get those to work properly.

The sixth icon (a cog) has to do with the chatroom link that shows up in the upper left of your page. But the ninth icon (briefcase) will allow you to disable it completely, along with other settings.

The eighth button from the top (looks like an image) on the admin panel for freichat lets you modify the theme.

There may be some graphical errors (overlapping text) going on with the appearance of the chat box itself. You will need to fine tune some going ons in here. If the online status text is overlapping the users online area, then I would make these changes: In the freichat admin panel, click the eighth icon (a picture?) and by basic or silver or whatever design you're using, hit 'Design'. Open up the chatbox (it has the buddylist). See where the chatbox says 'i am available'? Click that the container holding that. Or, rather, don't click the text, or the arrow icon next to it, click just a tiny bit beneath and between them. It should pop up that you're editting DIV#frei_option_bar_status.frei_option_bar_status so here I want you to change the width to 120px.

OR manually: in ~/freichat/client/themes/basic/styles.css (or silver, or whichever theme you're using), find .frei_option_bar_status and set its width property to 120px.


-



Huge thanks to HoF for helping me on AIM to figure out how to modify the authentication code!

Last edited by Kyttias; 11-14-2014 at 12:22 PM.
Reply With Quote
  #2  
Old 03-14-2014, 10:10 PM
LucasA33's Avatar
LucasA33 LucasA33 is offline
Member
 
Join Date: Jul 2011
Posts: 144
Gender: Male
Credits: 12,241
LucasA33 is on a distinguished road
Default

Create guide and great script you shared with us.
My only issue is that I named my project database project.

I also gave it a prefix of project_

I'm not sure what I am supposed to replace to make it work with my directory.
__________________
Reply With Quote
  #3  
Old 03-15-2014, 02:08 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,962
Kyttias is on a distinguished road
Default

Quote:
Originally Posted by LucasA33 View Post
Create guide and great script you shared with us.
My only issue is that I named my project database project.

I also gave it a prefix of project_

I'm not sure what I am supposed to replace to make it work with my directory.
As I have in the original post: "If you used the default prefix when installing the Mysidia database, the tables you need to find the users is adopts_users, and the columns are username and uid."

Because the default prefix is adopts_, at this point you change adopts_ to project_ since you aren't using the default prefix. Any instance in the guide where you see the default adopts_ you just have to change that to the project_ prefix you've chosen to use instead. Does this make it any more clear??

If you need to manually change the prefix after you've installed it you can do so in by finding hardcode.php in your freichat folder, and finding this to make the change (should be all you need, adopts_users to project_users):
Code:
/* Custom driver */
$usertable='adopts_users'; //specifies the name of the table in which your user information is stored.
$row_username='username'; //specifies the name of the field in which the user's name/display name is stored.
$row_userid='uid'; //specifies the name of the field in which the user's id is stored (usually id or userid)
I've personally had trouble getting the avatars to work, so I've disabled them within freichat's admin panel (you get an admin panel if you visit the freichat folder directory directly and login with the password you set during installation, it's also found in hardcode.php in case you ever forget it).

But theoretically, the avatar part would need changing, as well (adopts_users_profile to project_users_profile):
Code:
$avatar_table_name='adopts_users_profile'; //specifies the table where avatar information is stored
$avatar_column_name='avatar'; //specifies the column name where the avatar url is stored
$avatar_userid='uid'; //specifies the userid  to the user to get the user's avatar

Last edited by Kyttias; 03-15-2014 at 02:20 PM.
Reply With Quote
  #4  
Old 03-29-2014, 12:19 AM
LucasA33's Avatar
LucasA33 LucasA33 is offline
Member
 
Join Date: Jul 2011
Posts: 144
Gender: Male
Credits: 12,241
LucasA33 is on a distinguished road
Default

After doing everything you said step by step, this is what I am getting.
__________________
Reply With Quote
  #5  
Old 09-26-2014, 05:54 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,089
parayna is on a distinguished road
Default

This is cool! :D I have a question though, why do you install in the class_menu and not the index or theme files? It's just I tried installing and a header warning popped up... (not too hard to get rid of, but still.. XD) Would it still work if you install somewhere else? Or not?
Reply With Quote
  #6  
Old 09-27-2014, 03:18 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,044
kristhasirah
Default

have the chat working... but my only problem is when i add the code to the class_menu.php I can't logout if i already logged in
and can't login if im already logged out... don't know if i make sense?
But when i add it to a individual page like: adopts, shoutbox, the login and log out work fine, but the chat wont appear in the other pages...
__________________
Reply With Quote
  #7  
Old 09-29-2014, 03:22 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,089
parayna is on a distinguished road
Default

I had that problem! Then I messed around and I got it somehow... I used this code (in class_menu) You can see if it helps?:


EDIT: Nope. Ignore me. Seems to have gone wrong for me now.. XD

Last edited by parayna; 09-29-2014 at 03:55 PM.
Reply With Quote
  #8  
Old 10-06-2014, 03:06 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,089
parayna is on a distinguished road
Default

Sorry for the double post, but I have figured out the login/logout issue. I am trying to install it again and I put it in the index.php file and I can log in and log out without a problem! The only problem I do have is trying to get the uid thing to work... it keeps coming up with the same error on the installation that Lucas gets... :/ And I followed the instructions too.. hmm
Reply With Quote
  #9  
Old 11-13-2014, 08:23 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 3,685
AndromedaKerova is on a distinguished road
Default

I can't even get past step1.
I filled out the info as best as I could understand it but I get this error:
Hmm :( Failed to connect to your database ERROR: database connection failed ERROR: SQLSTATE[28000] [1045] Access denied for user 'rommie'@'localhost' (using password: YES)

The password was NOT filled out as "YES"
__________________
Failing at being normal since 1990.
Reply With Quote
  #10  
Old 11-13-2014, 10:25 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,962
Kyttias is on a distinguished road
Default

It's not saying that 'YES' is your password, just that you're using one. Double check that your password (and username) for your database is, in fact, correct. It should be the same database information entered for your Mysidia configuration. But the MySQL database could always be confused after server downtime, so manually logging into it through phpMyAdmin sometimes helps kick it back into gear.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
Reply

Tags
chat, chatroom, facebook-like chat, messenger

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone tried Facebook features on their site? Kesstryl Feedback and Suggestions 1 07-17-2012 11:08 PM
Yahoo Instant Messenger.. please help! solskenn Other Chat 0 05-10-2012 11:00 AM
Facebook Like Site Nemesis Other Chat 0 06-04-2011 11:02 AM
Adoptable Search Addon [by Kae] Kaeliah Mys v1.1.x Mods 16 01-25-2011 07:05 PM
Facebook Connect fadillzzz Questions and Supports 6 09-01-2010 01:48 PM


All times are GMT -5. The time now is 11:35 AM.

Currently Active Users: 457 (0 members and 457 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636