Hi Guys, just to compile some hacks and codes I'm sharing with the community. Basically, these codes are compilations of some stuffs I do in my site as a personal customization.
// Glue back query.
$query = implode(' ', $query);
// remove below query to make it work before.
//$query = 'SELECT b.* FROM `#__users` AS b inner join #__social_friends as f ON b.id = f.target_id WHERE b.name LIKE '.'"%' . $term . '%"'.' OR b.username LIKE '.'"%' . $term . '%"';
$query = 'SELECT b.* FROM `#__users` AS b WHERE b.name LIKE '.'"%' . $term . '%"'.' OR b.username LIKE '.'"%' . $term . '%"';
$db->setQuery( $query );
$userEmail = $config->get( 'users.indexer.email' ) ? $user->email : '';
// $userEmail = $config->get( 'users.indexer.email' ) ? $user->email : '';
.es-online-status.es-online-status-small {
display: none !important;
}
create view trending_hash AS
SELECT
count(0) AS `trend_count`,
`#_social_stream_tags`.`id` AS `id`,
`#_social_stream_tags`.`title` AS `title`
FROM
(
`#_social_stream_tags`
JOIN `#_social_stream` ON (
(
`#_social_stream_tags`.`stream_id` = `#_social_stream`.`id`
)
)
)
WHERE
(
(
`#_social_stream`.`modified` > (curdate() - INTERVAL 7 DAY)
)
AND (
`#_social_stream_tags`.`title` IS NOT NULL
)
)
GROUP BY
`#_social_stream_tags`.`title`
ORDER BY
count(0) DESC
.fabrik_actions.fabrik_element, .fabrik_select.fabrik_element, .fabrik___heading > td, .fabrik___heading, .nav.nav-pills.pull-left {
display: none;
}
.trending_hash___title.fabrik_element.fabrik_list_1_group_1 {
border: none !important;
}
.fabrik___rowlink.fabrik_edit:before {
content: "#";
}
.fabrik___rowlink.fabrik_edit:before {
content: " \0023 ";
}
if ($type == 'following') {
$stream->get(array('context' => SOCIAL_STREAM_CONTEXT_TYPE_ALL, 'type' => 'follow'));
if ($type == 'following') {
// $stream->get(array('context' => SOCIAL_STREAM_CONTEXT_TYPE_ALL, 'type' => 'follow'));
// Above line was original and commented by developer on 24-09-2014 and belwo line added
$stream->get();
}
UPDATE um6yn_social_users
SET um6yn_social_users.permalink = NULL
WHERE
um6yn_social_users.permalink IS NOT NULL;
update um6yn_social_users set permalink = (select username from um6yn_users where um6yn_users.id = um6yn_social_users.user_id);
<?php
class profileDetails{
public function addPermalink($id, $username){
$db = JFactory::getDBO();
$query = "SELECT *
FROM um6yn_social_users
WHERE um6yn_social_users.user_id = '".$id."'
AND um6yn_social_users.permalink = ''
";
$db->setQuery($query);
$result = $db->loadAssocList();
$count=count($result);
if($count == '1'){
$db2 = JFactory::getDBO();
$q = "UPDATE um6yn_social_users
SET permalink = '".$username."'
WHERE um6yn_social_users.user_id = '".$id."'
";
$db2->setQuery($q);
$result2 = $db2->query();
}
//return $q;
}
?>
defined( '_JEXEC' ) or die( 'Unauthorized Access' );
$profile = new profileDetails;
//add permalink if perma is not existing
$profile->addPermalink($this->my->id,$this->my->getUsername());
/administrator/components/com_easysocial/models/friends.php
$query .= " order by score desc";
$query .= " order by rand() desc";
Ken wrote:
@josh - Added it up on the first thread
create view trending_hash AS
SELECT
count(0) AS `trend_count`,
`#_social_stream_tags`.`id` AS `id`,
`#_social_stream_tags`.`title` AS `title`
FROM
(
`#_social_stream_tags`
JOIN `#_social_stream` ON (
(
`#_social_stream_tags`.`stream_id` = `um6yn_social_stream`.`id`
)
)
)
WHERE
(
(
`#_social_stream`.`modified` > (curdate() - INTERVAL 7 DAY)
)
AND (
`#_social_stream_tags`.`title` IS NOT NULL
)
)
GROUP BY
`#_social_stream_tags`.`title`
ORDER BY
count(0) DESC
Thanks Ken, but I did something similar to that already - I need a User to be able to turn there own status off/on
Why not ask Mark to just add this feature?They already added Invite Non-Friends in Groups, based on the hack Ken did it doesn't look too complicated for SI Team. Since the hack is in the model file, it will get overwritten on every update I'm talking about the @mention by the way.
Ken wrote:
@jannik - Hi There Jannik. There's some customization in the core there and I believe providing the module just isn't gonna work due to the way easysocial works on updates. But here's a shortcut (not native and requires fabrik)
1. go to mysql (replace # with your prefix)
create view trending_hash AS
SELECT
count(0) AS `trend_count`,
`#_social_stream_tags`.`id` AS `id`,
`#_social_stream_tags`.`title` AS `title`
FROM
(
`#_social_stream_tags`
JOIN `#_social_stream` ON (
(
`#_social_stream_tags`.`stream_id` = `um6yn_social_stream`.`id`
)
)
)
WHERE
(
(
`#_social_stream`.`modified` > (curdate() - INTERVAL 7 DAY)
)
AND (
`#_social_stream_tags`.`title` IS NOT NULL
)
)
GROUP BY
`#_social_stream_tags`.`title`
ORDER BY
count(0) DESC
2. in fabrik, create a list view of the table trending_hash
3. link them up properly and hide the other columns in list view.
Please be informed this is not possible in the frontpage since easysocial doesn't have a public view in hashtag searches.
If you want to enable this on public, vote my sig! They might include it in the future builds (I don't have luck on making it public...)
Thanks for sharing this KenGreatly appreciated! For that, your public hashtag gets a vote from me
.fabrik_actions.fabrik_element, .fabrik_select.fabrik_element, .fabrik___heading > td, .fabrik___heading, .nav.nav-pills.pull-left {
display: none;
}
.trending_hash___title.fabrik_element.fabrik_list_1_group_1 {
border: none !important;
}
.fabrik___rowlink.fabrik_edit:before {
content: "#";
}
.fabrik___rowlink.fabrik_edit:before {
content: " \0023 ";
}
Ken wrote:
Next project will be following with your details in it. I just can't seem to fix the union (im not that good with SQL) but i'm near it.
So here's how it works. Most of us just go with the "following" as default, but just like twitter, it should include OUR post in it so we will still know how our timeline goes without flipping back and forth with "me and friends" and "following"
What do you think guys? Is it a worthwhile project?
Ken wrote:
Appreciate everything guys! I'm not much of a CSS guy and really more on site optimization so every tricks do count ^_^
SELECT
#_social_stream.id,
#_social_stream.actor_id,
#_social_stream.title,
#_social_stream.edited,
#_social_stream.content
FROM
#_social_stream
WHERE
#_social_stream.content like '%keywordhere%'
Ken wrote:
I would love to add that but I'm really pushing all my effort in making the hashtag public as of this moment. I'll do what I can by next week to see if I can do this too.
Anyway, here's a global search for the stream using mySQL/mariaDB
SELECT
#_social_stream.id,
#_social_stream.actor_id,
#_social_stream.title,
#_social_stream.edited,
#_social_stream.content
FROM
#_social_stream
WHERE
#_social_stream.content like '%keywordhere%'
Sunny wrote:
@ken on your site you have a Pen icon on extreme right of logo bar, which when clicked a popup for status update appears, can you please share the method of achieving the same.
regards
Ken wrote:
@sunny
I'll put that on Monday, I'll be on a vacation this week and I don't want my wife to see me going in the internet (or else it will ruin her vacation) ^_^