 |
 |
 |
 |
 |
| Author |
Message |
ivanh
Joined: 16 Aug 2007 Posts: 72
|
|
|
|
lol no luck at all ;'[
thanks for trying to help tho, much appreciated
kinda odd how this used to work for me =s
i might have to make my site transitional instead of strict and use an iframe in it =(
|
|
| Tue Apr 29, 2008 8:00 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 400
|
|
|
|
Hi i tried this mod again but i cant seem to logout in any kind of way?!
edit: lol suddenly it works :s
|
|
| Wed Jun 11, 2008 4:09 pm |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 400
|
|
|
|
Well, it stopped working.
When i try to logout i get this error.
Warning: Cannot modify header information - headers already sent by (output started at /home/partyism/domains/partyism.nl/public_html/artikelen/plugins/latest_comments.php:138) in /home/partyism/domains/partyism.nl/public_html/artikelen/loginbox.php on line 61
Warning: Cannot modify header information - headers already sent by (output started at /home/partyism/domains/partyism.nl/public_html/artikelen/plugins/latest_comments.php:138) in /home/partyism/domains/partyism.nl/public_html/artikelen/loginbox.php on line 67
When i deactive the latest comments it just works
any idea?
edit: fixed it myself, by default in latest_comments.php at the end there a two blank lines, just delete those to and the problem is gone. Only the latest comments is generating a url that isnt working: http://partyism.nl/index.php/2008/07/27/%7Blink%7D#1511 any idea?
|
|
| Thu Jul 31, 2008 7:21 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2214 Location: US |
|
|
| Tue Oct 28, 2008 12:34 am |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 400
|
|
|
|
Hey Scott,
I only included it and it works fine for me!
index.php
 |  | <?PHP include("artikelen/loginbox.php"); ?> |
loginbox.php
 |  | <?php
///////////////////////////////////////////////////////////////////
//
//Login box by FI-DD
//http://english.cutenews.ru/forum/profile.php?mode=viewprofile&u=2
//Based on:http://www.xs4all.nl/~cvdtak/loginbox_1.0.htm
//
///////////////////////////////////////////////////////////////////
if (!defined('CN_INIT_LOGINBOX')) {
define('CN_INIT_LOGINBOX', true);
$echo = cute_lang();
if(session){
session_start();
}
$username = $_POST['username'];
$password = $_POST['password'];
if($_POST['act'] == 'dologin'){
$is_logged_in = false;
if ($username){
$cmd5_password = md5x($password);
if (check_login($username, $cmd5_password)){
$cookie_logged = true;
if(cookie){
@setcookie('login_username', $username, time() + 3600 * 24 * 365);
}
if(session){
session_register('login_username');
$_SESSION['login_username'] = $username;
}
} else {
$error = '<font color="red">'.$echo['loginError'].'</font>';
$cookie_logged = false;
}
}
if ($cookie_logged){
$is_logged_in = true;
if ($_POST['act'] == 'dologin'){
$sql->update(array(
'table' => 'users',
'where' => array("username = $username"),
'values' => array('last_visit' => (time() + $config_date_adjust * 60))
));
}
header('Location: '.$PHP_SELF);
}
}
if($_GET['act'] == 'logout'){
if(cookie){
setcookie('login_username', '', time() - 3600 * 24 * 365);
}
if(session){
@session_destroy();
@session_unset();
}
header('Location: '.$PHP_SELF);
}
if(cookie){
if(!$_COOKIE['login_username']){
$is_logged_in = false;
}
else{
$is_logged_in = true;
}
}
if(session){
if(!session_is_registered('login_username') || $_SESSION['login_username'] == "") {
$is_logged_in = false;
}
else{
$is_logged_in = true;
}
}
}
else{
if (!$is_logged_in){
//The login box
?>
<form method="post" action="<?=$PHP_SELF; ?>">
<table>
<tr>
<td>Gebruikersnaam: <input type="text" name="username" size="14"></td>
<td><td>Wachtwoord: <input type="password" name="password" size="14"></td>
<td><input type="submit" value="OK"></td>
<tr>
</table>
<input type="hidden" name="act" value="dologin">
</form>
<?
}
else{
echo 'Ingelogd als: <strong>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</strong>
<a href="http://www.mysite.com/cuteru.nl/artikelen/?mod=personal" target="_blank">Profiel wijzigen</a>
<a href="http://www.mysite.com/leden"><span class="new">Leden</span></a>
<a href="http://www.mysite.com/cuteru/?mod=addnews" target="_blank">Nieuws Submit</a>
<a href="http://www.mysite.com/cuteru/index.php?mod=options&action=pm" target="_blank">Inbox ('.count_unread_messages().')</a>
<a href="'.$PHP_SELF.'?act=logout">Log uit</a>';
}
echo $error;
}
?> |
Make sure you delete the last 2 blank lines in latest_comments.php That solves the error
|
|
| Tue Oct 28, 2008 8:02 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2214 Location: US |
|
|
| Tue Oct 28, 2008 3:34 pm |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 400
|
|
|
|
Jep it does
|
|
| Tue Oct 28, 2008 4:35 pm |
|
 |
faustao
Joined: 28 Nov 2008 Posts: 7 Location: Brazil |
|
How to salute to Nickname? |
|
Hi,
How can I make it show "Logged in as '$name'" instead of "Logged in as '$username'" ?
Thanks a lot for your help.
|
|
| Fri Nov 28, 2008 3:13 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2973 Location: Germany |
|
|
|
Try to change this:
 |  | echo 'Logged in as <b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>'; |
to this:
 |  | echo 'Logged in as <b>'.($username ? $user_name[$username] : (cookie ? $user_name[$_COOKIE['login_username']] : $user_name[$_SESSION['login_username']])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>'; |
|
|
| Fri Dec 05, 2008 6:21 pm |
|
 |
faustao
Joined: 28 Nov 2008 Posts: 7 Location: Brazil |
|
|
|
Thank you FI-DD. You are the best.
|
|
| Sat Dec 06, 2008 4:47 am |
|
 |
Triton
Joined: 10 Mar 2009 Posts: 7
|
|
|
| Wed Mar 11, 2009 7:24 am |
|
 |
DarkSlim

Joined: 06 Aug 2009 Posts: 286 Location: IL |
|
|
|
It's pretty buggy, but after some work I managed to make it work 100%!
The log in box itself does-not use iframe, but after the login, the welcome
message is in an iframe that I made to look normally (without borders etc')
This is my code (with my design etc' you can change it as you want):
This is the Login Box code that you put where you want it to
show in the page:
 |  |
<!------ Login Box------>
<? if (!$is_logged_in){ ?>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="138" align="center">
<form name="login" action="" method="post" onsubmit="return process_form(this)">
<tr>
<td width="55" style="font-size:14px;"><div align="left">User:</div></td>
<td><input tabindex="1" type="text" name="username" value="<?=$lastusername; ?>" style="width:73px"></td>
</tr>
<tr>
<td style="font-size:14px;"><div align="left">Password:</div></td>
<td><input type="password" name="password" style="width:73px"></td>
</tr>
<tr>
<td></td>
<td><div align="center"><input accesskey="s" type="submit" style="font-size:12px;width:45px;" value="Log In"></div></td>
</tr>
<tr>
<td align="center" colspan="3"><font size="1"><?=$result; ?></td>
</tr>
<input type="hidden" name="action" value="dologin">
</form>
</table></div>
<?
}
elseif ($is_logged_in){
?>
<iframe name="loginbox" src="cms/indexlog.php" width="138" height="100" frameborder="0" marginheight="0" marginwidth="0" align="center">
<font size="2">Your browser does not support I-Frames</font>
</iframe>
<?
}
?>
<!------ ENDLogin Box------>
|
* Change "cms/indexlog.php" to your location of the cutenews ru directory!
Then, make a new file in the cutenews ru directory called: indexlog.php,
and pase this inside (it is a modified version of cnru index.php):
 |  |
<?php
$PHP_SELF = 'indexlog.php';
$config_cutenews_version = 'CuteNews.RU';
$config_cutenews_built = '2.5.4';
#-------------------------------------------------------------------------------
include_once 'head.php';
@chmoddir($cutepath.'/data', chmod);
@chmoddir($cutepath.'/cache', chmod);
@chmod($cutepath.'/data', 0755);
$timer = new microTimer;
$timer->start();
if ($action == 'logout'){
setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
setcookie('username', '', time() - 3600 * 24 * 365, '/');
setcookie('login_referer', '');
@session_destroy();
@session_unset();
@setcookie(session_name(), '');
?>
<!-- Javascript redirect -->
<script type="text/javascript">self.location.href="<?=$_SERVER['PHP_SELF']; ?>";</script>
<?
}
b64dck();
// If User is Not Logged In, Display The Logout Message
if (!$is_logged_in){
if (session){
@session_destroy();
@session_unset();
}
setcookie('username', '', time() - 3600 * 24 * 365, '/');
setcookie('password', '');
setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
setcookie('login_referer', '');
//echoheader('user', $echo['header']);
?>
<!-- The Logout Message -->
<br>You have logged out successfuly!
<?
//echofooter();
} elseif ($is_logged_in){
if (check_referer){
$self = $_SERVER['SCRIPT_NAME'];
if (!$self){
$self = $_SERVER['REDIRECT_URL'];
}
if (!$self){
$self = $PHP_SELF;
}
if (!eregi($self, $HTTP_REFERER) and $HTTP_REFERER){
echo sprintf($echo['badReferer'], $PHP_SELF);
exit;
}
}
//Logged in Message
echo '<div align="right" dir="rtl"><font size="1px" face="arial"><br><font size="2px">Welcome, <br><b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><br><a href="'.$PHP_SELF.'?action=logout">Log Out</a></div>';
}
?>
|
* I have adjusted it to english and all, but you may still need to change it a little bit (havn't checked)
so it will look perfectly as you want it (as I used it for a "right to left" language)
Thats it, you will be able to show a log in box without an iframe (while not logged in)
and when logging in, it is directing it to load a nice stealth iframe, and when logging out it
goes back to the awesome login box.
Hope that helps ^^
_________________ Portfolio: www.Yaniv.tk
Some of my Plugins and Mods and more in the CuteNewsRU Index!
Donations Accepted, Thank you |
|
| Mon Oct 12, 2009 4:44 pm |
|
 |
Goberg
Joined: 18 Jan 2007 Posts: 67
|
|
|
| Mon May 31, 2010 3:45 am |
|
 |
DarkSlim

Joined: 06 Aug 2009 Posts: 286 Location: IL |
|
|
| Mon May 31, 2010 7:56 am |
|
 |
Goberg
Joined: 18 Jan 2007 Posts: 67
|
|
|
| Mon May 31, 2010 9:41 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|