1
ThaMikestro
Direct Friends Problem
  • 2005/2/13 21:39

  • ThaMikestro

  • Just popping in

  • Posts: 2

  • Since: 2005/2/13


Hello,

I'm here to gripe about the DirectFriends module. I followed the installation instructions and created the "myfriends" table, but it doesn't seem to work properly.

When I click the "Add Friends" button (Which actually displays as "Zu My Friends-Liste hinzufügen" because there is no English language support!) it displays "Problem." (Such descriptive error-handling!) I tracked down the code that's spitting out this message. Here it is:

$sqlstr ="INSERT INTO ".$xoopsDB->prefix("myfriends")." (uid, fuid) VALUES ($myid$fuid_in)";
        
$req=mysql_query($sqlstr);
        if (
$req) {
                echo 
"";
                echo 
""._MF_FRIENDADDED.""
;
                echo 
""._MF_BACKTOMODPAGE."";
                echo 
""._MF_BACKTOLIST."";
                echo 
"";
                }
        else {
                echo 
_MF_PROBLEM;
                }
        }


I tweaked around with the DB using a remote administration program (MySQL-Front) and I could add users to my friends list. For some reason, the INSERT doesn't work when it's called from the direct friends PHP files. I've also checked the DELETE function and it's not working properly.

Has anyone experienced similar problems with the directfriends module?

I think that this module needs some work. First of all, it doesn't function properly without being customized. We could also improve the setup so that it automatically creates the table so the user doesn't have to do anything. Perhaps we could also translate the German to English. Anyone interested in helping out with making these improvements?

It's quite a basic module, so it would be a quick project for those of you who are familiar with editing XOOPS modules. If you're interested in helping me fix this, please let me know.

Thanks,

Mike

2
dadoprom
Re: Direct Friends Problem
  • 2005/11/4 12:58

  • dadoprom

  • Not too shy to talk

  • Posts: 143

  • Since: 2004/3/2 1


Is there a possibility to fix this module, it does the same error to me... but I like it because of it's simpleness. I'd be glad if someone helps!

Thanx
Everything is possible......
-------------------------------------------------
http://www.mla.sk

3
dgbauer
Re: Direct Friends Problem
  • 2005/12/8 12:33

  • dgbauer

  • Just popping in

  • Posts: 5

  • Since: 2005/11/12


I know this topic is over a month old now, but for what it's worth, I am working on one of two things depending on how the first goes...

1. Fixxing the bug in the directfriends module

-or-

2. Writing a completely new friends module for XOOPS 2.0.x and higher.

You guys let me know what you would prefer before I get too far in, and that's what I will do.


Also, if either of you have gotten the directfriends module working, can you please let me know and post the code?

4
robbhammack
Re: Direct Friends Problem
  • 2006/6/3 21:33

  • robbhammack

  • Just popping in

  • Posts: 2

  • Since: 2006/6/3 2


I've gotten it (mostly) working under 2.2.4 - it was fairly easy, only took a few hours.
The database structure has changed, and the sql needs to be updated to reflect that. Also, I changed the way he accesses configuration variables to use the XOOPS constants from mainfile.php (not sure if it was necessary, but it seemed like a good idea)

I should really rewrite all the database code to use the $xoopsDB object, but this is a temporary hack - I'll be writing a much more full-featured "social networking" module and framework from scratch over the next few months.

Changes:
Mostly replacing $xoopsconfig["xoops_url"], etc with the equivalent constants, like XOOPS_URL

I.E. in myfriends.php
@mysql_connect($xoopsConfig["dbhost"],$xoopsConfig["dbuname"],$xoopsConfig["dbpass"])
becomes
@mysql_connect(XOOPS_DB_HOST,XOOPS_DB_USER,XOOPS_DB_PASS);

and rewriting the sql strings to use new fields.
I.E.
$sqlstr8="SELECT uid, time FROM ".$xoopsDB->prefix("sessions")."";
becomes
$sqlstr8="SELECT member_id, sess_updated FROM ".XOOPS_DB_PREFIX."_session"."";

I'll be happy to email you a zip of what I have so far, I'm still working on a few things as I'm new to XOOPS - I haven't figured out how to tell when a user is online, for example. email me at robbhammack@gmail.com and I'll send you a zip file of the working module ;o)

--Robb

5
jordi_rc
Re: Direct Friends Problem
  • 2006/10/11 16:16

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello! I am building my XOOPS site and want to have something like this module.
I tried to make it work, removed some bug but I didn't manage it to run on XOOPS 2.0.15. Many problems with header.php and others...

Since I removed the bugs of some other modules, I don't know why this is so hard to fix.

robbhammack could you please email me if you got something that works with this module, and I will try to work from that and if I got all working, I will paste a link here to download the work. Maybe if we all try together we have it working ok, since there is nothing as this module, it seems, and many of us need it.

I thought to make a module from the beginnig for this.
I suppose it would work this way:

1) make a db that stores 2 fields: username and list of uids of friends. Or maybe alter the xoops_users db and add a field that stores uid of friends.
2) a block for adding a friend
3) a block of showing friends on line possibly based in membros_online (online_members) module.

Please email me your work if you like.

Thanks.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

Login

Who's Online

338 user(s) are online (248 user(s) are browsing Support Forums)


Members: 0


Guests: 338


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits