Example #1
0
	function getLinkToBox($box, $sef=0) {
		$Itemid = uddeIMgetItemid($this->config);
		switch($box) {
			case 'inbox':
				$link = "index.php?option=com_uddeim&task=inbox".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'outbox':
				$link = "index.php?option=com_uddeim&task=outbox".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'archive':
				$link = "index.php?option=com_uddeim&task=archive".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'trashcan':
				$link = "index.php?option=com_uddeim&task=trashcan".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'settings':
				$link = "index.php?option=com_uddeim&task=settings".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'compose':
				$link = "index.php?option=com_uddeim&task=new".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			case 'contacts':
				$link = "index.php?option=com_uddeim&task=showlists".($Itemid ? "&Itemid=".$Itemid : "");
				break;
			default:
				$link = "index.php?option=com_uddeim&task=inbox".($Itemid ? "&Itemid=".$Itemid : "");
				break;
		}
		if ($sef)
			$link = uddeIMsefRelToAbs($link);
		return $link;
	}
Example #2
0
        $uddout .= "</span>&nbsp;";
    }
}
if ($uddshowsettings) {
    $uddout .= "  <span class='uddeim-module-body'>";
    if ($uddshowicons) {
        $uddout .= "<img src='" . $uddpathtosite . "/components/com_uddeim/templates/" . $uddconfig->templatedir . "/images/menu_settings.gif' alt='" . _UDDEIM_SETTINGS . "' style='vertical-align:text-bottom;' /> ";
    }
    $uddout .= '<a href="' . uddeIMsefRelToAbs("index.php?option=com_uddeim&task=settings" . ($udditem_id ? "&Itemid=" . $udditem_id : "")) . '" title="' . _UDDEIM_SETTINGS . '">';
    $uddout .= _UDDEIM_SETTINGS;
    $uddout .= '</a>';
    $uddout .= "</span>&nbsp;";
}
if ($uddshowcompose) {
    $uddout .= "  <span class='uddeim-module-body'>";
    if ($uddshowicons) {
        $uddout .= "<img src='" . $uddpathtosite . "/components/com_uddeim/templates/" . $uddconfig->templatedir . "/images/menu_new.gif' alt='" . _UDDEIM_COMPOSE . "' style='vertical-align:text-bottom;' /> ";
    }
    $uddout .= '<a href="' . uddeIMsefRelToAbs("index.php?option=com_uddeim&task=new" . ($udditem_id ? "&Itemid=" . $udditem_id : "")) . '" title="' . _UDDEIM_COMPOSE . '">';
    $uddout .= _UDDEIM_COMPOSE;
    $uddout .= '</a>';
    $uddout .= "</span>&nbsp;";
}
$uddout .= "</div>";
echo $uddout;
function aup_moduddemailboxtime($uddtimezone = 0)
{
    $uddmosConfig_offset = uddeIMgetOffset();
    $uddrightnow = time() + ($uddmosConfig_offset + $uddtimezone) * 3600;
    return $uddrightnow;
}
Example #3
0
function uddeIMshowTrashCan($myself, $item_id, $limit, $limitstart, $cryptpass, $config) {
	global $uddeicons_onlinepic, $uddeicons_offlinepic, $uddeicons_readpic, $uddeicons_unreadpic;

	$pathtosite = uddeIMgetPath('live_site');
	$pathtouser = uddeIMgetPath('user');
	$my_gid = $config->usergid;

	if( ($config->trashrestriction==0) ||
	    ($config->trashrestriction==1 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
	    ($config->trashrestriction==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) ) {
		// ok trashcan enabled
	} else {
		uddeIMprintMenu($myself, 'trashcan', $item_id, $config);
		echo "<div id='uddeim-m'>\n";
		echo "<div id='uddeim-overview'><p><b>"._UDDEADM_NOTRASHACCESS_NOT."</b></p></div>\n";
		echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
		return;
	}

	$rightnow=uddetime($config->timezone);
	$offset=((float)$config->TrashLifespan) * 86400;
	$timeframe=$rightnow-$offset;

	$total = uddeIMgetTrashcanCount($myself, $timeframe);

	// now load messages as required
	if(!$limitstart) {
		$limitstart=0;
	}
	if(!$limit) {
		$limit=$config->perpage;
	}

	if ($limitstart>=$total)
		$limitstart=max(0,$limitstart - $limit);

	$allmessages = Array();
	if ($total>0)
		$allmessages = uddeIMselectTrashcan($myself, $timeframe, $limitstart, $limit, $config);
	
	// write the uddeim menu
	uddeIMprintMenu($myself, 'trashcan', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	// if no messages:
	if(count($allmessages)<1) { // no messages to list
		echo "<div id='uddeim-overview'><p><b>"._UDDEIM_NOMESSAGES_TRASHCAN."</b></p>\n</div>\n";
		// and close the HTML output and return
		echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
		return;
	}

	// now open the inbox container and table; write table headings
	echo "<div id='uddeim-overview'>";
	echo "<table cellpadding='7' width='100%'>";
//	echo "\n\n\t<tr><th class='sectiontableheader'>&nbsp;</th><th class='sectiontableheader'>"._UDDEIM_FROM." / "._UDDEIM_TO."</th><th class='sectiontableheader'>"._UDDEIM_MESSAGE."</th><th class='sectiontableheader'>"._UDDEIM_DATE."</th><th class='sectiontableheader'>&nbsp;</th></tr>";
	echo "\n\n\t<tr><th class='sectiontableheader'>&nbsp;</th><th class='sectiontableheader'>"._UDDEIM_FROM." / "._UDDEIM_TO."</th><th class='sectiontableheader'>"._UDDEIM_MESSAGE."</th><th class='sectiontableheader'>"._UDDEIM_DELETED."</th><th class='sectiontableheader'>&nbsp;</th></tr>";

	$i=1;
	// now write the list
	foreach($allmessages as $themessage) {

		if($themessage->toread) {
			$readcell=$uddeicons_readpic;
		} else {
			$readcell=$uddeicons_unreadpic;
		}

		if ($config->showlistattachment) {
			$cnt = uddeIMgetAttachmentCount($themessage->id);
			if ($cnt)
				$readcell .= "<br /><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/attachment.gif' alt='"._UDDEIM_ATTACHMENT."' title='"._UDDEIM_ATTACHMENT."' border='0' />";
		}

		$themarker = "";
		$theuser = 0;
		$datumcell = "";
//		$createdcell=uddeDate($themessage->datum, $config, uddeIMgetUserTZ());
		if ($myself==$themessage->toid && $myself!=$themessage->fromid) {
			// Msg sent to me, sender is someone else, so user is in "fromid"
			$themarker = "&lt;";
			$theuser = $themessage->fromid;
			$datumcell=uddeDate($themessage->totrashdate, $config, uddeIMgetUserTZ());
			// $displayname = $themessage->fromname;
			$displayname = uddeIMevaluateUsername($themessage->fromname, $themessage->fromid, $themessage->publicname);
		} elseif ($myself==$themessage->fromid && $myself!=$themessage->toid) {
			// Msg sent by me, receiver is someone else, so user is in "toid"
			$themarker = "&gt;";
			$theuser = $themessage->toid;
			$datumcell=uddeDate($themessage->totrashdateoutbox, $config, uddeIMgetUserTZ());
			// $displayname = $themessage->toname;
			$displayname = uddeIMevaluateUsername($themessage->toname, $themessage->toid, $themessage->publicname);
		} else {	// this case appears when a copy to me message has been trashed my myself
			// totrashoutbox=1 messages (sender has trashed are not selected in the SQL statement, so they do not appear here
			// totrash=1 messages has been trashed by myself, so I show them in the trashcan
			$themarker = "&lt;";	// the message has been send to me (we could also reorder the if-clause and catch this case with "$myself==$themessage->toid" but maybe I change the marker sometime)
			$theuser = $themessage->fromid;
			$datumcell=uddeDate($themessage->totrashdate, $config, uddeIMgetUserTZ());
			// $displayname = $themessage->fromname;
			$displayname = uddeIMevaluateUsername($themessage->fromname, $themessage->fromid, $themessage->publicname);
		}

		// systemmsg = "an XXX XXXX"
		$personalsys=0;
		if($themessage->systemflag && $myself==$themessage->toid && $themessage->systemmessage==$displayname) {
			$personalsys=1;
		}
		if($themessage->systemflag && $myself==$themessage->toid) {
			$displayname=$themessage->systemmessage;	// its for me, so show systemname "to username" (copy2me message)
		}

		$fromcell = $themarker." ".$displayname;
		if ($theuser) {
			if(($config->showcblink && !$themessage->systemflag) || ($config->showcblink && $personalsys)) {
				$fromcell = uddeIMshowThumbOrLink($theuser, $themarker." ".$displayname, $config);
			}

			// Is this user currently online? Don't check, if it is a system message
			if (($config->showonline && !$themessage->systemflag) || ($config->showonline && $personalsys)) {
				$isonline = uddeIMisOnline($theuser);
				if($isonline) {
					$fromcell.="&nbsp;".$uddeicons_onlinepic;
				} else {
					$fromcell.="&nbsp;".$uddeicons_offlinepic;
				}
			}
		}

		// CRYPT
		$cm = uddeIMgetMessage($themessage->message, $cryptpass, $themessage->cryptmode, $themessage->crypthash, $config->cryptkey);

		$teasermessage=$cm;
		// if it is a system message or bb codes allowed, parse BB codes
		if ($themessage->systemflag || $config->allowbb)
			$teasermessage=uddeIMbbcode_strip($teasermessage);

		$teasermessage=uddeIMteaser(stripslashes($teasermessage), $config->firstwordsinbox, $config->quotedivider, $config->languagecharset);
		$teasermessage=htmlspecialchars($teasermessage, ENT_QUOTES, $config->charset);
		$teasermessage=str_replace("&amp;#", "&#", $teasermessage);
		$teasermessage=str_replace("&amp;&lt;/br&gt;", " ", $teasermessage);

		$safemessage=htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset);
		$safemessage=str_replace("&amp;&lt;/br&gt;", "</br>", $safemessage);

		$messagecell=$teasermessage;

		if($config->actionicons) {
			$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=restore&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/recycle.gif' alt='"._UDDEIM_RESTORE."' title='"._UDDEIM_RESTORE."' /></a>";
		} else {
			$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=restore&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'>"._UDDEIM_RESTORE."</a>";
		}

		echo "\n\t<tr class='sectiontableentry".$i."'>";
		echo "\n\t\t<td style='width:32px; text-align:center; vertical-align:middle'>".$readcell."</td>";
		$st=uddeIMgetStyleForThumb($config);
		echo "\n\t\t<td ".$st.">".$fromcell."</td>";
		echo "\n\t\t<td>".$messagecell."</td>";
//		echo "\n\t\t<td>".$createdcell."</td>";
		echo "\n\t\t<td>".$datumcell."</td>";
		if($config->actionicons) {
			echo "\n\t\t<td style='width:32px; text-align:center; vertical-align:middle'>".$deletecell."</td>";
		} else {
			echo "\n\t\t<td class='pathway'>".$deletecell."</td>";
		}
		echo "</tr>";

		$i++;
		if ($i>2) {
			$i=1;
		}
	}

	// now close inbox table and container
	echo "\n</table></div>\n";

	// write the inbox navigation links
	$pageNav = new uddeIMmosPageNav($total, $limitstart, $limit);
	$referlink = "index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id;
	if($total>$limit) {
		$shownav = $pageNav->writePagesLinks($referlink);
		$shownav = uddeIMarrowReplace($shownav, $config->templatedir, $pathtouser);
		echo "<div id='uddeim-pagenav'>".$shownav."<br />";
		echo "[<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id."&limitstart=0&limit=".$total)."'>"._UDDEIM_SHOWALL."</a>]";
		echo "</div>\n";
	}

	$keephours=((float)$config->TrashLifespan) * 24;
	echo "<div id='uddeim-bottomlines'>";
	if ($config->TrashLifespanNote)
		echo "<p>"._UDDEIM_TRASHCAN_INFO_1.$keephours._UDDEIM_TRASHCAN_INFO_2."</p>";
	echo "</div>\n";
	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
}
Example #4
0
function uddeIMcreateLists($myself, $item_id, $listid, $limit, $limitstart, $config) {
	$pathtosite  = uddeIMgetPath('live_site');

	$my_gid = $config->usergid;

	// write the uddeim menu
	uddeIMprintMenu($myself, 'none', $item_id, $config);
	echo "<div id='uddeim-m'>\n";
	echo "<div id='uddeim-writeform'>\n";

	uddeIMaddScript($pathtosite."/components/com_uddeim/js/uddeimtools.js");

	$lname = "";
	$ldesc = "";
	$lids = "";
	$lglobal = 0;
	if ( $listid ) {
		if (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config)) 		// admins can create global user lists
			$this_lists = uddeIMselectUserlistsListFromID($myself, $listid, true);
		else
			$this_lists = uddeIMselectUserlistsListFromID($myself, $listid);
		foreach($this_lists as $this_list) {
			$lname = $this_list->name;
			$ldesc = $this_list->description;
			$lids = trim($this_list->userids);
			$lglobal = $this_list->global;
		}
	}
//	$total = count(explode(",",$lids));
	$total = 0;
	if ($lids)
		$total = substr_count($lids, ",")+1;
	if ($total>=$config->maxonlists) {
		echo "<div id='uddeim-toplines'><p>"._UDDEIM_LISTSLIMIT_1." ".$config->maxonlists.").</p></div>\n";
	}

	echo "<br />";
	echo "<form name='listsform' method='post' action='".uddeIMsefRelToAbs( "index.php?option=com_uddeim&listid=".$listid."&Itemid=".$item_id."&task=savelists" )."'>";
	echo _UDDEIM_LISTSNAMEWO."<br />";
	echo "<input type='text' name='listname' size='20' maxlength='40' value='".$lname."' /><br />";
	echo _UDDEIM_LISTSDESC."<br />";
	echo "<textarea name='listdesc' rows='5' cols='40'>".$ldesc."</textarea><br />";

	$global_checkstatus='';
	if ($lglobal)
		$global_checkstatus='checked="checked"';

	if (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))	{		// admins can create global user lists
		echo '<input type="radio" '.($lglobal==0 ? 'checked="checked"' : '' ).' name="listglobal" value="0" />'._UDDEIM_LISTGLOBAL_P0.'<br />';
		echo '<input type="radio" '.($lglobal==1 ? 'checked="checked"' : '' ).' name="listglobal" value="1" />'._UDDEIM_LISTGLOBAL_P1.'<br />';
		echo '<input type="radio" '.($lglobal==2 ? 'checked="checked"' : '' ).' name="listglobal" value="2" />'._UDDEIM_LISTGLOBAL_P2.'<br />';
	}

	echo "<input type='hidden' name='listids' size='40' value='".$lids."' />";
	echo "<br />";
	echo "<table border='0' cellspacing='10' cellpadding='0'><tr><td valign='top' nowrap='nowrap'>";
	echo uddeIMselectComboSelectionlist( $myself, $my_gid, $lids, $config );
	echo "</td><td valign='middle'>";
	echo "<input type='button' name='buttonadd' class='button' value='&nbsp;&laquo;&nbsp;' onclick='uddeIMaddToSelection( \"listsform\", \"userlist\", \"selectionlist\", ".$config->maxonlists." );' /><br />";
	echo "<input type='button' name='buttonadd' class='button' value='&nbsp;&raquo;&nbsp;' onclick='uddeIMremoveFromSelection( \"listsform\", \"selectionlist\", \"userlist\", ".$config->maxonlists." );' />";
	echo "</td><td valign='top'>";
	echo uddeIMselectComboUserlist( $myself, $my_gid, $lids, $config );
	echo "</td></tr></table>";
	echo "<br />";
	echo "<input type='submit' name='reply' class='button' value='"._UDDEIM_SAVE."' />";
	echo "<br /><br />";
	echo "</form>";

	$temp = _UDDEIM_LISTSLIMIT_2." ".$config->maxonlists;
	echo "</div>\n";
	echo "</div>\n";
	echo "<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $temp, $config)."</div>\n";
}
Example #5
0
             $udd_displaymessage = stripslashes($udd_cm);
             if ($udd_themessage->systemmessage || $udd_config->allowbb) {
                 require_once $udd_pathtouser . "/bbparser.php";
                 $udd_displaymessage = uddeIMbbcode_strip($udd_displaymessage);
             }
             $udd_displaymessage = htmlspecialchars($udd_displaymessage, ENT_QUOTES, $udd_config->charset);
             $udd_displaymessage = str_replace("&amp;#", "&#", $udd_displaymessage);
             $udd_maxlen = $udd_par_maxchars - strlen($udd_whofrom) - 1;
             // one space
             if ($udd_maxlen < 5) {
                 $udd_maxlen = 5;
             }
             if ($udd_themessage->cryptmode == 2) {
                 $udd_pms_show = uddeIMsefRelToAbs("index.php?option=com_uddeim" . ($udd_item_id ? "&Itemid=" . $udd_item_id : "") . "&task=showpass&messageid=" . $udd_themessage->id);
             } else {
                 $udd_pms_show = uddeIMsefRelToAbs("index.php?option=com_uddeim" . ($udd_item_id ? "&Itemid=" . $udd_item_id : "") . "&task=show&messageid=" . $udd_themessage->id);
             }
             if ($udd_par_showmsg == 2) {
                 echo "<p class='uddeim-module-row'>";
                 echo "<a href='" . $udd_pms_show . "'>" . $udd_whofrom . "</a>";
                 echo "</p>";
             } else {
                 echo "<p class='uddeim-module-row'>" . $udd_whofrom . " ";
                 echo "<a href='" . $udd_pms_show . "'>" . aup_uddTeaserHead($udd_displaymessage, $udd_maxlen) . "</a>";
                 echo "</p>";
             }
         }
         $udd_count++;
     }
 }
 echo "</div>";
Example #6
0
function uddeIMdrawWriteform($myself, $my_gid, $item_id, $backto, $recipname, $pmessage, $messageid, $dwf_isreply, $dwf_errorcode, $dwf_sysgm, $config) {
	$pathtouser  = uddeIMgetPath('user');
	$pathtosite  = uddeIMgetPath('live_site');

	// possible values for dwf_errorcode:
	// 0 = no error
	// 1 = no error, show complete userlist
	// 2 = don't send to yourself
	// 3 = username not found
	// 4 = no message
	// 5 = no username
	// 6 = too many recipients
	// 7 = wrong captcha code
	// 8 = does not allow public messages
	// 9 = one user has blocked you
	// 10 = sending to this group not allowed
	// 11 = contact list not found
	// 12 = error in from name (n/a, public frontend only)
	// 13 = error in from email (n/a, public frontend only)
	// 14 = time delay for spam protection
	// 15 = csrf protection
	// 16 = administrative blocking
	// 17 = user is banned
	// 18 = file upload failed
	// 19 = file size exceeded
	// 20 - file type not allowed
	// 21 - bad words

	// This functions expects values stripslashed

	// allowed to send messages?
	if ($config->waitdays && uddeIMisReggedOnly($my_gid)) {
		$rightnow=uddetime($config->timezone);
		$offset=((float)$config->waitdays) * 86400;
		$timeframe=$rightnow-$offset;
		$registerDate=uddeIMgetRegisterDate($myself, $config);
		// $registerDate=mktime(0, 0, 0, 3, 28, 2010);
		if ($timeframe<$registerDate) {
			$temp = ($registerDate-$timeframe)/86400;
			$showinboxlimit_borderbottom = "<span class='uddeim-warning'>";
			if ($temp>=1)
				$showinboxlimit_borderbottom.= _UDDEIM_WAITDAYS1.sprintf("%0.1f", $temp)._UDDEIM_WAITDAYS2;
			else 
				$showinboxlimit_borderbottom.= _UDDEIM_WAITDAYS1.sprintf("%0.1f", $temp*24)._UDDEIM_WAITDAYS2H;
			$showinboxlimit_borderbottom.= "</span>";
			echo "<div id='uddeim-bottomlines'>".$showinboxlimit_borderbottom."</div>";
			return;
		}
	}
	
	echo "<div id='uddeim-writeform'>\n";
	if ($dwf_sysgm) {
		echo "<br />";
		echo "<form enctype='multipart/form-data' name='sendeform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=savesysgm&Itemid=".$item_id)."'>\n";
		uddeIMwriteCSRF($config);
		echo "<p><input type='checkbox' checked='checked' name='sysgm_sys' value='1' />"._UDDEIM_SEND_ASSYSM."</p>\n";

		if ($config->showgroups) {
			echo "<p><select name='sysgm_universe' size='1'>";
			echo "<option value='sysgm_toall'>"._UDDEIM_SEND_TOALL."</option>";
			echo "<option value='sysgm_toallspecial'>"._UDDEIM_SEND_TOALLSPECIAL."</option>";
			echo "<option value='sysgm_toalladmins'>"._UDDEIM_SEND_TOALLADMINS."</option>";
			echo "<option value='sysgm_toalllogged'>"._UDDEIM_SEND_TOALLLOGGED."</option>";
			$groups = uddeIMselectAROgroups();
			foreach ($groups as $group) {
				$groupid = $group->id;
				$groupname = $group->name;
				echo "<option value='".$groupid."'>".$groupname."</option>";
			}
			echo "</select></p>";
		} else {
			echo "<p><input type='radio' name='sysgm_universe' value='sysgm_toall' />"._UDDEIM_SEND_TOALL."<br />\n";
			echo "<input type='radio' name='sysgm_universe' checked='checked' value='sysgm_toallspecial' />"._UDDEIM_SEND_TOALLSPECIAL."<br />\n";
			echo "<input type='radio' name='sysgm_universe' checked='checked' value='sysgm_toalladmins' />"._UDDEIM_SEND_TOALLADMINS."<br />\n";
			echo "<input type='radio' name='sysgm_universe' value='sysgm_toalllogged' />"._UDDEIM_SEND_TOALLLOGGED."</p>\n";
		}
		echo "<p>"._UDDEIM_VALIDFOR_1;
		echo "<input name='sysgm_validfor' type='text' size='4' />"._UDDEIM_VALIDFOR_2."</p>\n";
		echo "<p>"._UDDEIM_SYSGM_SHORTHELP."</p>\n";
	} else {
		echo "<br />";
		echo "<form enctype='multipart/form-data' name='sendeform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=save&Itemid=".$item_id)."'>";
		echo "<input type='hidden' name='sendeform_showallusers' value='' />\n";
		uddeIMwriteCSRF($config);
		if (uddeIMgetEMNmoderated($myself) ) { //&& uddeIMisReggedOnly($my_gid)) {
			echo "<p>"._UDDEIM_MCP_MODERATED."</p>";
		}
	}
	echo "\n";

	if($dwf_errorcode==0 && $backto) {
		echo "<input type='hidden' name='backto' value='".htmlspecialchars($backto)."' />";
	}

	if(!$dwf_sysgm) {
	
		if($dwf_isreply!=1) { // if this is NOT a reply

			echo "<table width='100%' cellspacing='0' cellpadding='0' width='100%'>";

			if(0 && $dwf_errorcode==0 && $recipname) {		// BUGBUG "0 &&". don't need this case
				echo "<tr><td valign='top'>";
				echo "<b>".$recipname."</b>";
				echo "<input type='hidden' name='to_name' id='input_to_name' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
				echo "</td></tr>";
			} else {

// START FIRST LINE IN TABLE (contains two fields: TO USER and select from ALL USER list)
				echo "<tr><td valign='top'>";
//				if ($dwf_errorcode==0 && $recipname) {	// does not really make sense
//					echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=new&Itemid=".$item_id)."'>"._UDDEIM_TODP."</a>";
//				} else {
				echo "<span title='".($config->allowmultipleuser ? _UDDEIM_TODP_TITLE_CC : _UDDEIM_TODP_TITLE)."'>";
				echo _UDDEIM_TODP;
//				}
				echo "<br />";

				if($dwf_errorcode==2 || $dwf_errorcode==3 || $dwf_errorcode==5 || 
				   $dwf_errorcode==6 || $dwf_errorcode==8 || $dwf_errorcode==9 || 
				   $dwf_errorcode==10 || $dwf_errorcode==11 || $dwf_errorcode==16 ||
				   $dwf_errorcode==17 || $dwf_errorcode==18 || $dwf_errorcode==19 ||
				   $dwf_errorcode==20) {
					$errorstyle='style="background-color: #ff0000;" ';
				} else {
					$errorstyle='';
				}

				echo "<input type='hidden' name='to_id' value='' />";
				echo "<input type='hidden' name='messageid' value='".$messageid."' />";
				if (!($config->flags & 0x04)) {
					echo "<input type='text' ".$errorstyle."name='to_name' id='input_to_name' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
				} else {
					echo "<span ".$errorstyle.">".htmlentities($recipname, ENT_QUOTES, $config->charset)."</span>";
					echo "<input type='hidden' name='to_name' id='input_to_name' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
				}
				echo "</span>";

				if ($config->useautocomplete) {
					uddeIMdoAutocomplete($config);
				}

// SECOND FIELD IN FIRST LINE IN TABLE
				echo "</td><td valign='top' align='right'>\n";
				$allusersallowed = 0;
				if( ($config->restrictallusers==0) ||
					($config->restrictallusers==1 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
					($config->restrictallusers==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) )
					$allusersallowed=1;
				if (!($config->flags & 0x01) && $allusersallowed) {
					if ($config->modeshowallusers==1 || $config->modeshowallusers==2) {
						if ($dwf_errorcode==0 && $config->modeshowallusers==1) {
							// link to drop down box with names of connected users, value is 2 since it is shown the first time (so selecting the link does not show an error message because of an empty recipient field)
							echo "<br />";
							echo "<a href=\"#\" onclick=\"document.sendeform.sendeform_showallusers.value='2'; document.sendeform.submit(); return false;\">"._UDDEIM_SHOWUSERS."</a>";
						} else { // now show all users
							uddeIMdoShowAllUsers($myself, $my_gid, $config, 1);
						}
					}
				}
				echo "</td></tr>";

// START SECOND LINE IN TABLE (colspan=2)
				if ($dwf_errorcode==3) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_NOSUCHUSER."</td></tr>";
				} elseif ($dwf_errorcode==2) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_NOTTOYOURSELF."</td></tr>";
				} elseif ($dwf_errorcode==5) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ENTERNAME."</td></tr>";
				} elseif ($dwf_errorcode==6) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_TOOMANYRECIPIENTS."</td></tr>";
				} elseif ($dwf_errorcode==7) {
					if ($config->captchatype==0) {
						echo "<tr><td valign=left colspan=2>"._UDDEIM_WRONGCAPTCHA."</td></tr>";
					} else {
						echo "<tr><td valign=left colspan=2><span style='background-color: #ff0000;'>"._UDDEIM_WRONGCAPTCHA."</span></td></tr>";
					}
				} elseif ($dwf_errorcode==8) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_NOPUBLICMSG."</td></tr>";
				} elseif ($dwf_errorcode==9) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ONEUSERBLOCKS."</td></tr>";
				} elseif ($dwf_errorcode==10) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_GROUPBLOCKED."</td></tr>";
				} elseif ($dwf_errorcode==11) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_NOSUCHLIST."</td></tr>";
				} elseif ($dwf_errorcode==12) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORINFROMNAME."</td></tr>";
				} elseif ($dwf_errorcode==13) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORINEMAIL."</td></tr>";
				} elseif ($dwf_errorcode==14) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_YOUHAVETOWAIT."</td></tr>";
				} elseif ($dwf_errorcode==15) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORCSRF."</td></tr>";
				} elseif ($dwf_errorcode==16) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_USERBLOCKED."</td></tr>";
				} elseif ($dwf_errorcode==17) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_USERBANNED."</td></tr>";
				} elseif ($dwf_errorcode==18) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_FILEUPLOAD_FAILED."</td></tr>";
				} elseif ($dwf_errorcode==19) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_FILESIZE_EXCEEDED."</td></tr>";
				} elseif ($dwf_errorcode==20) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_FILETYPE_NOTALLOWED."</td></tr>";
				} elseif ($dwf_errorcode==21) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_BADWORD."</td></tr>";
				}
// START THIRD LINE IN TABLE WHEN CONNECTIONS AVAILABLE

				$have_lists=0;
				if( ($config->enablelists==1) ||
					($config->enablelists==2 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
					($config->enablelists==3 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) )
					$have_lists=1;

				if (!($config->flags & 0x02)) {
					if ($config->showconnex || $have_lists) {
						// if (uddeIMcheckCB() && $showconnex && !($recipname && $dwf_errorcode==0)) {
						uddeIMdoShowConnections($myself, $my_gid, $config);	// this creates a third row in table
					}
				}
			}
			echo "</table>";
			echo "<br />";
		} else { // it IS a reply
			if ($dwf_errorcode) {
				echo "<table width='100%' cellspacing='0' cellpadding='0'>";
				if ($dwf_errorcode==7) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_WRONGCAPTCHA."</td></tr>";
				} elseif ($dwf_errorcode==13) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORINEMAIL."</td></tr>";
				} elseif ($dwf_errorcode==14) {
					echo "<tr><td valign=left colspan=2>"._UDDEIM_YOUHAVETOWAIT."</td></tr>";
				}
				echo "</table>";
				echo "<br />";
			}
			echo "<input type='hidden' name='to_id' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
			echo "<input type='hidden' name='messageid' value='".$messageid."' />";
			echo "<input type='hidden' name='to_name' value='' />";
		}
	}

	if(($config->showtextcounter && $config->maxlength) || 
		$config->cryptmode==2 || $config->cryptmode==4) {
		uddeIMaddScript($pathtosite."/components/com_uddeim/js/uddeimtools.js");
	}

	if($config->allowbb || $config->allowsmile) {
		uddeIMaddScript($pathtosite."/components/com_uddeim/js/bbsmile.js");
		$num = uddeIMdoSmileysEx($config);
		uddeIMdoBB($config);
		uddeIMdoSmileys($config, $num);
	}

// well, I think the complete textarea should be red (or only the label? or both?)
//	if($dwf_errorcode==4) {
//		$errorstyle=' style="background-color: #ff0000;"';
//	} else {
		$errorstyle='';
//	}

	if($dwf_isreply==1) {
		echo "<span".$errorstyle.">"._UDDEIM_REPLY."</span>";
	} else {
		echo "<span".$errorstyle.">"._UDDEIM_MESSAGE."</span>";
	}
	echo "<br />";

	$thestyle = "";
	if ($config->width)
		$thestyle .= "width: ".(int)$config->width."px; ";

	if ($dwf_errorcode==4 || $dwf_errorcode==21)
		$thestyle .= "background-color: #ff0000; ";

	$errorstyle="";
	if ($thestyle!="")
		$errorstyle="style='".$thestyle."' ";

	// ================================== TEXTBOX/TEXTCOUNTER ==============================

	if($config->showtextcounter && $config->maxlength) {
		$uc = ($config->showtextcounter) ? "textCount(document.sendeform.pmessage,document.sendeform.characterstyped,".$config->maxlength.");" : "";
		echo "<textarea name='pmessage' ".$errorstyle."class='inputbox' rows='".(int)$config->rows."' cols='".(int)$config->cols."' onkeydown='".$uc."' onkeyup='".$uc."'>".$pmessage."</textarea>";
		echo "<div class='uddeim-textcounter'>";
		echo "<input style='background-color: lightgray;' readonly='readonly' type='text' name='characterstyped' size='4' maxlength='4' value='".$config->maxlength."' /> "._UDDEIM_CHARSLEFT;
		echo "</div>";
	} else {
		echo "<textarea name='pmessage' ".$errorstyle."class='inputbox' rows='".(int)$config->rows."' cols='".(int)$config->cols."'>".$pmessage."</textarea>";
	}

	// ================================== FILE UPLOAD ==============================

	if( $config->enableattachment && uddeIMisAttachmentAllowed($my_gid, $config))
		uddeIMshowUploadButtons($config);

	// ================================== PASSWORD ==============================

	// CRYPT
	if($config->cryptmode==2 || $config->cryptmode==4) {
		echo "<div class='uddeim-password'>";
		echo "<a href='javascript:uddeidswap(\"divpass\");'>"._UDDEIM_PASSWORDBOX."</a>";
		echo "<span id='divpass' style='visibility:hidden;'>: <input name='cryptpass' value='' />"._UDDEIM_ENCRYPTIONTEXT."</span>";
		echo "</div>";
	}

	// ================================== CAPTCHA ==============================

	if ( $config->usecaptcha>=4 ||																			// all users (incl. admins)
		($config->usecaptcha==3 && !uddeIMisAdmin($my_gid)   && !uddeIMisAdmin2($my_gid, $config)) ||		// CAPTCHA enabled for public frontend, registered and special users
		($config->usecaptcha==2 && !uddeIMisSpecial($my_gid) && !uddeIMisSpecial2($my_gid, $config)) ) {	// CAPTCHA enabled for public frontend and registered users (note: 0 is not required since this is done in public.php)
		// CAPTCHA
		if ($config->captchatype==0) {
			if($dwf_errorcode==7) {
				$errorstyle='style="background-color: #ff0000;" ';
			} else {
				$errorstyle='';
			}
			echo "<div class='uddeim-captcha'>";
			echo "<label for='security_code'>"._UDDEIM_SECURITYCODE." </label><input id='security_code' name='security_code' type='text' ".$errorstyle." />&nbsp;";

			if (class_exists('JFactory')) {
				// CAPTCHA15
				echo "<img style='vertical-align:middle;' src='".$pathtosite."/components/com_uddeim/captcha15.php' alt='' /><br />";
			} else {
				// CAPTCHA10
				echo "<img style='vertical-align:middle;' src='".$pathtosite."/components/com_uddeim/captcha.php' alt='' /><br />";
			}
			echo "</div>";
		} else {
			$pathtouser  = uddeIMgetPath('user');
			require_once($pathtouser."/recaptchalib.php");
			echo "<div class='uddeim-captcha'>";
		    echo recaptcha_get_html($config->recaptchapub);
			echo "</div>";
		}
	}

	// ================================== Show the SEND OPTIONS ==============================

	$showoptions =  ($config->trashoriginal && $dwf_isreply==1) ||
					($config->trashoriginalsent && !$dwf_sysgm) ||
					($config->allowcopytome && !$dwf_sysgm) ||
					($config->addccline && $config->allowmultipleuser && !$dwf_sysgm) ||
					($config->allowemailnotify && $config->emailwithmessage==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))) ||
					($config->allowemailnotify && $dwf_sysgm);

	if ($showoptions) {
		echo "<div class='uddeim-sendoption'>";
	}
	if($config->trashoriginal && $dwf_isreply==1) {
		echo "<input type='checkbox' value='1' checked='checked' name='tobedeleted' />"._UDDEIM_TRASHORIGINAL."&nbsp;";
	}
	if($config->trashoriginalsent && !$dwf_sysgm) {
		echo "<input type='checkbox' value='1' name='tobedeletedsent' />"._UDDEIM_TRASHORIGINALSENT."&nbsp;";
	}
	if($config->allowcopytome && !$dwf_sysgm) {
		echo "<input type='checkbox' value='1' name='copytome' />"._UDDEIM_SENDCOPYTOME."&nbsp;";
	}
	if($config->addccline && $config->allowmultipleuser && !$dwf_sysgm) {
		echo "<span title='"._UDDEIM_ADDCCINFO_TITLE."'>";
		echo "<input type='checkbox' value='1' checked='checked' name='addccinfo' />"._UDDEIM_ADDCCINFO;
		echo "</span>";
	}
	// Email notifications must be on AND emailwithmessage for admins AND its an admin
	if($config->allowemailnotify && $config->emailwithmessage==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))) {
		echo "<span title='"._UDDEAIM_ADDEMAIL_TITLE."'>";
		echo "<input type='checkbox' value='1' name='forceembedded' />"._UDDEAIM_ADDEMAIL_SELECT;
		echo "</span>";
	}
	if($config->allowemailnotify && $dwf_sysgm) {
		echo "<span><input type='checkbox' value='1' name='sysgm_nonotify' />"._UDDEIM_SEND_NONOTIFY."</span>\n";
	}

	if ($showoptions) {
		echo "</div>";
	}

	// ================================== SEND BUTTON ==============================

	echo "<div class='uddeim-sendbutton'>";
	// when going back one page (history(-1)) the button stays disabled
    // echo "<input type='submit' name='reply' class='button' onclick=\"this.disabled=true;this.value='"._UDDEIM_PROCESSING."';this.form.submit();\" value='"._UDDEIM_SUBMIT."' /> ";
    echo "<input type='submit' name='reply' class='button' value='"._UDDEIM_SUBMIT."' /> ";
	echo "</div>";

	echo "</form>\n";
	echo "</div>\n"; // end of uddeim-writeform
}
Example #7
0
function uddeIMdrawPublicWriteform($item_id, $backto, $fromname, $fromemail, $recipname, $pmessage, $dwf_errorcode, $config) {
	$pathtouser  = uddeIMgetPath('user');
	$pathtosite  = uddeIMgetPath('live_site');

	// possible values for dwf_errorcode:
	// 0 = no error
	// 1 = no error, show complete userlist
	// 2 = don't send to yourself
	// 3 = username not found
	// 4 = no message
	// 5 = no username
	// 6 = too many recipients
	// 7 = wrong captcha code
	// 8 = does not allow public messages
	// 9 = one user has blocked you
	// 10 = sending to this group not allowed
	// 11 = contact list not found
	// 12 = error in from name
	// 13 = error in from email
	// 14 = time delay for spam protection
	// 15 = csrf protection
	// 16 = administrative blocking
	// 17 = user has been banned
	// 18 = file upload failed
	// 19 = file size exceeded
	// 20 = file type not allowed

	// This functions expects values stripslashed

	echo "<div id='uddeim-writeform'>\n";
	echo "<form name='sendeform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=publicsave&Itemid=".$item_id)."'>\n";
	echo "<input type='hidden' name='sendeform_showallusers' value='' />\n";
	uddeIMwriteCSRF($config);

	if($dwf_errorcode==0 && $backto) {
		echo "<input type='hidden' name='backto' value='".$backto."' />\n";
	}

	echo "<table width='100%' cellspacing='0' cellpadding='0'>";

// START SENDER LINE IN TABLE
	echo "<tr><td colspan='2' valign='top'>"._UDDEIM_YOURNAME."<br />";
	$errorstyle='';
	if($dwf_errorcode==12)
		$errorstyle='style="background-color: #ff0000;" ';

	echo "<input type='text' ".$errorstyle."name='from_name' value='".htmlentities($fromname, ENT_QUOTES, $config->charset)."' /></td></tr>";

// START SENDER EMAIL LINE IN TABLE
	echo "<tr><td colspan='2' valign='top'>"._UDDEIM_YOUREMAIL."<br />";
	$errorstyle='';
	if($dwf_errorcode==13)
		$errorstyle='style="background-color: #ff0000;" ';
	echo "<input type='text' ".$errorstyle."name='from_email' value='".htmlentities($fromemail, ENT_QUOTES, $config->charset)."' /></td></tr>";

// START FIRST LINE IN TABLE (contains two fields: TO USER and select from ALL USER list)
	echo "<tr><td valign='top'>"._UDDEIM_TODP."<br />";

	if($dwf_errorcode==2 || $dwf_errorcode==3 || $dwf_errorcode==5 || 
	   $dwf_errorcode==6 || $dwf_errorcode==8 || $dwf_errorcode==9 || 
	   $dwf_errorcode==10 || $dwf_errorcode==11 || $dwf_errorcode==16 ||
	   $dwf_errorcode==17 || $dwf_errorcode==18 || $dwf_errorcode==19 ||
	   $dwf_errorcode==20) {
		$errorstyle='style="background-color: #ff0000;" ';
	} else {
		$errorstyle='';
	}

	if (!($config->flags & 0x04)) {
		echo "<input type='text' ".$errorstyle."name='to_name' id='input_to_name' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
	} else {
		echo "<span ".$errorstyle.">".htmlentities($recipname, ENT_QUOTES, $config->charset)."</span>";
		echo "<input type='hidden' name='to_name' id='input_to_name' value='".htmlentities($recipname, ENT_QUOTES, $config->charset)."' />&nbsp;";
	}

	if ($config->pubuseautocomplete) {
		uddeIMdoAutocomplete($config);
	}

// SECOND FIELD IN FIRST LINE IN TABLE
	echo "</td><td valign='top' align='right'>\n";
	if (!($config->flags & 0x01)) {
		if ($config->pubmodeshowallusers==1 || $config->pubmodeshowallusers==2) {
			if ($dwf_errorcode==0 && $config->pubmodeshowallusers==1) {
				// link to drop down box with names of connected users, value is 2 since it is shown the first time (so selecting the link does not show an error message because of an empty recipient field)
				echo "<br />";
				echo "<a href=\"#\" onclick=\"document.sendeform.sendeform_showallusers.value='2'; document.sendeform.submit(); return false;\">"._UDDEIM_SHOWUSERS."</a>";
			} else { // now show all users
				uddeIMdoPublicShowAllUsers($config);
			}
		}
	}
	echo "</td></tr>";

// START SECOND LINE IN TABLE (colspan=2)
	if ($dwf_errorcode==3) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_NOSUCHUSER."</td></tr>";
	} elseif ($dwf_errorcode==2) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_NOTTOYOURSELF."</td></tr>";
	} elseif ($dwf_errorcode==5) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_ENTERNAME."</td></tr>";
	} elseif ($dwf_errorcode==6) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_TOOMANYRECIPIENTS."</td></tr>";
	} elseif ($dwf_errorcode==7) {
		if ($config->captchatype==0) {
			echo "<tr><td valign=left colspan=2>"._UDDEIM_WRONGCAPTCHA."</td></tr>";
		} else {
			echo "<tr><td valign=left colspan=2><span style='background-color: #ff0000;'>"._UDDEIM_WRONGCAPTCHA."</span></td></tr>";
		}
	} elseif ($dwf_errorcode==8) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_NOPUBLICMSG."</td></tr>";
	} elseif ($dwf_errorcode==9) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_ONEUSERBLOCKS."</td></tr>";
	} elseif ($dwf_errorcode==10) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_GROUPBLOCKED."</td></tr>";
	} elseif ($dwf_errorcode==11) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_NOSUCHLIST."</td></tr>";
	} elseif ($dwf_errorcode==12) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORINFROMNAME."</td></tr>";
	} elseif ($dwf_errorcode==13) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORINEMAIL."</td></tr>";
	} elseif ($dwf_errorcode==14) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_YOUHAVETOWAIT."</td></tr>";
	} elseif ($dwf_errorcode==15) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_ERRORCSRF."</td></tr>";
	} elseif ($dwf_errorcode==16) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_USERBLOCKED."</td></tr>";
	} elseif ($dwf_errorcode==17) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_USERBANNED."</td></tr>";
	} elseif ($dwf_errorcode==18) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_FILEUPLOAD_FAILED."</td></tr>";
	} elseif ($dwf_errorcode==19) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_FILESIZE_EXCEEDED."</td></tr>";
	} elseif ($dwf_errorcode==20) {
		echo "<tr><td valign=left colspan=2>"._UDDEIM_FILETYPE_NOTALLOWED."</td></tr>";
	}
	echo "</table>";
	echo "<br />";

	if($config->showtextcounter && $config->maxlength) {
		uddeIMaddScript($pathtosite."/components/com_uddeim/js/uddeimtools.js");
	}

	if($config->allowbb || $config->allowsmile) {
		uddeIMaddScript($pathtosite."/components/com_uddeim/js/bbsmile.js");
		uddeIMdoSmileysEx($config);
		uddeIMdoBB($config);
		uddeIMdoSmileys($config);
	}

	$errorstyle='';
	echo "<span".$errorstyle.">"._UDDEIM_MESSAGE."</span>";
	echo "<br />";

	$thestyle = "";
	if ($config->width)
		$thestyle .= "width: ".(int)$config->width."px; ";
	if ($dwf_errorcode==4)
		$thestyle .= "background-color: #ff0000; ";

	$errorstyle="";
	if ($thestyle!="")
		$errorstyle="style='".$thestyle."' ";

	// ================================== TEXTBOX/TEXTCOUNTER ==============================

	if($config->showtextcounter && $config->maxlength) {
		$uc = ($config->showtextcounter) ? "textCount(document.sendeform.pmessage,document.sendeform.characterstyped,".$config->maxlength.");" : "";
		echo "<textarea name='pmessage' ".$errorstyle."class='inputbox' rows='".(int)$config->rows."' cols='".(int)$config->cols."' onkeydown='".$uc."' onkeyup='".$uc."'>".$pmessage."</textarea>";
		echo "<div class='uddeim-textcounter'>";
		echo "<input style='background-color: lightgray;' readonly='readonly' type='text' name='characterstyped' size='4' maxlength='4' value='".$config->maxlength."' /> "._UDDEIM_CHARSLEFT;
		echo "</div>";
	} else {
		echo "<textarea name='pmessage' ".$errorstyle."class='inputbox' rows='".(int)$config->rows."' cols='".(int)$config->cols."'>".$pmessage."</textarea>";
	}

	// ================================== CAPTCHA ==============================

	if ($config->usecaptcha>=1) {
		if ($config->captchatype==0) {
			// CAPTCHA
			if($dwf_errorcode==7) {
				$errorstyle='style="background-color: #ff0000;" ';
			} else {
				$errorstyle='';
			}
			echo "<div class='uddeim-captcha'>";
			echo "<label for='security_code'>Security Code: </label><input id='security_code' name='security_code' type='text' ".$errorstyle." />&nbsp;";

			if (class_exists('JFactory')) {
				// CAPTCHA15
				echo "<img style='vertical-align:middle;' src='".$pathtosite."/components/com_uddeim/captcha15.php' /><br />";
			} else {
				// CAPTCHA10
				echo "<img style='vertical-align:middle;' src='".$pathtosite."/components/com_uddeim/captcha.php' /><br />";
			}
			echo "</div>";
		} else {
			$pathtouser  = uddeIMgetPath('user');
			require_once($pathtouser."/recaptchalib.php");
			echo "<div class='uddeim-captcha'>";
		    echo recaptcha_get_html($config->recaptchapub);
			echo "</div>";
		}		
	}

	echo "<div class='uddeim-sendbutton'>";
	echo "<input type='submit' name='reply' class='button' value='"._UDDEIM_SUBMIT."' />&nbsp;";
	echo "</div>";
	echo "<span id='city' style='visibility:hidden;'><input type='text' name='city' value='' /></span>\n";

	echo "</form>\n";
	echo "</div>\n"; // end of uddeim-writeform
}
Example #8
0
function uddeIMarchive($myself, $item_id, $limit, $limitstart, $cryptpass, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode) {
	global $uddeicons_flagged, $uddeicons_unflagged, $uddeicons_onlinepic, $uddeicons_offlinepic, $uddeicons_readpic, $uddeicons_unreadpic;
	
	if(!$config->allowarchive) {
		uddeIMprintMenu($myself, 'archive', $item_id, $config);
		echo "<div id='uddeim-m'>\n";
		echo "<div id='uddeim-overview'><p><b>"._UDDEIM_ARCHIVENOTENABLED."</b></p></div>\n";
		echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
		return;
	}

	$pathtosite = uddeIMgetPath('live_site');

	$addlink = "";
	$addlink2 = "";
	if ($filter_user)
		$addlink .= "&filter_user="******"&filter_unread=".(int)$filter_unread;
	if ($filter_flagged)
		$addlink .= "&filter_flagged=".(int)$filter_flagged;
	if ($sort_mode)
		$addlink2 .= "&sort_mode=".(int)$sort_mode;

	// TODO $sort_datum/name leer, wenn nicht aktiviert
	$sort_datum = "";
	$sort_name = "";
	if ($config->enablesort) {
		$temppic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_updown.gif' alt='"._UDDEIM_UPDOWN."' title='"._UDDEIM_UPDOWN."' border='0' />";
		$sort_datum = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=0&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
		$sort_name  = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=2&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
		switch($sort_mode) {
			case 0: $temppic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_down.gif' alt='"._UDDEIM_UP."' title='"._UDDEIM_UP."' border='0' />";
					$sort_datum = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=1&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
					break;
			case 1: $temppic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_up.gif' alt='"._UDDEIM_DOWN."' title='"._UDDEIM_DOWN."' border='0' />";
					$sort_datum = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=0&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
					break;
			case 2: $temppic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_down.gif' alt='"._UDDEIM_UP."' title='"._UDDEIM_UP."' border='0' />";
					$sort_name  = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=3&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
					break;
			case 3: $temppic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_up.gif' alt='"._UDDEIM_DOWN."' title='"._UDDEIM_DOWN."' border='0' />";
					$sort_name  = "&nbsp;<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&sort_mode=2&Itemid=".$item_id.$addlink)."'>". $temppic ."</a>";
					break;
		}
	}

	$my_gid = $config->usergid;

	// message limit for archive?
	if ($config->inboxlimit) {
		$universeflag = _UDDEIM_ARC_UNIVERSE_BOTH;	// inbox and archive.
	} else {
		$universeflag = _UDDEIM_ARC_UNIVERSE_ARC;	// archive.
	}

	// how many messages total in archive?
	$totalarchive = uddeIMgetArchiveCount($myself, $filter_user, $filter_unread, $filter_flagged);

	if ($config->inboxlimit) {		// inbox + archive
		$total = uddeIMgetInboxArchiveCount($myself);
	} else {
		$total = uddeIMgetArchiveCount($myself);
	}
	
	$limitwarning = "";
	// "You have XX messages in your inbox/inbox+archive."
	$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
	$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
	$limitreached.= $universeflag;

	if (!uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config)) {
		// "The allowed maximum is XX."
		// $limitreached.= _UDDEIM_INBOX_LIMIT_3." ".$config->maxarchive.". ";
		$limitreached.= " "._UDDEIM_SHOWINBOXLIMIT_2." ".$config->maxarchive.").";	// (of max. )
		if ($total > $config->maxarchive) {
			$limitwarning = _UDDEIM_ARC_SAVED_3;
			// To save messages, you have to delete other messages first.
		}
	}

	// now load messages as required
	if (!$limitstart)
		$limitstart=0;
	
	if(!$limit)
		$limit=$config->perpage;
	
	if ($limitstart>=$totalarchive)
		$limitstart=max(0,$limitstart - $limit);

	// read from archive db all msg where toid is me 
	// this query should return all messages stored by me
	$allmessages = uddeIMselectArchive($myself, $limitstart, $limit, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode);

	// write the uddeim menu
	uddeIMprintMenu($myself, 'archive', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	if ($config->enablefilter==1 || $config->enablefilter==3)
		uddeIMprintFilter($myself, 'archive', $totalarchive, $item_id, $config, $filter_user, $filter_unread, $filter_flagged);

	if (count($allmessages)<1) { // no messages to list
		uddeIMshowNoMessage('archive', $filter_user, $filter_unread, $filter_flagged);
		echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
		return;
	}

	uddeIMaddScript($pathtosite."/components/com_uddeim/js/uddeimtools.js");

	echo "<form method='post' name='messages' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivefork&Itemid=".$item_id)."'>\n";
	echo "<div id='uddeim-overview'><table cellpadding='7' width='100%'>\n";
	echo "\t<tr><th style='text-align:center;' class='sectiontableheader'>";
	echo "<input type='checkbox' name='arcmes[]' value='' onclick='wiglwogl(this);' title='"._UDDEIM_CHECKALL."' />";
	echo "</th>";
	echo "<th class='sectiontableheader'>&nbsp;</th><th class='sectiontableheader'>"._UDDEIM_FROM.$sort_name."</th><th class='sectiontableheader'>"._UDDEIM_MESSAGE."</th><th class='sectiontableheader'>"._UDDEIM_DATE.$sort_datum."</th><th class='sectiontableheader'>&nbsp;</th></tr>";

	$i=1;
	// now write the list
	foreach($allmessages as $themessage) {
		
		$fromname = uddeIMevaluateUsername($themessage->fromname, $themessage->fromid, $themessage->publicname);

		if($themessage->systemflag)
			$fromname=$themessage->systemmessage;

		$personalsys=0;
		if($themessage->systemmessage==$fromname)
			$personalsys=1;

		// show links ???
		$fromcell=$fromname;
		if ($themessage->fromid) {
			if ($config->showcblink && $themessage->fromname) {
				if (!$themessage->systemflag || $personalsys) {
					$fromcell = uddeIMshowThumbOrLink($themessage->fromid, $fromname, $config);
				}
			}

			// is this user currently online?
			if ($config->showonline && $themessage->fromname) {
				if (!$themessage->systemflag || $personalsys) {
					$isonline = uddeIMisOnline($themessage->fromid);
					if ($isonline)
						$fromcell.="&nbsp;".$uddeicons_onlinepic;
					else
						$fromcell.="&nbsp;".$uddeicons_offlinepic;
				}
			}
		}

		$flagcell = "";
		if($config->allowflagged) {
			if($themessage->flagged)
				$flagcell="<br /><br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unflag&ret=archive&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_flagged."</a>";
			else
				$flagcell="<br /><br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=flag&ret=archive&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_unflagged."</a>";
		}

		// as all messages in archive are READ by design, so this is basically nonsense but consistent with inbox/outbox handling
		if($themessage->toread)
			$readcell=$uddeicons_readpic;
		else
			$readcell=$uddeicons_unreadpic;

		if ($config->showlistattachment) {
			$cnt = uddeIMgetAttachmentCount($themessage->id);
			if ($cnt)
				$readcell .= "<br /><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/attachment.gif' alt='"._UDDEIM_ATTACHMENT."' title='"._UDDEIM_ATTACHMENT."' border='0' />";
		}

		// CRYPT
		$cm = uddeIMgetMessage($themessage->message, $cryptpass, $themessage->cryptmode, $themessage->crypthash, $config->cryptkey);
		
		$teasermessage = $cm;
		// if it is a system message or bb codes allowed, parse BB codes
		if ($themessage->systemflag || $config->allowbb)
			$teasermessage = uddeIMbbcode_strip($teasermessage);

		$teasermessage=uddeIMteaser(stripslashes($teasermessage), $config->firstwordsinbox, $config->quotedivider, $config->languagecharset);			
		$teasermessage=htmlspecialchars($teasermessage, ENT_QUOTES, $config->charset);
		$teasermessage=str_replace("&amp;#", "&#", $teasermessage);
		$teasermessage=str_replace("&amp;&lt;/br&gt;", " ", $teasermessage);
		
		$safemessage=htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset);
		$safemessage=str_replace("&amp;&lt;/br&gt;", "</br>", $safemessage);

		if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
			$messagecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
		} else {							// normal message
			$messagecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
		}
		$datumcell=uddeDate($themessage->datum, $config, uddeIMgetUserTZ());

		$fwdcell="";
		if($config->actionicons) {
			$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=delete&ret=archive&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/trash.gif' alt='"._UDDEIM_DELETELINK."' title='"._UDDEIM_DELETELINK."' /></a>";
			if ($config->allowforwards) {
				if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
					$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardpass&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
				} else {							// normal message
					$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
				}
			}
			$unarchivecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unarchive&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/unarchive.gif' alt='"._UDDEIM_UNARCHIVE."' title='"._UDDEIM_UNARCHIVE."' /></a><br />";
		} else {
			$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=delete&ret=archive&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'>"._UDDEIM_DELETELINK."</a>";
			if ($config->allowforwards) {
				if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
					$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
				} else {							// normal message
					$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
				}
			}
			$unarchivecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unarchive&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_UNARCHIVE."</a><br />";
		}

		// for displaying a checkbox (for mass delete, mass download)
		$delcell = "<input type='checkbox' name='arcmes[]' value='".$themessage->id."' />";

		echo "\t<tr class='sectiontableentry".$i."'>";
		// checkcell
		echo "\t<td style='width:32px; text-align:center; vertical-align:middle'>".$delcell."</td>";
		echo "<td style='width:32px; text-align:center; vertical-align:middle'>".$readcell.$flagcell."</td>";
		$st=uddeIMgetStyleForThumb($config);
		echo "<td ".$st.">".$fromcell."</td>";
		echo "<td>".$messagecell."</td>";
		echo "<td>".$datumcell."</td>";
		if($config->actionicons) {
			echo "<td style='width:32px; text-align:center; vertical-align:middle'>".$fwdcell.$unarchivecell.$deletecell."</td>";
		} else {
			echo "<td class='pathway'>".$fwdcell.$unarchivecell.$deletecell."</td>";
		}
		echo "</tr>\n";

		$i++;
		if ($i>2) {
			$i=1;
		}
	}

	$muldown = uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivedownload&Itemid=".$item_id."&limitstart=0&limit=".$limit);
	$multrash = uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivetrash&Itemid=".$item_id."&limitstart=0&limit=".$limit);
	if($config->bottomlineicons) {
		echo "<tr><th style='text-align:left;' class='sectiontablefooter' colspan='2'>";	// colspan=2 for more space
		if ($config->enabledownload) {
			echo '<a href="#" onclick="archiveDownload(\''.$muldown.'\'); return false;"><img src="'.$pathtosite.'/components/com_uddeim/templates/'.$config->templatedir.'/images/email.gif" alt="'._UDDEIM_EXPORT_NOW.'" title="'._UDDEIM_EXPORT_NOW.'" /></a>&nbsp;';
		}
		echo '<a href="#" onclick="archiveTrash(\''.$multrash.'\'); return false;"><img src="'.$pathtosite.'/components/com_uddeim/templates/'.$config->templatedir.'/images/trash.gif" alt="'._UDDEIM_TRASHCHECKED.'" title="'._UDDEIM_TRASHCHECKED.'" /></a>';
		echo "</th><th class='sectiontablefooter'>&nbsp;</th><th class='sectiontablefooter'>&nbsp;</th><th class='sectiontablefooter'>&nbsp;</th><th class='sectiontablefooter'>&nbsp;</th></tr>\n";
	}

	// now close inbox table and container
	echo "</table></div>\n";
	echo "</form>\n";

	// write the inbox navigation links
	$pageNav = new uddeIMmosPageNav($totalarchive, $limitstart, $limit);
	$referlink = "index.php?option=com_uddeim&task=archive&Itemid=".$item_id.$addlink.$addlink2;
	if ($totalarchive>$limit) {
		$shownav = $pageNav->writePagesLinks($referlink);
		$shownav = uddeIMarrowReplace($shownav, $config->templatedir);
		echo "<div id='uddeim-pagenav'>".$shownav."<br />";
		echo "[<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&Itemid=".$item_id."&limitstart=0&limit=".$totalarchive.$addlink.$addlink2)."'>"._UDDEIM_SHOWALL."</a>]";
		echo "</div>\n";
	}

	$showinboxlimit_borderbottom = "";
	if ($limitwarning) {
		$showinboxlimit_borderbottom = "<span class='uddeim-warning'>";
		$showinboxlimit_borderbottom.= $limitreached." ";
		$showinboxlimit_borderbottom.= $limitwarning;
		$showinboxlimit_borderbottom.= "</span>";
	}

	echo "<div id='uddeim-bottomlines'>";
	if (!$config->bottomlineicons) {
		echo "<p>";
		if ($config->enabledownload) {
			echo '<a href="#" onclick="archiveDownload(\''.$muldown.'\'); return false;">'._UDDEIM_EXPORT_NOW.'</a> | ';
		}
		echo '<a href="#" onclick="archiveTrash(\''.$multrash.'\'); return false;">'._UDDEIM_TRASHCHECKED.'</a>';
		echo "</p>";
	}
	if ($showinboxlimit_borderbottom)
		echo "<p>".$showinboxlimit_borderbottom."</p>";
	echo "</div>\n";

	if ($config->enablefilter==2 || $config->enablefilter==3)
		uddeIMprintFilter($myself, 'archive', $totalarchive, $item_id, $config, $filter_user, $filter_unread, $filter_flagged);

	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $limitreached, $config)."</div>\n";
}
Example #9
0
function uddeIMforwardPass($myself, $item_id, $messageid, $config) {
	uddeIMprintMenu($myself, 'forwardPass', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	echo "<div id='uddeim-overview'><p><b>"._UDDEIM_PASSWORD."</b></p>";
	echo "<form name='showform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$messageid)."'>";
	echo _UDDEIM_PASSWORDBOX.": ";
	echo "<input name='cryptpass' value='' />"._UDDEIM_DECRYPTIONTEXT."<br /><br />";
	echo "<input type='submit' name='sendpass' class='button' value='"._UDDEIM_SUBMIT."' />";
	echo "</form>";
	echo "</div>\n";

	echo "</div>\n";
	echo "<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
}
Example #10
0
function uddeIMshowPostboxUser($myself, $userid, $item_id, $limit, $limitstart, $cryptpass, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode) {
	global $uddeicons_delayedpic, $uddeicons_flagged, $uddeicons_unflagged, $uddeicons_onlinepic, $uddeicons_offlinepic, $uddeicons_readpic, $uddeicons_unreadpic;
	
	$pathtosite = uddeIMgetPath('live_site');

	// invoke pruning if set so
	$my_gid = $config->usergid;

	// message limit for inbox?
	if ($config->inboxlimit && $config->allowarchive) {
		$universeflag = _UDDEIM_ARC_UNIVERSE_BOTH;	// inbox and archive
	} else {
		$universeflag = _UDDEIM_ARC_UNIVERSE_INBOX;	// inbox
	}

	if ($config->inboxlimit && $config->allowarchive) {		// inbox + archive, already stored messages in archive are not counted, when archive is disabled
		$total = uddeIMgetInboxArchiveCount($myself);
	} else {
		$total = uddeIMgetInboxCount($myself);				// also used for navigation
	}

	$limitwarning = "";
	// "You have XX messages in your inbox/inbox+archive."
	$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
	$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
	$limitreached.= $universeflag;

	if ($config->inboxlimit) {		// there is a limit for inbox + archive
		if (!uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config)) {
			// "The allowed maximum is XX."
			// $limitreached.= _UDDEIM_INBOX_LIMIT_3." ".$config->maxarchive.". ";
			$limitreached.= " "._UDDEIM_SHOWINBOXLIMIT_2." ".$config->maxarchive.").";	// (of max. )

			if ($total > $config->maxarchive) {
				$limitwarning = _UDDEIM_INBOX_LIMIT_4;		// You can still receive and read messages but you will not be able to reply or to compose new ones until you delete messages.
			}
		}
	} else {						// there is a limit for the archive only
		$limitreached.= ".";		// so inbox is unlimited
	}

	


	$totalpostbox = uddeIMgetPostboxUserCount($myself, $userid, $filter_user, $filter_unread, $filter_flagged);

	// now load messages as required
	if(!$limitstart)
		$limitstart = 0;

	if(!$limit)
		$limit=$config->perpage;

	if ($limitstart>=$totalpostbox)
		$limitstart=max(0,$limitstart - $limit);

	// $allmessages = uddeIMselectInbox($myself, $limitstart, $limit, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode);
	$allmessages = uddeIMselectPostboxUser($myself, $userid, $limitstart, $limit, $config);


	// write the uddeim menu
	uddeIMprintMenu($myself, 'inbox', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	//if ($config->enablefilter==1 || $config->enablefilter==3)
	//	uddeIMprintFilter($myself, 'postboxuser', $totalpostbox, $item_id, $config, $filter_user, $filter_unread, $filter_flagged);

	// if no messages:
	if (count($allmessages)<1) { // no messages to list
		uddeIMshowNoMessage('postbox', $filter_user, $filter_unread, $filter_flagged);
		echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
		return;
	}

	uddeIMaddScript($pathtosite."/components/com_uddeim/js/uddeimtools.js");



	if ($config->blocksystem) {
		if ($userid && $userid!=$myself) {
			$isblocked = uddeIMcheckBlockerBlocked($myself, $userid);
			if (!$isblocked) {
				echo "<div id='uddeim-block'>";
				echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td align='left'>";
				$blockcell = "<div style='text-align:right;'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=blockuser&Itemid=".$item_id."&recip=".$userid."&ret=postboxuser")."'>"._UDDEIM_BLOCKNOW."</a></div>";
				echo $blockcell;
				echo "</td></tr></table>";
				echo "</div>";
			}
		}
	}
	
	

	echo "<form method='post' name='messages' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=inboxfork&Itemid=".$item_id)."'>\n";
	// now open the inbox container and table; write table headings
	echo "<div id='uddeim-overview'>";
	echo "<table cellpadding='7' width='100%'>\n";
	// checkcell
	$delall="<input type=\"checkbox\" name=\"arcmes[]\" value=\"\" onclick=\"wiglwogl(this);\" title=\""._UDDEIM_CHECKALL."\" />";
	echo "<tr>";
	echo "<th style='border:none; text-align:center;' class='sectiontableheader'>".$delall."</th>";
	echo "<th style='border:none;' class='sectiontableheader'>&nbsp;</th>";
	echo "<th style='border:none;' class='sectiontableheader'>"._UDDEIM_FROM."/"._UDDEIM_TO."</th>";
	echo "<th style='border:none;' class='sectiontableheader'>"._UDDEIM_DATE."</th>";
	echo "<th style='border:none;' class='sectiontableheader'>&nbsp;</th>";
	echo "</tr>\n";

	$k = 1;
	$i = 1;
	// now write the list
	foreach($allmessages as $themessage) {

		$isinbox = 0;
		$isoutbox = 0;
		if ($myself==$themessage->toid && $myself!=$themessage->fromid) {
			$isinbox = 1;
		} elseif ($myself==$themessage->fromid && $myself!=$themessage->toid) {
			$isoutbox = 1;
		} else {	// this case appears when a copy to me message has been trashed my myself
			$isinbox = 1;
		}

		$is_spam = 0;
		if ($config->reportspam)		// save one database query if possible
			$is_spam = uddeIMgetSpamStatus($themessage->id);

		$flagcell = "";
		$archivecell = "";
		$fwdcell = "";
		$deletecell = "";
		$recallcell = "";
		$attachcell = "";
		$spamcell = "";
		$spamcellflag = "";

		if ($isinbox) {
			if($config->allowflagged) {
				if($themessage->flagged)
					$flagcell="<br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unflag&recip=".$userid."&ret=postboxuser&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_flagged."</a>";
				else
					$flagcell="<br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=flag&recip=".$userid."&ret=postboxuser&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_unflagged."</a>";
			}
			if($themessage->toread)
				$readcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=markunread&recip=".$userid."&ret=postboxuser&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_readpic."</a>";
			else
				$readcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=markread&recip=".$userid."&ret=postboxuser&Itemid=".$item_id."&messageid=".$themessage->id."&limit=".$limit."&limitstart=".$limitstart)."'>".$uddeicons_unreadpic."</a>";

			if ($config->showlistattachment) {
				$cnt = uddeIMgetAttachmentCount($themessage->id);
				if ($cnt)
					$attachcell = "<br /><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/attachment.gif' alt='"._UDDEIM_ATTACHMENT."' title='"._UDDEIM_ATTACHMENT."' border='0' />";
			}

			if ($config->actionicons) {
				$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postboxdeleteinbox&recip=".$userid."&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/trash.gif' alt='"._UDDEIM_DELETELINK."' title='"._UDDEIM_DELETELINK."' /></a>";
				if ($config->allowforwards) {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardpass&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
					} else {	// normal message
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
					}
				}
				if ($config->allowarchive && $themessage->toread)
					$archivecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivemessage&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/archive.gif' alt='"._UDDEIM_STORE."' title='"._UDDEIM_STORE."' /></a><br />";
			} else {
				$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postboxdeleteinbox&recip=".$userid."&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'>"._UDDEIM_DELETELINK."</a>";
				if ($config->allowforwards) {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
					} else {	// normal message
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
					}
				}
				if ($config->allowarchive && $themessage->toread)
					$archivecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivemessage&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'>"._UDDEIM_STORE."</a><br />";
			}

			if ($config->reportspam) {		// uddeIMcheckPlugin('spamcontrol') &&  not required since uddeIMcheckConfig sets this 0 if plugin is missing
				if ($is_spam) {
					$spamcell = "<br /><br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unreportspam&Itemid=".$item_id."&messageid=".$themessage->id."&recip=".$userid."&ret=postboxuser")."'>"._UDDEIM_SPAMCONTROL_UNREPORT."</a>";
					$spamcellflag = "<br /><div class='uddeim-messagefrom-spam'>"._UDDEIM_SPAMCONTROL_MARKED."</div>";
				} else {
					$spamcell = "<br /><br /><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=reportspam&Itemid=".$item_id."&messageid=".$themessage->id."&recip=".$userid."&ret=postboxuser")."'>"._UDDEIM_SPAMCONTROL_REPORT."</a>";
				}
			}
		}

		if ($isoutbox) {
			if ($themessage->delayed) {
				$readcell=$uddeicons_delayedpic;
			} else {
				if ($themessage->toread)
					$readcell=$uddeicons_readpic;
				else
					$readcell=$uddeicons_unreadpic;
			}

			if ($config->showlistattachment) {
				$cnt = uddeIMgetAttachmentCount($themessage->id);
				if ($cnt)
					$attachcell = "<br /><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/attachment.gif' alt='"._UDDEIM_ATTACHMENT."' title='"._UDDEIM_ATTACHMENT."' border='0' />";
			}

			if ($config->actionicons) {
				$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postboxdeleteoutbox&recip=".$userid."&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/trash.gif' alt='"._UDDEIM_DELETELINK."' title='"._UDDEIM_DELETELINK."' /></a>";
				if ($config->allowforwards) {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutboxpass&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
					} else {	// normal message
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutbox&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/forward.gif' alt='"._UDDEIM_FORWARDLINK."' title='"._UDDEIM_FORWARDLINK."' /></a><br />";
					}
				}
			} else {
				$deletecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postboxdeleteoutbox&recip=".$userid."&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart."&messageid=".$themessage->id)."'>"._UDDEIM_DELETELINK."</a>";
				if ($config->allowforwards) {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutboxpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
					} else {	// normal message
						$fwdcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutbox&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_FORWARDLINK."</a><br />";
					}
				}
			}
			if(!$themessage->toread) {	// if not read then a recall is possible
				if($config->actionicons) {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$recallcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recallpass&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/restore.gif' alt='"._UDDEIM_RECALL."' title='"._UDDEIM_RECALL."' /></a><br />";
					} else {	// normal message
						$recallcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recall&Itemid=".$item_id."&messageid=".$themessage->id)."'><img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/restore.gif' alt='"._UDDEIM_RECALL."' title='"._UDDEIM_RECALL."' /></a><br />";
					}
				} else {
					if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$recallcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recallpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_RECALL."</a><br />";
					} else {	// normal message
						$recallcell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recall&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_RECALL."</a><br />";
					}
				}
			}
		}

		


		if ($isinbox) {
			if ($config->actionicons) {
				$newemail = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=reply&recip=".$userid."&Itemid=".$item_id."&messageid=".$themessage->id)."'>";
				$newemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_new.gif' alt='"._UDDEIM_COMPOSE."' />";
				$newemail .= "</a>";
			} else {
				$newemail = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=reply&recip=".$userid."&Itemid=".$item_id."&messageid=".$themessage->id)."'>"._UDDEIM_COMPOSE."</a>";
			}
		}
		if ($isoutbox) {
			if ($config->actionicons) {
				$newemail = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=new&recip=".$userid."&Itemid=".$item_id)."'>";
				$newemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_new.gif' alt='"._UDDEIM_COMPOSE."' />";
				$newemail .= "</a>";
			} else {
				$newemail = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=new&recip=".$userid."&Itemid=".$item_id)."'>"._UDDEIM_COMPOSE."</a>";
			}
		}

		
		
		// CRYPT
		$cm = uddeIMgetMessage($themessage->message, $cryptpass, $themessage->cryptmode, $themessage->crypthash, $config->cryptkey);
		$teasermessage=$cm;
		// if it is a system message or bb codes allowed, parse BB codes
		if ($themessage->systemflag || $config->allowbb)
			$teasermessage=uddeIMbbcode_strip($teasermessage);

		$teasermessage=uddeIMteaser(stripslashes($teasermessage), $config->firstwordsinbox, $config->quotedivider, $config->languagecharset);
		$teasermessage=htmlspecialchars($teasermessage, ENT_QUOTES, $config->charset);
		$teasermessage=str_replace("&amp;#", "&#", $teasermessage);
		$safemessage=htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset);

		$showemail = "";
		if ($isinbox) {
			if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
				$messagecell= "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
				$showemail  = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>";
				$showemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/page_white_magnify.gif' alt='"._UDDEIM_DISPLAY."' />";;
				$showemail .= "</a>";
			} else {							// normal message
				// $messagecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
				$messagecell="<a href='javascript:uddeIMtoggleLayer2(\"".$i."\");'>".$teasermessage."</a>";
				$showemail  = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$themessage->id)."'>";
				$showemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/page_white_magnify.gif' alt='"._UDDEIM_DISPLAY."' />";;
				$showemail .= "</a>";
			}
		}
		if ($isoutbox) {
			if ($themessage->cryptmode==2 || $themessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
				$messagecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showoutpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
				$showemail  = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showoutpass&Itemid=".$item_id."&messageid=".$themessage->id)."'>";
				$showemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/page_white_magnify.gif' alt='"._UDDEIM_DISPLAY."' />";;
				$showemail .= "</a>";
			} else {	// normal message
				// $messagecell="<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showout&Itemid=".$item_id."&messageid=".$themessage->id)."'>".$teasermessage."</a>";
				$messagecell="<a href='javascript:uddeIMtoggleLayer2(\"".$i."\");'>".$teasermessage."</a>";
				$showemail  = "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showout&Itemid=".$item_id."&messageid=".$themessage->id)."'>";
				$showemail .= "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/page_white_magnify.gif' alt='"._UDDEIM_DISPLAY."' />";;
				$showemail .= "</a>";
			}
		}

		$datumcell=uddeDate($themessage->datum, $config, uddeIMgetUserTZ());

		// checkcell
		$delcell="<input type='checkbox' name='arcmes[]' value='".$themessage->id."' />";

		//echo "<tr class='sectiontableentry1'>";
		echo "<tr class='uddeim-messagebody2header'>";
		echo "<td style='padding:4px; border-bottom:none; border-right:none; width:32px; text-align:center; vertical-align:top'>".$delcell."</td>";		// checkcell
		echo "<td style='padding:4px; border-bottom:none; border-right:none; width:32px; text-align:center; vertical-align:top'>".
						$readcell.$attachcell.$flagcell.
						"</td>";
		$st=uddeIMgetStyleForThumb($config);
		//echo "<td ".$st.">";
		echo "<td style='padding:4px; border-bottom:none; border-right:none; vertical-align:top'>";
		if ($isinbox)
			echo uddeIMdoInboxHeader($myself, $themessage, $config);
		if ($isoutbox)
			echo uddeIMdoOutboxHeader($myself, $themessage, $config);
		echo "</td>";
		echo "<td style='padding:4px; border-bottom:none; border-right:none; vertical-align:top'>";
		echo $datumcell;
		echo $spamcell.$spamcellflag;
		echo "</td>";
		if ($config->actionicons) {
			echo "<td style='padding:4px; border-bottom:none; width:32px; text-align:center; vertical-align:top'>".
//						$fwdcell.$recallcell.$archivecell.$deletecell."<br /><br />".$newemail.
						$fwdcell.$recallcell.$archivecell.$deletecell.
						"</td>";
		} else {
			echo "<td style='padding:4px; border-bottom:none; vertical-align:top' class='pathway'>".
						$fwdcell.$recallcell.$archivecell.$deletecell."<br /><br />".$newemail.
						"</td>";
		}
		echo "</tr>\n";

		
//		if ($themessage->cryptmode!=2 && $themessage->cryptmode!=4) {	// Message is encrypted, so display no message

			// ############################################################# MESSSAGE

			$cm = uddeIMgetMessage($themessage->message, $cryptpass, $themessage->cryptmode, $themessage->crypthash, $config->cryptkey);

			// echo str_replace("&amp;#", "&#", nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset)));
			$dmessage = nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset));
			$dmessage = str_replace("&amp;#", "&#", $dmessage);		// unicode workaround
			// if system message or bbcodes allowed, call parser
			if ($themessage->systemflag || $config->allowbb)
				$dmessage = uddeIMbbcode_replace($dmessage, $config);
			if ($config->allowsmile)
				$dmessage = uddeIMsmile_replace($dmessage, $config);
			$bodystring = $dmessage;			// converted message for email body


if (0) {
			echo "<tr class='uddeim-messagebody2body'>";
			echo "<td colspan='3' style='border-style:none; padding:0 8px 0 8px; text-align:left; vertical-align:bottom'>";
				echo str_replace("<br />", "", $fwdcell."&nbsp".$recallcell."&nbsp".$archivecell."&nbsp".$deletecell."&nbsp;&nbsp;&nbsp;".$newemail);
			echo "</td>";
			echo "<td colspan='2' style='border-style:none; padding:0 8px 0 8px; text-align:right; vertical-align:middle'>";
				echo str_replace("<br />", "", $readcell.$attachcell.$flagcell);
			echo "</td>";
			echo "</tr>";
}


			echo "<tr class='uddeim-messagebody2body'>";
			echo "<td colspan='4' style='padding:8px; border-top:none; border-right:none;'>";
				// echo "<div style='text-align:right;'><a href='javascript:uddeIMtoggleLayer2(\"".$i."\");'>"._UDDEADM_SPAMCONTROL_SHOWHIDE."</a></div>";

				if ($config->postboxfull==0) {
					$st_preview = "display:inline;";
					$st_normal = "display:none;";
				}
				if ($config->postboxfull==1) {
					if ($i==1) {
						$st_preview = "display:none;";
						$st_normal = "display:inline;";
					} else {
						$st_preview = "display:inline;";
						$st_normal = "display:none;";
					}
				}
				if ($config->postboxfull==2) {
					$st_preview = "display:none;";
					$st_normal = "display:inline;";
				}
				
				echo "<div id='uddeimdivlayerpreview_".$i."' style='".$st_preview."'>";
				echo "<div class='uddeim-messagebody2'>".$messagecell."</div>";
				echo "</div>\n";

				echo "<div id='uddeimdivlayer_".$i."' style='".$st_normal."'>";
				$messagecell="<a href='javascript:uddeIMtoggleLayer2(\"".$i."\");'>".uddeIMreplyquoteMarkup($bodystring,$config->quotedivider)."</a>";
				echo "<div class='uddeim-messagebody2'>".$messagecell."</div>";
				// UDDEIMFILE
				if( $config->enableattachment )	{ // Always show attachments when attachments are enabled
					if ($isinbox)
						uddeIMshowAttachments("inbox", $item_id, $themessage->id, $config);
					if ($isoutbox)
						uddeIMshowAttachments("outbox", $item_id, $themessage->id, $config);
				}
				echo "</div>\n";

			echo "</td>\n";
			echo "<td style='padding:4px; border-top:none; border-left:none; width:32px; text-align:center; vertical-align:top'>";
				echo $newemail."<br />".$showemail;
			echo "</td>\n";
			echo "</tr>\n";
//		}
		

		
		$i++;
		$k++;
		if ($k > 2)
			$k = 1;
	}

	$muldel = uddeIMsefRelToAbs("index.php?option=com_uddeim&task=mulpostboxdelete&Itemid=".$item_id."&recip=".$userid."&limitstart=0&limit=".$limit);
	if($config->bottomlineicons) {
		echo "<tr><th style='border:none; text-align:center;' class='sectiontablefooter'>";
		echo '<a href="#" onclick="inboxDelete(\''.$muldel.'\'); return false;"><img src="'.$pathtosite.'/components/com_uddeim/templates/'.$config->templatedir.'/images/trash.gif" alt="'._UDDEIM_TRASHCHECKED.'" title="'._UDDEIM_TRASHCHECKED.'"/></a>';
		echo "</th><th style='border:none;' class='sectiontablefooter'>&nbsp;</th><th style='border:none;' class='sectiontablefooter'>&nbsp;</th><th style='border:none;' class='sectiontablefooter'>&nbsp;</th><th style='border:none;' class='sectiontablefooter'>&nbsp;</th></tr>\n";
	}
	
	// now close inbox table and container
	echo "</table></div>\n";
	// checkcell
	echo "</form>\n";

	// write the inbox navigation links
	$pageNav = new uddeIMmosPageNav($totalpostbox, $limitstart, $limit);
	$referlink = "index.php?option=com_uddeim&task=postboxuser&Itemid=".$item_id."&recip=".$userid;
	if ($totalpostbox>$limit) {
		$shownav = $pageNav->writePagesLinks($referlink);
		$shownav = uddeIMarrowReplace($shownav, $config->templatedir);
		echo "<div id='uddeim-pagenav'>".$shownav."<br />";
		echo "[<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postboxuser&Itemid=".$item_id."&recip=".$userid."&limitstart=0&limit=".$totalpostbox)."'>"._UDDEIM_SHOWALL."</a>]";
		echo "</div>\n";
	}

	$showinboxlimit_borderbottom = "";
	if ($limitwarning) {
		$showinboxlimit_borderbottom = "<span class='uddeim-warning'>";
		$showinboxlimit_borderbottom.= $limitreached." ";
		$showinboxlimit_borderbottom.= $limitwarning;
		$showinboxlimit_borderbottom.= "</span>";
	}

	$keephours1=($config->ReadMessagesLifespan) * 1;  // this are days
	$keephours2=($config->UnreadMessagesLifespan) * 1;  // this are days
	echo "<div id='uddeim-bottomlines'>";
	if(!$config->bottomlineicons)
		echo '<p><a href="#" onclick="inboxDelete(\''.$muldel.'\'); return false;">'._UDDEIM_TRASHCHECKED.'</a></p>';
	if ($config->ReadMessagesLifespanNote)
		echo "<p>"._UDDEIM_READ_INFO_1.$keephours1._UDDEIM_READ_INFO_2."</p>";
	if ($config->UnreadMessagesLifespanNote)
		echo "<p>"._UDDEIM_UNREAD_INFO_1.$keephours2._UDDEIM_UNREAD_INFO_2."</p>";
	if ($showinboxlimit_borderbottom)
		echo "<p>".$showinboxlimit_borderbottom."</p>";
	echo "</div>\n";

	//if ($config->enablefilter==2 || $config->enablefilter==3)
	//	uddeIMprintFilter($myself, 'postboxuser', $totalpostbox, $item_id, $config, $filter_user, $filter_unread, $filter_flagged);

	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $limitreached, $config)."</div>\n";
//	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $showinboxlimit_borderbottom, $config)."</div>\n";
}
Example #11
0
function uddeIMrssFeedPlugin($versionstring, $userid, $config) {
	$database = uddeIMgetDatabase();
	$sitename = uddeIMgetSitename();
	$live_site = uddeIMgetPath('live_site');

	$Itemid 	= uddeIMmosGetParam( $_REQUEST, 'Itemid');
	if (!$Itemid || !isset($Itemid) || empty( $Itemid )) {
		$Itemid = uddeIMgetItemid($config);
	} else if ($config->overwriteitemid) {
		$Itemid = (int)$config->useitemid;
	}
	$item_id = (int)$Itemid;

	$username = stripslashes( strval( uddeIMmosGetParam ($_REQUEST, 'user', '') ));
	$passwd   = stripslashes( strval( uddeIMmosGetParam ($_REQUEST, 'pass', '') ));
	$showall  = (int) uddeIMmosGetParam ($_REQUEST, 'showall', 0);
	$type  	  = (int) uddeIMmosGetParam ($_REQUEST, 'type', 0);

	$row = uddeIMselectUserrecordFromUsername($username, $config);
	if ($row) {
		if ($row->block) {
			uddeIMrssOutputHeader($versionstring);
			uddeIMrssOutputItem($type, "Code=5", _UDDEIM_RSS_USERBLOCKED, "");
			uddeIMrssOutputFooter();
			return;
		}
		$gid = uddeIMgetGID($row->id);	// $userid
		if (!$config->enablerss || ($config->enablerss==2 && !uddeIMisAdmin($gid) && !uddeIMisAdmin2($gid, $config))) {
			uddeIMrssOutputHeader($versionstring);
			uddeIMrssOutputItem($type, "Code=2", _UDDEIM_RSS_NOTALLOWED, "");
			uddeIMrssOutputFooter();
			return;
		}
		
		if ((strpos($row->password, ':') === false) && $row->password == md5($passwd)) {
			// Old password hash storage but authentic ... lets convert it
			$salt = uddeIMmosMakePassword(16);
			$crypt = md5($passwd.$salt);
			$row->password = $crypt.':'.$salt;
		}
		list($hash, $salt) = explode(':', $row->password);

		$hash_db   = sha1($hash);		// the hash value from the user database
		$hash_post = $passwd;
		if ($hash_db != $hash_post) {
			uddeIMrssOutputHeader($versionstring);
			uddeIMrssOutputItem($type, "Code=3", _UDDEIM_RSS_WRONGPASSWORD, "");
			uddeIMrssOutputFooter();
			return;
		}

		uddeIMrssOutputHeader($versionstring);

		$filter = "";
		if (!$showall) {
			$filter = "AND a.toread=0 ";
		}

		$limit = "";
		if ($config->rsslimit)
			$limit = " LIMIT ".(int)$config->rsslimit;
			
		$userid = uddeIMgetIDfromUsername($username, $config, true);
		$sql = "SELECT a.*, b.".($config->realnames ? "name" : "username")." AS fromname FROM #__uddeim AS a LEFT JOIN #__users AS b ON a.fromid=b.id WHERE a.toid=".(int)$userid." AND a.totrash=0 AND a.archived=0 AND `a`.`delayed`=0 ".$filter."ORDER BY a.datum DESC".$limit;

		$database->setQuery($sql);
		$rows = $database->loadObjectList();
		if (!$rows) {
			$pms_show = uddeIMsefRelToAbs("index.php?option=com_uddeim&Itemid=".$item_id);
			uddeIMrssOutputItem($type,($showall ? "Code=0" : "Code=1"),
									  ($showall ? _UDDEIM_RSS_NOMESSAGES : _UDDEIM_RSS_NONEWMESSAGES), 
									  "", $pms_show);
		} else {
			foreach ($rows as $row) {
				$fromname = uddeIMevaluateUsername($row->fromname, $row->fromid, $row->publicname);
				if($row->systemmessage)
					$fromname = $row->systemmessage;
				if ($row->cryptmode==2)
					$pms_show = uddeIMsefRelToAbs("index.php?option=com_uddeim&Itemid=".$item_id."&task=showpass&messageid=".$row->id);
				else
					$pms_show = uddeIMsefRelToAbs("index.php?option=com_uddeim&Itemid=".$item_id."&task=show&messageid=".$row->id);
				$cm = uddeIMgetMessage($row->message, "", $row->cryptmode, "", $config->cryptkey);
				$cm = stripslashes($cm);
				if($row->systemflag || $config->allowbb) {					
					$cm = uddeIMbbcode_strip($cm);
				}
				$cm = htmlspecialchars($cm, ENT_QUOTES, $config->charset);
				$cm = str_replace("&amp;#", "&#", $cm); 

				$title = $fromname.": ".substr($cm,0,30);
				$pubdate = date("r",$row->datum);
				$desc = substr($cm,0,500);
				uddeIMrssOutputItem(0, "", $title, $desc, $pms_show, $pubdate);
			}
		}
		uddeIMrssOutputFooter();

	} else {
		uddeIMrssOutputHeader($versionstring);
		uddeIMrssOutputItem($type, "Code=4", _UDDEIM_RSS_NOOBJECT, "");
		uddeIMrssOutputFooter();
	}
}
Example #12
0
function uddeIMshowSettings($myself, $item_id, $config) {
	// write the uddeim menu
	uddeIMprintMenu($myself, 'settings', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	$emptysettings = _UDDEIM_NOSETTINGS;

	$my_gid = $config->usergid;

	if ($config->blocksystem) {
		$emptysettings='';
		$blockedusers = uddeIMselectBlockerBlockedList($myself, $config);
		$howmanyblocks=count($blockedusers);

		echo "<div class='uddeim-set-block'>\n";
		echo "<h4>"._UDDEIM_BLOCKSYSTEM."</h4>\n";
		if ($howmanyblocks) {
			echo "<p>"._UDDEIM_BLOCKS_EXP."</p>\n";
			echo "<p>"._UDDEIM_YOUBLOCKED_PRE.$howmanyblocks._UDDEIM_YOUBLOCKED_POST."</p>\n";
			echo "<div id='uddeim-overview'>";
			foreach($blockedusers as $blockeduser) {
				if ($blockeduser->displayname)
					echo uddeIMgetLinkOnly($blockeduser->blocked, "<b>".$blockeduser->displayname."</b>", $config);
				else
					echo _UDDEADM_NONEORUNKNOWN;
				echo "&nbsp;&nbsp;";
				echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unblockuser&Itemid=".$item_id."&recip=".$blockeduser->blocked)."'>"._UDDEIM_UNBLOCKNOW."</a><br />";
			}
			echo "</div>\n";
			if ($config->blockalert) {
				echo "<p>"._UDDEIM_BLOCKALERT_EXP_ON."</p>\n";
			} else {
				echo "<p>"._UDDEIM_BLOCKALERT_EXP_OFF."</p>\n";
			}
		} else {
			echo "<p>"._UDDEIM_NOBODYBLOCKED."</p>\n";
		}
		echo "</div>";
	}

	if ($config->allowemailnotify==1 || 
	   ($config->allowemailnotify==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config)))) {

		$emptysettings='';
		$emn_notonreply_checkstatus='';
		$emn_always_checkstatus='';
		$emn_whenoffline_checkstatus='';
		$emn_none_checkstatus='';

		$ison = uddeIMgetEMNstatus($myself);
		if ($ison==0) {
			$emn_none_checkstatus='checked="checked"';
		} elseif ($ison==1 || $ison==10) {
			$emn_always_checkstatus='checked="checked"';
		} elseif ($ison==2 || $ison==20) {
			$emn_whenoffline_checkstatus='checked="checked"';
		}
		if ($ison==10 || $ison==20) {
			$emn_notonreply_checkstatus='checked="checked"';
		}
		echo "<div class='uddeim-set-block'>";  // was uddeim-set-emn
		echo "<h4>"._UDDEIM_EMN."</h4>";
		echo "<p>"._UDDEIM_EMN_EXP."</p>";
		echo "<form name='emnform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=saveemn&Itemid=".$item_id)."'>";
		echo '<input type="radio" '.$emn_always_checkstatus.		' name="emailradio" value="1" onclick="document.emnform.emailreplycheck.disabled=false;" />'._UDDEIM_EMN_ALWAYS.'<br />';
		echo '<input type="radio" '.$emn_whenoffline_checkstatus.	' name="emailradio" value="2" onclick="document.emnform.emailreplycheck.disabled=false;" />'._UDDEIM_EMN_WHENOFFLINE.'<br />';
		echo '<input type="radio" '.$emn_none_checkstatus.			' name="emailradio" value="0" onclick="document.emnform.emailreplycheck.disabled=true; document.emnform.emailreplycheck.checked=false;" />'._UDDEIM_EMN_NONE.'<br />';
		if ($emn_none_checkstatus) {
			echo '<input type="checkbox" '.$emn_notonreply_checkstatus.' value="1" name="emailreplycheck" disabled="disabled" />'._UDDEIM_EMN_NOTONREPLY.'<br />';
		} else {
			echo '<input type="checkbox" '.$emn_notonreply_checkstatus.' value="1" name="emailreplycheck" />'._UDDEIM_EMN_NOTONREPLY.'<br />';
		}
		echo '<input type="submit" name="reply" class="button" value="'._UDDEIM_SAVECHANGE.'" />';
		echo "</form>";
		echo "</div>";
	}

	if ($config->autoresponder==1 || 
	   ($config->autoresponder==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config)))) {
		$emptysettings='';

		$emn_responder_checkstatus='';
		$ison = uddeIMgetEMNautoresponder($myself);
		if ($ison==1) {
			$emn_responder_checkstatus='checked="checked"';
		}
		$autorespondertext = uddeIMgetEMNautorespondertext($myself);
		if (!$autorespondertext) {
			$autorespondertext = _UDDEIM_AUTORESPONDER_DEFAULT;
		}
		if ($config->maxlength>0)		// because if 0 do not use any maxlength
			$autorespondertext = uddeIM_utf8_substr($config->languagecharset, $autorespondertext, 0, $config->maxlength);
		echo "<div class='uddeim-set-block'>";  // was uddeim-set-emn
		echo "<h4>"._UDDEIM_AUTORESPONDER."</h4>";
		echo "<p>"._UDDEIM_AUTORESPONDER_EXP."</p>";
		echo "<form name='emnrespform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=saveresponderemn&Itemid=".$item_id)."'>";
		echo '<input onclick="document.emnrespform.autorespondercheck.checked ? document.emnrespform.autorespondertext.disabled=false : document.emnrespform.autorespondertext.disabled=true;" type="checkbox" '.$emn_responder_checkstatus.' value="1" name="autorespondercheck" />'._UDDEIM_EMN_AUTORESPONDER.'<br />';
		echo "<textarea name='autorespondertext' class='inputbox' rows='4' cols='60'".($ison==1 ? '' : 'disabled="disabled"').">".htmlentities($autorespondertext,ENT_QUOTES, $config->charset)."</textarea><br />";
		echo '<input type="submit" name="reply" class="button" value="'._UDDEIM_SAVECHANGE.'" />';
		echo "</form>";
		echo "</div>";
	}

	if ($config->autoforward==1 || 
	   ($config->autoforward==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) ||
	   ($config->autoforward==3 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) ) {
		$emptysettings='';

		$emn_forward_checkstatus='';
		$ison = uddeIMgetEMNautoforward($myself);
		if ($ison==1) {
			$emn_forward_checkstatus='checked="checked"';
		}
		$autoforwardid = uddeIMgetEMNautoforwardid($myself);

		echo "<div class='uddeim-set-block'>";  // was uddeim-set-emn
		echo "<h4>"._UDDEIM_AUTOFORWARD."</h4>";
		echo "<p>"._UDDEIM_AUTOFORWARD_EXP."</p>";
		echo "<form name='emnfwdform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=saveforwardemn&Itemid=".$item_id)."'>";
		echo '<input onclick="document.emnfwdform.autoforwardcheck.checked ? document.emnfwdform.autoforwardid.disabled=false : document.emnfwdform.autoforwardid.disabled=true;" type="checkbox" '.$emn_forward_checkstatus.' value="1" name="autoforwardcheck" />'._UDDEIM_EMN_AUTOFORWARD.'<br />';
		uddeIMdoShowAllUsers($myself, $my_gid, $config, 2, $ison, $autoforwardid);
//		echo "<textarea name='autoforwardid' class='inputbox' rows='1' cols='10'".($ison==1 ? '' : 'disabled="disabled"').">".htmlentities($autoforwardid,ENT_QUOTES, $config->charset)."</textarea><br />";
		echo "<br />";
		echo '<input type="submit" name="reply" class="button" value="'._UDDEIM_SAVECHANGE.'" />';
		echo "</form>";
		echo "</div>";
	}

	if ($config->allowpopup || ($config->pubfrontend && !uddeIMisRecipientBlockedPublic($myself, $config)) ) {

		$emptysettings='';
		echo "<div class='uddeim-set-block'>";
		echo "<h4>"._UDDEIM_OPTIONS."</h4>";
		echo "<p>"._UDDEIM_OPTIONS_EXP."</p>";
		echo "<form name='uddeim-popupform' method='post' action='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=saveuseremn&Itemid=".$item_id)."'>";

		$ison = uddeIMgetEMNpopup($myself);
		$p0checked='';
		switch($ison) {
			case 0:		$p0checked='';						break;
			case 1:		$p0checked='checked="checked"'; 	break;
		}
		if ($config->allowpopup)
			echo '<input type="checkbox" '.$p0checked.' value="1" name="popupcheck" />'._UDDEIM_OPTIONS_P.'<br />';
		else
			echo '<input type="hidden" name="popupcheck" value="'.$ison.'" />';

		$ison = uddeIMgetEMNpublic($myself);
		$p0checked='';
		switch($ison) {
			case 0:		$p0checked='';						break;
			case 1:		$p0checked='checked="checked"'; 	break;
		}
		if ($config->pubfrontend && !uddeIMisRecipientBlockedPublic($myself, $config))			// show option only when I am not in a generally blocked group
			echo '<input type="checkbox" '.$p0checked.' value="1" name="publiccheck" />'._UDDEIM_OPTIONS_F.'<br />';
		else
			echo '<input type="hidden" name="publiccheck" value="'.$ison.'" />';
		// Note: When a certain group is blocked it does not matter what is stored in $public by default, since the group checked if performed before the individual check.
		// I.e. when the group is not blocked -> the individual check $public is tested (the user can modify this value here)
		// and when the group is blocked -> the individual check is not done, since the user will see an error message that the group is not allowed

		echo '<input type="submit" name="reply" class="button" value="'._UDDEIM_SAVECHANGE.'" />';
		echo "</form>";
		echo "</div>";
	}

	if ($config->enablerss==1 || 
	   ($config->enablerss==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config)))) {

		$emptysettings='';
		$database = uddeIMgetDatabase();
		$sql = "SELECT id, name, username, password, block FROM #__users WHERE id=".(int)$myself;
		$database->setQuery($sql);
		$values = $database->loadObjectList();
		if (!$values)
			$values = Array();
		$row = NULL;
		foreach($values as $value) {
			$row = $value;
		}
		if ($row) {
			if ((strpos($row->password, ':') === false) && $row->password == md5($passwd)) {
				$salt = uddeIMmosMakePassword(16);
				$crypt = md5($passwd.$salt);
				$row->password = $crypt.':'.$salt;
			}
			list($hash, $salt) = explode(':', $row->password);
			$hash_db = sha1($hash);
			$pms_show = uddeIMgetPath('live_site')."/index.php?option=com_uddeim&amp;task=rss&amp;no_html=1&amp;format=raw&amp;user="******"&amp;pass="******"'.$pms_show.'" target="_blank">'.$pms_show.'</a>';
			echo '<div class="uddeim-set-block">';
			echo '<h4>'._UDDEIM_RSS_FEED.'</h4>';
			echo '<p>'._UDDEIM_RSS_INTRO1.' '._UDDEIM_RSS_INTRO1B.'</p>';
			echo '<p>'.$link.'</p>';
			echo '<p>'._UDDEIM_RSS_INTRO2.'</p>';
			
			if ($config->showigoogle) {
				echo '<p><a href="http://fusion.google.com/ig/add?synd=open&amp;source=ggyp&amp;moduleurl='.uddeIMgetPath('live_site').'/components/com_uddeim/uddeim_igoogle.xml">';
				echo '<img src="'.uddeIMgetPath('live_site').'/components/com_uddeim/templates/images/igoogle.gif" border="0" alt="Add to Google" width="62" height="17" />';
				echo '</a></p>';
				echo '</div>';
			}
		}
	}

	if ($emptysettings) {
			echo "<div id='uddeim-toplines'>".$emptysettings."</div>";
	}
	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'settings', 'none', $config)."</div>\n";
}
Example #13
0
function uddeIMgetLinkOnly($ofanid, $ofaname, $config) {	// LINK only
	$database = uddeIMgetDatabase();
	$itemid = "";
	if ($config->cbitemid)
		$itemid = "&Itemid=".$config->cbitemid;
	$gimmeback = "";

	if ($config->showcblink==1) {			// CB
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user="******"'>".$ofaname."</a>";
	} elseif ($config->showcblink==2) {		// FB
        // $sql = "SELECT id FROM #__menu WHERE link = 'index.php?option=com_fireboard' AND published = 1";
		// $database->setQuery($sql);
        // $fbid = (int)$database->loadResult();
		// $gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_fireboard&task=showprf&func=fbprofile&userid=".(int)$ofanid."&Itemid=".(int)$fbid)."'>".$ofaname."</a>";
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_fireboard&task=showprf&func=fbprofile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==3) {		// Agora
		$sql = "SELECT id FROM #__agora_users WHERE jos_id=".(int)$ofanid;
		$database->setQuery($sql);
		$agoraid = (int)$database->loadResult($sql);
		if ($agoraid)
			$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_agora&task=profile&id=".(int)$agoraid.$itemid)."'>".$ofaname."</a>";
		else
			$gimmeback = $ofaname;			// user has not visited the forum before, so no agora profile exists
	} elseif ($config->showcblink==4) {		// CBE
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_cbe&task=userProfile&user="******"'>".$ofaname."</a>";
	} elseif ($config->showcblink==5) {		// KUNENA
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena&task=showprf&func=fbprofile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==6) {		// JOMSOCIAL
        // $database->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_community' AND published=1");
        // $JOMSOCIAL_Itemid = $database->loadResult();
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_community&view=profile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==7) {		// AUP
		$api_AUP = JPATH_SITE.'/components/com_alphauserpoints/helper.php';
		if (file_exists($api_AUP)) {
			require_once($api_AUP);
			$linktoAUPprofil = AlphaUserPointsHelper::getAupLinkToProfil($ofanid);
			$gimmeback = "<a href='".$linktoAUPprofil."'>".$ofaname."</a>";
		}
	} elseif ($config->showcblink==8) {		// JooCM
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_joocm&view=profile&layout=joocm&id=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==9) {		// KUNENA 1.6
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena&func=profile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==10) {	// NINJABOARD
		// $sql = "SELECT id FROM #__agora_users WHERE jos_id=".(int)$ofanid;
		// $database->setQuery($sql);
		// $agoraid = (int)$database->loadResult($sql);
		//if ($agoraid)
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_ninjaboard&view=person&id=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
		//else
		//	$gimmeback = $ofaname;			// user has not visited the forum before, so no agora profile exists
	} elseif ($config->showcblink==11) {	// KUNENA 2.0
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena&func=profile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} elseif ($config->showcblink==12) {	// KUNENA 3.0
		// $gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena&func=user&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
		// same as 2.0
		$gimmeback = "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena&func=profile&userid=".(int)$ofanid.$itemid)."'>".$ofaname."</a>";
	} else {
		$gimmeback = $ofaname;
	}
	return $gimmeback;
}