(SOLVED) Connections/Friends Sorting

15 years 5 months ago #77583 by krileon
(SOLVED) Connections/Friends Sorting was created by krileon
Hey beat are you guys currently working on this?

As I'm about to implement it, but won't bother if it's going to be in say the next RC.

If not then I'll do it and give you the code to implement it into future releases. Already inspected the code and know exactly what I'm going to do.

Should only take me a couple days.

So if the CB team is interested or even ya users here. Let me know and I'll release the code when complete.

Will begin working on it tomorrow. I'm tired now, lol. Been coding all day. Sleep time :)

Post edited by: krileon, at: 2008/10/17 03:35

Post edited by: krileon, at: 2008/10/17 21:40


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

15 years 5 months ago #77630 by hippo
Replied by hippo on topic Re:Connects/Friends Sorting
Yes there is interest in this, if not from the CB team then from the other developers around here snagging code and getting ideas.

Sleep then code, is my advice.

:P

Please Log in to join the conversation.

15 years 5 months ago #77633 by krileon
Replied by krileon on topic Re:Connects/Friends Sorting
Well it's done for the most part. I just can't get the new saveConnection function to actually update the database.

Trying to figure out what's causing it to mess up.

These are my changes to the function:
Original:
[code:1]
function saveConnection($connectionid,$desc=null,$contype=null) {
global $_CB_database;

$sql="UPDATE #__comprofiler_members SET description='".htmlspecialchars(cbGetEscaped($desc))."', type='".htmlspecialchars(cbGetEscaped($contype))."' WHERE referenceid=".(int) $this->referenceid." AND memberid=".(int) $connectionid;
$_CB_database->SetQuery($sql);
if (!$_CB_database->query()) {
$this->_setErrorMSG("SQL error" . $_CB_database->stderr(true));
return 0;
}
return 1;
}
[/code:1]
New:
[code:1]
function saveConnection($connectionid,$desc=null,$contype=null,$order=null) {
global $_CB_database;

$sql="UPDATE #__comprofiler_members SET description='".htmlspecialchars(cbGetEscaped($desc))."', type='".htmlspecialchars(cbGetEscaped($contype))."', order='".htmlspecialchars(cbGetEscaped($order))."' WHERE referenceid=".(int) $this->referenceid." AND memberid=".(int) $connectionid;
$_CB_database->SetQuery($sql);
if (!$_CB_database->query()) {
$this->_setErrorMSG("SQL error" . $_CB_database->stderr(true));
return 0;
}
return 1;
}
[/code:1]

Post edited by: krileon, at: 2008/10/17 20:17


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

15 years 5 months ago #77641 by krileon
Replied by krileon on topic Re:Connects/Friends Sorting
LMFAO! omg I'm dieing.. I'm dieing here.. seriously hilarious.

I'm so dumb! order is used to define an order of a query. I set it as a table row name. That was stupid. I didn't put it in single quotes so it kept trying to order the update, LOL!!!!

Funny stuff. :P

Changed row name and it is now 100% working. Can now order friends =)

The limit is 9999. So hopefully that should be plenty, lol.

Give me a bit to compile some instructions and I'll release the code.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

15 years 5 months ago #77646 by krileon
Replied by krileon on topic Re:Connects/Friends Sorting
Done. The instructions are very straight forward and easy to understand. It's literally just copy and paste for the entire process.

The only work that requires some extended knowledge is inserting the new field into your database, but I've given instructions for that as well.

So follow the instructions carefully and you'll have sorting capability. Yes it does sort the tab as well as the management.

Also Beat if you guys want you can add this to future CB releases. Be a good addition to the core so people won't have to keep applying the hack.

Attachment order_hack_instructions.txt not found



Sorry guys I forgot to include 1 thing in the instructions.

Open [code:1]/components/com_comprofiler/comprofiler.html.php[/code:1]
Locate and add the following after line 1869:
[code:1]
<th style='text-align:center;'><?php echo _UE_CONNECTIONORDER; ?></th>
[/code:1]

Post edited by: krileon, at: 2008/10/17 22:13


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Attachments:

Please Log in to join the conversation.

15 years 5 months ago #77649 by beat
Replied by beat on topic Re:Connects/Friends Sorting
Hi krileon,

Thanks for sharing this nice addition.

The connections feature is due for a rework in next CB release 1.3, and we will certainly keep this nice feature in mind during the rework.

We are currently trying to stabilize CB 1.2 RC 3 to make a CB 1.2 Stable, while checking the new framework API through some exciting new plugins, so we are trying to put new features in the core of CB 1.2 at this stage, even if sometimes very tempting like here...

Keep up the good work B)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.228 seconds

Facebook Twitter LinkedIn