vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   HTML/PHP sidebar block help (https://vborg.vbsupport.ru/showthread.php?t=287438)

Anygma 09-04-2012 07:31 AM

HTML/PHP sidebar block help
 
I want to put this on my sidebar block, but it wont work..
Can somebody revise the code to make it work on html/PHP sidebar block..

Code:

<vb:if condition="$show['guest']">
                        <form id="navbar_loginform" action="login.php?{vb:raw session.sessionurl}do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, {vb:raw show.nopasswordempty})">
                                <fieldset id="logindetails" class="logindetails">
                                        <div>
                                                <div>
                                        <span class="leftusername">User Name:</span>
                                        <input type="text" class="textbox<vb:if condition="!$username"> default-value</vb:if>" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="" />
                                        <span class="leftpass">Password:</span>
                                        <input type="password" class="textbox" tabindex="102" name="vb_login_password" id="navbar_password" size="10" />
                                        <input type="text" class="textbox default-value" tabindex="102" name="vb_login_password_hint" id="navbar_password_hint" size="10" value="{vb:rawphrase password}" style="display:none;" />
                                        <input type="submit" class="loginbutton" tabindex="104" value="{vb:rawphrase log_in}" title="{vb:rawphrase enter_username_to_login_or_register}" accesskey="s" />
                                                </div>
                                        </div>
                                </fieldset>

                                <div id="remember" class="remember">
                                        <label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser_navbar" class="cb_cookieuser_navbar" accesskey="c" tabindex="103" /> {vb:rawphrase remember_me}</label>

                                </div>

                                <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
                                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                                <input type="hidden" name="do" value="login" />
                                <input type="hidden" name="vb_login_md5password" />
                                <input type="hidden" name="vb_login_md5password_utf" />
                        </form>
        </div>
<vb:else />
                <p class="usercpwelcome">Welcome back!</p><!-- Welcome back text -->
                <p><a href="{vb:link member, {vb:raw bbuserinfo}}">{vb:raw bbuserinfo.username}</a></p>
                <vb:if condition="$vboptions['profilepicenabled']">
                        <vb:if condition="$prepared['profilepicurl']">
                                <a href="{vb:link member, {vb:raw bbuserinfo}}">
                                                <span class="avatarcontainer"><img src="{vb:raw prepared.profilepicurl}" alt="" /></span>
                                </a>
                        <vb:else />
                                <a href="{vb:link member, {vb:raw bbuserinfo}}">
                                        <span class="avatarcontainer"><img src="{vb:stylevar imgdir_misc}/unknown.gif" alt="" /></span>
                                </a>
                        </vb:if>
                </vb:if>

</vb:if>


kh99 09-04-2012 02:49 PM

Yeah, one problem is that there is no "template" type for a custom forum block. You can get around that putting the code you posted into a new template (if you haven't done that already). Then make the "Content Type" php and insert code to render your template. That's only a couple of lines of code.

But the bigger problem is that it seems to depend on a $prepared variable - I assume you took it from the profile page or something like that. So you would have to do whatever needs to be done to set up the $prepared variable (it looks like you're just using $prepared[profilepicurl], so that's all you need to set). That's a bit harder, but if you search the code for it you can probably find how it's set.


All times are GMT. The time now is 08:07 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.01037 seconds
  • Memory Usage 1,727KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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