TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,043
  • Total Topics: 21,335
  • Online today: 287
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 203
  • Total: 203

modified userbox

Started by hsdk, November 26, 2006, 07:49:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shadow

I pot this at RebelRose forum. 

Quote from: Ã,©RebelRose on April 18, 2007, 01:41:43 AM
:-??  well lets post about it on TP because that is where it came from.

I try this code out. And I use a php box and I get a error.

Fatal error: Cannot redeclare tportal_userbox() (previously declared in /home/wishyou/public_html/skhilled/smf3/Sources/Load.php(1733) : eval()'d code:388) in /home/wishyou/public_html/skhilled/smf3/Sources/Load.php(1733) : eval()'d code(35) : eval()'d code on line 3

G6Cad

You have to give us more info then that Shadow Queen.
What code did you use to get that error ?

Where did you put it ?
A link to your site to please

Shadow

Two member's post this code off of this topic I think..Here the code is below here.  RebelRose just say put the code in a phpbox and dont work and I get that error. I just did what the post told me to do and I did...

Here is my test site I am testing thing's out.  I won't test thing's on my live site all that.  Because I put tons of hard work on the site.

Here is my test site link http://www.skhilled.com/smf3/index.php

G6 You can can me Shadow just letting you know  ;)

Quote from: Ã,©RebelRose on April 18, 2007, 12:53:52 AM
You can just create a new user block and turn the other off, just put that code in a php block.


// Tportal userbox
//modifies userbox, with logout button, submit links and a extra link
function TPortal_userbox()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

echo'
<table width="99%" cellpadding="0" cellspacing="5" border="0">
<tr>
<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo $context['user']['avatar']['image'] . '<br />';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged']){
echo '<span class="normaltext">', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']

['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].'<b> '. $context

['unapproved_members']  . '</b></a>';

if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
}

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';

//Show the logout button in your userbox
if($context['user']['is_logged'])
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],'">'.$txt[108].' </a><br />';

// If user is allowed to submit articles, show the link here
              if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
                       echo $bullet.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';

// same for upload, show if allowed
              if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
                       echo $bullet.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// If user is logged in, display a link to a page you choose.
if ($context['user']['is_logged'])
echo $bullet. '<a href="your url goes here">Your url link</a><br />';
                        //if user has admin right, display a link to the admin section
if ($context['user']['is_admin'])
echo $bullet. '<a href="', $scripturl, '?action=admin">Admin</a>';

// Show the total time logged in?
/*
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged'])){

echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';

echo '<br />'.$context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays'];

echo $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours'];

echo $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];

}
*/
if(isset($context['TPortal']['userbox']['time'])){

echo '<br />'.$bullet. $context['current_time'];

}

echo '</div>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />
<form action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
        <select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
        <input type="submit" value="', $txt[34], '" /><br />
        ', $txt['smf52'], '
</form>';
}
echo ' <br />
</td>
</tr>
</table>';
}



G6Cad

dont know if it will help, but try and change the

function TPortal_userbox()

to

function tportal_userbox()

Shadow

No, Its didn't help at all G6

This website is proudly hosted on Crocweb Cloud Website Hosting.