View Full Version : Widget User Area
apelsiny
11-19-2011, 04:31 AM
The widget worked fine on suite 4.1.7 default template, but when installed the template Seamus, then on the main page /content.php give an error
Fatal error: Call to undefined function fetch_avatar_url() in /home/users2/d/ddaxenon/domains/site.ru/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 23
Suite 4.1.8 at the default template, this error also when I put this widget
help me please :confused:
Lynne
11-19-2011, 03:11 PM
There is no User Area widget, so I'm not sure what you are talking about.
(That error is from a modification though.)
apelsiny
11-23-2011, 08:33 AM
Here is the code of my widget. Help make it right
$output2 = '<link rel="stylesheet" href="my_css.css" type="text/css" />';
if (vB::$vbulletin->userinfo['username']=='Unregistered') {
$output2.= '<form id="navbar_loginform_my" action="login.php?'.$vbulletin->session->vars['sessionurl'] .'do=login" method="post" onsubmit="md5hash(vb_login_password_my, vb_login_my_md5password_my, vb_login_my_md5password_utf_my, 0)">';
$output2.='<div class="my_welcome">Wellcome, Guest!</div>';
$output2.='<div class="my_avatar"><img src="/images/cms/noavatar.jpg"/></div>';
$output2.='<table border="0" cellpadding="0" cellspacing="0" width="100%">';
$output2.='<tr><td class="my_name">Login</td><td class="my_val"><input type="text" name="vb_login_username" id="navbar_username_my" size="10" /></td></tr>';
$output2.='<tr><td class="my_name">Paasword</td><td class="my_val"><input type="password" name="vb_login_password" id="navbar_password_my" size="10" /></td></tr>';
$output2.='<input type="text"name="vb_login_password_hint" id="navbar_password_hint_my" size="10" style="display:none;" />';
$output2.='<tr><td class="my_name2" colspan="2"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser_navbar_my" class="cb_cookieuser_navbar" /> Remember me</td></tr>';
$output2.='<tr><td class="my_name"></td><td class="my_val"><input type="submit" value="Log in" /></td></tr>';
$output2.='<input type="hidden" name="s" value="'.$vbulletin->session->vars['sessionhash'].'" />';
$output2.='<input type="hidden" name="securitytoken" value="'.$vbulletin->userinfo['securitytoken_raw'].'" />';
$output2.='<input type="hidden" name="do" value="login" />';
$output2.='<input type="hidden" name="vb_login_md5password_my" />';
$output2.='<input type="hidden" name="vb_login_md5password_utf_my" />';
$output2.='<tr><td class="my_name3" colspan="2"><a href="register.php'.$vbulletin->session->vars['sessionurl_q'] .'" rel="nofollow">Registration</a> <a href="faq.php">Help</a></td></tr>';
$output2.='</table>';
$output2.='</form>';
}
else {
$output2.='<div class="my_welcome">Wellcome, '.vB::$vbulletin->userinfo['usertitle'].'!</div>';
$av = fetch_avatar_url(vB::$vbulletin->userinfo['userid']);
if ($av) $output2.='<div class="my_avatar"><img src="' .vB::$vbulletin->options['bburl']. '/' .$av[0] . '"/></div>';
else $output2.='<div class="my_avatar"><img src="/images/cms/noavatar.jpg"/></div>';
$output2.='<div class="my_link"><a href="private.php">Message';
if ($GLOBALS['notifications_total']) $output2.=' ('.$GLOBALS['notifications_total'].')';
$output2.='</a></div>';
$output2.='<div class="my_link"><a href="member.php?'.vB::$vbulletin->userinfo['userid'].'-'.vB::$vbulletin->userinfo['username'].'">Profile</a></div>';
$output2.='<div class="my_link"><a href="usercp.php">Settings</a></div>';
$output2.='<div class="my_link"><a href="login.php?do=logout&logouthash='.vB::$vbulletin->userinfo['logouthash'].'" onclick="return log_out(\'Вы дейстивтельно хотите выйти?\')">Log out</a></div>';
}
$output=$output2;
Lynne
11-23-2011, 05:20 PM
That code works just fine on my 4.1.8 test site.
youhack
11-24-2011, 04:03 AM
That code works just fine on my 4.1.8 test site.
try to create two more widgets
PHP Direct Execution and static HTML code
not only empty, but any code, that error will appear
without additional widgets PHP Direct Execution and static HTML code works fine, no errors
Lynne
11-24-2011, 04:28 AM
Actually, the layout I tested it on has 7 widgets on it including one other php direct execution widget and an html widget.
youhack
11-24-2011, 01:55 PM
Lynne, please can customize the widget code from php to html widget statistical?
Lynne
11-24-2011, 05:10 PM
Huh? I'm sorry, but I have no idea what you are asking for.
youhack
11-24-2011, 06:58 PM
I want this widget in html code. is it possible?
widget in php I have an error in code on line 23
If you remove the 23 line, the error is not present, but the avatar does not show
Lynne
11-25-2011, 05:04 PM
You are using php in the widget code, so you can't make it straight html.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.