cotonti.com : Button Option https://www.cotonti.com Last topic posts Cotonti en Wed, 22 Oct 2025 22:48:49 -0000 Heater
But a big thanks at MIHDev ! Sure !]]>
Wed, 15 Dec 2010 17:04:15 -0000
GHengeveld ]]> Wed, 15 Dec 2010 08:05:26 -0000 Heater Thanks at Koradhil & Kilandor for support me ! ;)

Heater]]>
Wed, 15 Dec 2010 06:45:45 -0000
MIHDev

Looks like there are 2 problems, There is a typo on line 14 and the order is incorrect.
$leetloging

Replace lines 14, 15, 16 and 17 with this
if($usr['level'] >= 20)
{
     $buttontext = 'Download Mission 3'; 
}
elseif($usr['level'] >= 15) 
{ 
     $buttontext = 'Download Mission 2'; 
}
elseif($usr['level'] >= 10) 
{
     $buttontext = 'Download Mission 1'; 
}
$leetlogin .= $buttontext;

Not seen all the code but that puts it in a way that should work for you, hope it helps.]]>
Wed, 15 Dec 2010 06:16:02 -0000
Heater
if ($cfg['plugin']['leetlogin']['avatar'] == true)
		{
		$leetlogin .= "<tr>";
		$leetlogin .= "<td style=\"text-align:center;\"><a href=https://www.cotonti.com/\"users.php?m=profile&amp;a=avatarchoose&amp;".sed_xg()."#list\"><img src=\"".$el_avatar."\" alt=\"\" /></a></td>";
		$leetlogin .= "<td style=\"text-align:left;width:100%;padding:0px;\"><div style=\"text-align:left;\">".$el_admin."<img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pm.php\">".$L['ll_inbox']."</a> <strong>".$el_npmessages."</strong>/".$el_olmessages."/".$el_apmessages."".$pmmessage."<br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=profile\">".$L['ll_profile']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pfs.php\">".$L['ll_pfs']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=logout&amp;".sed_xg()."\">".$L['ll_logout']."</a></div></td>";
		$leetlogin .= "</tr>";
		}
		else
		{
		$leetlogin .= "<tr>";
		$leetlogin .= "<td style=\"width:100%;padding:0px;\"><div style=\"text-align:left;\">".$el_admin."<img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pm.php\">".$L['ll_inbox']."</a> <strong>".$el_npmessages."</strong>/".$el_olmessages."/".$el_apmessages."".$pmmessage."<br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=profile\">".$L['ll_profile']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pfs.php\">".$L['ll_pfs']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"auth.php?m=logout&amp;".sed_xg()."\">".$L['ll_logout']."</a></div></td>";
		$leetlogin .= "</tr>";
		}
		$leetloging .= $buttontext;
		if($usr['level'] >= 20) { $buttontext = 'Download Mission 3'; }
		elseif($usr['level'] >= 15) { $buttontext = 'Download Mission 2'; }
		elseif($usr['level'] >= 10) { $buttontext = 'Download Mission 1'; }
	$leetlogin .= "</table>";
	}
	else
	{

I'm not very good... :(]]>
Wed, 15 Dec 2010 05:15:50 -0000
MIHDev
Have you output the $buttontext variable anywhere?, I am not familiar with the leetlogin.php file so may need to have a look at it to find an appropriate output tag.

Regards

MIHDev]]>
Wed, 15 Dec 2010 04:50:28 -0000
Heater
<!-- IF {PHP.usr.level} >= 10 AND {PHP.usr.level} < 15 -->
Download Mission 1
<!-- ENDIF -->
<!-- IF {PHP.usr.level} >= 15 AND {PHP.usr.level} < 20 -->
Download Mission 2
<!-- ENDIF -->
<!-- IF {PHP.usr.level} >= 20 -->
Download Mission 3
<!-- ENDIF -->

------------------------------------

Now, if I put the code in leetlogin.php this code don't show anything....where I wrong ?

   1. if($usr['level'] >= 20) { $buttontext = 'Download Mission 3'; }
   2. elseif($usr['level'] >= 15) { $buttontext = 'Download Mission 2'; }
   3. elseif($usr['level'] >= 10) { $buttontext = 'Download Mission 1'; }

this the php code of leetlogin.php:

<?PHP
/* ====================
Seditio - Website engine
Copyright Neocrome
http://www.neocrome.net

[BEGIN_SED]
File=plugins/leetlogin/leetlogin.php
Version=101
Updated=2006-apr-09
Type=Plugin
Author=Hodges
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=leetlogin
Part=main
File=leetlogin
Hooks=header.tags
Tags=header.tpl:{PLUGIN_LEETLOGIN}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]

==================== */

if (!defined('SED_CODE')) { sed_diefatal('Wrong URL.'); }

require("plugins/leetlogin/lang/leetlogin.".$usr['lang'].".lang.php");

// Retrive avatar from user
$avatar = sed_sql_query("SELECT user_avatar FROM $db_users WHERE user_id='".$usr['id']."'");
$avatar = sed_sql_fetcharray($avatar);
$el_avatar = stripslashes($avatar["user_avatar"]);
// Count total new private messages from user
$npmessages = sed_sql_query("SELECT COUNT(*) FROM $db_pm WHERE pm_touserid='".$usr['id']."' AND pm_state=0");
$el_npmessages = sed_sql_result($npmessages,0,"COUNT(*)");
// Count total old private messages from user
$olmessages = sed_sql_query("SELECT COUNT(*) FROM $db_pm WHERE pm_touserid='".$usr['id']."' AND pm_state=1");
$el_olmessages = sed_sql_result($olmessages,0,"COUNT(*)");
// Count total archived private messages from user
$apmessages = sed_sql_query("SELECT COUNT(*) FROM $db_pm WHERE pm_touserid='".$usr['id']."' AND pm_state=2");
$el_apmessages = sed_sql_result($apmessages,0,"COUNT(*)");

if($usr['id']>0)
	{
	if ($el_avatar == "")
		{
		$el_avatar = $cfg['plugin']['leetlogin']['avatar2'];
		}
	if ($usr['isadmin'])
		{
		$el_admin = "<img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"admin.php\">".$L['ll_administration']."</a><br />";
		}
		else
		{
		$el_admin = "";
		}
	if ($cfg['plugin']['leetlogin']['pmsound'] > 0)
		{
		if ($el_npmessages != 1)
			{
			$pluralmessage = $L['ll_plural'];
			}
			else
			{
			$pluralmessage = "";
			}
			$cookiepm = sed_import('LduPmTracking-usr'.$usr['id'],'C','NUM');
		if ($el_npmessages > 0)
			{
			if ($el_npmessages > $cookiepm)
			{
			if ($cfg['plugin']['leetlogin']['pmsound'] == 2 || $cfg['plugin']['leetlogin']['pmsound'] == 3)
				{	
				$pmmessage .= "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" style=\"width:1px;height:1px\"><param name=\"movie\" value=\"".$cfg['plugin']['leetlogin']['npmessages']."\"><param name=\"quality\" value=\"high\"><embed src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['npmessages']."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" style=\"width:1px;height:1px\"></embed></object>";
				}			
			if ($cfg['plugin']['leetlogin']['pmsound'] == 1 || $cfg['plugin']['leetlogin']['pmsound'] == 3)
				{	
				$pmmessage .= "
				<script language=\"javascript\" type=\"text/javascript\">
				<!--
				function shownewpm() 
				{
				viewpmconfirm = confirm('".$L['ll_msg1']." ".$el_npmessages." ".$L['ll_msg2'].$pluralmessage.".\\n".$L['ll_msg3']."');
				if(viewpmconfirm == true)
				{
				window.location = \"pm.php\";
				}
				}
				setTimeout('shownewpm()',1250);
				-->
				</script>";
				}
			}
			}
		setcookie("LduPmTracking-usr".$usr['id'], "$el_npmessages", time()+30000000);
		}
	$leetlogin = "<table style=\"border-collapse:collapse;text-align:center;width:98%\">";
	if ($cfg['plugin']['leetlogin']['welcome'] == true)
		{
		$leetlogin .= "<tr><td style=\"text-align:center;padding:3px;\" colspan=\"2\"><div><strong>".$L['ll_welcome']."</strong> <a href=https://www.cotonti.com/\"users.php?m=details&amp;id=".$usr['id']."\">".$usr['name']."!</a><br /></div></td></tr>";
		}
		else
		{
		$leetlogin .= "";
		}
	if ($cfg['plugin']['leetlogin']['avatar'] == true)
		{
		$leetlogin .= "<tr>";
		$leetlogin .= "<td style=\"text-align:center;\"><a href=https://www.cotonti.com/\"users.php?m=profile&amp;a=avatarchoose&amp;".sed_xg()."#list\"><img src=\"".$el_avatar."\" alt=\"\" /></a></td>";
		$leetlogin .= "<td style=\"text-align:left;width:100%;padding:0px;\"><div style=\"text-align:left;\">".$el_admin."<img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pm.php\">".$L['ll_inbox']."</a> <strong>".$el_npmessages."</strong>/".$el_olmessages."/".$el_apmessages."".$pmmessage."<br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=profile\">".$L['ll_profile']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pfs.php\">".$L['ll_pfs']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=logout&amp;".sed_xg()."\">".$L['ll_logout']."</a></div></td>";
		$leetlogin .= "</tr>";
		}
		else
		{
		$leetlogin .= "<tr>";
		$leetlogin .= "<td style=\"width:100%;padding:0px;\"><div style=\"text-align:left;\">".$el_admin."<img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pm.php\">".$L['ll_inbox']."</a> <strong>".$el_npmessages."</strong>/".$el_olmessages."/".$el_apmessages."".$pmmessage."<br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"users.php?m=profile\">".$L['ll_profile']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"pfs.php\">".$L['ll_pfs']."</a><br /><img src=https://www.cotonti.com/\"".$cfg['plugin']['leetlogin']['1arrow']."\" /><a href=https://www.cotonti.com/\"auth.php?m=logout&amp;".sed_xg()."\">".$L['ll_logout']."</a></div></td>";
		$leetlogin .= "</tr>";
		}
	$leetlogin .= "</table>";
	}
	else
	{
	$leetlogin .= "<table style=\"border-collapse:collapse;text-align:center;width:98%\">";
	if ($cfg['plugin']['leetlogin']['ynlin'] == true)
		{
		$leetlogin .= "<tr><td style=\"text-align:center\" colspan=\"2\"><div><strong>".$L['ll_ynlin']."</strong><br /></div></td></tr>";
		}
		else
		{
		$leetlogin .= "";
		}
	$leetlogin .= "<tr><td style=\"text-align:left;\" colspan=\"2\"><form name=\"login\" action=\"users.php?m=auth&amp;a=check\" method=\"post\"><div>".$L['ll_username']."<br /><input class=\"input\" type=\"text\" name=\"rusername\" size=\"20\" maxlength=\"32\"></input><br />";
	$leetlogin .= "".$L['ll_password']."<br /><input class=\"input\" type=\"password\" name=\"rpassword\" size=\"20\" maxlength=\"32\"></input><br />";
	$leetlogin .= "".$L['ll_rcookiettl']."<br />".$out['guest_cookiettl']."<br /></div>";
	$leetlogin .= "<br /><div style=\"text-align:center;\"><input type=\"submit\" value=\"Submit\"></input></div></form>";
	$leetlogin .= "<div style=\"text-align:center;\">[<a href=https://www.cotonti.com/\"users.php?m=register\">".$L['ll_reg']."</a>]&nbsp;&nbsp;&nbsp;[<a href=https://www.cotonti.com/\"plug.php?e=passrecover\">".$L['ll_lp']."</a>]</div></td></tr>";
	$leetlogin .= "</table>";
	}


$t-> assign(array(
	"PLUGIN_LEETLOGIN" => $leetlogin
	));

?>

where should I put the php code ?

Thanks for all. Heater]]>
Wed, 15 Dec 2010 03:13:20 -0000
GHengeveld It won't work in .php like this. If you want to put it in .php put it like this:

if($usr['level'] >= 20) { $buttontext = 'Download Mission 3'; }
elseif($usr['level'] >= 15) { $buttontext = 'Download Mission 2'; }
elseif($usr['level'] >= 10) { $buttontext = 'Download Mission 1'; }

Then use $buttontext where you want it.]]>
Tue, 14 Dec 2010 20:06:37 -0000
Heater But I can put this code in leetlogin.php file ?
Or only in header.tpl ?]]>
Tue, 14 Dec 2010 19:10:24 -0000
GHengeveld
<!-- IF {PHP.usr.level} >= 10 AND {PHP.usr.level} < 15 -->
Download Mission 1
<!-- ENDIF -->
<!-- IF {PHP.usr.level} >= 15 AND {PHP.usr.level} < 20 -->
Download Mission 2
<!-- ENDIF -->
<!-- IF {PHP.usr.level} >= 20 -->
Download Mission 3
<!-- ENDIF -->

Put it in your .tpl file.]]>
Tue, 14 Dec 2010 11:03:25 -0000
Heater I want to insert a button in my SITE under the LeetLogin plugin changing when a user go up a level...
Example:

Guest: Register
After my confirmation the Button change in "Download Mission 1" - Members ( Lvl 10 ) -->
After 20 hours of fly - Lieutenant ( Lvl 15 ) --> the Button change in "Download Mission 2"
After 50 hours of Fly - Captain ( Lvl 20 ) --> the Button change in "Download Mission 3"

I can add this ? If yes, how ?

p.s. sorry for my English...

Thanks for all.]]>
Tue, 14 Dec 2010 06:23:15 -0000