PDA

View Full Version : Two small code changes


aceofspades
10-07-2007, 01:52 PM
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<div align="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</div>


Im having two problems with this code. First of all, its aligning the date on the right which is what i want, but its dropping it down on another line, i want the date to be on the same line as the name. I dont have any <br />'s there so i dont know why its doing that.

Also the second problem (which isnt a big deal) is that when i click anywhere on the line that the posters name is on the postbit legacy, the box comes up with find more posts by this user etc. I dont want it to do this, only when the user clicks on the actual name not the line do i want the box to come up.

Can anyone help me with either of these?

James

Lynne
10-07-2007, 04:36 PM
A div tag is a block element, thus it goes to the next line (as you are seeing). Try using span tags instead of the div tags and see if that works.

As for the second one, your javascript is running on the div element "postmenu_$post[postid]". So, if you click anywhere inside that div element, you are running the javascript "vbmenu_register("postmenu_$post[postid]", true)"

aceofspades
10-07-2007, 05:21 PM
Thank you for the reply. I tried two different things, and i couldnt get the result with either one.

Attempt One (span for date):


$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<div>
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>


With this result the text was on the left and still on the line below.

Attempt Two (Span for both the name and date):


$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<span class="left">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</span>
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>


Got to the point there the date is on the same line as the name, but its not on the right, its just next to it, and on top of that the javascript popup box doesnt open at all now, but ill worry about fixing that later. Can you offer any more advice?

James

Lynne
10-07-2007, 05:46 PM
Try this:
$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>
<span class="left">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</span>

aceofspades
10-07-2007, 05:57 PM
Now they are on the same line, but the date is on the left in front of the name, like this:

08-25-2007 aceofspades

--------------- Added at 21:52 ---------------

Got this working :)

Lynne
10-07-2007, 10:24 PM
Whoops, I didn't bother to look at your span tags. Do you have a class called right and left? If not, <span style="float:right"> should be written instead of <span class="right">

aceofspades
10-08-2007, 10:26 AM
Yeah thats how i got it working in the end.