PDA

View Full Version : HTML/PHP sidebar block help


Anygma
09-04-2012, 07:31 AM
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..

<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.