Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
User Follower speci...
 
Notifications
Clear all

User Follower specific question

1 Posts
1 Users
0 Reactions
2,481 Views
(@wpwp2)
New Member
Joined: 7 years ago
Posts: 2
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#4410]

Hello, I would like to list/show all the usernames following a certain user (the author of a post). I want to hook into your plugin data from the content-single.php that creates every post. How can I achieve this? Specifically, I found the functions that I would need to tie into in your /wpdiscuz/includes/class.WpdiscuzDBManager.php:

public function getUserFollowers($userEmail) // returns users that follow userEmail from followUsers table

I know I can use something similar to your /utils/layouts/follows/follows-page.php to display the usernames. But how can I tie into this table to retrieve the data from outside your plugin? 

Also, I want to be about to use the follower (bell symbol) on the same content-single.php, so that other users can follow the author (and subscribe to their comments). I know I can use this from class.WpdiscuzDBManager.php:

public function addNewFollow($args) // adds new follower into followUsers table

and this from class.WpdiscuzWalker.php:

$commentOutput .= '<div class="wc-comment-author ' . $uNameClasses . '">' . $user['authorName'] . '</div>';
if ($args['can_user_follow'] && $args['current_user_email'] != $comment->comment_author_email) {
if (is_array($args['user_follows']) && in_array($comment->comment_author_email, $args['user_follows'])) {
$followClass = 'wc-unfollow wc-follow-active';
$followTip = $this->optionsSerialized->phrases['wc_unfollow_user'];
} else {
$followClass = 'wc-follow';
$followTip = $this->optionsSerialized->phrases['wc_follow_user'];
}
$commentOutput .= '<div class="wc-follow-link wpd-tooltip-right wc_not_clicked ' . $followClass . '">';
$commentOutput .= '<i class="fas fa-rss" aria-hidden="true"></i>';
$commentOutput .= '<wpdtip>' . $followTip . '</wpdtip>';
$commentOutput .= '</div>';
}

Any help is appreciated. I really like your plugin setup and want to take advantage of the functionality and data.

Thanks!



   
Quote
Share:
Scroll to top