New User (Friends or Family)

yanick beaulieu Posted in Beginning Developers 2 months ago

Will someone be able to create a plugin that will allow you to choose if the person is added as a friend or as a family? I would like to create a new tab on the profile page

Replies
German Michael Z├╝lsdorff Replied 2 months ago

My way of getting familiar with things like that would be
- start with a new clean Ossn site
- add a second user
- have a close look into the database and remember the number of rows of each table
- make a friend request
- check the database for changes / new rows
- let that second user confirm your request
- check the database again

now I know which database entries are reflecting the friendship
next step is to find the actions that are responsible for creating these database entries / changes
so what's left in the end when I have the knowledge what 'makes' another member a friend of mine is to develop some similar code for family, colleague or other kind of relations

Catalan Yanick beaulieu Replied 2 months ago

I will try to be as clear as possible
When we go to search we can click on add a friend
I would like to add an add a colleague button.
see these 2 links
https://prnt.sc/6_N4iveKexQ1
https://prnt.sc/4YVX3unSzzoq

I created a list in the profile like the friend list
https://prnt.sc/SiYoAUzzoh4W

and to be clearer I added the modules on the profile pages
https://prnt.sc/4x4hL-laeeKm
https://prnt.sc/5foiE2QGJMgi
https://prnt.sc/fVbAywubo7iC
In the last images you notice that the list is empty

Indonesian Arsalan Shah Replied 2 months ago

Seems either php warning occurs or syntax error. Enable error reporting in OSSN site settings, when the error appears try to look error log file if nothing on error log file look into your cpanel apache error log file.

Catalan Yanick beaulieu Replied 2 months ago

the site web shut down

Indonesian Arsalan Shah Replied 2 months ago

What is the problem when adding dropdown? or the dropdown not working?

Catalan Yanick beaulieu Replied 2 months ago

I apologize, I expressed myself badly, I will show you an image which will allow you to better understand what I am trying to do.

https://prnt.sc/VU_crad5BlWY

Fortunately, I have sorted out all my programming conflicts, everything works well now, when adding I would like to determine the role of the people I am adding, I have created the buttons and the friend list, however, I cannot not to create a dropdown in the user.php to allow me to add the member to the correct user_list.

Indonesian Arsalan Shah Replied 2 months ago

You are using premium version and it already have option to show family and relationship to others on about page you just need to enable About page in users - > custom fields -> about settings

Catalan Yanick beaulieu Replied 2 months ago

error corriged I added the value getFamily and the page works on the profile

Now I need to do 4 things,
- I need to find a way to add a select when the person clicks add so that the person can choose if they are a friend, family, work colleague or in my favorites list.
- I need to ensure that the added user is visible on my page getFamily
- I need to make the add/remove function work correctly it may already be correct but as the other 2 steps don't work I can't test /action/
- I need to ensure that the user can move the member from one list to another without needing to delete the member.

To help you further, the other pages linked to this have already been modified or ready to be modified but it's location I can't find them

Catalan Yanick beaulieu Replied 2 months ago

I solved half, I added everywhere in the wall in the addition on the module but one thing is not working.

I do not publish any information regarding my website, I do not solicit
https://prnt.sc/AaKjcPWHExQF
https://prnt.sc/bUCXpFd7m_JU
https://prnt.sc/Aq1l4AQqCBRB
https://prnt.sc/DucRnRg3iALQ
My only problem is that when I click on the page /family the page gets its errors

Exception: Call to undefined method OssnUser:getFamily in /home/.../.../classes/OssnBase.php:74 Stack trace:

#0 /home/.../.../components/OssnProfile/plugins/default/profile/pages/family.php(13): OssnBase->__call('getFamily', Array)

#1 /home/.../.../libraries/ossn.lib.views.php(27): include('/home/.../...')
#2 /home/.../.../libraries/ossn.lib.views.php(50): ossn_include('/home/.../...', Array)
#3 /home/.../.../libraries/ossn.lib.plugins.php(75): ossn_view('/home/.../...', Array)

#4 /home/.../.../components/OssnProfile/ossn_com.php(192): ossn_plugin_view('profile/pages/f...', Array)

#5 /home/.../.../libraries/ossn.lib.system.php(223): profile_user_family('profile', 'subpage', NULL, Array)

#6 /home/.../.../themes/white/plugins/default/profile/pages/profile.php(145): ossn_call_hook('profile', 'subpage', Array)

#7 /home/.../.../libraries/ossn.lib.views.php(27): include('/home/.../...')
#8 /home/.../.../libraries/ossn.lib.views.php(50): ossn_include('/home/.../...', Array)
#9 /home/.../.../libraries/ossn.lib.plugins.php(75): ossn_view('/home/.../...', Array)

#10 /home/.../.../components/OssnProfile/ossn_com.php(366): ossn_plugin_view('profile/pages/p...', Array)

#11 /home/.../.../libraries/ossn.lib.page.php(79): profile_page_handler(Array, 'u')
#12 /home/.../.../index.php(22): ossn_load_page('u', Array)
#13 {main}
Catalan Yanick beaulieu Replied 2 months ago

I would like to know how to add one in OssnProfil, I added a module to see the family members on the profile and their work colleagues, but when I add the function in ossn_com.php in the ossnprofil component the whole site crashes because the information is missing

I added a page in

modules/about.php
modules/friends.php
modules/family.php

pages/profile.php
pages/friends.php
pages/family.php