Skip to Content Skip to Menu

Invite a Friend Component

  • Brow3000
  • Brow3000
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
17 years 11 months ago #23365 by Brow3000
Replied by Brow3000 on topic Re:Invite a Friend Component
@ p9939068, the site is back up to download...I have been waiting for it to come up again as well.

Does anyone know if this fix works with the Account Expiration Control - Subscription Manager

extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,176/Itemid,35/

I see that it would work with CB now, but with the Account Expiration Control - Subscription Manager mod installed, the first step is to confirm that you would like to pay.

If you need a sample demo, www.bloggerbuds.com/ (click register)

Please Log in or Create an account to join the conversation.

  • p9939068
  • p9939068
  • OFFLINE
  • Posts: 186
  • Thanks: 0
  • Karma: 117
17 years 11 months ago #23403 by p9939068
Replied by p9939068 on topic Re:Invite a Friend Component
The way i see it, the one and only way to have a invite feature with CB is through a CB plugin that uses cookies.


Mike Feng
Creator of SIMGallery, SIMAnswers, and ParaInvite
www.simbunch.com
twitter.com/simbunch

Please Log in or Create an account to join the conversation.

  • p9939068
  • p9939068
  • OFFLINE
  • Posts: 186
  • Thanks: 0
  • Karma: 117
17 years 11 months ago #23405 by p9939068
Replied by p9939068 on topic Re:Invite a Friend Component
To hide the plugin tab from other users, you can either use mikko's privacy plugin, or replace your entire plug_cbinvitefriends/invitefriends.php with the following code:
[code:1]<?php
/**
* Joomla Community Builder User Plugin: plug_cbinvitefriends
* @version $Id$
* @package plug_invitefriends
* @subpackage invitefriends.php
* @author Michael Spredemann
* @copyright (C) Michael Spredemann
* @license Limited www.gnu.org/copyleft/gpl.html GNU/GPL
* @final 1.0
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );


/**
* Basic tab extender. Any plugin that needs to display a tab in the user profile
* needs to have such a class. Also, currently, even plugins that do not display tabs (e.g., auto-welcome plugin)
* need to have such a class if they are to access plugin parameters (see $this->params statement).
*/
class getinvitefriendsTab extends cbTabHandler {
/**
* Construnctor
*/
function getinvitefriendsTab() {
$this->cbTabHandler();
}

/**
* Generates the HTML to display the user profile tab
* @param object tab reflecting the tab database entry
* @param object mosUser reflecting the user being displayed
* @param int 1 for front-end, 2 for back-end
* @returns mixed : either string HTML for tab content, or false if ErrorMSG generated
*/

function getDisplayTab($tab,$user,$ui) {
$return = null;

$params = $this->params; // get parameters (plugin and related tab)
global $my, $database,$mainframe,$mosConfig_live_site, $mosConfig_absolute_path, $mosConfig_lang, $mosConfig_offset;

if (file_exists($mosConfig_absolute_path."/components/com_comprofiler/plugin/user/plug_cbinvitefriends/language/".$mosConfig_lang.".php"«»))
include($mosConfig_absolute_path."/components/com_comprofiler/plugin/user/plug_cbinvitefriends/language/".$mosConfig_lang.".php"«»);
else if(file_exists($mosConfig_absolute_path."/components/com_comprofiler/plugin/user/plug_cbinvitefriends/language/english.php"«»))
include($mosConfig_absolute_path."/components/com_comprofiler/plugin/user/plug_cbinvitefriends/language/english.php"«»);
else return "Error: No language file could be loaded. Is the Invite a Friend plugin properly installed?";

$is_invitefriends_plug_enabled = $params->get('ifPlugEnabled', "1"«»);

if ($is_invitefriends_plug_enabled != "0"«») {



if($tab->description != null) {
$return .= "\t\t<div class=\"tab_Description\">"
. (($my->id == $user->id) ? $tab->description : "You can see <strong>".$user->name."</strong>'s invites statistics here.<br />For security and privacy reasons, you are only able to view the number of accepted and pending invites."«») // html content is allowed in descriptions
. "</div>\n";
}
$return .= "\t\t<div>\n"
. "<p>"
. htmlspecialchars($invitefriends_tab_message) // make all other output html-safe
. "</p>"
. "</div>\n";


$database->setQuery("select `id` from #__menu where `link` like '%com_invite%' LIMIT 1"«»);
$cominviteid = $database->loadResult();

$database->setQuery("select `id` from #__menu where `link` like '%com_comprofiler%' LIMIT 1"«»);
$comprofilerid = $database->loadResult();

$curdate = date("Y-m-d", time() + $mosConfig_offset * 60 * 60);

$sql = "SELECT count(id) FROM #__invite_sent WHERE user_id = ".$user->id." AND date = '".$curdate."'";

$sql2 = "select value from #__invite_conf where name = 'max_daily'";

$database->setQuery($sql);
$daycnt = $database->loadResult();
$database->setQuery($sql2);
$lims = $database->loadResult();

$invites = $lims - $daycnt;

if ($invites > 0) {
if ($my->id == $user->id)
$return .= "<p>"._IF_YOUHAVE1." <span style=\"font-weight:bold;color:green;\">$invites</span> "._IF_YOUHAVE2." <a href=\"index.php?option=com_invite&amp;Itemid=".$cominviteid."\">"._IF_YOUHAVE3."</a> "._IF_YOUHAVE4."</p>";
else
$return .= "<p>".$user->name." (".$user->username."«») has <span style=\"font-weight:bold;color:green;\">$invites</span> "._IF_YOUHAVE2;
} else {
if ($my->id == $user->id)
$return .= "<p>"._IF_YOUHAVE5."</p>";
else
$return .= "<p>".$user->name." (".$user->username."«») has no more invites remaining for today.";
}

$sqljoined = "select u.username, j.user_id from #__invite_joined as j LEFT JOIN #__invite_sent as s ON j.ref_str = s.ref_str LEFT JOIN #__users as u ON j.user_id = u.id WHERE s.user_id = $user->id AND s.joined = 1";

$database->setQuery($sqljoined);
$joined = $database->loadObjectList();

$sqlsent = "select email from #__invite_sent WHERE user_id = ".$user->id." AND joined = 0";

$database->setQuery($sqlsent);
$sents = $database->loadObjectList();

$return .= "<div style=\"font-size:14px;font-weight:bold;\">"._IF_ACCEPTED_TITLE."</div>";

if ($joined == null) {
if ($my->id == $user->id)
$return .= "<div>"._IF_NONE_JOINED."</div>";
else
$return .= "<div>User has not successfully invited anyone.</div>";
}
else {
if ($my->id == $user->id) {
$return .= "<div>";
foreach ($joined as $ujoin) {
$return .= "<a href=\"index.php?option=com_comprofiler&amp;task=userProfile&amp;user=".$ujoin->user_id."&amp;Itemid=$comprofilerid\" title=\""._IF_VIEW." ".$ujoin->username."'s "._IF_PROFILE."\">$ujoin->username</a> | ";
}
$return .= "</div>";
}
else
$return .= "<div>User has <span style=\"font-weight:bold;color:green;\">".count($joined)."</span> invite(s) accepted.</div>";
}

$return .= "<div style=\"font-size:14px;font-weight:bold;padding-top:15px;\">"._IF_PENDING_TITLE."</div>";


if ($sents == null) {
$return .= "<div>"._IF_NONE."</div>";
}
else {
if ($my->id == $user->id) {
$return .= "<div>";
foreach ($sents as $usent) {
$return .= "<a href=\"mailto:".$usent->email."\" title=\""._IF_EMAIL." ".$usent->email."\">$usent->email | ";
}
$return .= "</div>";
}
else
$return .= "<div>User has <span style=\"font-weight:bold;color:green;\">".count($sents)."</span> invite(s) pending.</div>";
}

}

return $return;
} // end or getDisplayTab function
} // end of gethelloworldTab class
?>[/code:1]

I did not bother with the english language files, so if you wish to, you can edit the extra output text here or through your own language file


Mike Feng
Creator of SIMGallery, SIMAnswers, and ParaInvite
www.simbunch.com
twitter.com/simbunch

Please Log in or Create an account to join the conversation.

  • mgalang
  • mgalang
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
17 years 11 months ago #23632 by mgalang
Replied by mgalang on topic Re:Invite a Friend Component
Hi guys,

First I want to thank you all for using/downloading my invite component. Thanks for the inputs and suggestions on how to improve the component.

However im very sorry that the development on this project is painstakingly slow. I've been very busy with my work these days doing custom components and modules so I hope you'll understand why the component is still beta and some of it's features are not working yet.

As soon as I find time, I'll fix everything up and release a full version with the module.

Roadmap:
1. Module
2. CB registration
3. 1.5 compatibility

Thanks again!

Marc Galang

Please Log in or Create an account to join the conversation.

  • dsendecki
  • dsendecki
  • OFFLINE
  • Posts: 160
  • Thanks: 0
  • Karma: 14
17 years 11 months ago #23661 by dsendecki
Replied by dsendecki on topic Re:Invite a Friend Component
Hi Marc!

That's outstanding! Great news and looking forward to CB registration -- you are going to make a lot of people very happy!

Dan

Please Log in or Create an account to join the conversation.

17 years 11 months ago #23978 by GenBradley
Replied by GenBradley on topic Re:Invite a Friend Component
Iam getting this message after the install.

"You have no more invites remaining for today. Come back and invite more friends tomorrow."

How can I change the seetings to add more invites?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum