Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Members & login
Shinora
Posted on 17 Feb 2010, 11:58:01

Access: Member
Total Posts: 2
Joined: 2010-02-17

Hi!
So I just installed your application, which I must say is super, but I do have some questions.

Is there a possibillity that whenever someone is logged-in, he doesn't have to write his own name at Comments?

And my template has an area (a box) that contains the space to log in. Is there someway to let them log in over there and also show there Avatar as a link to logout and edit there profile?

And just one small other thing, is there a possibility that over at comments, the smilies don't appear straight away, but that there's a link with a pop-up which holds the smilies?

EDIT: Almlost forgot.. Ahum.. I already found this code:
Code:
<form method="post" action="news/admin.php">
Name: <input type="text" name="name" /><br />
Pass: <input type="password" name="pass" /><br />
Stay logged in? <input type="checkbox" name="rememberme" /><br />
<input type="submit" name="B3" value="Login" />
</form>
But when I try to log in, it gives an error. This one:
Code:
Warning: require_once(language/.php) [function.require-once]: failed to open stream: No such file or directory in /public_html/news/modules/home.php on line 20

Thanks in advance, you're really great!

Yours,
Shinora
#1914
Last edited by Shinora at 2010-02-17 14:38:28 Reason:
Chris
Posted on 17 Feb 2010, 16:54:14

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Quote:
Is there a possibillity that whenever someone is logged-in, he doesn't have to write his own name at Comments?

This already works. The "Comments Form" section in the templatesa have a {name} and {email} tag that will show the users name/email if logged in.

Quote:
And just one small other thing, is there a possibility that over at comments, the smilies don't appear straight away, but that there's a link with a pop-up which holds the smilies?

It is possible but you'll need to code it yourself using html/javascript in the "Comments Form" section.


Code:
<form method="post" action="news/admin.php">
Name: <input type="text" name="name" /><br />
Pass: <input type="password" name="pass" /><br />
Stay logged in? <input type="checkbox" name="rememberme" /><br />
<input type="submit" name="B3" value="Login" />
</form>

I wrote this for a previous version, to get it to work with 3.4> you need to add a new element to the form, the language selection box, if you don't want users to be able to select a language and instead use English as default use this

Code:
<form method="post" action="news/admin.php">
Name: <input type="text" name="name" /><br />
Pass: <input type="password" name="pass" /><br />
<input type="hidden" name="n13language" value="langmsg_english" />
Stay logged in? <input type="checkbox" name="rememberme" /><br />
<input type="submit" name="B3" value="Login" />
</form>

#1918
Shinora
Posted on 17 Feb 2010, 17:03:32

Access: Member
Total Posts: 2
Joined: 2010-02-17

Many thanks for this,

but I still don't got a anwser on this:
Quote:
And my template has an area (a box) that contains the space to log in. Is there someway to let them log in over there and also show there Avatar as a link to logout and edit there profile?

So, when you log in, that this box changes to the avatar and details etc. from that user?


EDIT: Nevermind, just saw you post this at the other thread:
Code:
<?php
if($_SESSION['userlogged20'] == "true"){
// user is logged in
echo 'Welcome ' . $_SESSION['name'] .
' <a href="news/admin.php?action=private">Inbox</a>' .
' <a href="news/admin.php?action=logout">Logout</a>';
}else{
// user isn't logged in, show the login form
?>
<form method="post" action="news/admin.php">
Name: <input type="text" name="name" /><br />
Pass: <input type="password" name="pass" /><br />
<input type="hidden" name="n13language" value="langmsg_english" />
Stay logged in? <input type="checkbox" name="rememberme" /><br />
<input type="submit" name="B3" value="Login" />
</form>
<?php
}
?>
#1920
Last edited by Shinora at 2010-02-17 17:13:01 Reason:
Chris
Posted on 17 Feb 2010, 17:18:18

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Here's an improved version of that post that will show the avatar and made it link to their profile edit page.

Code:
<?php
session_name
('n13news');
session_start();
require_once 
'news/db.php';
require_once 
'news/config.php';

if(
$_SESSION['userlogged20'] == "true"){
    
// user is logged in

    // get the users avatar
    
$user_avatar = DataAccess::fetch("SELECT avatar FROM $newsusers WHERE user = ?", $_SESSION['name']);
    
$user_avatar = $user_avatar['0']['avatar'];
    
    if(!
$user_avatar){
        
// if the user doesn't have an avatar set yet, use a default one
        
echo '<a href="news/admin.php?action=options&mod=profile"><img src="default.jpg" /></a>';
    }else{
        
// if they do, use their own
        
echo '<a href="news/admin.php?action=options&mod=profile"><img src="' . $user_avatar . '" /></a>';
    }
    
    echo 
'Welcome ' . $_SESSION['name'] .
    
' <a href="news/admin.php?action=private">Inbox</a>' . 
    
' <a href="news/admin.php?action=logout">Logout</a>';
}else{
    
// user isn't logged in, show the login form
?>
    <form method="post" action="news/admin.php">
    Name: <input type="text" name="name" /><br />
    Pass: <input type="password" name="pass" /><br />
    <input type="hidden" name="n13language" value="langmsg_english" />
    Stay logged in? <input type="checkbox" name="rememberme" /><br />
    <input type="submit" name="B3" value="Login" />
    </form> 
<?php
}
?> 
#1921
Network-13.com © 2013