From b02a671494b9278b338b015322df7896e4a71696 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Apr 2012 20:50:31 -0700 Subject: visit "random profile" feature --- include/Contact.php | 8 ++++++++ include/contact_widgets.php | 2 ++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index d8d94b190..532ea2f95 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -158,3 +158,11 @@ function contact_photo_menu($contact) { } return $o; }} + + +function random_profile() { + $r = q("select url from gcontact where url like '%%://%%/profile/%%' order by rand() limit 1"); + if(count($r)) + return dirname($r[0]['url']); + return ''; +} \ No newline at end of file diff --git a/include/contact_widgets.php b/include/contact_widgets.php index e0f37f078..96b02f293 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -12,6 +12,7 @@ function follow_widget() { } function findpeople_widget() { + require_once('include/Contact.php'); $a = get_app(); @@ -32,6 +33,7 @@ function findpeople_widget() { '$findthem' => t('Find'), '$suggest' => t('Friend Suggestions'), '$similar' => t('Similar Interests'), + '$random' => t('Random Profile'), '$inv' => t('Invite Friends') )); -- cgit v1.2.3