Page 1 of 1

ArrowChat "misc" fields

PostPosted: 05 May 2011, 07:47
by LeopardX
Hello Jason and ArrowChat team,

In implementing ArrowChat into my own site engine (NewsTime), I found the need to have more than 3 "misc" fields. So I went into the code and added support for these myself. It pretty much just involved searching through
Code: Select all
receive_core.php
to include:
Code: Select all
getMarkup($author_id, $author_name, $type, $message_time, $misc1, $misc2, $misc3, $misc4, $misc5);

So might it be possible to include more "misc" fields? One possible way to do this could be by rewriting these functions to input an array instead of individual values:
Code: Select all
$misc = array();
array_push($misc, "however", "many", "values", "you", "need");
getMarkup($author_id, $author_name, $type, $message_time, $misc);

One could put the array_push into a loop and and run it for however many values you need.

Could this be implemented for future versions of ArrowChat?

Thanks,
Jacob

PostPosted: 05 May 2011, 14:42
by Jason
I never thought someone would need more than 3. Out of curiosity, what all are you passing through? The array idea seems good.

PostPosted: 06 Jun 2011, 17:24
by LeopardX
(Sorry for the late reply!)
For example, notifications for comments on people's wallposts are set up by formulating a user-friendly descriptive message:
"[First name] [Last name] (if more than one comment: "also") commented on ("your"|"his"|"her") ("wall post"|"status"|"posted item" (safe fallback if it's type is unknown)).

This is sent as an email, no issues there.
But when creating a verbose notification for ArrowChat, all 3 values are used by the message:
$misc1 = "also" (if necessary)
$misc2 = "your"|"his"|"her"|"owner full name"
$misc3 = "wall post"|"status"|"posted item"

So I can have ArrowChat fill those in while displaying the notifications, no problem.
But I need two more, to show the link to the comment.

$misc4 = page_id of parent post
$misc5 = comment's HTML anchor ID (so the browser scrolls to the correct section).

Hopefully that made sense.

I managed to get this working perfectly in a previous version of ArrowChat, but it was overwritten by an update. Guess that's why you back up before you update, huh? ;)

Thanks again for the amazing product!

PostPosted: 06 Jun 2011, 17:58
by Jason
Well that's a lot of additional fields but it makes sense! You're array suggestion is on our list of things to consider.

PostPosted: 06 Jun 2011, 23:42
by LeopardX
Thank you! Looking forward to seeing it!

PostPosted: 13 Jun 2011, 13:01
by EGonzalezmarroquin
Hi,

I had the same issue as I was pretty much rebuilding this script to fit my site. Any word on this feature?

Topic Closed

PostPosted: 07 Nov 2012, 12:40
by Staff Bot
This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.