vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Widget User Area (https://vborg.vbsupport.ru/showthread.php?t=274265)

apelsiny 11-19-2011 04:31 AM

Widget User Area
 
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
Code:

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

PHP Code:

$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>&nbsp;&nbsp;&nbsp;&nbsp;<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

Quote:

Originally Posted by Lynne (Post 2271223)
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.


All times are GMT. The time now is 07:52 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01096 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete