PDA

View Full Version : Logged off user Postbit Issue


Tact7626
04-24-2007, 03:54 AM
hello everyone. I was hoping to get some help on a little problem of mine. I hope this is the correct place. It's basically related to the custom images i used for the control inside each post.

EDIT: SORRY. FORGOT TO MENTION THIS IS ONLY FOR THE "CRUSIFIXION" STYLE!
If you would be so kind as to direct yourselfs to that style. (i don't think it's the default yet. :p) sorry for the trouble.

"edit, quote, multiquote, quickreply"

I made it so that it looks like one large image. (like an imagemap) but it's not. i just made all the buttons float left using divs and css.

here's a screenshot:
http://www.legionofangels.net/nail.jpg

The problem comes when you log out. for some reason the "quote" button is positioned on the far left of the post. (i know it's the float tag, but why did it go outside the div wrapper?)

here's the code if you'd like to take a look at it, please.



<div style="border:0px dotted black; width:400px;padding-top:10px;margin-top:0px;float:right;" align="$stylevar[right]">

<!-- controls -->
<if condition="$post['editlink']">
<img style="display: none" id="progress_$postid" src="$stylevar[imgdir_misc]/progress.gif" alt="$vbphrase[loading_editor_please_wait]" />

<div style="float:left">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/nailbg_01.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
</div>


<div style="float:left">
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
</div>


<div style="float:left">
<if condition="$post['replylink']">
<a href="$post[replylink]" rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />nailbg_02</if>.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if>
</div>

<div style="float:left">
<if condition="$show['multiquote_post']">
<a href="$post[replylink]" rel="nofollow" onclick="return false"><img src="$stylevar[imgdir_button]/<if condition="$show['multiquote_selected']">on<else />nailbg_03</if>.gif" alt="$vbphrase[multi_quote_this_message]" border="0" id="mq_$post[postid]" /></a>
</if>
</div>


<div style="float:left">
<if condition="$show['quickreply'] AND !$show['threadedmode']">
<a href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"><img src="$stylevar[imgdir_button]/nailbg_04.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
</div>


<div style="float:left">
<if condition="$show['moderated']">
<img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
</if>
</div>


<div style="float:left">
<if condition="$show['deletedpost']">
<img src="$stylevar[imgdir_misc]/trashcan.gif" alt="$vbphrase[deleted_post]" border="0" />
</if>
</div>


<div style="float:left">
<if condition="$show['redcard']">
<a href="infraction.php?$session[sessionurl]do=view&amp;p=$post[postid]"><img src="$stylevar[imgdir_button]/redcard.gif" alt="$vbphrase[received_infraction]" border="0" /></a>
<else />
<if condition="$show['yellowcard']">
<a href="infraction.php?$session[sessionurl]do=view&amp;p=$post[postid]"><img src="$stylevar[imgdir_button]/yellowcard.gif" alt="$vbphrase[received_warning]" border="0" /></a>
</if>
</if>

</div>
<!-- / controls -->

</div>



here's a random thread i picked out so you can see what happens with logged off users.


http://www.legionofangels.net/forum/showthread.php?t=510


I'm well aware that I will never be able to keep the whole nail perfectly intact for a number of reasons (regular mods, regular members, permissions) that would affect how many buttons appear and the like.

the only thing that bugs me, is that when you're offline, the only remaining button is located on the far left of the post.

the owner of the site would greatly appreciate if someone would know to either, make it stay inside it's div wrapper and remain on the right side, (the div wrapper is float:right) or make it not show any buttons at all for logged off users. he's ok with any of these solutions if at all possible.


any tips, advice, thoughts, comments, help, are greatly appreciated.

thank you very much for your time.

CyberAlien
04-24-2007, 08:15 PM
You should move all <if> before <div>, and </if> after </div> for those buttons. That might fix problem.

Tact7626
04-24-2007, 09:12 PM
awesome! it worked! (for the most part)

it definately made the quote button stay inside its wrapper div that's for sure.

now i just need to tackle the width of the wrapper or something.

I don't know if it will be enough for the site owner to like it. Would you happen to know of a way to get rid of all buttons for logged off users instead? Because I think I'm not gonna be able to figure out how to make the quote button float right for logged off users when it needs to float left for logged on users. o_o

Brad
04-24-2007, 11:16 PM
This may get messy, but you can use it to control the width based on the user's logged in status;

<if condition="$vbulletin->userinfo['userid']">
<!-- User is logged in -->
<else />
<!-- User is not logged in -->
</if>

Tact7626
04-27-2007, 01:13 AM
ok. can i copy that exactly letter for letter, or does it need just a teeny bit of customization?

cause something tells me, i should enter a value for 'userid'. just that i'm not familiar with the values. i remmeber seing some in the breadcrumb menu when i added some links there. i'll look at those and copy the desired one. :p

thanks again. i'll post again with updates. (i've never done <if> tags. i hope i do ok :p)



edit: ok. i got confused. those were accesskey's. yah. i don't understand those. i'll just try this out word for word then and hope for the best. :p




EDIT#2:

OK. so far. not really working out. my logged in users are getting the logged off users line. here's how i put the code you suggested. did i do it right? i'm totally noob with <if> tags sorry. :p

<if condition="$vbulletin->userinfo['userid']">
<!-- User is logged in -->
<div style="border:0px dotted black; width:400px;padding-top:10px;margin-top:0px;float:right;" align="$stylevar[right]">

<else />
<!-- User is not logged in -->
<div style="border:0px dotted black; width:100px;padding-top:10px;margin-top:0px;float:right;" align="$stylevar[right]">
</if>

<!-- controls -->

CyberAlien
04-27-2007, 07:09 AM
You don't need <else /> and anything after it. Guests shouldn't see quote buttons, so that whole block can be skipped for them. Use <if condition="$vbulletin->userinfo['userid']"> here is your buttons code </if> without <else /> block.

Tact7626
04-27-2007, 10:12 PM
ok. after some more messing around with, i'm sorry to say, there is no progress.

but cyberalien, you're making me think twice now. you say guests shouldn't see the quote buttons to begin with, but i tested every style in my board, and even the default style that came with my vb, (which i never altered in anyway...i think) has the "reply with quote" button for logged off users. (the button itself just says "quote" btw)

is it possible i'm attacking the problem from the wrong angle? because if you say guests shoudln't see such buttons (maybe all buttons) at all, then how come it shows up?

http://www.legionofangels.net/imlost.jpg



hmm. and here i thought this was only happening in my crucifixon skin. darn it.


i'd love it if guests would se no buttons at all. >.<

CyberAlien
04-28-2007, 05:01 AM
They show up because style code allows it. User still must login/register before posting, so even if quote button is shown it won't work. It only redirects to login page.

Tact7626
04-29-2007, 02:26 AM
yes that is correct. it does just re-direct to a register page. and to be honest, i'd just ignore this and let it slide because it really doesn't bother me atall.

in actually, it's the owner of the site, (whom i work for, kinda) who really hates it. :p (i don't get paid, he's my friend and i'm just helping him out because i believe in the purpsoe of his forum too and i think it's nice)

so yah. it'd be great if someone could tell me how to get rid of it.

OR,

can teach me the proper way to use the <if> tags to make it so that logged off users get a diffrent width than logged in users. they werne't working for me at all sadly no matter how i re-arranged them.

CyberAlien
04-29-2007, 07:01 AM
so yah. it'd be great if someone could tell me how to get rid of it.
see 3 posts above

Tact7626
04-30-2007, 10:15 PM
ok. thanks. but...um. as i somewhat mentioned before, it doesn't work.

it WILL take it off, but it takes it off for ALL members too.

no matter where i put it. it never makes it show up for members, and not show up for non-members.


so i decided to do some template searching based on those tags. and no tag has ever existed like that before.

so i thought i'd examine the navbar template cause that's a good example of <if> tags that work and differ for members/non-members.

and i found out the correct code is actually:

<if condition="$show['member']">

so i'm using that now, and it worked PERFECTLY.


i don't know where you guys got

<if condition="$vbulletin->userinfo['userid']">

but it dind't work. but thansk anyway. if it wasn't for that. i would have never found it. :p

i did a template search for every instance of (<if condition=") it could find. and $show is the only one used for member/non-member diffrences.



thanks to everyone who helped. really appreciate it. most likely just a simple mistake of incorrect code give. it's ok. i forgive ya. :p maybe it works for you guys and i have rotten luck. idk. maybe i'm an idiot and didn't put it in just the right spot. idk. but either way, i'm thankful and you guys are great. :p